repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
groupe-sii/ogham
ogham-core/src/main/java/fr/sii/ogham/core/util/HashCodeBuilder.java
HashCodeBuilder.reflectionsHashCode
public static int reflectionsHashCode(Object object, String... excludeFields) { """ <p> Uses reflection to build a valid hash code from the fields of object. </p> <p> This constructor uses two hard coded choices for the constants needed to build a hash code. </p> <p> It uses AccessibleObject.setAccessi...
java
public static int reflectionsHashCode(Object object, String... excludeFields) { return org.apache.commons.lang3.builder.HashCodeBuilder.reflectionHashCode(object, excludeFields); }
[ "public", "static", "int", "reflectionsHashCode", "(", "Object", "object", ",", "String", "...", "excludeFields", ")", "{", "return", "org", ".", "apache", ".", "commons", ".", "lang3", ".", "builder", ".", "HashCodeBuilder", ".", "reflectionHashCode", "(", "o...
<p> Uses reflection to build a valid hash code from the fields of object. </p> <p> This constructor uses two hard coded choices for the constants needed to build a hash code. </p> <p> It uses AccessibleObject.setAccessible to gain access to private fields. This means that it will throw a security exception if run und...
[ "<p", ">", "Uses", "reflection", "to", "build", "a", "valid", "hash", "code", "from", "the", "fields", "of", "object", ".", "<", "/", "p", ">" ]
train
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/util/HashCodeBuilder.java#L199-L201
mgm-tp/jfunk
jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Configuration.java
Configuration.extractFromArchive
public void extractFromArchive(final File targetFile, final boolean forceOverwrite) throws IOException { """ Extracts the specified file from this configuration's zip file, if applicable. @param targetFile The target file. The file name without the path information is taken in order to identify the zip entry ...
java
public void extractFromArchive(final File targetFile, final boolean forceOverwrite) throws IOException { if (zipArchive != null) { ZipEntry entry = zipArchive.getEntry(targetFile.getName()); if (entry != null) { if (!targetFile.exists()) { try { targetFile.createNewFile(); } catch (IOExcepti...
[ "public", "void", "extractFromArchive", "(", "final", "File", "targetFile", ",", "final", "boolean", "forceOverwrite", ")", "throws", "IOException", "{", "if", "(", "zipArchive", "!=", "null", ")", "{", "ZipEntry", "entry", "=", "zipArchive", ".", "getEntry", ...
Extracts the specified file from this configuration's zip file, if applicable. @param targetFile The target file. The file name without the path information is taken in order to identify the zip entry to extract. @param forceOverwrite If {@code true}, an existing file is overwritten.
[ "Extracts", "the", "specified", "file", "from", "this", "configuration", "s", "zip", "file", "if", "applicable", "." ]
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Configuration.java#L271-L299
OpenLiberty/open-liberty
dev/com.ibm.ws.junit.extensions/src/com/ibm/websphere/ras/CapturedOutputHolder.java
CapturedOutputHolder.publishTraceLogRecord
@Override protected void publishTraceLogRecord(TraceWriter detailLog, LogRecord logRecord, Object id, String formattedMsg, String formattedVerboseMsg) { """ Overwritten for old BaseTraceService behaviour for publishTraceLogRecord """ if (formattedVerboseMsg == null) { formattedVerboseMs...
java
@Override protected void publishTraceLogRecord(TraceWriter detailLog, LogRecord logRecord, Object id, String formattedMsg, String formattedVerboseMsg) { if (formattedVerboseMsg == null) { formattedVerboseMsg = formatter.formatVerboseMessage(logRecord, formattedMsg, false); } Leve...
[ "@", "Override", "protected", "void", "publishTraceLogRecord", "(", "TraceWriter", "detailLog", ",", "LogRecord", "logRecord", ",", "Object", "id", ",", "String", "formattedMsg", ",", "String", "formattedVerboseMsg", ")", "{", "if", "(", "formattedVerboseMsg", "==",...
Overwritten for old BaseTraceService behaviour for publishTraceLogRecord
[ "Overwritten", "for", "old", "BaseTraceService", "behaviour", "for", "publishTraceLogRecord" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.junit.extensions/src/com/ibm/websphere/ras/CapturedOutputHolder.java#L135-L157
httl/httl
httl/src/main/java/httl/spi/codecs/json/JSONObject.java
JSONObject.getLong
public long getLong(String key, long def) { """ get long value. @param key key. @param def default value. @return value or default value. """ Object tmp = objectMap.get(key); return tmp != null && tmp instanceof Number ? ((Number) tmp) .longValue() : def; }
java
public long getLong(String key, long def) { Object tmp = objectMap.get(key); return tmp != null && tmp instanceof Number ? ((Number) tmp) .longValue() : def; }
[ "public", "long", "getLong", "(", "String", "key", ",", "long", "def", ")", "{", "Object", "tmp", "=", "objectMap", ".", "get", "(", "key", ")", ";", "return", "tmp", "!=", "null", "&&", "tmp", "instanceof", "Number", "?", "(", "(", "Number", ")", ...
get long value. @param key key. @param def default value. @return value or default value.
[ "get", "long", "value", "." ]
train
https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/codecs/json/JSONObject.java#L76-L80
lestard/advanced-bindings
src/main/java/eu/lestard/advanced_bindings/api/SwitchBindings.java
SwitchBindings.switchBinding
public static <T, R> SwitchBuilder<T, R> switchBinding(ObservableValue<T> observable, Class<R> bindingType) { """ Creates builder for a binding that works like a switch-case in java. Example: ```java IntegerProperty base = new SimpleIntegerProperty(); ObservableValue<String> result = switchBinding(base, ...
java
public static <T, R> SwitchBuilder<T, R> switchBinding(ObservableValue<T> observable, Class<R> bindingType) { return new SwitchBuilder<>(observable); }
[ "public", "static", "<", "T", ",", "R", ">", "SwitchBuilder", "<", "T", ",", "R", ">", "switchBinding", "(", "ObservableValue", "<", "T", ">", "observable", ",", "Class", "<", "R", ">", "bindingType", ")", "{", "return", "new", "SwitchBuilder", "<>", "...
Creates builder for a binding that works like a switch-case in java. Example: ```java IntegerProperty base = new SimpleIntegerProperty(); ObservableValue<String> result = switchBinding(base, String.class) .bindCase(3, i -> "three") .bindCase(10, i -> "ten") .bindCase(1, i -> "one") .bindDefault(() -> "nothing") .bui...
[ "Creates", "builder", "for", "a", "binding", "that", "works", "like", "a", "switch", "-", "case", "in", "java", "." ]
train
https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/SwitchBindings.java#L154-L156
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java
CPInstancePersistenceImpl.fetchByC_ERC
@Override public CPInstance fetchByC_ERC(long companyId, String externalReferenceCode) { """ Returns the cp instance where companyId = &#63; and externalReferenceCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param companyId the company ID @param externalReferenceC...
java
@Override public CPInstance fetchByC_ERC(long companyId, String externalReferenceCode) { return fetchByC_ERC(companyId, externalReferenceCode, true); }
[ "@", "Override", "public", "CPInstance", "fetchByC_ERC", "(", "long", "companyId", ",", "String", "externalReferenceCode", ")", "{", "return", "fetchByC_ERC", "(", "companyId", ",", "externalReferenceCode", ",", "true", ")", ";", "}" ]
Returns the cp instance where companyId = &#63; and externalReferenceCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param companyId the company ID @param externalReferenceCode the external reference code @return the matching cp instance, or <code>null</code> if a matching c...
[ "Returns", "the", "cp", "instance", "where", "companyId", "=", "&#63", ";", "and", "externalReferenceCode", "=", "&#63", ";", "or", "returns", "<code", ">", "null<", "/", "code", ">", "if", "it", "could", "not", "be", "found", ".", "Uses", "the", "finder...
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L6861-L6864
apereo/cas
core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java
AbstractCasWebflowConfigurer.prependActionsToActionStateExecutionList
public void prependActionsToActionStateExecutionList(final Flow flow, final ActionState actionStateId, final String... actions) { """ Prepend actions to action state execution list. @param flow the flow @param actionStateId the action state id @param actions the actions """ prependA...
java
public void prependActionsToActionStateExecutionList(final Flow flow, final ActionState actionStateId, final String... actions) { prependActionsToActionStateExecutionList(flow, actionStateId.getId(), actions); }
[ "public", "void", "prependActionsToActionStateExecutionList", "(", "final", "Flow", "flow", ",", "final", "ActionState", "actionStateId", ",", "final", "String", "...", "actions", ")", "{", "prependActionsToActionStateExecutionList", "(", "flow", ",", "actionStateId", "...
Prepend actions to action state execution list. @param flow the flow @param actionStateId the action state id @param actions the actions
[ "Prepend", "actions", "to", "action", "state", "execution", "list", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java#L797-L799
googleapis/google-cloud-java
google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java
SessionPool.createPool
static SessionPool createPool(SpannerOptions spannerOptions, DatabaseId db, SpannerImpl spanner) { """ Create a session pool with the given options and for the given database. It will also start eagerly creating sessions if {@link SessionPoolOptions#getMinSessions()} is greater than 0. Return pool is immediately...
java
static SessionPool createPool(SpannerOptions spannerOptions, DatabaseId db, SpannerImpl spanner) { return createPool( spannerOptions.getSessionPoolOptions(), ((GrpcTransportOptions) spannerOptions.getTransportOptions()).getExecutorFactory(), db, spanner); }
[ "static", "SessionPool", "createPool", "(", "SpannerOptions", "spannerOptions", ",", "DatabaseId", "db", ",", "SpannerImpl", "spanner", ")", "{", "return", "createPool", "(", "spannerOptions", ".", "getSessionPoolOptions", "(", ")", ",", "(", "(", "GrpcTransportOpti...
Create a session pool with the given options and for the given database. It will also start eagerly creating sessions if {@link SessionPoolOptions#getMinSessions()} is greater than 0. Return pool is immediately ready for use, though getting a session might block for sessions to be created.
[ "Create", "a", "session", "pool", "with", "the", "given", "options", "and", "for", "the", "given", "database", ".", "It", "will", "also", "start", "eagerly", "creating", "sessions", "if", "{" ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java#L715-L721
beanshell/beanshell
src/main/java/bsh/Interpreter.java
Interpreter.set
public void set( String name, Object value ) throws EvalError { """ Assign the value to the name. name may evaluate to anything assignable. e.g. a variable or field. """ // map null to Primtive.NULL coming in... if ( value == null ) value = Primitive.NULL; CallStac...
java
public void set( String name, Object value ) throws EvalError { // map null to Primtive.NULL coming in... if ( value == null ) value = Primitive.NULL; CallStack callstack = new CallStack(); try { if ( Name.isCompound( name ) ) { ...
[ "public", "void", "set", "(", "String", "name", ",", "Object", "value", ")", "throws", "EvalError", "{", "// map null to Primtive.NULL coming in...", "if", "(", "value", "==", "null", ")", "value", "=", "Primitive", ".", "NULL", ";", "CallStack", "callstack", ...
Assign the value to the name. name may evaluate to anything assignable. e.g. a variable or field.
[ "Assign", "the", "value", "to", "the", "name", ".", "name", "may", "evaluate", "to", "anything", "assignable", ".", "e", ".", "g", ".", "a", "variable", "or", "field", "." ]
train
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Interpreter.java#L794-L813
prometheus/client_java
simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java
DropwizardExports.fromTimer
MetricFamilySamples fromTimer(String dropwizardName, Timer timer) { """ Export Dropwizard Timer as a histogram. Use TIME_UNIT as time unit. """ return fromSnapshotAndCount(dropwizardName, timer.getSnapshot(), timer.getCount(), 1.0D / TimeUnit.SECONDS.toNanos(1L), getHelpMessage(dropwiza...
java
MetricFamilySamples fromTimer(String dropwizardName, Timer timer) { return fromSnapshotAndCount(dropwizardName, timer.getSnapshot(), timer.getCount(), 1.0D / TimeUnit.SECONDS.toNanos(1L), getHelpMessage(dropwizardName, timer)); }
[ "MetricFamilySamples", "fromTimer", "(", "String", "dropwizardName", ",", "Timer", "timer", ")", "{", "return", "fromSnapshotAndCount", "(", "dropwizardName", ",", "timer", ".", "getSnapshot", "(", ")", ",", "timer", ".", "getCount", "(", ")", ",", "1.0D", "/"...
Export Dropwizard Timer as a histogram. Use TIME_UNIT as time unit.
[ "Export", "Dropwizard", "Timer", "as", "a", "histogram", ".", "Use", "TIME_UNIT", "as", "time", "unit", "." ]
train
https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java#L110-L113
BlueBrain/bluima
modules/bluima_abbreviations/src/main/java/com/wcohen/ss/abbvGapsHmm/AbbvGapsHmmBackwardsEvaluator.java
AbbvGapsHmmBackwardsEvaluator.getPartialStartedWord
protected static String getPartialStartedWord(String str, int pos) { """ If pos is starting a new word in str, returns this word. Else, returns null. """ assert(pos < str.length() && pos >= 0); if( posIsAtWord(str, pos) ){ int nextSpace = findNextNonLetterOrDigit(str, pos); if(nextSpace == -1){ ...
java
protected static String getPartialStartedWord(String str, int pos){ assert(pos < str.length() && pos >= 0); if( posIsAtWord(str, pos) ){ int nextSpace = findNextNonLetterOrDigit(str, pos); if(nextSpace == -1){ nextSpace = str.length(); } return str.substring(pos, nextSpace); } return null; ...
[ "protected", "static", "String", "getPartialStartedWord", "(", "String", "str", ",", "int", "pos", ")", "{", "assert", "(", "pos", "<", "str", ".", "length", "(", ")", "&&", "pos", ">=", "0", ")", ";", "if", "(", "posIsAtWord", "(", "str", ",", "pos"...
If pos is starting a new word in str, returns this word. Else, returns null.
[ "If", "pos", "is", "starting", "a", "new", "word", "in", "str", "returns", "this", "word", ".", "Else", "returns", "null", "." ]
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/abbvGapsHmm/AbbvGapsHmmBackwardsEvaluator.java#L153-L165
TakahikoKawasaki/nv-websocket-client
src/main/java/com/neovisionaries/ws/client/ReadingThread.java
ReadingThread.callOnMessageError
private void callOnMessageError(WebSocketException cause, List<WebSocketFrame> frames) { """ Call {@link WebSocketListener#onMessageError(WebSocket, WebSocketException, List) onMessageError} method of the listeners. """ mWebSocket.getListenerManager().callOnMessageError(cause, frames); }
java
private void callOnMessageError(WebSocketException cause, List<WebSocketFrame> frames) { mWebSocket.getListenerManager().callOnMessageError(cause, frames); }
[ "private", "void", "callOnMessageError", "(", "WebSocketException", "cause", ",", "List", "<", "WebSocketFrame", ">", "frames", ")", "{", "mWebSocket", ".", "getListenerManager", "(", ")", ".", "callOnMessageError", "(", "cause", ",", "frames", ")", ";", "}" ]
Call {@link WebSocketListener#onMessageError(WebSocket, WebSocketException, List) onMessageError} method of the listeners.
[ "Call", "{" ]
train
https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ReadingThread.java#L304-L307
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Registry.java
Registry.setAction
public void setAction(String action) throws ApplicationException { """ set the value action action to the registry @param action value to set @throws ApplicationException """ action = action.toLowerCase().trim(); if (action.equals("getall")) this.action = ACTION_GET_ALL; else if (action.equals("get")) t...
java
public void setAction(String action) throws ApplicationException { action = action.toLowerCase().trim(); if (action.equals("getall")) this.action = ACTION_GET_ALL; else if (action.equals("get")) this.action = ACTION_GET; else if (action.equals("set")) this.action = ACTION_SET; else if (action.equals("delete")) thi...
[ "public", "void", "setAction", "(", "String", "action", ")", "throws", "ApplicationException", "{", "action", "=", "action", ".", "toLowerCase", "(", ")", ".", "trim", "(", ")", ";", "if", "(", "action", ".", "equals", "(", "\"getall\"", ")", ")", "this"...
set the value action action to the registry @param action value to set @throws ApplicationException
[ "set", "the", "value", "action", "action", "to", "the", "registry" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Registry.java#L115-L122
leancloud/java-sdk-all
android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/sns/GetMsgSendIntentApi.java
GetMsgSendIntentApi.getMsgSendIntent
public void getMsgSendIntent(SnsMsg msg, boolean needResult, GetMsgSendIntentHandler handler) { """ 获取发送社交消息的intent @param msg 要发送的消息体 @param needResult 在社交界面发送完图文消息是否自动跳转回调用者应用界面 True:发完消息自动跳转回调用者界面 False:发完消息停留在社交界面 @param handler 结果回调 """ HMSAgentLog.i("getMsgSendIntent:msg=" + StrUtils.objDes...
java
public void getMsgSendIntent(SnsMsg msg, boolean needResult, GetMsgSendIntentHandler handler){ HMSAgentLog.i("getMsgSendIntent:msg=" + StrUtils.objDesc(msg) + " needResult=" + needResult + " handler=" + StrUtils.objDesc(handler)); this.msg = msg; this.needResult = needResult; this....
[ "public", "void", "getMsgSendIntent", "(", "SnsMsg", "msg", ",", "boolean", "needResult", ",", "GetMsgSendIntentHandler", "handler", ")", "{", "HMSAgentLog", ".", "i", "(", "\"getMsgSendIntent:msg=\"", "+", "StrUtils", ".", "objDesc", "(", "msg", ")", "+", "\" ...
获取发送社交消息的intent @param msg 要发送的消息体 @param needResult 在社交界面发送完图文消息是否自动跳转回调用者应用界面 True:发完消息自动跳转回调用者界面 False:发完消息停留在社交界面 @param handler 结果回调
[ "获取发送社交消息的intent" ]
train
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/sns/GetMsgSendIntentApi.java#L119-L126
jbundle/jbundle
thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageRecordDesc.java
BaseMessageRecordDesc.setNodeIndex
public Rec setNodeIndex(int iNodeIndex, Rec record) { """ Position to this node in the tree. @param iNodeIndex The node to position to. @param record The record I am moving data to. If this is null, don't position/setup the data. @return An error code. """ if (END_OF_NODES == iNodeIndex) ...
java
public Rec setNodeIndex(int iNodeIndex, Rec record) { if (END_OF_NODES == iNodeIndex) iNodeIndex = 0; m_iNodeIndex = iNodeIndex; return record; }
[ "public", "Rec", "setNodeIndex", "(", "int", "iNodeIndex", ",", "Rec", "record", ")", "{", "if", "(", "END_OF_NODES", "==", "iNodeIndex", ")", "iNodeIndex", "=", "0", ";", "m_iNodeIndex", "=", "iNodeIndex", ";", "return", "record", ";", "}" ]
Position to this node in the tree. @param iNodeIndex The node to position to. @param record The record I am moving data to. If this is null, don't position/setup the data. @return An error code.
[ "Position", "to", "this", "node", "in", "the", "tree", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageRecordDesc.java#L315-L321
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.removeVariable
public boolean removeVariable(String attribute, String varName) { """ Removes a specific variable definition given a variable name. @param attribute the attribute that defines variable definitions. @param varName the name of the variable to remove. @return true if the variable was successfully removed. Otherw...
java
public boolean removeVariable(String attribute, String varName) { Bindings binds = rslTree.getBindings(attribute); if (binds == null) return false; return binds.removeVariable(varName); }
[ "public", "boolean", "removeVariable", "(", "String", "attribute", ",", "String", "varName", ")", "{", "Bindings", "binds", "=", "rslTree", ".", "getBindings", "(", "attribute", ")", ";", "if", "(", "binds", "==", "null", ")", "return", "false", ";", "retu...
Removes a specific variable definition given a variable name. @param attribute the attribute that defines variable definitions. @param varName the name of the variable to remove. @return true if the variable was successfully removed. Otherwise, returns false,
[ "Removes", "a", "specific", "variable", "definition", "given", "a", "variable", "name", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L206-L210
indeedeng/proctor
proctor-consumer/src/main/java/com/indeed/proctor/consumer/spring/SampleRandomGroupsHttpHandler.java
SampleRandomGroupsHttpHandler.runSampling
private Map<String, Integer> runSampling( final ProctorContext proctorContext, final Set<String> targetTestNames, final TestType testType, final int determinationsToRun ) { """ test, how many times the group was present in the list of groups. """ fina...
java
private Map<String, Integer> runSampling( final ProctorContext proctorContext, final Set<String> targetTestNames, final TestType testType, final int determinationsToRun ) { final Set<String> targetTestGroups = getTargetTestGroups(targetTestNames); fina...
[ "private", "Map", "<", "String", ",", "Integer", ">", "runSampling", "(", "final", "ProctorContext", "proctorContext", ",", "final", "Set", "<", "String", ">", "targetTestNames", ",", "final", "TestType", "testType", ",", "final", "int", "determinationsToRun", "...
test, how many times the group was present in the list of groups.
[ "test", "how", "many", "times", "the", "group", "was", "present", "in", "the", "list", "of", "groups", "." ]
train
https://github.com/indeedeng/proctor/blob/b7795acfc26a30d013655d0e0fa1d3f8d0576571/proctor-consumer/src/main/java/com/indeed/proctor/consumer/spring/SampleRandomGroupsHttpHandler.java#L143-L171
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringParser.java
StringParser.parseByte
public static byte parseByte (@Nullable final String sStr, @Nonnegative final int nRadix, final byte nDefault) { """ Parse the given {@link String} as byte with the specified radix. @param sStr The String to parse. May be <code>null</code>. @param nRadix The radix to use. Must be &ge; {@link Character#MIN_RA...
java
public static byte parseByte (@Nullable final String sStr, @Nonnegative final int nRadix, final byte nDefault) { if (sStr != null && sStr.length () > 0) try { return Byte.parseByte (sStr, nRadix); } catch (final NumberFormatException ex) { // Fall through } ...
[ "public", "static", "byte", "parseByte", "(", "@", "Nullable", "final", "String", "sStr", ",", "@", "Nonnegative", "final", "int", "nRadix", ",", "final", "byte", "nDefault", ")", "{", "if", "(", "sStr", "!=", "null", "&&", "sStr", ".", "length", "(", ...
Parse the given {@link String} as byte with the specified radix. @param sStr The String to parse. May be <code>null</code>. @param nRadix The radix to use. Must be &ge; {@link Character#MIN_RADIX} and &le; {@link Character#MAX_RADIX}. @param nDefault The value to be returned if the string cannot be converted to a vali...
[ "Parse", "the", "given", "{", "@link", "String", "}", "as", "byte", "with", "the", "specified", "radix", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L316-L328
vRallev/ECC-25519
ECC-25519-Java/src/main/java/djb/Curve25519.java
Curve25519.mont_dbl
private static final void mont_dbl(long10 t1, long10 t2, long10 t3, long10 t4,long10 bx, long10 bz) { """ /* B = 2 * Q where X(B) = bx/bz X(Q) = (t3+t4)/(t3-t4) clobbers t1 and t2, preserves t3 and t4 """ sqr(t1, t3); sqr(t2, t4); mul(bx, t1, t2); sub(t2, t1, t2); mul_small(bz, t2, 121665); ad...
java
private static final void mont_dbl(long10 t1, long10 t2, long10 t3, long10 t4,long10 bx, long10 bz) { sqr(t1, t3); sqr(t2, t4); mul(bx, t1, t2); sub(t2, t1, t2); mul_small(bz, t2, 121665); add(t1, t1, bz); mul(bz, t1, t2); }
[ "private", "static", "final", "void", "mont_dbl", "(", "long10", "t1", ",", "long10", "t2", ",", "long10", "t3", ",", "long10", "t4", ",", "long10", "bx", ",", "long10", "bz", ")", "{", "sqr", "(", "t1", ",", "t3", ")", ";", "sqr", "(", "t2", ","...
/* B = 2 * Q where X(B) = bx/bz X(Q) = (t3+t4)/(t3-t4) clobbers t1 and t2, preserves t3 and t4
[ "/", "*", "B", "=", "2", "*", "Q", "where", "X", "(", "B", ")", "=", "bx", "/", "bz", "X", "(", "Q", ")", "=", "(", "t3", "+", "t4", ")", "/", "(", "t3", "-", "t4", ")", "clobbers", "t1", "and", "t2", "preserves", "t3", "and", "t4" ]
train
https://github.com/vRallev/ECC-25519/blob/5c4297933aabfa4fbe7675e36d6d923ffd22e2cb/ECC-25519-Java/src/main/java/djb/Curve25519.java#L791-L799
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java
DiagnosticsInner.getSiteAnalysisAsync
public Observable<DiagnosticAnalysisInner> getSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { """ Get Site Analysis. Get Site Analysis. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @...
java
public Observable<DiagnosticAnalysisInner> getSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { return getSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).map(new Func1<ServiceResponse<DiagnosticAnaly...
[ "public", "Observable", "<", "DiagnosticAnalysisInner", ">", "getSiteAnalysisAsync", "(", "String", "resourceGroupName", ",", "String", "siteName", ",", "String", "diagnosticCategory", ",", "String", "analysisName", ")", "{", "return", "getSiteAnalysisWithServiceResponseAsy...
Get Site Analysis. Get Site Analysis. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param diagnosticCategory Diagnostic Category @param analysisName Analysis Name @throws IllegalArgumentException thrown if parameters fail the validation @return the observ...
[ "Get", "Site", "Analysis", ".", "Get", "Site", "Analysis", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L565-L572
h2oai/h2o-2
src/main/java/water/NanoHTTPD.java
NanoHTTPD.encodeUri
private String encodeUri( String uri ) { """ URL-encodes everything between "/"-characters. Encodes spaces as '%20' instead of '+'. @throws UnsupportedEncodingException """ String newUri = ""; StringTokenizer st = new StringTokenizer( uri, "/ ", true ); while ( st.hasMoreTokens()) { String ...
java
private String encodeUri( String uri ) { String newUri = ""; StringTokenizer st = new StringTokenizer( uri, "/ ", true ); while ( st.hasMoreTokens()) { String tok = st.nextToken(); if ( tok.equals( "/" )) newUri += "/"; else if ( tok.equals( " " )) newUri += "%20"; el...
[ "private", "String", "encodeUri", "(", "String", "uri", ")", "{", "String", "newUri", "=", "\"\"", ";", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", "uri", ",", "\"/ \"", ",", "true", ")", ";", "while", "(", "st", ".", "hasMoreTokens", "(...
URL-encodes everything between "/"-characters. Encodes spaces as '%20' instead of '+'. @throws UnsupportedEncodingException
[ "URL", "-", "encodes", "everything", "between", "/", "-", "characters", ".", "Encodes", "spaces", "as", "%20", "instead", "of", "+", "." ]
train
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/NanoHTTPD.java#L826-L844
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/minkowski/EuclideanDistanceFunction.java
EuclideanDistanceFunction.maxDist
public double maxDist(SpatialComparable mbr1, SpatialComparable mbr2) { """ Maximum distance of two objects. @param mbr1 First object @param mbr2 Second object """ final int dim1 = mbr1.getDimensionality(), dim2 = mbr2.getDimensionality(); final int mindim = dim1 < dim2 ? dim1 : dim2; double a...
java
public double maxDist(SpatialComparable mbr1, SpatialComparable mbr2) { final int dim1 = mbr1.getDimensionality(), dim2 = mbr2.getDimensionality(); final int mindim = dim1 < dim2 ? dim1 : dim2; double agg = 0.; for(int d = 0; d < mindim; d++) { double d1 = mbr1.getMax(d) - mbr2.getMin(d); d...
[ "public", "double", "maxDist", "(", "SpatialComparable", "mbr1", ",", "SpatialComparable", "mbr2", ")", "{", "final", "int", "dim1", "=", "mbr1", ".", "getDimensionality", "(", ")", ",", "dim2", "=", "mbr2", ".", "getDimensionality", "(", ")", ";", "final", ...
Maximum distance of two objects. @param mbr1 First object @param mbr2 Second object
[ "Maximum", "distance", "of", "two", "objects", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/minkowski/EuclideanDistanceFunction.java#L160-L182
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/ColorConverter.java
ColorConverter.parseRGB
protected Color parseRGB(String value) { """ Parsers a String in the form "x, y, z" into an SWT RGB class. @param value the color as String @return RGB """ StringTokenizer items = new StringTokenizer(value, ","); try { int red = 0; if (items.hasMoreTokens()) { ...
java
protected Color parseRGB(String value) { StringTokenizer items = new StringTokenizer(value, ","); try { int red = 0; if (items.hasMoreTokens()) { red = Integer.parseInt(items.nextToken().trim()); } int green = 0; if (items...
[ "protected", "Color", "parseRGB", "(", "String", "value", ")", "{", "StringTokenizer", "items", "=", "new", "StringTokenizer", "(", "value", ",", "\",\"", ")", ";", "try", "{", "int", "red", "=", "0", ";", "if", "(", "items", ".", "hasMoreTokens", "(", ...
Parsers a String in the form "x, y, z" into an SWT RGB class. @param value the color as String @return RGB
[ "Parsers", "a", "String", "in", "the", "form", "x", "y", "z", "into", "an", "SWT", "RGB", "class", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/ColorConverter.java#L73-L97
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java
CounterMap.incrementCount
public void incrementCount(F first, S second, double inc) { """ This method will increment counts for a given first/second pair @param first @param second @param inc """ Counter<S> counter = maps.get(first); if (counter == null) { counter = new Counter<S>(); maps.pu...
java
public void incrementCount(F first, S second, double inc) { Counter<S> counter = maps.get(first); if (counter == null) { counter = new Counter<S>(); maps.put(first, counter); } counter.incrementCount(second, inc); }
[ "public", "void", "incrementCount", "(", "F", "first", ",", "S", "second", ",", "double", "inc", ")", "{", "Counter", "<", "S", ">", "counter", "=", "maps", ".", "get", "(", "first", ")", ";", "if", "(", "counter", "==", "null", ")", "{", "counter"...
This method will increment counts for a given first/second pair @param first @param second @param inc
[ "This", "method", "will", "increment", "counts", "for", "a", "given", "first", "/", "second", "pair" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/primitives/CounterMap.java#L90-L98
upwork/java-upwork
src/com/Upwork/api/Routers/Workdays.java
Workdays.getByCompany
public JSONObject getByCompany(String company, String fromDate, String tillDate, HashMap<String, String> params) throws JSONException { """ Get Workdays by Company @param company Company ID @param fromDate Start date @param tillDate End date @param params (Optional) Parameters @throws JSONException ...
java
public JSONObject getByCompany(String company, String fromDate, String tillDate, HashMap<String, String> params) throws JSONException { return oClient.get("/team/v3/workdays/companies/" + company + "/" + fromDate + "," + tillDate, params); }
[ "public", "JSONObject", "getByCompany", "(", "String", "company", ",", "String", "fromDate", ",", "String", "tillDate", ",", "HashMap", "<", "String", ",", "String", ">", "params", ")", "throws", "JSONException", "{", "return", "oClient", ".", "get", "(", "\...
Get Workdays by Company @param company Company ID @param fromDate Start date @param tillDate End date @param params (Optional) Parameters @throws JSONException If error occurred @return {@link JSONObject}
[ "Get", "Workdays", "by", "Company" ]
train
https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Workdays.java#L56-L58
atomix/atomix
core/src/main/java/io/atomix/core/map/impl/AbstractAtomicMapService.java
AbstractAtomicMapService.putValue
protected void putValue(K key, MapEntryValue value) { """ Updates the given value. @param key the key to update @param value the value to update """ MapEntryValue oldValue = entries().put(key, value); cancelTtl(oldValue); scheduleTtl(key, value); }
java
protected void putValue(K key, MapEntryValue value) { MapEntryValue oldValue = entries().put(key, value); cancelTtl(oldValue); scheduleTtl(key, value); }
[ "protected", "void", "putValue", "(", "K", "key", ",", "MapEntryValue", "value", ")", "{", "MapEntryValue", "oldValue", "=", "entries", "(", ")", ".", "put", "(", "key", ",", "value", ")", ";", "cancelTtl", "(", "oldValue", ")", ";", "scheduleTtl", "(", ...
Updates the given value. @param key the key to update @param value the value to update
[ "Updates", "the", "given", "value", "." ]
train
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/core/src/main/java/io/atomix/core/map/impl/AbstractAtomicMapService.java#L255-L259
prestodb/presto
presto-orc/src/main/java/com/facebook/presto/orc/TupleDomainOrcPredicate.java
TupleDomainOrcPredicate.checkInBloomFilter
@VisibleForTesting public static boolean checkInBloomFilter(BloomFilter bloomFilter, Object predicateValue, Type sqlType) { """ checks whether a value part of the effective predicate is likely to be part of this bloom filter """ if (sqlType == TINYINT || sqlType == SMALLINT || sqlType == INTEGER ||...
java
@VisibleForTesting public static boolean checkInBloomFilter(BloomFilter bloomFilter, Object predicateValue, Type sqlType) { if (sqlType == TINYINT || sqlType == SMALLINT || sqlType == INTEGER || sqlType == BIGINT) { return bloomFilter.testLong(((Number) predicateValue).longValue()); ...
[ "@", "VisibleForTesting", "public", "static", "boolean", "checkInBloomFilter", "(", "BloomFilter", "bloomFilter", ",", "Object", "predicateValue", ",", "Type", "sqlType", ")", "{", "if", "(", "sqlType", "==", "TINYINT", "||", "sqlType", "==", "SMALLINT", "||", "...
checks whether a value part of the effective predicate is likely to be part of this bloom filter
[ "checks", "whether", "a", "value", "part", "of", "the", "effective", "predicate", "is", "likely", "to", "be", "part", "of", "this", "bloom", "filter" ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/TupleDomainOrcPredicate.java#L162-L179
sputnikdev/bluetooth-utils
src/main/java/org/sputnikdev/bluetooth/URL.java
URL.copyWithDevice
public URL copyWithDevice(String deviceAddress, Map<String, String> attr) { """ Makes a copy of a given URL with some additional components. @param deviceAddress bluetooth device MAC address @param attr device attributes @return a copy of a given URL with some additional components """ return new UR...
java
public URL copyWithDevice(String deviceAddress, Map<String, String> attr) { return new URL(this.protocol, this.adapterAddress, deviceAddress, attr, this.serviceUUID, this.characteristicUUID, this.fieldName); }
[ "public", "URL", "copyWithDevice", "(", "String", "deviceAddress", ",", "Map", "<", "String", ",", "String", ">", "attr", ")", "{", "return", "new", "URL", "(", "this", ".", "protocol", ",", "this", ".", "adapterAddress", ",", "deviceAddress", ",", "attr",...
Makes a copy of a given URL with some additional components. @param deviceAddress bluetooth device MAC address @param attr device attributes @return a copy of a given URL with some additional components
[ "Makes", "a", "copy", "of", "a", "given", "URL", "with", "some", "additional", "components", "." ]
train
https://github.com/sputnikdev/bluetooth-utils/blob/794e4a8644c1eed54cd043de2bc967f4ef58acca/src/main/java/org/sputnikdev/bluetooth/URL.java#L266-L269
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataExactCardinalityImpl_CustomFieldSerializer.java
OWLDataExactCardinalityImpl_CustomFieldSerializer.deserializeInstance
@Override public void deserializeInstance(SerializationStreamReader streamReader, OWLDataExactCardinalityImpl instance) throws SerializationException { """ Deserializes the content of the object from the {@link com.google.gwt.user.client.rpc.SerializationStreamReader}. @param streamReader the {@link com.go...
java
@Override public void deserializeInstance(SerializationStreamReader streamReader, OWLDataExactCardinalityImpl instance) throws SerializationException { deserialize(streamReader, instance); }
[ "@", "Override", "public", "void", "deserializeInstance", "(", "SerializationStreamReader", "streamReader", ",", "OWLDataExactCardinalityImpl", "instance", ")", "throws", "SerializationException", "{", "deserialize", "(", "streamReader", ",", "instance", ")", ";", "}" ]
Deserializes the content of the object from the {@link com.google.gwt.user.client.rpc.SerializationStreamReader}. @param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the object's content from @param instance the object instance to deserialize @throws com.google.gwt.user...
[ "Deserializes", "the", "content", "of", "the", "object", "from", "the", "{", "@link", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "rpc", ".", "SerializationStreamReader", "}", "." ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataExactCardinalityImpl_CustomFieldSerializer.java#L95-L98
marklogic/java-client-api
marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java
StructuredQueryBuilder.containerQuery
public StructuredQueryDefinition containerQuery(ContainerIndex index, StructuredQueryDefinition query) { """ Matches a query within the substructure contained by an element or JSON property. @param index the element or JSON property @param query the query over the contained substructure @return the Str...
java
public StructuredQueryDefinition containerQuery(ContainerIndex index, StructuredQueryDefinition query) { checkQuery(query); return new ContainerQuery(index, query); }
[ "public", "StructuredQueryDefinition", "containerQuery", "(", "ContainerIndex", "index", ",", "StructuredQueryDefinition", "query", ")", "{", "checkQuery", "(", "query", ")", ";", "return", "new", "ContainerQuery", "(", "index", ",", "query", ")", ";", "}" ]
Matches a query within the substructure contained by an element or JSON property. @param index the element or JSON property @param query the query over the contained substructure @return the StructuredQueryDefinition for the container query
[ "Matches", "a", "query", "within", "the", "substructure", "contained", "by", "an", "element", "or", "JSON", "property", "." ]
train
https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L439-L442
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java
Range.of
public R of(@Nonnull T startClosed, @Nonnull T endOpen) { """ Creates a new {@link Range} with the specified inclusive start and the specified exclusive end. """ return startClosed(startClosed).endOpen(endOpen); }
java
public R of(@Nonnull T startClosed, @Nonnull T endOpen) { return startClosed(startClosed).endOpen(endOpen); }
[ "public", "R", "of", "(", "@", "Nonnull", "T", "startClosed", ",", "@", "Nonnull", "T", "endOpen", ")", "{", "return", "startClosed", "(", "startClosed", ")", ".", "endOpen", "(", "endOpen", ")", ";", "}" ]
Creates a new {@link Range} with the specified inclusive start and the specified exclusive end.
[ "Creates", "a", "new", "{" ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java#L77-L79
dnsjava/dnsjava
org/xbill/DNS/ZoneTransferIn.java
ZoneTransferIn.newAXFR
public static ZoneTransferIn newAXFR(Name zone, String host, int port, TSIG key) throws UnknownHostException { """ Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer). @param zone The zone to transfer. @param host The host from which to transfer the zone. @param port The port to connect to o...
java
public static ZoneTransferIn newAXFR(Name zone, String host, int port, TSIG key) throws UnknownHostException { if (port == 0) port = SimpleResolver.DEFAULT_PORT; return newAXFR(zone, new InetSocketAddress(host, port), key); }
[ "public", "static", "ZoneTransferIn", "newAXFR", "(", "Name", "zone", ",", "String", "host", ",", "int", "port", ",", "TSIG", "key", ")", "throws", "UnknownHostException", "{", "if", "(", "port", "==", "0", ")", "port", "=", "SimpleResolver", ".", "DEFAULT...
Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer). @param zone The zone to transfer. @param host The host from which to transfer the zone. @param port The port to connect to on the server, or 0 for the default. @param key The TSIG key used to authenticate the transfer, or null. @return The ZoneTra...
[ "Instantiates", "a", "ZoneTransferIn", "object", "to", "do", "an", "AXFR", "(", "full", "zone", "transfer", ")", "." ]
train
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ZoneTransferIn.java#L214-L221
kaazing/java.client
transport/src/main/java/org/kaazing/gateway/client/transport/ws/WsFrameEncodingSupport.java
WsFrameEncodingSupport.doEncodeOpcode
private static byte doEncodeOpcode(byte b, WsMessage message) { """ Encode a WebSocket opcode onto a byte that might have some high bits set. @param b @param message @return """ switch (message.getKind()) { case TEXT: { b |= Opcode.TEXT.getCode(); break; } ...
java
private static byte doEncodeOpcode(byte b, WsMessage message) { switch (message.getKind()) { case TEXT: { b |= Opcode.TEXT.getCode(); break; } case BINARY: { b |= Opcode.BINARY.getCode(); break; } case PING: { b ...
[ "private", "static", "byte", "doEncodeOpcode", "(", "byte", "b", ",", "WsMessage", "message", ")", "{", "switch", "(", "message", ".", "getKind", "(", ")", ")", "{", "case", "TEXT", ":", "{", "b", "|=", "Opcode", ".", "TEXT", ".", "getCode", "(", ")"...
Encode a WebSocket opcode onto a byte that might have some high bits set. @param b @param message @return
[ "Encode", "a", "WebSocket", "opcode", "onto", "a", "byte", "that", "might", "have", "some", "high", "bits", "set", "." ]
train
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/transport/src/main/java/org/kaazing/gateway/client/transport/ws/WsFrameEncodingSupport.java#L119-L145
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/UserResources.java
UserResources.getUserById
@GET @Produces(MediaType.APPLICATION_JSON) @Path("/id/ { """ Returns the user having the given ID. @param req The HTTP request. @param userId The user ID to retrieve @return The corresponding user DTO. @throws WebApplicationException If an error occurs. """userId}") @Descripti...
java
@GET @Produces(MediaType.APPLICATION_JSON) @Path("/id/{userId}") @Description("Returns the user having the given ID.") public PrincipalUserDto getUserById(@Context HttpServletRequest req, @PathParam("userId") final BigInteger userId) { if (userId == null || userId.compareTo(BigInteger.ZE...
[ "@", "GET", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Path", "(", "\"/id/{userId}\"", ")", "@", "Description", "(", "\"Returns the user having the given ID.\"", ")", "public", "PrincipalUserDto", "getUserById", "(", "@", "Context", "Http...
Returns the user having the given ID. @param req The HTTP request. @param userId The user ID to retrieve @return The corresponding user DTO. @throws WebApplicationException If an error occurs.
[ "Returns", "the", "user", "having", "the", "given", "ID", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/UserResources.java#L106-L124
killbill/killbill
invoice/src/main/java/org/killbill/billing/invoice/usage/ContiguousIntervalUsageInArrear.java
ContiguousIntervalUsageInArrear.computeUpdatedAmount
private Long computeUpdatedAmount(@Nullable Long currentAmount, @Nullable Long newAmount) { """ Based on usage type compute new amount @param currentAmount @param newAmount @return """ currentAmount = currentAmount == null ? 0L : currentAmount; newAmount = newAmount == null ? 0L : newAmou...
java
private Long computeUpdatedAmount(@Nullable Long currentAmount, @Nullable Long newAmount) { currentAmount = currentAmount == null ? 0L : currentAmount; newAmount = newAmount == null ? 0L : newAmount; if (usage.getUsageType() == UsageType.CAPACITY) { return Math.max(currentAmount, n...
[ "private", "Long", "computeUpdatedAmount", "(", "@", "Nullable", "Long", "currentAmount", ",", "@", "Nullable", "Long", "newAmount", ")", "{", "currentAmount", "=", "currentAmount", "==", "null", "?", "0L", ":", "currentAmount", ";", "newAmount", "=", "newAmount...
Based on usage type compute new amount @param currentAmount @param newAmount @return
[ "Based", "on", "usage", "type", "compute", "new", "amount" ]
train
https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/invoice/src/main/java/org/killbill/billing/invoice/usage/ContiguousIntervalUsageInArrear.java#L394-L404
pebble/pebble-android-sdk
PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java
PebbleKit.registerReceivedNackHandler
public static BroadcastReceiver registerReceivedNackHandler(final Context context, final PebbleNackReceiver receiver) { """ A convenience function to assist in programatically registering a broadcast receiver for the 'RECEIVE_NACK' intent. To avoi...
java
public static BroadcastReceiver registerReceivedNackHandler(final Context context, final PebbleNackReceiver receiver) { return registerBroadcastReceiverInternal(context, INTENT_APP_RECEIVE_NACK, receiver); }
[ "public", "static", "BroadcastReceiver", "registerReceivedNackHandler", "(", "final", "Context", "context", ",", "final", "PebbleNackReceiver", "receiver", ")", "{", "return", "registerBroadcastReceiverInternal", "(", "context", ",", "INTENT_APP_RECEIVE_NACK", ",", "receive...
A convenience function to assist in programatically registering a broadcast receiver for the 'RECEIVE_NACK' intent. To avoid leaking memory, activities registering BroadcastReceivers <em>must</em> unregister them in the Activity's {@link android.app.Activity#onPause()} method. @param context The context in which to r...
[ "A", "convenience", "function", "to", "assist", "in", "programatically", "registering", "a", "broadcast", "receiver", "for", "the", "RECEIVE_NACK", "intent", "." ]
train
https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L469-L472
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/core/Transaction.java
Transaction.addOutput
public TransactionOutput addOutput(Coin value, ECKey pubkey) { """ Creates an output that pays to the given pubkey directly (no address) with the given value, adds it to this transaction, and returns the new output. """ return addOutput(new TransactionOutput(params, this, value, pubkey)); }
java
public TransactionOutput addOutput(Coin value, ECKey pubkey) { return addOutput(new TransactionOutput(params, this, value, pubkey)); }
[ "public", "TransactionOutput", "addOutput", "(", "Coin", "value", ",", "ECKey", "pubkey", ")", "{", "return", "addOutput", "(", "new", "TransactionOutput", "(", "params", ",", "this", ",", "value", ",", "pubkey", ")", ")", ";", "}" ]
Creates an output that pays to the given pubkey directly (no address) with the given value, adds it to this transaction, and returns the new output.
[ "Creates", "an", "output", "that", "pays", "to", "the", "given", "pubkey", "directly", "(", "no", "address", ")", "with", "the", "given", "value", "adds", "it", "to", "this", "transaction", "and", "returns", "the", "new", "output", "." ]
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L1049-L1051
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java
Retryer.stopAfterAttempt
public Retryer<R> stopAfterAttempt(final int maxAttemptNumber) { """ Sets the stop strategy which stops after N failed attempts @param maxAttemptNumber @return """ checkArgument(maxAttemptNumber >= 1, "maxAttemptNumber must be >= 1 but is %d", maxAttemptNumber); return withStopStrategy(new ...
java
public Retryer<R> stopAfterAttempt(final int maxAttemptNumber) { checkArgument(maxAttemptNumber >= 1, "maxAttemptNumber must be >= 1 but is %d", maxAttemptNumber); return withStopStrategy(new StopStrategy() { @Override public boolean shouldStop(int previousAttemptNumber, long de...
[ "public", "Retryer", "<", "R", ">", "stopAfterAttempt", "(", "final", "int", "maxAttemptNumber", ")", "{", "checkArgument", "(", "maxAttemptNumber", ">=", "1", ",", "\"maxAttemptNumber must be >= 1 but is %d\"", ",", "maxAttemptNumber", ")", ";", "return", "withStopSt...
Sets the stop strategy which stops after N failed attempts @param maxAttemptNumber @return
[ "Sets", "the", "stop", "strategy", "which", "stops", "after", "N", "failed", "attempts" ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java#L309-L317
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/postprocess/impl/css/base64/Base64PostProcessorCssImageUrlRewriter.java
Base64PostProcessorCssImageUrlRewriter.getBooleanValue
private boolean getBooleanValue(String strVal, boolean defaultValue) { """ Returns the boolean value of the string passed in parameter or the default value if the string is null @param strVal the string value @param defaultValue the default value @return the boolean value of the string passed in parameter ...
java
private boolean getBooleanValue(String strVal, boolean defaultValue) { boolean result = defaultValue; if (strVal != null) { result = Boolean.parseBoolean(strVal); } return result; }
[ "private", "boolean", "getBooleanValue", "(", "String", "strVal", ",", "boolean", "defaultValue", ")", "{", "boolean", "result", "=", "defaultValue", ";", "if", "(", "strVal", "!=", "null", ")", "{", "result", "=", "Boolean", ".", "parseBoolean", "(", "strVa...
Returns the boolean value of the string passed in parameter or the default value if the string is null @param strVal the string value @param defaultValue the default value @return the boolean value of the string passed in parameter or the default value if the string is null
[ "Returns", "the", "boolean", "value", "of", "the", "string", "passed", "in", "parameter", "or", "the", "default", "value", "if", "the", "string", "is", "null" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/postprocess/impl/css/base64/Base64PostProcessorCssImageUrlRewriter.java#L147-L155
protostuff/protostuff
protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeSchema.java
RuntimeSchema.createFrom
public static <T> RuntimeSchema<T> createFrom(Class<T> typeClass) { """ Generates a schema from the given class. <p> Method overload for backwards compatibility. """ return createFrom(typeClass, NO_EXCLUSIONS, ID_STRATEGY); }
java
public static <T> RuntimeSchema<T> createFrom(Class<T> typeClass) { return createFrom(typeClass, NO_EXCLUSIONS, ID_STRATEGY); }
[ "public", "static", "<", "T", ">", "RuntimeSchema", "<", "T", ">", "createFrom", "(", "Class", "<", "T", ">", "typeClass", ")", "{", "return", "createFrom", "(", "typeClass", ",", "NO_EXCLUSIONS", ",", "ID_STRATEGY", ")", ";", "}" ]
Generates a schema from the given class. <p> Method overload for backwards compatibility.
[ "Generates", "a", "schema", "from", "the", "given", "class", ".", "<p", ">", "Method", "overload", "for", "backwards", "compatibility", "." ]
train
https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeSchema.java#L176-L179
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUService.java
ICUService.getDisplayName
public String getDisplayName(String id) { """ Convenience override for getDisplayName(String, ULocale) that uses the current default locale. """ return getDisplayName(id, ULocale.getDefault(Category.DISPLAY)); }
java
public String getDisplayName(String id) { return getDisplayName(id, ULocale.getDefault(Category.DISPLAY)); }
[ "public", "String", "getDisplayName", "(", "String", "id", ")", "{", "return", "getDisplayName", "(", "id", ",", "ULocale", ".", "getDefault", "(", "Category", ".", "DISPLAY", ")", ")", ";", "}" ]
Convenience override for getDisplayName(String, ULocale) that uses the current default locale.
[ "Convenience", "override", "for", "getDisplayName", "(", "String", "ULocale", ")", "that", "uses", "the", "current", "default", "locale", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUService.java#L611-L613
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
PersistenceBrokerImpl.doDelete
private void doDelete(Object obj, boolean ignoreReferences) throws PersistenceBrokerException { """ do delete given object. Should be used by all intern classes to delete objects. """ //logger.info("DELETING " + obj); // object is not null if (obj != null) { obj = g...
java
private void doDelete(Object obj, boolean ignoreReferences) throws PersistenceBrokerException { //logger.info("DELETING " + obj); // object is not null if (obj != null) { obj = getProxyFactory().getRealObject(obj); /** * Kuali Foundation modificat...
[ "private", "void", "doDelete", "(", "Object", "obj", ",", "boolean", "ignoreReferences", ")", "throws", "PersistenceBrokerException", "{", "//logger.info(\"DELETING \" + obj);", "// object is not null", "if", "(", "obj", "!=", "null", ")", "{", "obj", "=", "getProxyFa...
do delete given object. Should be used by all intern classes to delete objects.
[ "do", "delete", "given", "object", ".", "Should", "be", "used", "by", "all", "intern", "classes", "to", "delete", "objects", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java#L532-L592
jruby/jcodings
src/org/jcodings/AbstractEncoding.java
AbstractEncoding.caseFoldCodesByString
@Override public CaseFoldCodeItem[]caseFoldCodesByString(int flag, byte[]bytes, int p, int end) { """ onigenc_ascii_get_case_fold_codes_by_str / used also by multibyte encodings """ return asciiCaseFoldCodesByString(flag, bytes, p, end); }
java
@Override public CaseFoldCodeItem[]caseFoldCodesByString(int flag, byte[]bytes, int p, int end) { return asciiCaseFoldCodesByString(flag, bytes, p, end); }
[ "@", "Override", "public", "CaseFoldCodeItem", "[", "]", "caseFoldCodesByString", "(", "int", "flag", ",", "byte", "[", "]", "bytes", ",", "int", "p", ",", "int", "end", ")", "{", "return", "asciiCaseFoldCodesByString", "(", "flag", ",", "bytes", ",", "p",...
onigenc_ascii_get_case_fold_codes_by_str / used also by multibyte encodings
[ "onigenc_ascii_get_case_fold_codes_by_str", "/", "used", "also", "by", "multibyte", "encodings" ]
train
https://github.com/jruby/jcodings/blob/8e09c6caab59f9a0b9760e57d2708eea185c2de1/src/org/jcodings/AbstractEncoding.java#L102-L105
belaban/JGroups
src/org/jgroups/protocols/pbcast/FLUSH.java
FLUSH.onSuspend
private void onSuspend(final List<Address> members) { """ Starts the flush protocol @param members List of participants in the flush protocol. Guaranteed to be non-null """ Message msg = null; Collection<Address> participantsInFlush = null; synchronized (sharedLock) { flushCoord...
java
private void onSuspend(final List<Address> members) { Message msg = null; Collection<Address> participantsInFlush = null; synchronized (sharedLock) { flushCoordinator = localAddress; // start FLUSH only on group members that we need to flush participantsInFlush...
[ "private", "void", "onSuspend", "(", "final", "List", "<", "Address", ">", "members", ")", "{", "Message", "msg", "=", "null", ";", "Collection", "<", "Address", ">", "participantsInFlush", "=", "null", ";", "synchronized", "(", "sharedLock", ")", "{", "fl...
Starts the flush protocol @param members List of participants in the flush protocol. Guaranteed to be non-null
[ "Starts", "the", "flush", "protocol" ]
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/protocols/pbcast/FLUSH.java#L688-L713
czyzby/gdx-lml
kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/reflection/Reflection.java
Reflection.isAnnotationPresent
public static boolean isAnnotationPresent(final Field field, final Class<? extends Annotation> annotationType) { """ Utility method kept for backwards compatibility. Annotation checking used to be problematic on GWT. @param field might be annotated. Can be null. @param annotationType class of the annotation th...
java
public static boolean isAnnotationPresent(final Field field, final Class<? extends Annotation> annotationType) { return field != null && field.isAnnotationPresent(annotationType); }
[ "public", "static", "boolean", "isAnnotationPresent", "(", "final", "Field", "field", ",", "final", "Class", "<", "?", "extends", "Annotation", ">", "annotationType", ")", "{", "return", "field", "!=", "null", "&&", "field", ".", "isAnnotationPresent", "(", "a...
Utility method kept for backwards compatibility. Annotation checking used to be problematic on GWT. @param field might be annotated. Can be null. @param annotationType class of the annotation that the field is checked against. @return true if field is annotated with the specified annotation.
[ "Utility", "method", "kept", "for", "backwards", "compatibility", ".", "Annotation", "checking", "used", "to", "be", "problematic", "on", "GWT", "." ]
train
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/reflection/Reflection.java#L80-L82
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java
ZooKeeper.getChildren
public void getChildren(final String path, Watcher watcher, ChildrenCallback cb, Object ctx) { """ The Asynchronous version of getChildren. The request doesn't actually until the asynchronous callback is called. @see #getChildren(String, Watcher) """ verbotenThreadCheck(); final...
java
public void getChildren(final String path, Watcher watcher, ChildrenCallback cb, Object ctx) { verbotenThreadCheck(); final String clientPath = path; PathUtils.validatePath(clientPath); // the watch contains the un-chroot path WatchRegistration wcb = null; if...
[ "public", "void", "getChildren", "(", "final", "String", "path", ",", "Watcher", "watcher", ",", "ChildrenCallback", "cb", ",", "Object", "ctx", ")", "{", "verbotenThreadCheck", "(", ")", ";", "final", "String", "clientPath", "=", "path", ";", "PathUtils", "...
The Asynchronous version of getChildren. The request doesn't actually until the asynchronous callback is called. @see #getChildren(String, Watcher)
[ "The", "Asynchronous", "version", "of", "getChildren", ".", "The", "request", "doesn", "t", "actually", "until", "the", "asynchronous", "callback", "is", "called", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L1345-L1367
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/GridBagLayoutFormBuilder.java
GridBagLayoutFormBuilder.appendLabeledField
public GridBagLayoutFormBuilder appendLabeledField(String propertyName, final JComponent field, LabelOrientation labelOrientation, int colSpan) { """ Appends a label and field to the end of the current line. <p /> The label will be to the left of the field, and be right-justified. <br /> The fiel...
java
public GridBagLayoutFormBuilder appendLabeledField(String propertyName, final JComponent field, LabelOrientation labelOrientation, int colSpan) { return appendLabeledField(propertyName, field, labelOrientation, colSpan, 1, true, false); }
[ "public", "GridBagLayoutFormBuilder", "appendLabeledField", "(", "String", "propertyName", ",", "final", "JComponent", "field", ",", "LabelOrientation", "labelOrientation", ",", "int", "colSpan", ")", "{", "return", "appendLabeledField", "(", "propertyName", ",", "field...
Appends a label and field to the end of the current line. <p /> The label will be to the left of the field, and be right-justified. <br /> The field will "grow" horizontally as space allows. <p /> @param propertyName the name of the property to create the controls for @param colSpan the number of columns the fie...
[ "Appends", "a", "label", "and", "field", "to", "the", "end", "of", "the", "current", "line", ".", "<p", "/", ">" ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/GridBagLayoutFormBuilder.java#L155-L158
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/impl/MigrationManager.java
MigrationManager.finalizeMigration
void finalizeMigration(MigrationInfo migrationInfo) { """ Finalizes a migration that has finished with {@link MigrationStatus#SUCCESS} or {@link MigrationStatus#FAILED} by invoking {@link FinalizeMigrationOperation} locally if this is the source or destination. The finalization is asynchronous and there might b...
java
void finalizeMigration(MigrationInfo migrationInfo) { try { PartitionReplica localReplica = PartitionReplica.from(node.getLocalMember()); int partitionId = migrationInfo.getPartitionId(); boolean source = localReplica.equals(migrationInfo.getSource()); boolean de...
[ "void", "finalizeMigration", "(", "MigrationInfo", "migrationInfo", ")", "{", "try", "{", "PartitionReplica", "localReplica", "=", "PartitionReplica", ".", "from", "(", "node", ".", "getLocalMember", "(", ")", ")", ";", "int", "partitionId", "=", "migrationInfo", ...
Finalizes a migration that has finished with {@link MigrationStatus#SUCCESS} or {@link MigrationStatus#FAILED} by invoking {@link FinalizeMigrationOperation} locally if this is the source or destination. The finalization is asynchronous and there might be other ongoing migration finalizations. <p> It will also cleanup ...
[ "Finalizes", "a", "migration", "that", "has", "finished", "with", "{", "@link", "MigrationStatus#SUCCESS", "}", "or", "{", "@link", "MigrationStatus#FAILED", "}", "by", "invoking", "{", "@link", "FinalizeMigrationOperation", "}", "locally", "if", "this", "is", "th...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/impl/MigrationManager.java#L190-L242
pietermartin/sqlg
sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java
Partition.createRangeSubPartition
private static Partition createRangeSubPartition(SqlgGraph sqlgGraph, Partition parentPartition, String name, String from, String to) { """ Create a range partition on an existing {@link Partition} @param sqlgGraph @param parentPartition @param name @param from @param to @return """ Preconditio...
java
private static Partition createRangeSubPartition(SqlgGraph sqlgGraph, Partition parentPartition, String name, String from, String to) { Preconditions.checkArgument(!parentPartition.getAbstractLabel().getSchema().isSqlgSchema(), "createRangeSubPartition may not be called for \"%s\"", Topology.SQLG_SCHEMA); ...
[ "private", "static", "Partition", "createRangeSubPartition", "(", "SqlgGraph", "sqlgGraph", ",", "Partition", "parentPartition", ",", "String", "name", ",", "String", "from", ",", "String", "to", ")", "{", "Preconditions", ".", "checkArgument", "(", "!", "parentPa...
Create a range partition on an existing {@link Partition} @param sqlgGraph @param parentPartition @param name @param from @param to @return
[ "Create", "a", "range", "partition", "on", "an", "existing", "{", "@link", "Partition", "}" ]
train
https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java#L334-L341
tiesebarrell/process-assertions
process-assertions-api/src/main/java/org/toxos/processassertions/api/internal/MessageLogger.java
MessageLogger.getMessage
public String getMessage(final String messageKey, final Object... objects) { """ Gets the message as defined by the provided messageKey and substitutes the provided object values in the message. @param messageKey the key of the message pattern @param objects the object values to substitute @return the formatted...
java
public String getMessage(final String messageKey, final Object... objects) { //TODO validate input return getFormattedMessage(getMessagePattern(messageKey), objects); }
[ "public", "String", "getMessage", "(", "final", "String", "messageKey", ",", "final", "Object", "...", "objects", ")", "{", "//TODO validate input", "return", "getFormattedMessage", "(", "getMessagePattern", "(", "messageKey", ")", ",", "objects", ")", ";", "}" ]
Gets the message as defined by the provided messageKey and substitutes the provided object values in the message. @param messageKey the key of the message pattern @param objects the object values to substitute @return the formatted message
[ "Gets", "the", "message", "as", "defined", "by", "the", "provided", "messageKey", "and", "substitutes", "the", "provided", "object", "values", "in", "the", "message", "." ]
train
https://github.com/tiesebarrell/process-assertions/blob/932a8443982e356cdf5a230165a35c725d9306ab/process-assertions-api/src/main/java/org/toxos/processassertions/api/internal/MessageLogger.java#L88-L91
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/IntStream.java
IntStream.filter
@NotNull public IntStream filter(@NotNull final IntPredicate predicate) { """ Returns a stream consisting of the elements of this stream that match the given predicate. <p> This is an intermediate operation. <p>Example: <pre> predicate: (a) -&gt; a &gt; 2 stream: [1, 2, 3, 4, -8, 0, 11] result: [3, ...
java
@NotNull public IntStream filter(@NotNull final IntPredicate predicate) { return new IntStream(params, new IntFilter(iterator, predicate)); }
[ "@", "NotNull", "public", "IntStream", "filter", "(", "@", "NotNull", "final", "IntPredicate", "predicate", ")", "{", "return", "new", "IntStream", "(", "params", ",", "new", "IntFilter", "(", "iterator", ",", "predicate", ")", ")", ";", "}" ]
Returns a stream consisting of the elements of this stream that match the given predicate. <p> This is an intermediate operation. <p>Example: <pre> predicate: (a) -&gt; a &gt; 2 stream: [1, 2, 3, 4, -8, 0, 11] result: [3, 4, 11] </pre> @param predicate non-interfering, stateless predicate to apply to each element to...
[ "Returns", "a", "stream", "consisting", "of", "the", "elements", "of", "this", "stream", "that", "match", "the", "given", "predicate", "." ]
train
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L368-L371
sothawo/mapjfx
src/main/java/com/sothawo/mapjfx/MapView.java
JavaConnector.processMarkerClicked
private void processMarkerClicked(final String name, final ClickType clickType) { """ processes a marker click @param name name of the marker @param clickType the type of click """ if (logger.isTraceEnabled()) { logger.trace("JS reports marker {} clicked {}", name, clickType);...
java
private void processMarkerClicked(final String name, final ClickType clickType) { if (logger.isTraceEnabled()) { logger.trace("JS reports marker {} clicked {}", name, clickType); } synchronized (mapCoordinateElements) { if (mapCoordinateElements.contai...
[ "private", "void", "processMarkerClicked", "(", "final", "String", "name", ",", "final", "ClickType", "clickType", ")", "{", "if", "(", "logger", ".", "isTraceEnabled", "(", ")", ")", "{", "logger", ".", "trace", "(", "\"JS reports marker {} clicked {}\"", ",", ...
processes a marker click @param name name of the marker @param clickType the type of click
[ "processes", "a", "marker", "click" ]
train
https://github.com/sothawo/mapjfx/blob/202091de492ab7a8b000c77efd833029f7f0ef92/src/main/java/com/sothawo/mapjfx/MapView.java#L1474-L1508
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java
FastMultidimensionalScalingTransform.randomInitialization
protected void randomInitialization(double[] out, Random rnd) { """ Choose a random vector of unit norm for power iterations. @param out Output storage @param rnd Random source. """ double l2 = 0.; while(!(l2 > 0)) { for(int d = 0; d < out.length; d++) { final double val = rnd.nextDou...
java
protected void randomInitialization(double[] out, Random rnd) { double l2 = 0.; while(!(l2 > 0)) { for(int d = 0; d < out.length; d++) { final double val = rnd.nextDouble(); out[d] = val; l2 += val * val; } } // Standardize: final double s = 1. / FastMath.sqrt(l2)...
[ "protected", "void", "randomInitialization", "(", "double", "[", "]", "out", ",", "Random", "rnd", ")", "{", "double", "l2", "=", "0.", ";", "while", "(", "!", "(", "l2", ">", "0", ")", ")", "{", "for", "(", "int", "d", "=", "0", ";", "d", "<",...
Choose a random vector of unit norm for power iterations. @param out Output storage @param rnd Random source.
[ "Choose", "a", "random", "vector", "of", "unit", "norm", "for", "power", "iterations", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L212-L226
zaproxy/zaproxy
src/org/parosproxy/paros/view/WorkbenchPanel.java
WorkbenchPanel.removePanel
public void removePanel(AbstractPanel panel, PanelType panelType) { """ Removes the given panel of given panel type from the workbench panel. @param panel the panel to remove from the workbench panel @param panelType the type of the panel @throws IllegalArgumentException if any of the parameters is {@code nul...
java
public void removePanel(AbstractPanel panel, PanelType panelType) { validateNotNull(panel, "panel"); validateNotNull(panelType, "panelType"); removeTabPanel(getTabbedFull(), panel); getTabbedFull().revalidate(); switch (panelType) { case SELECT: removeTabPanel(getTabbedSelect(), panel); ge...
[ "public", "void", "removePanel", "(", "AbstractPanel", "panel", ",", "PanelType", "panelType", ")", "{", "validateNotNull", "(", "panel", ",", "\"panel\"", ")", ";", "validateNotNull", "(", "panelType", ",", "\"panelType\"", ")", ";", "removeTabPanel", "(", "get...
Removes the given panel of given panel type from the workbench panel. @param panel the panel to remove from the workbench panel @param panelType the type of the panel @throws IllegalArgumentException if any of the parameters is {@code null}. @since 2.5.0 @see #addPanel(AbstractPanel, PanelType) @see #removePanels(List...
[ "Removes", "the", "given", "panel", "of", "given", "panel", "type", "from", "the", "workbench", "panel", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/WorkbenchPanel.java#L1006-L1029
h2oai/h2o-3
h2o-genmodel/src/main/java/water/util/ModelUtils.java
ModelUtils.sampleOOBRows
public static int[] sampleOOBRows(int nrows, float rate, Random sampler) { """ Sample out-of-bag rows with given rate with help of given sampler. It returns array of sampled rows. The first element of array contains a number of sampled rows. The returned array can be larger than number of returned sampled eleme...
java
public static int[] sampleOOBRows(int nrows, float rate, Random sampler) { return sampleOOBRows(nrows, rate, sampler, new int[2+Math.round((1f-rate)*nrows*1.2f+0.5f)]); }
[ "public", "static", "int", "[", "]", "sampleOOBRows", "(", "int", "nrows", ",", "float", "rate", ",", "Random", "sampler", ")", "{", "return", "sampleOOBRows", "(", "nrows", ",", "rate", ",", "sampler", ",", "new", "int", "[", "2", "+", "Math", ".", ...
Sample out-of-bag rows with given rate with help of given sampler. It returns array of sampled rows. The first element of array contains a number of sampled rows. The returned array can be larger than number of returned sampled elements. @param nrows number of rows to sample from. @param rate sampling rate @param samp...
[ "Sample", "out", "-", "of", "-", "bag", "rows", "with", "given", "rate", "with", "help", "of", "given", "sampler", ".", "It", "returns", "array", "of", "sampled", "rows", ".", "The", "first", "element", "of", "array", "contains", "a", "number", "of", "...
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/water/util/ModelUtils.java#L30-L32
rhuss/jolokia
agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java
OptionsAndArgs.lookupJarFile
public static File lookupJarFile() { """ Lookup the JAR File from where this class is loaded @return File pointing to the JAR-File from where this class was loaded. """ try { return new File(OptionsAndArgs.class .getProtectionDomain() ...
java
public static File lookupJarFile() { try { return new File(OptionsAndArgs.class .getProtectionDomain() .getCodeSource() .getLocation() .toURI()); } ...
[ "public", "static", "File", "lookupJarFile", "(", ")", "{", "try", "{", "return", "new", "File", "(", "OptionsAndArgs", ".", "class", ".", "getProtectionDomain", "(", ")", ".", "getCodeSource", "(", ")", ".", "getLocation", "(", ")", ".", "toURI", "(", "...
Lookup the JAR File from where this class is loaded @return File pointing to the JAR-File from where this class was loaded.
[ "Lookup", "the", "JAR", "File", "from", "where", "this", "class", "is", "loaded" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/client/util/OptionsAndArgs.java#L257-L267
perwendel/spark
src/main/java/spark/Response.java
Response.removeCookie
public void removeCookie(String path, String name) { """ Removes the cookie with given path and name. @param path path of the cookie @param name name of the cookie """ Cookie cookie = new Cookie(name, ""); cookie.setPath(path); cookie.setMaxAge(0); response.addCookie(cookie)...
java
public void removeCookie(String path, String name) { Cookie cookie = new Cookie(name, ""); cookie.setPath(path); cookie.setMaxAge(0); response.addCookie(cookie); }
[ "public", "void", "removeCookie", "(", "String", "path", ",", "String", "name", ")", "{", "Cookie", "cookie", "=", "new", "Cookie", "(", "name", ",", "\"\"", ")", ";", "cookie", ".", "setPath", "(", "path", ")", ";", "cookie", ".", "setMaxAge", "(", ...
Removes the cookie with given path and name. @param path path of the cookie @param name name of the cookie
[ "Removes", "the", "cookie", "with", "given", "path", "and", "name", "." ]
train
https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Response.java#L269-L274
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/lss/LssClient.java
LssClient.listSessions
public ListSessionsResponse listSessions(ListSessionsRequest request) { """ List all your live sessions. @param request The request object containing all parameters for listing live sessions. @return The list of all your live sessions. """ checkNotNull(request, "The parameter request should NOT be ...
java
public ListSessionsResponse listSessions(ListSessionsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_SESSION); if (request.getStatus() != null) { checkStringNotEm...
[ "public", "ListSessionsResponse", "listSessions", "(", "ListSessionsRequest", "request", ")", "{", "checkNotNull", "(", "request", ",", "\"The parameter request should NOT be null.\"", ")", ";", "InternalRequest", "internalRequest", "=", "createRequest", "(", "HttpMethodName"...
List all your live sessions. @param request The request object containing all parameters for listing live sessions. @return The list of all your live sessions.
[ "List", "all", "your", "live", "sessions", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L567-L576
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.removeFile
public T removeFile(final String name, final List<String> path, final byte[] existingHash, final boolean isDirectory) { """ Remove a misc file. @param name the file name @param path the relative path @param existingHash the existing hash @param isDirectory whether the file is a directory or not @return the ...
java
public T removeFile(final String name, final List<String> path, final byte[] existingHash, final boolean isDirectory) { return removeFile(name, path, existingHash, isDirectory, null); }
[ "public", "T", "removeFile", "(", "final", "String", "name", ",", "final", "List", "<", "String", ">", "path", ",", "final", "byte", "[", "]", "existingHash", ",", "final", "boolean", "isDirectory", ")", "{", "return", "removeFile", "(", "name", ",", "pa...
Remove a misc file. @param name the file name @param path the relative path @param existingHash the existing hash @param isDirectory whether the file is a directory or not @return the builder
[ "Remove", "a", "misc", "file", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L155-L157
b3dgs/lionengine
lionengine-network/src/main/java/com/b3dgs/lionengine/network/ServerImpl.java
ServerImpl.updateMessage
private void updateMessage(ClientSocket client, DataInputStream buffer, byte messageSystemId, byte from) throws IOException { """ Update the message depending of its ID. @param client The client socket. @param buffer The buffer input. @param messageSystemId The message system ID. @param from The ...
java
private void updateMessage(ClientSocket client, DataInputStream buffer, byte messageSystemId, byte from) throws IOException { switch (messageSystemId) { case NetworkMessageSystemId.CONNECTING: receiveConnecting(client, buffer, from, StateConnection.CONNECTING)...
[ "private", "void", "updateMessage", "(", "ClientSocket", "client", ",", "DataInputStream", "buffer", ",", "byte", "messageSystemId", ",", "byte", "from", ")", "throws", "IOException", "{", "switch", "(", "messageSystemId", ")", "{", "case", "NetworkMessageSystemId",...
Update the message depending of its ID. @param client The client socket. @param buffer The buffer input. @param messageSystemId The message system ID. @param from The source ID. @throws IOException If error when reading.
[ "Update", "the", "message", "depending", "of", "its", "ID", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-network/src/main/java/com/b3dgs/lionengine/network/ServerImpl.java#L391-L419
VoltDB/voltdb
src/frontend/org/voltdb/NonVoltDBBackend.java
NonVoltDBBackend.isIntegerColumn
private boolean isIntegerColumn(String columnName, List<String> tableNames, boolean debugPrint) { """ Returns true if the <i>columnName</i> is an integer column (including types TINYINT, SMALLINT, INTEGER, BIGINT, or equivalents in a comparison, non-VoltDB database); false otherwise. """ List<String>...
java
private boolean isIntegerColumn(String columnName, List<String> tableNames, boolean debugPrint) { List<String> intColumnTypes = Arrays.asList("TINYINT", "SMALLINT", "INTEGER", "BIGINT"); return isColumnType(intColumnTypes, columnName, tableNames, debugPrint); }
[ "private", "boolean", "isIntegerColumn", "(", "String", "columnName", ",", "List", "<", "String", ">", "tableNames", ",", "boolean", "debugPrint", ")", "{", "List", "<", "String", ">", "intColumnTypes", "=", "Arrays", ".", "asList", "(", "\"TINYINT\"", ",", ...
Returns true if the <i>columnName</i> is an integer column (including types TINYINT, SMALLINT, INTEGER, BIGINT, or equivalents in a comparison, non-VoltDB database); false otherwise.
[ "Returns", "true", "if", "the", "<i", ">", "columnName<", "/", "i", ">", "is", "an", "integer", "column", "(", "including", "types", "TINYINT", "SMALLINT", "INTEGER", "BIGINT", "or", "equivalents", "in", "a", "comparison", "non", "-", "VoltDB", "database", ...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L578-L581
umano/AndroidSlidingUpPanel
library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java
ViewDragHelper.tryCaptureViewForDrag
boolean tryCaptureViewForDrag(View toCapture, int pointerId) { """ Attempt to capture the view with the given pointer ID. The callback will be involved. This will put us into the "dragging" state. If we've already captured this view with this pointer this method will immediately return true without consulting th...
java
boolean tryCaptureViewForDrag(View toCapture, int pointerId) { if (toCapture == mCapturedView && mActivePointerId == pointerId) { // Already done! return true; } if (toCapture != null && mCallback.tryCaptureView(toCapture, pointerId)) { mActivePointerId = poin...
[ "boolean", "tryCaptureViewForDrag", "(", "View", "toCapture", ",", "int", "pointerId", ")", "{", "if", "(", "toCapture", "==", "mCapturedView", "&&", "mActivePointerId", "==", "pointerId", ")", "{", "// Already done!", "return", "true", ";", "}", "if", "(", "t...
Attempt to capture the view with the given pointer ID. The callback will be involved. This will put us into the "dragging" state. If we've already captured this view with this pointer this method will immediately return true without consulting the callback. @param toCapture View to capture @param pointerId Pointer to ...
[ "Attempt", "to", "capture", "the", "view", "with", "the", "given", "pointer", "ID", ".", "The", "callback", "will", "be", "involved", ".", "This", "will", "put", "us", "into", "the", "dragging", "state", ".", "If", "we", "ve", "already", "captured", "thi...
train
https://github.com/umano/AndroidSlidingUpPanel/blob/45a460435b07e764138a700328836cafc1ed5c42/library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java#L927-L938
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/codec/DataFileEncoder.java
DataFileEncoder.encodeDiff
protected String encodeDiff(final Task<Diff> task, final Diff diff) throws ConfigurationException, UnsupportedEncodingException, DecodingException, EncodingException, SQLConsumerException { """ Encodes the diff. @param task Reference to the DiffTask @param diff Diff to encode @return Base 64 encoded Dif...
java
protected String encodeDiff(final Task<Diff> task, final Diff diff) throws ConfigurationException, UnsupportedEncodingException, DecodingException, EncodingException, SQLConsumerException { RevisionCodecData codecData = diff.getCodecData(); String encoding = encoder.encodeDiff(codecData, diff); return enco...
[ "protected", "String", "encodeDiff", "(", "final", "Task", "<", "Diff", ">", "task", ",", "final", "Diff", "diff", ")", "throws", "ConfigurationException", ",", "UnsupportedEncodingException", ",", "DecodingException", ",", "EncodingException", ",", "SQLConsumerExcept...
Encodes the diff. @param task Reference to the DiffTask @param diff Diff to encode @return Base 64 encoded Diff @throws ConfigurationException if an error occurred while accessing the configuration @throws UnsupportedEncodingException if the character encoding is unsupported @throws DecodingException if the decoding ...
[ "Encodes", "the", "diff", "." ]
train
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/codec/DataFileEncoder.java#L97-L106
looly/hulu
src/main/java/com/xiaoleilu/hulu/ActionHandler.java
ActionHandler.handle
public final boolean handle(HttpServletRequest req, HttpServletResponse res, String target) { """ 处理请求 @param req ServletRequest @param res ServletResponse @param target 请求目标(请求路径) @return 是否处理成功 """ final String method = req.getMethod(); if (HuluSetting.isDevMode) { log.debug("Client [{}] {} [...
java
public final boolean handle(HttpServletRequest req, HttpServletResponse res, String target) { final String method = req.getMethod(); if (HuluSetting.isDevMode) { log.debug("Client [{}] {} [{}]", HttpUtil.getClientIP(req), method, target); } final ActionMethod actionMethod = actionMapping.getActionMeth...
[ "public", "final", "boolean", "handle", "(", "HttpServletRequest", "req", ",", "HttpServletResponse", "res", ",", "String", "target", ")", "{", "final", "String", "method", "=", "req", ".", "getMethod", "(", ")", ";", "if", "(", "HuluSetting", ".", "isDevMod...
处理请求 @param req ServletRequest @param res ServletResponse @param target 请求目标(请求路径) @return 是否处理成功
[ "处理请求" ]
train
https://github.com/looly/hulu/blob/4072de684e2e2f28ac8a3a44c0d5a690b289ef28/src/main/java/com/xiaoleilu/hulu/ActionHandler.java#L49-L76
networknt/light-4j
metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java
InstrumentedExecutors.newSingleThreadExecutor
public static InstrumentedExecutorService newSingleThreadExecutor(MetricRegistry registry, String name) { """ Creates an InstrumentedExecutor that uses a single worker thread operating off an unbounded queue. (Note however that if this single thread terminates due to a failure during execution prior to shutdown...
java
public static InstrumentedExecutorService newSingleThreadExecutor(MetricRegistry registry, String name) { return new InstrumentedExecutorService(Executors.newSingleThreadExecutor(), registry, name); }
[ "public", "static", "InstrumentedExecutorService", "newSingleThreadExecutor", "(", "MetricRegistry", "registry", ",", "String", "name", ")", "{", "return", "new", "InstrumentedExecutorService", "(", "Executors", ".", "newSingleThreadExecutor", "(", ")", ",", "registry", ...
Creates an InstrumentedExecutor that uses a single worker thread operating off an unbounded queue. (Note however that if this single thread terminates due to a failure during execution prior to shutdown, a new one will take its place if needed to execute subsequent tasks.) Tasks are guaranteed to execute sequentially,...
[ "Creates", "an", "InstrumentedExecutor", "that", "uses", "a", "single", "worker", "thread", "operating", "off", "an", "unbounded", "queue", ".", "(", "Note", "however", "that", "if", "this", "single", "thread", "terminates", "due", "to", "a", "failure", "durin...
train
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java#L154-L156
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/utils/URBridgeEntity.java
URBridgeEntity.getUsersForGroup
public void getUsersForGroup(List<String> grpMbrAttrs, int countLimit) throws Exception { """ Ensure that an exception will be thrown if this function is called but not implemented by the child class. @param grpMbrshipAttrs @throws Exception on all calls. """ throw new WIMApplicationException(WIMM...
java
public void getUsersForGroup(List<String> grpMbrAttrs, int countLimit) throws Exception { throw new WIMApplicationException(WIMMessageKey.METHOD_NOT_IMPLEMENTED, Tr.formatMessage(tc, WIMMessageKey.METHOD_NOT_IMPLEMENTED)); }
[ "public", "void", "getUsersForGroup", "(", "List", "<", "String", ">", "grpMbrAttrs", ",", "int", "countLimit", ")", "throws", "Exception", "{", "throw", "new", "WIMApplicationException", "(", "WIMMessageKey", ".", "METHOD_NOT_IMPLEMENTED", ",", "Tr", ".", "format...
Ensure that an exception will be thrown if this function is called but not implemented by the child class. @param grpMbrshipAttrs @throws Exception on all calls.
[ "Ensure", "that", "an", "exception", "will", "be", "thrown", "if", "this", "function", "is", "called", "but", "not", "implemented", "by", "the", "child", "class", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/utils/URBridgeEntity.java#L275-L277
kuali/ojb-1.0.4
src/tools/org/apache/ojb/tools/mapping/reversedb2/dbmetatreemodel/DatabaseMetaDataTreeModel.java
DatabaseMetaDataTreeModel.reportSqlError
public void reportSqlError(String message, java.sql.SQLException sqlEx) { """ Method for reporting SQLException. This is used by the treenodes if retrieving information for a node is not successful. @param message The message describing where the error occurred @param sqlEx The exception to be reported. ""...
java
public void reportSqlError(String message, java.sql.SQLException sqlEx) { StringBuffer strBufMessages = new StringBuffer(); java.sql.SQLException currentSqlEx = sqlEx; do { strBufMessages.append("\n" + sqlEx.getErrorCode() + ":" + sqlEx.getMessage()); c...
[ "public", "void", "reportSqlError", "(", "String", "message", ",", "java", ".", "sql", ".", "SQLException", "sqlEx", ")", "{", "StringBuffer", "strBufMessages", "=", "new", "StringBuffer", "(", ")", ";", "java", ".", "sql", ".", "SQLException", "currentSqlEx",...
Method for reporting SQLException. This is used by the treenodes if retrieving information for a node is not successful. @param message The message describing where the error occurred @param sqlEx The exception to be reported.
[ "Method", "for", "reporting", "SQLException", ".", "This", "is", "used", "by", "the", "treenodes", "if", "retrieving", "information", "for", "a", "node", "is", "not", "successful", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/tools/org/apache/ojb/tools/mapping/reversedb2/dbmetatreemodel/DatabaseMetaDataTreeModel.java#L93-L104
UrielCh/ovh-java-sdk
ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java
ApiOvhMe.accessRestriction_totp_POST
public OvhTOTPSecret accessRestriction_totp_POST() throws IOException { """ Add a TOTP access restriction REST: POST /me/accessRestriction/totp """ String qPath = "/me/accessRestriction/totp"; StringBuilder sb = path(qPath); String resp = exec(qPath, "POST", sb.toString(), null); return convertTo(re...
java
public OvhTOTPSecret accessRestriction_totp_POST() throws IOException { String qPath = "/me/accessRestriction/totp"; StringBuilder sb = path(qPath); String resp = exec(qPath, "POST", sb.toString(), null); return convertTo(resp, OvhTOTPSecret.class); }
[ "public", "OvhTOTPSecret", "accessRestriction_totp_POST", "(", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/me/accessRestriction/totp\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ")", ";", "String", "resp", "=", "exec", "(", "qPath"...
Add a TOTP access restriction REST: POST /me/accessRestriction/totp
[ "Add", "a", "TOTP", "access", "restriction" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3889-L3894
StripesFramework/stripes-stuff
src/main/java/org/stripesstuff/plugin/security/InstanceBasedSecurityManager.java
InstanceBasedSecurityManager.hasRole
@Override protected Boolean hasRole(ActionBean bean, Method handler, String role) { """ Determine if the current user has the specified role. Delegates to {@link #hasRoleName(ActionBean, Method, String)} to determine if the user has a role without using the expression; this method handles evaluating the express...
java
@Override protected Boolean hasRole(ActionBean bean, Method handler, String role) { LOG.debug("Checking role " + role + " using " + bean); String roleName; String roleExpression; Matcher ifTrigger = Pattern.compile("\\bif\\b").matcher(role); if (ifTrigger.find()) { roleName = role.substring(0, ifTrig...
[ "@", "Override", "protected", "Boolean", "hasRole", "(", "ActionBean", "bean", ",", "Method", "handler", ",", "String", "role", ")", "{", "LOG", ".", "debug", "(", "\"Checking role \"", "+", "role", "+", "\" using \"", "+", "bean", ")", ";", "String", "rol...
Determine if the current user has the specified role. Delegates to {@link #hasRoleName(ActionBean, Method, String)} to determine if the user has a role without using the expression; this method handles evaluating the expression. @param bean the current action bean @param handler the current event handler @param role t...
[ "Determine", "if", "the", "current", "user", "has", "the", "specified", "role", ".", "Delegates", "to", "{", "@link", "#hasRoleName", "(", "ActionBean", "Method", "String", ")", "}", "to", "determine", "if", "the", "user", "has", "a", "role", "without", "u...
train
https://github.com/StripesFramework/stripes-stuff/blob/51ad92b4bd5862ba34d7c18c5829fb00ea3a3811/src/main/java/org/stripesstuff/plugin/security/InstanceBasedSecurityManager.java#L54-L92
dwdyer/watchmaker
framework/src/java/main/org/uncommons/util/reflection/ReflectionUtils.java
ReflectionUtils.invokeUnchecked
public static <T> T invokeUnchecked(Method method, Object target, Object... arguments) { """ Invokes the specified method without throwing any checked exceptions. This is only valid for methods that are not declared to throw any checked exceptions. Any unchecked exceptions thrown by the specified method will be...
java
public static <T> T invokeUnchecked(Method method, Object target, Object... arguments) { try { @SuppressWarnings("unchecked") T result = (T) method.invoke(target, arguments); return result; } catch (IllegalAccessException ex) { ...
[ "public", "static", "<", "T", ">", "T", "invokeUnchecked", "(", "Method", "method", ",", "Object", "target", ",", "Object", "...", "arguments", ")", "{", "try", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "T", "result", "=", "(", "T", ")", ...
Invokes the specified method without throwing any checked exceptions. This is only valid for methods that are not declared to throw any checked exceptions. Any unchecked exceptions thrown by the specified method will be re-thrown (in their original form, not wrapped in an InvocationTargetException as would be the case...
[ "Invokes", "the", "specified", "method", "without", "throwing", "any", "checked", "exceptions", ".", "This", "is", "only", "valid", "for", "methods", "that", "are", "not", "declared", "to", "throw", "any", "checked", "exceptions", ".", "Any", "unchecked", "exc...
train
https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/framework/src/java/main/org/uncommons/util/reflection/ReflectionUtils.java#L51-L78
js-lib-com/dom
src/main/java/js/dom/w3c/DocumentImpl.java
DocumentImpl.evaluateXPathNode
Element evaluateXPathNode(Node contextNode, String expression, Object... args) { """ Evaluate XPath expression expecting a single result node. @param contextNode evaluation context node, @param expression XPath expression, formatting tags supported, @param args optional formatting arguments. @return evaluati...
java
Element evaluateXPathNode(Node contextNode, String expression, Object... args) { return evaluateXPathNodeNS(contextNode, null, expression, args); }
[ "Element", "evaluateXPathNode", "(", "Node", "contextNode", ",", "String", "expression", ",", "Object", "...", "args", ")", "{", "return", "evaluateXPathNodeNS", "(", "contextNode", ",", "null", ",", "expression", ",", "args", ")", ";", "}" ]
Evaluate XPath expression expecting a single result node. @param contextNode evaluation context node, @param expression XPath expression, formatting tags supported, @param args optional formatting arguments. @return evaluation result as element, possible null.
[ "Evaluate", "XPath", "expression", "expecting", "a", "single", "result", "node", "." ]
train
https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/DocumentImpl.java#L287-L289
dlemmermann/CalendarFX
CalendarFXView/src/main/java/com/calendarfx/model/Interval.java
Interval.withEndTime
public Interval withEndTime(LocalTime time) { """ Returns a new interval based on this interval but with a different end time. @param time the new end time @return a new interval """ requireNonNull(time); return new Interval(startDate, startTime, endDate, time, zoneId); }
java
public Interval withEndTime(LocalTime time) { requireNonNull(time); return new Interval(startDate, startTime, endDate, time, zoneId); }
[ "public", "Interval", "withEndTime", "(", "LocalTime", "time", ")", "{", "requireNonNull", "(", "time", ")", ";", "return", "new", "Interval", "(", "startDate", ",", "startTime", ",", "endDate", ",", "time", ",", "zoneId", ")", ";", "}" ]
Returns a new interval based on this interval but with a different end time. @param time the new end time @return a new interval
[ "Returns", "a", "new", "interval", "based", "on", "this", "interval", "but", "with", "a", "different", "end", "time", "." ]
train
https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L367-L370
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java
PoissonDistribution.devianceTerm
@Reference(title = "Fast and accurate computation of binomial probabilities", // authors = "C. Loader", booktitle = "", // url = "http://projects.scipy.org/scipy/raw-attachment/ticket/620/loader2000Fast.pdf", // bibkey = "web/Loader00") private static double devianceTerm(double x, double np) { "...
java
@Reference(title = "Fast and accurate computation of binomial probabilities", // authors = "C. Loader", booktitle = "", // url = "http://projects.scipy.org/scipy/raw-attachment/ticket/620/loader2000Fast.pdf", // bibkey = "web/Loader00") private static double devianceTerm(double x, double np) { i...
[ "@", "Reference", "(", "title", "=", "\"Fast and accurate computation of binomial probabilities\"", ",", "//", "authors", "=", "\"C. Loader\"", ",", "booktitle", "=", "\"\"", ",", "//", "url", "=", "\"http://projects.scipy.org/scipy/raw-attachment/ticket/620/loader2000Fast.pdf\...
Evaluate the deviance term of the saddle point approximation. <p> bd0(x,np) = x*ln(x/np)+np-x @param x probability density function position @param np product of trials and success probability: n*p @return Deviance term
[ "Evaluate", "the", "deviance", "term", "of", "the", "saddle", "point", "approximation", ".", "<p", ">", "bd0", "(", "x", "np", ")", "=", "x", "*", "ln", "(", "x", "/", "np", ")", "+", "np", "-", "x" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java#L403-L423
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/TrueTypeFont.java
TrueTypeFont.getRawWidth
int getRawWidth(int c, String name) { """ Gets the width from the font according to the unicode char <CODE>c</CODE>. If the <CODE>name</CODE> is null it's a symbolic font. @param c the unicode char @param name the glyph name @return the width of the char """ int[] metric = getMetricsTT(c); ...
java
int getRawWidth(int c, String name) { int[] metric = getMetricsTT(c); if (metric == null) return 0; return metric[1]; }
[ "int", "getRawWidth", "(", "int", "c", ",", "String", "name", ")", "{", "int", "[", "]", "metric", "=", "getMetricsTT", "(", "c", ")", ";", "if", "(", "metric", "==", "null", ")", "return", "0", ";", "return", "metric", "[", "1", "]", ";", "}" ]
Gets the width from the font according to the unicode char <CODE>c</CODE>. If the <CODE>name</CODE> is null it's a symbolic font. @param c the unicode char @param name the glyph name @return the width of the char
[ "Gets", "the", "width", "from", "the", "font", "according", "to", "the", "unicode", "char", "<CODE", ">", "c<", "/", "CODE", ">", ".", "If", "the", "<CODE", ">", "name<", "/", "CODE", ">", "is", "null", "it", "s", "a", "symbolic", "font", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/TrueTypeFont.java#L1041-L1046
wildfly/wildfly-core
logging/src/main/java/org/jboss/as/logging/handlers/HandlerOperations.java
HandlerOperations.disableHandler
private static void disableHandler(final LogContextConfiguration configuration, final String handlerName) { """ Disables the handler if the handler exists and is not already disabled. <p/> If the handler does not exist or is already disabled nothing happens. @param configuration the log context configuration....
java
private static void disableHandler(final LogContextConfiguration configuration, final String handlerName) { final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName); try { handlerConfiguration.setPropertyValueString("enabled", "false"); ...
[ "private", "static", "void", "disableHandler", "(", "final", "LogContextConfiguration", "configuration", ",", "final", "String", "handlerName", ")", "{", "final", "HandlerConfiguration", "handlerConfiguration", "=", "configuration", ".", "getHandlerConfiguration", "(", "h...
Disables the handler if the handler exists and is not already disabled. <p/> If the handler does not exist or is already disabled nothing happens. @param configuration the log context configuration. @param handlerName the handler name to disable.
[ "Disables", "the", "handler", "if", "the", "handler", "exists", "and", "is", "not", "already", "disabled", ".", "<p", "/", ">", "If", "the", "handler", "does", "not", "exist", "or", "is", "already", "disabled", "nothing", "happens", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/handlers/HandlerOperations.java#L906-L929
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/network/Interface_stats.java
Interface_stats.get
public static Interface_stats get(nitro_service service, String id) throws Exception { """ Use this API to fetch statistics of Interface_stats resource of given name . """ Interface_stats obj = new Interface_stats(); obj.set_id(id); Interface_stats response = (Interface_stats) obj.stat_resource(service);...
java
public static Interface_stats get(nitro_service service, String id) throws Exception{ Interface_stats obj = new Interface_stats(); obj.set_id(id); Interface_stats response = (Interface_stats) obj.stat_resource(service); return response; }
[ "public", "static", "Interface_stats", "get", "(", "nitro_service", "service", ",", "String", "id", ")", "throws", "Exception", "{", "Interface_stats", "obj", "=", "new", "Interface_stats", "(", ")", ";", "obj", ".", "set_id", "(", "id", ")", ";", "Interface...
Use this API to fetch statistics of Interface_stats resource of given name .
[ "Use", "this", "API", "to", "fetch", "statistics", "of", "Interface_stats", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/network/Interface_stats.java#L594-L599
EdwardRaff/JSAT
JSAT/src/jsat/linear/Matrix.java
Matrix.updateRow
public void updateRow(int i, double c, Vec b) { """ Alters row i of <i>this</i> matrix, such that <i>A[i,:] = A[i,:] + c*<b>b</b></i> @param i the index of the row to update @param c the scalar constant to multiply the vector by @param b the vector to add to the specified row """ if(b.length() != t...
java
public void updateRow(int i, double c, Vec b) { if(b.length() != this.cols()) throw new ArithmeticException("vector is not of the same column length"); if (b.isSparse()) for (IndexValue iv : b) this.increment(i, iv.getIndex(), c * iv.getValue()); else ...
[ "public", "void", "updateRow", "(", "int", "i", ",", "double", "c", ",", "Vec", "b", ")", "{", "if", "(", "b", ".", "length", "(", ")", "!=", "this", ".", "cols", "(", ")", ")", "throw", "new", "ArithmeticException", "(", "\"vector is not of the same c...
Alters row i of <i>this</i> matrix, such that <i>A[i,:] = A[i,:] + c*<b>b</b></i> @param i the index of the row to update @param c the scalar constant to multiply the vector by @param b the vector to add to the specified row
[ "Alters", "row", "i", "of", "<i", ">", "this<", "/", "i", ">", "matrix", "such", "that", "<i", ">", "A", "[", "i", ":", "]", "=", "A", "[", "i", ":", "]", "+", "c", "*", "<b", ">", "b<", "/", "b", ">", "<", "/", "i", ">" ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L864-L874
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java
XMLUtil.getAttributeIntWithDefault
@Pure public static Integer getAttributeIntWithDefault(Node document, Integer defaultValue, String... path) { """ Replies the integer value that corresponds to the specified attribute's path. <p>The path is an ordered list of tag's names and ended by the name of the attribute. Be careful about the fact that ...
java
@Pure public static Integer getAttributeIntWithDefault(Node document, Integer defaultValue, String... path) { return getAttributeIntWithDefault(document, true, defaultValue, path); }
[ "@", "Pure", "public", "static", "Integer", "getAttributeIntWithDefault", "(", "Node", "document", ",", "Integer", "defaultValue", ",", "String", "...", "path", ")", "{", "return", "getAttributeIntWithDefault", "(", "document", ",", "true", ",", "defaultValue", ",...
Replies the integer value that corresponds to the specified attribute's path. <p>The path is an ordered list of tag's names and ended by the name of the attribute. Be careful about the fact that the names are case sensitives. @param document is the XML document to explore. @param defaultValue is the default value to ...
[ "Replies", "the", "integer", "value", "that", "corresponds", "to", "the", "specified", "attribute", "s", "path", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L870-L873
square/okhttp
okhttp/src/main/java/okhttp3/internal/Util.java
Util.getSystemProperty
public static String getSystemProperty(String key, @Nullable String defaultValue) { """ Returns the system property, or {@code defaultValue} if the system property is null or cannot be read (e.g. because of security policy restrictions). """ String value; try { value = System.getProperty(key); ...
java
public static String getSystemProperty(String key, @Nullable String defaultValue) { String value; try { value = System.getProperty(key); } catch (AccessControlException ex) { return defaultValue; } return value != null ? value : defaultValue; }
[ "public", "static", "String", "getSystemProperty", "(", "String", "key", ",", "@", "Nullable", "String", "defaultValue", ")", "{", "String", "value", ";", "try", "{", "value", "=", "System", ".", "getProperty", "(", "key", ")", ";", "}", "catch", "(", "A...
Returns the system property, or {@code defaultValue} if the system property is null or cannot be read (e.g. because of security policy restrictions).
[ "Returns", "the", "system", "property", "or", "{" ]
train
https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/Util.java#L636-L644
heinrichreimer/material-drawer
library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerProfile.java
DrawerProfile.setRoundedAvatar
public DrawerProfile setRoundedAvatar(Context context, Bitmap image) { """ Sets a rounded avatar image to the drawer profile @param image Avatar image to set """ return setAvatar(new RoundedAvatarDrawable(new BitmapDrawable(context.getResources(), image).getBitmap())); }
java
public DrawerProfile setRoundedAvatar(Context context, Bitmap image) { return setAvatar(new RoundedAvatarDrawable(new BitmapDrawable(context.getResources(), image).getBitmap())); }
[ "public", "DrawerProfile", "setRoundedAvatar", "(", "Context", "context", ",", "Bitmap", "image", ")", "{", "return", "setAvatar", "(", "new", "RoundedAvatarDrawable", "(", "new", "BitmapDrawable", "(", "context", ".", "getResources", "(", ")", ",", "image", ")"...
Sets a rounded avatar image to the drawer profile @param image Avatar image to set
[ "Sets", "a", "rounded", "avatar", "image", "to", "the", "drawer", "profile" ]
train
https://github.com/heinrichreimer/material-drawer/blob/7c2406812d73f710ef8bb73d4a0f4bbef3b275ce/library/src/main/java/com/heinrichreimersoftware/materialdrawer/structure/DrawerProfile.java#L146-L148
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java
CoronaJobTracker.saveNewRequestForTip
private void saveNewRequestForTip(TaskInProgress tip, ResourceRequest req) { """ Saves new request for given tip, no recording in resource tracker happens @param tip task in progress @param req request """ requestToTipMap.put(req.getId(), tip); TaskContext context = taskToContextMap.get(tip); if ...
java
private void saveNewRequestForTip(TaskInProgress tip, ResourceRequest req) { requestToTipMap.put(req.getId(), tip); TaskContext context = taskToContextMap.get(tip); if (context == null) { context = new TaskContext(req); } else { context.resourceRequests.add(req); } taskToContextMap.p...
[ "private", "void", "saveNewRequestForTip", "(", "TaskInProgress", "tip", ",", "ResourceRequest", "req", ")", "{", "requestToTipMap", ".", "put", "(", "req", ".", "getId", "(", ")", ",", "tip", ")", ";", "TaskContext", "context", "=", "taskToContextMap", ".", ...
Saves new request for given tip, no recording in resource tracker happens @param tip task in progress @param req request
[ "Saves", "new", "request", "for", "given", "tip", "no", "recording", "in", "resource", "tracker", "happens" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobTracker.java#L2141-L2150
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java
AbstractDoclet.generateOtherFiles
protected void generateOtherFiles(DocletEnvironment docEnv, ClassTree classtree) throws DocletException { """ Generate additional documentation that is added to the API documentation. @param docEnv the DocletEnvironment @param classtree the data structure representing the class tree @throws Do...
java
protected void generateOtherFiles(DocletEnvironment docEnv, ClassTree classtree) throws DocletException { BuilderFactory builderFactory = configuration.getBuilderFactory(); AbstractBuilder constantsSummaryBuilder = builderFactory.getConstantsSummaryBuilder(); constantsSummaryBuilder....
[ "protected", "void", "generateOtherFiles", "(", "DocletEnvironment", "docEnv", ",", "ClassTree", "classtree", ")", "throws", "DocletException", "{", "BuilderFactory", "builderFactory", "=", "configuration", ".", "getBuilderFactory", "(", ")", ";", "AbstractBuilder", "co...
Generate additional documentation that is added to the API documentation. @param docEnv the DocletEnvironment @param classtree the data structure representing the class tree @throws DocletException if there is a problem while generating the documentation
[ "Generate", "additional", "documentation", "that", "is", "added", "to", "the", "API", "documentation", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java#L224-L231
anotheria/moskito
moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/parser/StatusData.java
StatusData.putAll
public void putAll(Map<? extends T, ?> m) { """ Stores every mapping from the given map. Implemented in 'fail-fast' manner: no rollbacks of already stored mappings, fails at first occurred violation. @param m map containing data to put in this StatusData. @throws IllegalArgumentException if any mapping in the g...
java
public void putAll(Map<? extends T, ?> m) { for (Map.Entry<? extends T, ?> e : m.entrySet()) { put(e.getKey(), e.getValue()); } }
[ "public", "void", "putAll", "(", "Map", "<", "?", "extends", "T", ",", "?", ">", "m", ")", "{", "for", "(", "Map", ".", "Entry", "<", "?", "extends", "T", ",", "?", ">", "e", ":", "m", ".", "entrySet", "(", ")", ")", "{", "put", "(", "e", ...
Stores every mapping from the given map. Implemented in 'fail-fast' manner: no rollbacks of already stored mappings, fails at first occurred violation. @param m map containing data to put in this StatusData. @throws IllegalArgumentException if any mapping in the given map violates this class restrictions.
[ "Stores", "every", "mapping", "from", "the", "given", "map", ".", "Implemented", "in", "fail", "-", "fast", "manner", ":", "no", "rollbacks", "of", "already", "stored", "mappings", "fails", "at", "first", "occurred", "violation", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/parser/StatusData.java#L41-L45
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.email_pro_service_account_duration_POST
public OvhOrder email_pro_service_account_duration_POST(String service, String duration, Long number) throws IOException { """ Create order REST: POST /order/email/pro/{service}/account/{duration} @param number [required] Number of Accounts to order @param service [required] The internal name of your pro orga...
java
public OvhOrder email_pro_service_account_duration_POST(String service, String duration, Long number) throws IOException { String qPath = "/order/email/pro/{service}/account/{duration}"; StringBuilder sb = path(qPath, service, duration); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "numb...
[ "public", "OvhOrder", "email_pro_service_account_duration_POST", "(", "String", "service", ",", "String", "duration", ",", "Long", "number", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/email/pro/{service}/account/{duration}\"", ";", "StringBuilder",...
Create order REST: POST /order/email/pro/{service}/account/{duration} @param number [required] Number of Accounts to order @param service [required] The internal name of your pro organization @param duration [required] Duration
[ "Create", "order" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4062-L4069
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/LabelsApi.java
LabelsApi.createLabel
public Label createLabel(Object projectIdOrPath, String name, String color, String description) throws GitLabApiException { """ Create a label @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param name the name for the label @param color the co...
java
public Label createLabel(Object projectIdOrPath, String name, String color, String description) throws GitLabApiException { return (createLabel(projectIdOrPath, name, color, description, null)); }
[ "public", "Label", "createLabel", "(", "Object", "projectIdOrPath", ",", "String", "name", ",", "String", "color", ",", "String", "description", ")", "throws", "GitLabApiException", "{", "return", "(", "createLabel", "(", "projectIdOrPath", ",", "name", ",", "co...
Create a label @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance @param name the name for the label @param color the color for the label @param description the description for the label @return the created Label instance @throws GitLabApiException if any e...
[ "Create", "a", "label" ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/LabelsApi.java#L77-L79
hawkular/hawkular-apm
examples/polyglot-zipkin/java-dropwizard/src/main/java/org/hawkular/apm/example/dropwizard/rest/URLUtils.java
URLUtils.getInServiceURL
public static String getInServiceURL(HttpServletRequest request, String path) { """ Constructs URL for in service requests (e.g. calls for endpoint of this application) """ String contextPath = ((Request) request).getContext().getContextPath(); int port = request.getServerPort(); retur...
java
public static String getInServiceURL(HttpServletRequest request, String path) { String contextPath = ((Request) request).getContext().getContextPath(); int port = request.getServerPort(); return getInServiceURL(port, contextPath, path); }
[ "public", "static", "String", "getInServiceURL", "(", "HttpServletRequest", "request", ",", "String", "path", ")", "{", "String", "contextPath", "=", "(", "(", "Request", ")", "request", ")", ".", "getContext", "(", ")", ".", "getContextPath", "(", ")", ";",...
Constructs URL for in service requests (e.g. calls for endpoint of this application)
[ "Constructs", "URL", "for", "in", "service", "requests", "(", "e", ".", "g", ".", "calls", "for", "endpoint", "of", "this", "application", ")" ]
train
https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/examples/polyglot-zipkin/java-dropwizard/src/main/java/org/hawkular/apm/example/dropwizard/rest/URLUtils.java#L36-L41
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java
TransformerIdentityImpl.setOutputProperty
public void setOutputProperty(String name, String value) throws IllegalArgumentException { """ Set an output property that will be in effect for the transformation. <p>Pass a qualified property name as a two-part string, the namespace URI enclosed in curly braces ({}), followed by the local name. If...
java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property no...
[ "public", "void", "setOutputProperty", "(", "String", "name", ",", "String", "value", ")", "throws", "IllegalArgumentException", "{", "if", "(", "!", "OutputProperties", ".", "isLegalPropertyKey", "(", "name", ")", ")", "throw", "new", "IllegalArgumentException", ...
Set an output property that will be in effect for the transformation. <p>Pass a qualified property name as a two-part string, the namespace URI enclosed in curly braces ({}), followed by the local name. If the name has a null URL, the String only contain the local name. An application can safely check for a non-null U...
[ "Set", "an", "output", "property", "that", "will", "be", "in", "effect", "for", "the", "transformation", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java#L735-L744
ocelotds/ocelot
ocelot-web/src/main/java/org/ocelotds/core/services/FaultServices.java
FaultServices.buildFault
public Fault buildFault(Throwable ex) { """ Build an fault Object from exception with stacktrace length from configuration @param ex @return """ Fault fault; int stacktracelength = configuration.getStacktracelength(); if (stacktracelength == 0 || logger.isDebugEnabled()) { logger.error("Invocati...
java
public Fault buildFault(Throwable ex) { Fault fault; int stacktracelength = configuration.getStacktracelength(); if (stacktracelength == 0 || logger.isDebugEnabled()) { logger.error("Invocation failed", ex); } fault = new Fault(ex, stacktracelength); return fault; }
[ "public", "Fault", "buildFault", "(", "Throwable", "ex", ")", "{", "Fault", "fault", ";", "int", "stacktracelength", "=", "configuration", ".", "getStacktracelength", "(", ")", ";", "if", "(", "stacktracelength", "==", "0", "||", "logger", ".", "isDebugEnabled...
Build an fault Object from exception with stacktrace length from configuration @param ex @return
[ "Build", "an", "fault", "Object", "from", "exception", "with", "stacktrace", "length", "from", "configuration" ]
train
https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/core/services/FaultServices.java#L29-L37
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/BinaryLogRecordSerializerImpl.java
BinaryLogRecordSerializerImpl.readString
private static String readString(DataInput reader) throws IOException { """ /* Deserialize string. Make sure <code>null</code> is handled properly. """ int blocks = reader.readInt(); String result; if (blocks == 0) { result = null; } else if (blocks < 0) { throw new DeserializerException("Wrong ...
java
private static String readString(DataInput reader) throws IOException { int blocks = reader.readInt(); String result; if (blocks == 0) { result = null; } else if (blocks < 0) { throw new DeserializerException("Wrong 'null' indicator for a string", "0", Integer.toString(blocks)); } else { StringBuilde...
[ "private", "static", "String", "readString", "(", "DataInput", "reader", ")", "throws", "IOException", "{", "int", "blocks", "=", "reader", ".", "readInt", "(", ")", ";", "String", "result", ";", "if", "(", "blocks", "==", "0", ")", "{", "result", "=", ...
/* Deserialize string. Make sure <code>null</code> is handled properly.
[ "/", "*", "Deserialize", "string", ".", "Make", "sure", "<code", ">", "null<", "/", "code", ">", "is", "handled", "properly", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/BinaryLogRecordSerializerImpl.java#L618-L633
b3dgs/lionengine
lionengine-core/src/main/java/com/b3dgs/lionengine/Xml.java
Xml.writeString
public void writeString(String attribute, String content) { """ Write a string. If the content is equal to <code>null</code>, {@link #NULL} is wrote instead. @param attribute The attribute name (must not be <code>null</code>). @param content The string value (can be <code>null</code>). @throws LionEngineExcep...
java
public void writeString(String attribute, String content) { if (content == null) { write(attribute, NULL); } else { write(attribute, content); } }
[ "public", "void", "writeString", "(", "String", "attribute", ",", "String", "content", ")", "{", "if", "(", "content", "==", "null", ")", "{", "write", "(", "attribute", ",", "NULL", ")", ";", "}", "else", "{", "write", "(", "attribute", ",", "content"...
Write a string. If the content is equal to <code>null</code>, {@link #NULL} is wrote instead. @param attribute The attribute name (must not be <code>null</code>). @param content The string value (can be <code>null</code>). @throws LionEngineException If error when writing.
[ "Write", "a", "string", ".", "If", "the", "content", "is", "equal", "to", "<code", ">", "null<", "/", "code", ">", "{", "@link", "#NULL", "}", "is", "wrote", "instead", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Xml.java#L302-L312
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java
VpnSitesInner.beginDelete
public void beginDelete(String resourceGroupName, String vpnSiteName) { """ Deletes a VpnSite. @param resourceGroupName The resource group name of the VpnSite. @param vpnSiteName The name of the VpnSite being deleted. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorExce...
java
public void beginDelete(String resourceGroupName, String vpnSiteName) { beginDeleteWithServiceResponseAsync(resourceGroupName, vpnSiteName).toBlocking().single().body(); }
[ "public", "void", "beginDelete", "(", "String", "resourceGroupName", ",", "String", "vpnSiteName", ")", "{", "beginDeleteWithServiceResponseAsync", "(", "resourceGroupName", ",", "vpnSiteName", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", ".", "body"...
Deletes a VpnSite. @param resourceGroupName The resource group name of the VpnSite. @param vpnSiteName The name of the VpnSite being deleted. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorException thrown if the request is rejected by server @throws RuntimeException all other w...
[ "Deletes", "a", "VpnSite", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java#L758-L760
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.setPerspective
public Matrix4d setPerspective(double fovy, double aspect, double zNear, double zFar) { """ Set this matrix to be a symmetric perspective projection frustum transformation for a right-handed coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code>. <p> In order to apply the perspective projection t...
java
public Matrix4d setPerspective(double fovy, double aspect, double zNear, double zFar) { return setPerspective(fovy, aspect, zNear, zFar, false); }
[ "public", "Matrix4d", "setPerspective", "(", "double", "fovy", ",", "double", "aspect", ",", "double", "zNear", ",", "double", "zFar", ")", "{", "return", "setPerspective", "(", "fovy", ",", "aspect", ",", "zNear", ",", "zFar", ",", "false", ")", ";", "}...
Set this matrix to be a symmetric perspective projection frustum transformation for a right-handed coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code>. <p> In order to apply the perspective projection transformation to an existing transformation, use {@link #perspective(double, double, double, double)...
[ "Set", "this", "matrix", "to", "be", "a", "symmetric", "perspective", "projection", "frustum", "transformation", "for", "a", "right", "-", "handed", "coordinate", "system", "using", "OpenGL", "s", "NDC", "z", "range", "of", "<code", ">", "[", "-", "1", ".....
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L12628-L12630
eurekaclinical/datastore
src/main/java/org/eurekaclinical/datastore/bdb/BdbUtil.java
BdbUtil.uniqueEnvironment
public static String uniqueEnvironment(String prefix, String suffix, File directory) throws IOException { """ Creates a unique directory for housing a BDB environment, and returns its name. @param prefix a prefix for the temporary directory's name. Cannot be <code>null</code>. @param suffix a su...
java
public static String uniqueEnvironment(String prefix, String suffix, File directory) throws IOException { File tmpDir = UNIQUE_DIRECTORY_CREATOR.create(prefix, suffix, directory); String randomFilename = UUID.randomUUID().toString(); File envNameAsFile = new File(tm...
[ "public", "static", "String", "uniqueEnvironment", "(", "String", "prefix", ",", "String", "suffix", ",", "File", "directory", ")", "throws", "IOException", "{", "File", "tmpDir", "=", "UNIQUE_DIRECTORY_CREATOR", ".", "create", "(", "prefix", ",", "suffix", ",",...
Creates a unique directory for housing a BDB environment, and returns its name. @param prefix a prefix for the temporary directory's name. Cannot be <code>null</code>. @param suffix a suffix for the temporary directory's name. @return the environment name to use. @param directory the parent directory to use. @throws ...
[ "Creates", "a", "unique", "directory", "for", "housing", "a", "BDB", "environment", "and", "returns", "its", "name", "." ]
train
https://github.com/eurekaclinical/datastore/blob/a03a70819bb562ba45eac66ca49f778035ee45e0/src/main/java/org/eurekaclinical/datastore/bdb/BdbUtil.java#L48-L55
OpenBEL/openbel-framework
org.openbel.framework.core/src/main/java/org/openbel/framework/core/CommandLineApplication.java
CommandLineApplication.initializeSystemConfiguration
protected final void initializeSystemConfiguration() { """ Initializes the system configuration from either {@link #SHRT_OPT_SYSCFG} or system defaults. <p> This method will initialize the system configuration or die trying. </p> @throws IOException Thrown if an I/O error occurs during initialization of th...
java
protected final void initializeSystemConfiguration() { try { attemptSystemConfiguration(); } catch (IOException e) { // Can't recover from this final String err = SYSCFG_READ_FAILURE; throw new BELRuntimeException(err, ExitCode.UNRECOVERABLE_ERROR, e); ...
[ "protected", "final", "void", "initializeSystemConfiguration", "(", ")", "{", "try", "{", "attemptSystemConfiguration", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "// Can't recover from this", "final", "String", "err", "=", "SYSCFG_READ_FAILURE"...
Initializes the system configuration from either {@link #SHRT_OPT_SYSCFG} or system defaults. <p> This method will initialize the system configuration or die trying. </p> @throws IOException Thrown if an I/O error occurs during initialization of the system configuration @see #attemptSystemConfiguration()
[ "Initializes", "the", "system", "configuration", "from", "either", "{", "@link", "#SHRT_OPT_SYSCFG", "}", "or", "system", "defaults", ".", "<p", ">", "This", "method", "will", "initialize", "the", "system", "configuration", "or", "die", "trying", ".", "<", "/"...
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/CommandLineApplication.java#L627-L635
codeprimate-software/cp-elements
src/main/java/org/cp/elements/util/zip/ZipUtils.java
ZipUtils.zipEntry
static ZipOutputStream zipEntry(File zipDirectory, File path, ZipOutputStream outputStream) { """ Zips the contents of the individual {@link File file system path} to the supplied {@link ZipOutputStream}. @param zipDirectory {@link File directory} being zipped. @param path {@link File} to zip and add to the su...
java
static ZipOutputStream zipEntry(File zipDirectory, File path, ZipOutputStream outputStream) { return zipEntry(newZipEntry(zipDirectory, path), outputStream); }
[ "static", "ZipOutputStream", "zipEntry", "(", "File", "zipDirectory", ",", "File", "path", ",", "ZipOutputStream", "outputStream", ")", "{", "return", "zipEntry", "(", "newZipEntry", "(", "zipDirectory", ",", "path", ")", ",", "outputStream", ")", ";", "}" ]
Zips the contents of the individual {@link File file system path} to the supplied {@link ZipOutputStream}. @param zipDirectory {@link File directory} being zipped. @param path {@link File} to zip and add to the supplied {@link ZipOutputStream}. @param outputStream {@link ZipOutputStream} used to zip the contents of th...
[ "Zips", "the", "contents", "of", "the", "individual", "{", "@link", "File", "file", "system", "path", "}", "to", "the", "supplied", "{", "@link", "ZipOutputStream", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/zip/ZipUtils.java#L240-L242
ZieIony/Carbon
carbon/src/main/java/carbon/drawable/ripple/TypedArrayCompat.java
TypedArrayCompat.getResourceId
public static int getResourceId(Resources.Theme theme, TypedArray a, TypedValue[] values, int index, int def) { """ Retrieve the resource identifier for the attribute at <var>index</var>. Note that attribute resource as resolved when the overall {@link TypedArray} object is retrieved. As a result, this functio...
java
public static int getResourceId(Resources.Theme theme, TypedArray a, TypedValue[] values, int index, int def) { if (values != null && theme != null) { TypedValue v = values[index]; if (v.type == TypedValue.TYPE_ATTRIBUTE) { TEMP_ARRAY[0] = v.data; TypedArr...
[ "public", "static", "int", "getResourceId", "(", "Resources", ".", "Theme", "theme", ",", "TypedArray", "a", ",", "TypedValue", "[", "]", "values", ",", "int", "index", ",", "int", "def", ")", "{", "if", "(", "values", "!=", "null", "&&", "theme", "!="...
Retrieve the resource identifier for the attribute at <var>index</var>. Note that attribute resource as resolved when the overall {@link TypedArray} object is retrieved. As a result, this function will return the resource identifier of the final resource value that was found, <em>not</em> necessarily the original res...
[ "Retrieve", "the", "resource", "identifier", "for", "the", "attribute", "at", "<var", ">", "index<", "/", "var", ">", ".", "Note", "that", "attribute", "resource", "as", "resolved", "when", "the", "overall", "{", "@link", "TypedArray", "}", "object", "is", ...
train
https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/TypedArrayCompat.java#L111-L130
colin-lee/mybatis-spring-support
src/main/java/com/github/mybatis/util/ReflectionUtil.java
ReflectionUtil.getFieldValue
@SuppressWarnings("unchecked") public static <T> T getFieldValue(Object object, String fieldName) { """ 获取类属性,无视private/protected限制,不经过getter方法 @param object 类对象 @param fieldName 属性名 @param <T> 目标类型 @return """ Field field = CACHE.getUnchecked(object.getClass().getName() + '#' + fieldName)...
java
@SuppressWarnings("unchecked") public static <T> T getFieldValue(Object object, String fieldName) { Field field = CACHE.getUnchecked(object.getClass().getName() + '#' + fieldName); if (field == null) { throw new IllegalArgumentException("Could not find field [" + fieldName + "] on target [" + object + "...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "T", "getFieldValue", "(", "Object", "object", ",", "String", "fieldName", ")", "{", "Field", "field", "=", "CACHE", ".", "getUnchecked", "(", "object", ".", "getClass", ...
获取类属性,无视private/protected限制,不经过getter方法 @param object 类对象 @param fieldName 属性名 @param <T> 目标类型 @return
[ "获取类属性,无视private", "/", "protected限制,不经过getter方法" ]
train
https://github.com/colin-lee/mybatis-spring-support/blob/de412e98d00e9a012c0619778fa1a61832863b82/src/main/java/com/github/mybatis/util/ReflectionUtil.java#L62-L75
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/endpoint/adapter/RequestDispatchingEndpointAdapter.java
RequestDispatchingEndpointAdapter.dispatchMessage
public Message dispatchMessage(Message request, String mappingKey) { """ Consolidate mapping strategy in order to find dispatch incoming request to endpoint adapter according to mapping key that was extracted before from message content. @param request @param mappingKey @return """ return mappingSt...
java
public Message dispatchMessage(Message request, String mappingKey) { return mappingStrategy.getEndpointAdapter(mappingKey).handleMessage(request); }
[ "public", "Message", "dispatchMessage", "(", "Message", "request", ",", "String", "mappingKey", ")", "{", "return", "mappingStrategy", ".", "getEndpointAdapter", "(", "mappingKey", ")", ".", "handleMessage", "(", "request", ")", ";", "}" ]
Consolidate mapping strategy in order to find dispatch incoming request to endpoint adapter according to mapping key that was extracted before from message content. @param request @param mappingKey @return
[ "Consolidate", "mapping", "strategy", "in", "order", "to", "find", "dispatch", "incoming", "request", "to", "endpoint", "adapter", "according", "to", "mapping", "key", "that", "was", "extracted", "before", "from", "message", "content", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/endpoint/adapter/RequestDispatchingEndpointAdapter.java#L51-L53
52inc/android-52Kit
library/src/main/java/com/ftinc/kit/util/IntentUtils.java
IntentUtils.cropImage
public static Intent cropImage(Context context, File image, int outputX, int outputY, int aspectX, int aspectY, boolean scale) { """ Crop image. Before using, cropImage requires especial check that differs from {@link #isIntentAvailable(android.content.Context, android.content.Intent)} see {@link #isCropAvailabl...
java
public static Intent cropImage(Context context, File image, int outputX, int outputY, int aspectX, int aspectY, boolean scale) { Intent intent = new Intent("com.android.camera.action.CROP"); intent.setType("image/*"); List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(in...
[ "public", "static", "Intent", "cropImage", "(", "Context", "context", ",", "File", "image", ",", "int", "outputX", ",", "int", "outputY", ",", "int", "aspectX", ",", "int", "aspectY", ",", "boolean", "scale", ")", "{", "Intent", "intent", "=", "new", "In...
Crop image. Before using, cropImage requires especial check that differs from {@link #isIntentAvailable(android.content.Context, android.content.Intent)} see {@link #isCropAvailable(android.content.Context)} instead @param context Application context @param image Image that will be used for cropping. This image is n...
[ "Crop", "image", ".", "Before", "using", "cropImage", "requires", "especial", "check", "that", "differs", "from", "{", "@link", "#isIntentAvailable", "(", "android", ".", "content", ".", "Context", "android", ".", "content", ".", "Intent", ")", "}", "see", "...
train
https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/IntentUtils.java#L455-L472
hugegraph/hugegraph-common
src/main/java/com/baidu/hugegraph/util/NumericUtil.java
NumericUtil.compareNumber
@SuppressWarnings("unchecked") public static int compareNumber(Object first, Number second) { """ Compare object with a number, the object should be a number, or it can be converted to a BigDecimal @param first might be number or string @param second must be number @return 0 if first is numerically equ...
java
@SuppressWarnings("unchecked") public static int compareNumber(Object first, Number second) { if (first instanceof Number && first instanceof Comparable && first.getClass().equals(second.getClass())) { return ((Comparable<Number>) first).compareTo(second); } Function...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "int", "compareNumber", "(", "Object", "first", ",", "Number", "second", ")", "{", "if", "(", "first", "instanceof", "Number", "&&", "first", "instanceof", "Comparable", "&&", "first", "."...
Compare object with a number, the object should be a number, or it can be converted to a BigDecimal @param first might be number or string @param second must be number @return 0 if first is numerically equal to second; a negative int if first is numerically less than second; a positive int if first is numerically g...
[ "Compare", "object", "with", "a", "number", "the", "object", "should", "be", "a", "number", "or", "it", "can", "be", "converted", "to", "a", "BigDecimal" ]
train
https://github.com/hugegraph/hugegraph-common/blob/1eb2414134b639a13f68ca352c1b3eb2d956e7b2/src/main/java/com/baidu/hugegraph/util/NumericUtil.java#L255-L265