repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
201
func_name
stringlengths
4
126
whole_func_string
stringlengths
75
3.57k
language
stringclasses
1 value
func_code_string
stringlengths
75
3.57k
func_code_tokens
listlengths
21
599
func_documentation_string
stringlengths
61
1.95k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
apache/predictionio-sdk-java
client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java
EventClient.setUserAsFuture
public FutureAPIResponse setUserAsFuture(String uid, Map<String, Object> properties) throws IOException { return setUserAsFuture(uid, properties, new DateTime()); }
java
public FutureAPIResponse setUserAsFuture(String uid, Map<String, Object> properties) throws IOException { return setUserAsFuture(uid, properties, new DateTime()); }
[ "public", "FutureAPIResponse", "setUserAsFuture", "(", "String", "uid", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "throws", "IOException", "{", "return", "setUserAsFuture", "(", "uid", ",", "properties", ",", "new", "DateTime", "(", ")"...
Sends a set user properties request. Same as {@link #setUserAsFuture(String, Map, DateTime) setUserAsFuture(String, Map&lt;String, Object&gt;, DateTime)} except event time is not specified and recorded as the time when the function is called.
[ "Sends", "a", "set", "user", "properties", "request", ".", "Same", "as", "{" ]
train
https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L310-L313
apache/incubator-druid
core/src/main/java/org/apache/druid/utils/CompressionUtils.java
CompressionUtils.getGzBaseName
public static String getGzBaseName(String fname) { final String reducedFname = Files.getNameWithoutExtension(fname); if (isGz(fname) && !reducedFname.isEmpty()) { return reducedFname; } throw new IAE("[%s] is not a valid gz file name", fname); }
java
public static String getGzBaseName(String fname) { final String reducedFname = Files.getNameWithoutExtension(fname); if (isGz(fname) && !reducedFname.isEmpty()) { return reducedFname; } throw new IAE("[%s] is not a valid gz file name", fname); }
[ "public", "static", "String", "getGzBaseName", "(", "String", "fname", ")", "{", "final", "String", "reducedFname", "=", "Files", ".", "getNameWithoutExtension", "(", "fname", ")", ";", "if", "(", "isGz", "(", "fname", ")", "&&", "!", "reducedFname", ".", ...
Get the file name without the .gz extension @param fname The name of the gzip file @return fname without the ".gz" extension @throws IAE if fname is not a valid "*.gz" file name
[ "Get", "the", "file", "name", "without", "the", ".", "gz", "extension" ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/utils/CompressionUtils.java#L563-L570
alkacon/opencms-core
src/org/opencms/ade/configuration/formatters/CmsFormatterConfigurationCache.java
CmsFormatterConfigurationCache.readFormatter
protected I_CmsFormatterBean readFormatter(CmsUUID structureId) { I_CmsFormatterBean formatterBean = null; CmsResource formatterRes = null; try { formatterRes = m_cms.readResource(structureId); CmsFile formatterFile = m_cms.readFile(formatterRes); CmsFormatte...
java
protected I_CmsFormatterBean readFormatter(CmsUUID structureId) { I_CmsFormatterBean formatterBean = null; CmsResource formatterRes = null; try { formatterRes = m_cms.readResource(structureId); CmsFile formatterFile = m_cms.readFile(formatterRes); CmsFormatte...
[ "protected", "I_CmsFormatterBean", "readFormatter", "(", "CmsUUID", "structureId", ")", "{", "I_CmsFormatterBean", "formatterBean", "=", "null", ";", "CmsResource", "formatterRes", "=", "null", ";", "try", "{", "formatterRes", "=", "m_cms", ".", "readResource", "(",...
Reads a formatter given its structure id and returns it, or null if the formatter couldn't be read.<p> @param structureId the structure id of the formatter configuration @return the formatter bean, or null if no formatter could be read for some reason
[ "Reads", "a", "formatter", "given", "its", "structure", "id", "and", "returns", "it", "or", "null", "if", "the", "formatter", "couldn", "t", "be", "read", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/formatters/CmsFormatterConfigurationCache.java#L334-L359
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java
StructureSequenceMatcher.getProteinSequenceForStructure
public static ProteinSequence getProteinSequenceForStructure(Structure struct, Map<Integer,Group> groupIndexPosition ) { if( groupIndexPosition != null) { groupIndexPosition.clear(); } StringBuilder seqStr = new StringBuilder(); for(Chain chain : struct.getChains()) { List<Group> groups = chain.getAtom...
java
public static ProteinSequence getProteinSequenceForStructure(Structure struct, Map<Integer,Group> groupIndexPosition ) { if( groupIndexPosition != null) { groupIndexPosition.clear(); } StringBuilder seqStr = new StringBuilder(); for(Chain chain : struct.getChains()) { List<Group> groups = chain.getAtom...
[ "public", "static", "ProteinSequence", "getProteinSequenceForStructure", "(", "Structure", "struct", ",", "Map", "<", "Integer", ",", "Group", ">", "groupIndexPosition", ")", "{", "if", "(", "groupIndexPosition", "!=", "null", ")", "{", "groupIndexPosition", ".", ...
Generates a ProteinSequence corresponding to the sequence of struct, and maintains a mapping from the sequence back to the original groups. Chains are appended to one another. 'X' is used for heteroatoms. @param struct Input structure @param groupIndexPosition An empty map, which will be populated with (residue index...
[ "Generates", "a", "ProteinSequence", "corresponding", "to", "the", "sequence", "of", "struct", "and", "maintains", "a", "mapping", "from", "the", "sequence", "back", "to", "the", "original", "groups", "." ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/StructureSequenceMatcher.java#L112-L147
realtime-framework/RealtimeStorage-Android
library/src/main/java/co/realtime/storage/TableRef.java
TableRef.isNull
public TableRef isNull(String attributeName){ filters.add(new Filter(StorageFilter.NULL, attributeName, null, null)); return this; }
java
public TableRef isNull(String attributeName){ filters.add(new Filter(StorageFilter.NULL, attributeName, null, null)); return this; }
[ "public", "TableRef", "isNull", "(", "String", "attributeName", ")", "{", "filters", ".", "add", "(", "new", "Filter", "(", "StorageFilter", ".", "NULL", ",", "attributeName", ",", "null", ",", "null", ")", ")", ";", "return", "this", ";", "}" ]
Applies a filter to the table. When fetched, it will return the null values. <pre> StorageRef storage = new StorageRef("your_app_key", "your_token"); TableRef tableRef = storage.table("your_table"); // Retrieve all items where their "itemProperty" value is null tableRef.isNull("itemProperty").getItems(new OnItemSnap...
[ "Applies", "a", "filter", "to", "the", "table", ".", "When", "fetched", "it", "will", "return", "the", "null", "values", "." ]
train
https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/TableRef.java#L829-L832
liyiorg/weixin-popular
src/main/java/weixin/popular/api/MessageAPI.java
MessageAPI.mediaUploadnews
public static Media mediaUploadnews(String access_token, String messageJson) { return MediaAPI.mediaUploadnews(access_token, messageJson); }
java
public static Media mediaUploadnews(String access_token, String messageJson) { return MediaAPI.mediaUploadnews(access_token, messageJson); }
[ "public", "static", "Media", "mediaUploadnews", "(", "String", "access_token", ",", "String", "messageJson", ")", "{", "return", "MediaAPI", ".", "mediaUploadnews", "(", "access_token", ",", "messageJson", ")", ";", "}" ]
高级群发 构成 MassMPnewsMessage 对象的前置请求接口 @param access_token access_token @param messageJson messageJson @return result
[ "高级群发", "构成", "MassMPnewsMessage", "对象的前置请求接口" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MessageAPI.java#L112-L114
NoraUi/NoraUi
src/main/java/com/github/noraui/application/steps/CommonSteps.java
CommonSteps.checkInputText
@Conditioned @Et("Je vérifie le texte '(.*)-(.*)' avec '(.*)'[\\.|\\?]") @And("I check text '(.*)-(.*)' with '(.*)'[\\.|\\?]") public void checkInputText(String page, String elementName, String textOrKey, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException { if (!c...
java
@Conditioned @Et("Je vérifie le texte '(.*)-(.*)' avec '(.*)'[\\.|\\?]") @And("I check text '(.*)-(.*)' with '(.*)'[\\.|\\?]") public void checkInputText(String page, String elementName, String textOrKey, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException { if (!c...
[ "@", "Conditioned", "@", "Et", "(", "\"Je vérifie le texte '(.*)-(.*)' avec '(.*)'[\\\\.|\\\\?]\")", "\r", "@", "And", "(", "\"I check text '(.*)-(.*)' with '(.*)'[\\\\.|\\\\?]\"", ")", "public", "void", "checkInputText", "(", "String", "page", ",", "String", "elementName", ...
Checks if html input text contains expected value. @param page The concerned page of elementName @param elementName The key of the PageElement to check @param textOrKey Is the new data (text or text in context (after a save)) @param conditions list of 'expected' values condition and 'actual' values ({@link com.github....
[ "Checks", "if", "html", "input", "text", "contains", "expected", "value", "." ]
train
https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L687-L694
mapsforge/mapsforge
mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java
MapViewerTemplate.initializePosition
protected IMapViewPosition initializePosition(IMapViewPosition mvp) { LatLong center = mvp.getCenter(); if (center.equals(new LatLong(0, 0))) { mvp.setMapPosition(this.getInitialPosition()); } mvp.setZoomLevelMax(getZoomLevelMax()); mvp.setZoomLevelMin(getZoomLevelMi...
java
protected IMapViewPosition initializePosition(IMapViewPosition mvp) { LatLong center = mvp.getCenter(); if (center.equals(new LatLong(0, 0))) { mvp.setMapPosition(this.getInitialPosition()); } mvp.setZoomLevelMax(getZoomLevelMax()); mvp.setZoomLevelMin(getZoomLevelMi...
[ "protected", "IMapViewPosition", "initializePosition", "(", "IMapViewPosition", "mvp", ")", "{", "LatLong", "center", "=", "mvp", ".", "getCenter", "(", ")", ";", "if", "(", "center", ".", "equals", "(", "new", "LatLong", "(", "0", ",", "0", ")", ")", ")...
initializes the map view position. @param mvp the map view position to be set @return the mapviewposition set
[ "initializes", "the", "map", "view", "position", "." ]
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java#L252-L261
morimekta/providence
providence-reflect/src/main/java/net/morimekta/providence/reflect/contained/CField.java
CField.equalsQualifiedName
private static boolean equalsQualifiedName(PDescriptor a, PDescriptor b) { return (a != null) && (b != null) && (a.getQualifiedName() .equals(b.getQualifiedName())); }
java
private static boolean equalsQualifiedName(PDescriptor a, PDescriptor b) { return (a != null) && (b != null) && (a.getQualifiedName() .equals(b.getQualifiedName())); }
[ "private", "static", "boolean", "equalsQualifiedName", "(", "PDescriptor", "a", ",", "PDescriptor", "b", ")", "{", "return", "(", "a", "!=", "null", ")", "&&", "(", "b", "!=", "null", ")", "&&", "(", "a", ".", "getQualifiedName", "(", ")", ".", "equals...
Check if the two descriptors has the same qualified name, i..e symbolically represent the same type. @param a The first type. @param b The second type. @return If the two types are the same.
[ "Check", "if", "the", "two", "descriptors", "has", "the", "same", "qualified", "name", "i", "..", "e", "symbolically", "represent", "the", "same", "type", "." ]
train
https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-reflect/src/main/java/net/morimekta/providence/reflect/contained/CField.java#L190-L193
mgormley/pacaya
src/main/java/edu/jhu/pacaya/autodiff/Tensor.java
Tensor.ravelIndexMatlab
public static int ravelIndexMatlab(int[] indices, int[] dims) { indices = indices.clone(); ArrayUtils.reverse(indices); dims = dims.clone(); ArrayUtils.reverse(dims); return ravelIndex(indices, dims); }
java
public static int ravelIndexMatlab(int[] indices, int[] dims) { indices = indices.clone(); ArrayUtils.reverse(indices); dims = dims.clone(); ArrayUtils.reverse(dims); return ravelIndex(indices, dims); }
[ "public", "static", "int", "ravelIndexMatlab", "(", "int", "[", "]", "indices", ",", "int", "[", "]", "dims", ")", "{", "indices", "=", "indices", ".", "clone", "(", ")", ";", "ArrayUtils", ".", "reverse", "(", "indices", ")", ";", "dims", "=", "dims...
Gets the index into the values array that corresponds to the indices.
[ "Gets", "the", "index", "into", "the", "values", "array", "that", "corresponds", "to", "the", "indices", "." ]
train
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/autodiff/Tensor.java#L178-L184
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/core/ServerConfig.java
ServerConfig.setParamFromString
private static boolean setParamFromString(String name, String value) throws ConfigurationException { try { Field field = config.getClass().getDeclaredField(name); String fieldType = field.getType().toString(); if (fieldType.compareToIgnoreCase("int") == 0) { ...
java
private static boolean setParamFromString(String name, String value) throws ConfigurationException { try { Field field = config.getClass().getDeclaredField(name); String fieldType = field.getType().toString(); if (fieldType.compareToIgnoreCase("int") == 0) { ...
[ "private", "static", "boolean", "setParamFromString", "(", "String", "name", ",", "String", "value", ")", "throws", "ConfigurationException", "{", "try", "{", "Field", "field", "=", "config", ".", "getClass", "(", ")", ".", "getDeclaredField", "(", "name", ")"...
Return false if given name is not a known scalar configuration parameter
[ "Return", "false", "if", "given", "name", "is", "not", "a", "known", "scalar", "configuration", "parameter" ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerConfig.java#L411-L430
WASdev/standards.jsr352.jbatch
com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java
JDBCPersistenceManagerImpl.getPartitionLevelJobInstanceWildCard
private String getPartitionLevelJobInstanceWildCard(long rootJobInstanceId, String stepName) { StringBuilder sb = new StringBuilder(":"); sb.append(Long.toString(rootJobInstanceId)); sb.append(":"); sb.append(stepName); sb.append(":%"); return sb.toString(); }
java
private String getPartitionLevelJobInstanceWildCard(long rootJobInstanceId, String stepName) { StringBuilder sb = new StringBuilder(":"); sb.append(Long.toString(rootJobInstanceId)); sb.append(":"); sb.append(stepName); sb.append(":%"); return sb.toString(); }
[ "private", "String", "getPartitionLevelJobInstanceWildCard", "(", "long", "rootJobInstanceId", ",", "String", "stepName", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "\":\"", ")", ";", "sb", ".", "append", "(", "Long", ".", "toString", "("...
Obviously would be nice if the code writing this special format were in the same place as this code reading it. Assumes format like: JOBINSTANCEDATA (jobinstanceid name, ...) 1197,"partitionMetrics","NOTSET" 1198,":1197:step1:0","NOTSET" 1199,":1197:step1:1","NOTSET" 1200,":1197:step2:0","NOTSET" @param rootJobExec...
[ "Obviously", "would", "be", "nice", "if", "the", "code", "writing", "this", "special", "format", "were", "in", "the", "same", "place", "as", "this", "code", "reading", "it", "." ]
train
https://github.com/WASdev/standards.jsr352.jbatch/blob/e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f/com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java#L1919-L1928
cqframework/clinical_quality_language
Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java
ElmBaseVisitor.visitTupleTypeSpecifier
public T visitTupleTypeSpecifier(TupleTypeSpecifier elm, C context) { for (TupleElementDefinition element : elm.getElement()) { visitElement(element, context); } return null; }
java
public T visitTupleTypeSpecifier(TupleTypeSpecifier elm, C context) { for (TupleElementDefinition element : elm.getElement()) { visitElement(element, context); } return null; }
[ "public", "T", "visitTupleTypeSpecifier", "(", "TupleTypeSpecifier", "elm", ",", "C", "context", ")", "{", "for", "(", "TupleElementDefinition", "element", ":", "elm", ".", "getElement", "(", ")", ")", "{", "visitElement", "(", "element", ",", "context", ")", ...
Visit a TupleTypeSpecifier. This method will be called for every node in the tree that is a TupleTypeSpecifier. @param elm the ELM tree @param context the context passed to the visitor @return the visitor result
[ "Visit", "a", "TupleTypeSpecifier", ".", "This", "method", "will", "be", "called", "for", "every", "node", "in", "the", "tree", "that", "is", "a", "TupleTypeSpecifier", "." ]
train
https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L110-L115
ZieIony/Carbon
carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java
LayerDrawable.refreshChildPadding
private boolean refreshChildPadding(int i, ChildDrawable r) { if (r.mDrawable != null) { final Rect rect = mTmpRect; r.mDrawable.getPadding(rect); if (rect.left != mPaddingL[i] || rect.top != mPaddingT[i] || rect.right != mPaddingR[i] || rect.bottom != mPa...
java
private boolean refreshChildPadding(int i, ChildDrawable r) { if (r.mDrawable != null) { final Rect rect = mTmpRect; r.mDrawable.getPadding(rect); if (rect.left != mPaddingL[i] || rect.top != mPaddingT[i] || rect.right != mPaddingR[i] || rect.bottom != mPa...
[ "private", "boolean", "refreshChildPadding", "(", "int", "i", ",", "ChildDrawable", "r", ")", "{", "if", "(", "r", ".", "mDrawable", "!=", "null", ")", "{", "final", "Rect", "rect", "=", "mTmpRect", ";", "r", ".", "mDrawable", ".", "getPadding", "(", "...
Refreshes the cached padding values for the specified child. @return true if the child's padding has changed
[ "Refreshes", "the", "cached", "padding", "values", "for", "the", "specified", "child", "." ]
train
https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java#L1551-L1565
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/RunnersApi.java
RunnersApi.disableRunner
public Runner disableRunner(Object projectIdOrPath, Integer runnerId) throws GitLabApiException { Response response = delete(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "runners", runnerId); return (response.readEntity(Runner.class)); }
java
public Runner disableRunner(Object projectIdOrPath, Integer runnerId) throws GitLabApiException { Response response = delete(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "runners", runnerId); return (response.readEntity(Runner.class)); }
[ "public", "Runner", "disableRunner", "(", "Object", "projectIdOrPath", ",", "Integer", "runnerId", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "delete", "(", "Response", ".", "Status", ".", "OK", ",", "null", ",", "\"projects\"", ",", ...
Disable a specific runner from the project. It works only if the project isn't the only project associated with the specified runner. If so, an error is returned. Use the {@link #removeRunner(Integer)} instead. <pre><code>GitLab Endpoint: DELETE /projects/:id/runners/:runner_id</code></pre> @param projectIdOrPath the...
[ "Disable", "a", "specific", "runner", "from", "the", "project", ".", "It", "works", "only", "if", "the", "project", "isn", "t", "the", "only", "project", "associated", "with", "the", "specified", "runner", ".", "If", "so", "an", "error", "is", "returned", ...
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RunnersApi.java#L477-L481
knightliao/apollo
src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java
DateUtils.formatDate
public static String formatDate(java.util.Date pDate, String format) { if (pDate == null) { pDate = new java.util.Date(); } SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(pDate); }
java
public static String formatDate(java.util.Date pDate, String format) { if (pDate == null) { pDate = new java.util.Date(); } SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(pDate); }
[ "public", "static", "String", "formatDate", "(", "java", ".", "util", ".", "Date", "pDate", ",", "String", "format", ")", "{", "if", "(", "pDate", "==", "null", ")", "{", "pDate", "=", "new", "java", ".", "util", ".", "Date", "(", ")", ";", "}", ...
按照给定格式返回代表日期的字符串 @param pDate Date @param format String 日期格式 @return String 代表日期的字符串
[ "按照给定格式返回代表日期的字符串" ]
train
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java#L61-L68
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java
ComputeNodeOperations.uploadBatchServiceLogs
public UploadBatchServiceLogsResult uploadBatchServiceLogs(String poolId, String nodeId, String containerUrl, DateTime startTime) throws BatchErrorException, IOException { return uploadBatchServiceLogs(poolId, nodeId, containerUrl, startTime, null, null); }
java
public UploadBatchServiceLogsResult uploadBatchServiceLogs(String poolId, String nodeId, String containerUrl, DateTime startTime) throws BatchErrorException, IOException { return uploadBatchServiceLogs(poolId, nodeId, containerUrl, startTime, null, null); }
[ "public", "UploadBatchServiceLogsResult", "uploadBatchServiceLogs", "(", "String", "poolId", ",", "String", "nodeId", ",", "String", "containerUrl", ",", "DateTime", "startTime", ")", "throws", "BatchErrorException", ",", "IOException", "{", "return", "uploadBatchServiceL...
Upload Azure Batch service log files from the specified compute node to Azure Blob Storage. This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support. The Azure Batch service log files should be shared with Azure support...
[ "Upload", "Azure", "Batch", "service", "log", "files", "from", "the", "specified", "compute", "node", "to", "Azure", "Blob", "Storage", ".", "This", "is", "for", "gathering", "Azure", "Batch", "service", "log", "files", "in", "an", "automated", "fashion", "f...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L554-L557
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/access/ecr/AwsSigner4.java
AwsSigner4.task3
final byte[] task3(AwsSigner4Request sr, AuthConfig credentials) { return hmacSha256(getSigningKey(sr, credentials), task2(sr)); }
java
final byte[] task3(AwsSigner4Request sr, AuthConfig credentials) { return hmacSha256(getSigningKey(sr, credentials), task2(sr)); }
[ "final", "byte", "[", "]", "task3", "(", "AwsSigner4Request", "sr", ",", "AuthConfig", "credentials", ")", "{", "return", "hmacSha256", "(", "getSigningKey", "(", "sr", ",", "credentials", ")", ",", "task2", "(", "sr", ")", ")", ";", "}" ]
Task 3. <a href="https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html">Calculate the Signature for AWS Signature Version 4</a>
[ "Task", "3", ".", "<a", "href", "=", "https", ":", "//", "docs", ".", "aws", ".", "amazon", ".", "com", "/", "general", "/", "latest", "/", "gr", "/", "sigv4", "-", "create", "-", "string", "-", "to", "-", "sign", ".", "html", ">", "Calculate", ...
train
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/ecr/AwsSigner4.java#L98-L100
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
AmazonS3Client.addDateHeader
private static void addDateHeader(Request<?> request, String header, Date value) { if (value != null) { request.addHeader(header, ServiceUtils.formatRfc822Date(value)); } }
java
private static void addDateHeader(Request<?> request, String header, Date value) { if (value != null) { request.addHeader(header, ServiceUtils.formatRfc822Date(value)); } }
[ "private", "static", "void", "addDateHeader", "(", "Request", "<", "?", ">", "request", ",", "String", "header", ",", "Date", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "request", ".", "addHeader", "(", "header", ",", "ServiceUtils", ...
<p> Adds the specified date header in RFC 822 date format to the specified request. This method will not add a date header if the specified date value is <code>null</code>. </p> @param request The request to add the header to. @param header The header name. @param value The header value.
[ "<p", ">", "Adds", "the", "specified", "date", "header", "in", "RFC", "822", "date", "format", "to", "the", "specified", "request", ".", "This", "method", "will", "not", "add", "a", "date", "header", "if", "the", "specified", "date", "value", "is", "<cod...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4491-L4495
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java
XHTMLText.appendOpenHeaderTag
public XHTMLText appendOpenHeaderTag(int level, String style) { if (level > 3 || level < 1) { throw new IllegalArgumentException("Level must be between 1 and 3"); } text.halfOpenElement(H + Integer.toString(level)); text.optAttribute(STYLE, style); text.rightAngleBrac...
java
public XHTMLText appendOpenHeaderTag(int level, String style) { if (level > 3 || level < 1) { throw new IllegalArgumentException("Level must be between 1 and 3"); } text.halfOpenElement(H + Integer.toString(level)); text.optAttribute(STYLE, style); text.rightAngleBrac...
[ "public", "XHTMLText", "appendOpenHeaderTag", "(", "int", "level", ",", "String", "style", ")", "{", "if", "(", "level", ">", "3", "||", "level", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Level must be between 1 and 3\"", ")", ";"...
Appends a tag that indicates a header, a title of a section of the message. @param level the level of the Header. It must be a value between 1 and 3 @param style the XHTML style of the blockquote @return this.
[ "Appends", "a", "tag", "that", "indicates", "a", "header", "a", "title", "of", "a", "section", "of", "the", "message", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java#L200-L208
lets-blade/blade
src/main/java/com/blade/kit/IocKit.java
IocKit.getInjectFields
private static List<FieldInjector> getInjectFields(Ioc ioc, ClassDefine classDefine) { List<FieldInjector> injectors = new ArrayList<>(); for (Field field : classDefine.getDeclaredFields()) { if (null != field.getAnnotation(InjectWith.class) || null != field.getAnnotation(Inject.class)) { ...
java
private static List<FieldInjector> getInjectFields(Ioc ioc, ClassDefine classDefine) { List<FieldInjector> injectors = new ArrayList<>(); for (Field field : classDefine.getDeclaredFields()) { if (null != field.getAnnotation(InjectWith.class) || null != field.getAnnotation(Inject.class)) { ...
[ "private", "static", "List", "<", "FieldInjector", ">", "getInjectFields", "(", "Ioc", "ioc", ",", "ClassDefine", "classDefine", ")", "{", "List", "<", "FieldInjector", ">", "injectors", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Field", "f...
Get @Inject Annotated field @param ioc ioc container @param classDefine classDefine @return return FieldInjector
[ "Get", "@Inject", "Annotated", "field" ]
train
https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/IocKit.java#L51-L62
jayantk/jklol
src/com/jayantkrish/jklol/models/DiscreteFactor.java
DiscreteFactor.describeAssignments
public String describeAssignments(List<Assignment> assignments, boolean includeZeros) { StringBuilder sb = new StringBuilder(); for (Assignment assignment : assignments) { double unnormalizedProb = getUnnormalizedProbability(assignment); if (unnormalizedProb != 0.0 || includeZeros) { Outcome...
java
public String describeAssignments(List<Assignment> assignments, boolean includeZeros) { StringBuilder sb = new StringBuilder(); for (Assignment assignment : assignments) { double unnormalizedProb = getUnnormalizedProbability(assignment); if (unnormalizedProb != 0.0 || includeZeros) { Outcome...
[ "public", "String", "describeAssignments", "(", "List", "<", "Assignment", ">", "assignments", ",", "boolean", "includeZeros", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Assignment", "assignment", ":", "assignments"...
Gets a string description of {@code assignments} and their weights in {@code this}. @param assignments @param includeZeros if {@code false}, zero weight assignments are omitted. @return
[ "Gets", "a", "string", "description", "of", "{", "@code", "assignments", "}", "and", "their", "weights", "in", "{", "@code", "this", "}", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/DiscreteFactor.java#L384-L395
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java
BigtableInstanceAdminClient.getCluster
@SuppressWarnings("WeakerAccess") public Cluster getCluster(String instanceId, String clusterId) { return ApiExceptions.callAndTranslateApiException(getClusterAsync(instanceId, clusterId)); }
java
@SuppressWarnings("WeakerAccess") public Cluster getCluster(String instanceId, String clusterId) { return ApiExceptions.callAndTranslateApiException(getClusterAsync(instanceId, clusterId)); }
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "Cluster", "getCluster", "(", "String", "instanceId", ",", "String", "clusterId", ")", "{", "return", "ApiExceptions", ".", "callAndTranslateApiException", "(", "getClusterAsync", "(", "instanceId", ",",...
Get the cluster representation by ID. <p>Sample code: <pre>{@code Cluster cluster = client.getCluster("my-instance", "my-cluster"); }</pre>
[ "Get", "the", "cluster", "representation", "by", "ID", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java#L572-L575
JavaMoney/jsr354-api
src/main/java/javax/money/CurrencyQueryBuilder.java
CurrencyQueryBuilder.setCurrencyCodes
public CurrencyQueryBuilder setCurrencyCodes(String... codes) { return set(CurrencyQuery.KEY_QUERY_CURRENCY_CODES, Arrays.asList(codes)); }
java
public CurrencyQueryBuilder setCurrencyCodes(String... codes) { return set(CurrencyQuery.KEY_QUERY_CURRENCY_CODES, Arrays.asList(codes)); }
[ "public", "CurrencyQueryBuilder", "setCurrencyCodes", "(", "String", "...", "codes", ")", "{", "return", "set", "(", "CurrencyQuery", ".", "KEY_QUERY_CURRENCY_CODES", ",", "Arrays", ".", "asList", "(", "codes", ")", ")", ";", "}" ]
Sets the currency code, or the regular expression to select codes. @param codes the currency codes or code expressions, not null. @return the query for chaining.
[ "Sets", "the", "currency", "code", "or", "the", "regular", "expression", "to", "select", "codes", "." ]
train
https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/CurrencyQueryBuilder.java#L68-L70
samskivert/pythagoras
src/main/java/pythagoras/f/MathUtil.java
MathUtil.lerpa
public static float lerpa (float a1, float a2, float t) { float ma1 = mirrorAngle(a1), ma2 = mirrorAngle(a2); float d = Math.abs(a2 - a1), md = Math.abs(ma1 - ma2); return (d <= md) ? lerp(a1, a2, t) : mirrorAngle(lerp(ma1, ma2, t)); }
java
public static float lerpa (float a1, float a2, float t) { float ma1 = mirrorAngle(a1), ma2 = mirrorAngle(a2); float d = Math.abs(a2 - a1), md = Math.abs(ma1 - ma2); return (d <= md) ? lerp(a1, a2, t) : mirrorAngle(lerp(ma1, ma2, t)); }
[ "public", "static", "float", "lerpa", "(", "float", "a1", ",", "float", "a2", ",", "float", "t", ")", "{", "float", "ma1", "=", "mirrorAngle", "(", "a1", ")", ",", "ma2", "=", "mirrorAngle", "(", "a2", ")", ";", "float", "d", "=", "Math", ".", "a...
Linearly interpolates between two angles, taking the shortest path around the circle. This assumes that both angles are in [-pi, +pi].
[ "Linearly", "interpolates", "between", "two", "angles", "taking", "the", "shortest", "path", "around", "the", "circle", ".", "This", "assumes", "that", "both", "angles", "are", "in", "[", "-", "pi", "+", "pi", "]", "." ]
train
https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/MathUtil.java#L103-L107
ddf-project/DDF
core/src/main/java/io/ddf/Factor.java
Factor.setLevels
public void setLevels(List<String> levels, boolean isOrdered) throws DDFException { this.setLevels(levels, null, isOrdered); }
java
public void setLevels(List<String> levels, boolean isOrdered) throws DDFException { this.setLevels(levels, null, isOrdered); }
[ "public", "void", "setLevels", "(", "List", "<", "String", ">", "levels", ",", "boolean", "isOrdered", ")", "throws", "DDFException", "{", "this", ".", "setLevels", "(", "levels", ",", "null", ",", "isOrdered", ")", ";", "}" ]
Typically, levels are automatically computed from the data, but in some rare instances, the user may want to specify the levels explicitly, e.g., when the data column does not contain all the levels desired. @param levels @param isOrdered a flag indicating whether the levels actually have "less than" and "greater than...
[ "Typically", "levels", "are", "automatically", "computed", "from", "the", "data", "but", "in", "some", "rare", "instances", "the", "user", "may", "want", "to", "specify", "the", "levels", "explicitly", "e", ".", "g", ".", "when", "the", "data", "column", "...
train
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/Factor.java#L157-L159
javamelody/javamelody
javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java
MPdfWriter.print
@Override public void print(final MBasicTable table, final OutputStream out) throws IOException { writePdf(table, out); }
java
@Override public void print(final MBasicTable table, final OutputStream out) throws IOException { writePdf(table, out); }
[ "@", "Override", "public", "void", "print", "(", "final", "MBasicTable", "table", ",", "final", "OutputStream", "out", ")", "throws", "IOException", "{", "writePdf", "(", "table", ",", "out", ")", ";", "}" ]
Lance l'impression (Méthode abstraite assurant le polymorphisme des instances.). @param table MBasicTable @param out OutputStream @throws IOException Erreur disque
[ "Lance", "l", "impression", "(", "Méthode", "abstraite", "assurant", "le", "polymorphisme", "des", "instances", ".", ")", "." ]
train
https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/print/MPdfWriter.java#L108-L111
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java
SimpleDateFormat.parseInt
private Number parseInt(String text, ParsePosition pos, boolean allowNegative, NumberFormat fmt) { return parseInt(text, -1, pos, allowNegative, fmt); }
java
private Number parseInt(String text, ParsePosition pos, boolean allowNegative, NumberFormat fmt) { return parseInt(text, -1, pos, allowNegative, fmt); }
[ "private", "Number", "parseInt", "(", "String", "text", ",", "ParsePosition", "pos", ",", "boolean", "allowNegative", ",", "NumberFormat", "fmt", ")", "{", "return", "parseInt", "(", "text", ",", "-", "1", ",", "pos", ",", "allowNegative", ",", "fmt", ")",...
Parse an integer using numberFormat. This method is semantically const, but actually may modify fNumberFormat.
[ "Parse", "an", "integer", "using", "numberFormat", ".", "This", "method", "is", "semantically", "const", "but", "actually", "may", "modify", "fNumberFormat", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L3720-L3725
google/closure-compiler
src/com/google/javascript/jscomp/AbstractCompiler.java
AbstractCompiler.setAnnotation
void setAnnotation(String key, Object object) { checkArgument(object != null, "The stored annotation value cannot be null."); Preconditions.checkArgument( !annotationMap.containsKey(key), "Cannot overwrite the existing annotation '%s'.", key); annotationMap.put(key, object); }
java
void setAnnotation(String key, Object object) { checkArgument(object != null, "The stored annotation value cannot be null."); Preconditions.checkArgument( !annotationMap.containsKey(key), "Cannot overwrite the existing annotation '%s'.", key); annotationMap.put(key, object); }
[ "void", "setAnnotation", "(", "String", "key", ",", "Object", "object", ")", "{", "checkArgument", "(", "object", "!=", "null", ",", "\"The stored annotation value cannot be null.\"", ")", ";", "Preconditions", ".", "checkArgument", "(", "!", "annotationMap", ".", ...
Sets an annotation for the given key. @param key the annotation key @param object the object to store as the annotation
[ "Sets", "an", "annotation", "for", "the", "given", "key", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AbstractCompiler.java#L688-L693
haifengl/smile
math/src/main/java/smile/math/IntArrayList.java
IntArrayList.set
public IntArrayList set(int index, int val) { if (index < 0 || index >= size) { throw new IndexOutOfBoundsException(String.valueOf(index)); } data[index] = val; return this; }
java
public IntArrayList set(int index, int val) { if (index < 0 || index >= size) { throw new IndexOutOfBoundsException(String.valueOf(index)); } data[index] = val; return this; }
[ "public", "IntArrayList", "set", "(", "int", "index", ",", "int", "val", ")", "{", "if", "(", "index", "<", "0", "||", "index", ">=", "size", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "String", ".", "valueOf", "(", "index", ")", ")", ...
Replaces the value at the specified position in this list with the specified value. @param index index of the value to replace @param val value to be stored at the specified position @throws IndexOutOfBoundsException if the index is out of range (index &lt; 0 || index &ge; size())
[ "Replaces", "the", "value", "at", "the", "specified", "position", "in", "this", "list", "with", "the", "specified", "value", "." ]
train
https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/IntArrayList.java#L150-L156
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Assert.java
Assert.notEmpty
public static <K, V> Map<K, V> notEmpty(Map<K, V> map, String errorMsgTemplate, Object... params) throws IllegalArgumentException { if (CollectionUtil.isEmpty(map)) { throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params)); } return map; }
java
public static <K, V> Map<K, V> notEmpty(Map<K, V> map, String errorMsgTemplate, Object... params) throws IllegalArgumentException { if (CollectionUtil.isEmpty(map)) { throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params)); } return map; }
[ "public", "static", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "V", ">", "notEmpty", "(", "Map", "<", "K", ",", "V", ">", "map", ",", "String", "errorMsgTemplate", ",", "Object", "...", "params", ")", "throws", "IllegalArgumentException", "{", "i...
断言给定Map非空 <pre class="code"> Assert.notEmpty(map, "Map must have entries"); </pre> @param <K> Key类型 @param <V> Value类型 @param map 被检查的Map @param errorMsgTemplate 异常时的消息模板 @param params 参数列表 @return 被检查的Map @throws IllegalArgumentException if the map is {@code null} or has no entries
[ "断言给定Map非空" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L390-L395
googleads/googleads-java-lib
modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/NodeExtractor.java
NodeExtractor.extractNode
public Node extractNode(@Nullable Node parentNode, Iterable<String> xPath) { Preconditions.checkNotNull(xPath, "Null xpath list"); Node node = parentNode; boolean wasMatch = false; Iterator<String> xPathElementsIter = xPath.iterator(); while (xPathElementsIter.hasNext() && node != null) { wasM...
java
public Node extractNode(@Nullable Node parentNode, Iterable<String> xPath) { Preconditions.checkNotNull(xPath, "Null xpath list"); Node node = parentNode; boolean wasMatch = false; Iterator<String> xPathElementsIter = xPath.iterator(); while (xPathElementsIter.hasNext() && node != null) { wasM...
[ "public", "Node", "extractNode", "(", "@", "Nullable", "Node", "parentNode", ",", "Iterable", "<", "String", ">", "xPath", ")", "{", "Preconditions", ".", "checkNotNull", "(", "xPath", ",", "\"Null xpath list\"", ")", ";", "Node", "node", "=", "parentNode", ...
Extracts the node specified by the xpath list. @param parentNode the node to extract the child node from. @param xPath xpath elements for <em>local</em> names that make up the child node's xpath. @return the matching {@link Node}, or {@code null} if no such child node exists.
[ "Extracts", "the", "node", "specified", "by", "the", "xpath", "list", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/NodeExtractor.java#L55-L78
apache/groovy
src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java
ProcessGroovyMethods.leftShift
public static Writer leftShift(Process self, Object value) throws IOException { return IOGroovyMethods.leftShift(self.getOutputStream(), value); }
java
public static Writer leftShift(Process self, Object value) throws IOException { return IOGroovyMethods.leftShift(self.getOutputStream(), value); }
[ "public", "static", "Writer", "leftShift", "(", "Process", "self", ",", "Object", "value", ")", "throws", "IOException", "{", "return", "IOGroovyMethods", ".", "leftShift", "(", "self", ".", "getOutputStream", "(", ")", ",", "value", ")", ";", "}" ]
Overloads the left shift operator (&lt;&lt;) to provide an append mechanism to pipe data to a Process. @param self a Process instance @param value a value to append @return a Writer @throws java.io.IOException if an IOException occurs. @since 1.0
[ "Overloads", "the", "left", "shift", "operator", "(", "&lt", ";", "&lt", ";", ")", "to", "provide", "an", "append", "mechanism", "to", "pipe", "data", "to", "a", "Process", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ProcessGroovyMethods.java#L114-L116
RogerParkinson/madura-objects-parent
madura-objects/src/main/java/nz/co/senanque/validationengine/ValidationSession.java
ValidationSession.invokeListeners
public void invokeListeners(final ValidationObject object, final String fieldName, final Object newValue, final Object currentValue) { m_validationEngine.invokeListeners(object, fieldName, newValue, currentValue, this); }
java
public void invokeListeners(final ValidationObject object, final String fieldName, final Object newValue, final Object currentValue) { m_validationEngine.invokeListeners(object, fieldName, newValue, currentValue, this); }
[ "public", "void", "invokeListeners", "(", "final", "ValidationObject", "object", ",", "final", "String", "fieldName", ",", "final", "Object", "newValue", ",", "final", "Object", "currentValue", ")", "{", "m_validationEngine", ".", "invokeListeners", "(", "object", ...
This is called after a successful setter call on one of the fields. If any listeners are attached to the field they are invoked from here. @param object @param fieldName @param newValue @param currentValue
[ "This", "is", "called", "after", "a", "successful", "setter", "call", "on", "one", "of", "the", "fields", ".", "If", "any", "listeners", "are", "attached", "to", "the", "field", "they", "are", "invoked", "from", "here", "." ]
train
https://github.com/RogerParkinson/madura-objects-parent/blob/9b5385dd0437611f0ce8506f63646e018d06fb8e/madura-objects/src/main/java/nz/co/senanque/validationengine/ValidationSession.java#L104-L106
AltBeacon/android-beacon-library
lib/src/main/java/org/altbeacon/beacon/BeaconParser.java
BeaconParser.fromScanData
public Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device) { return fromScanData(scanData, rssi, device, new Beacon()); }
java
public Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device) { return fromScanData(scanData, rssi, device, new Beacon()); }
[ "public", "Beacon", "fromScanData", "(", "byte", "[", "]", "scanData", ",", "int", "rssi", ",", "BluetoothDevice", "device", ")", "{", "return", "fromScanData", "(", "scanData", ",", "rssi", ",", "device", ",", "new", "Beacon", "(", ")", ")", ";", "}" ]
Construct a Beacon from a Bluetooth LE packet collected by Android's Bluetooth APIs, including the raw Bluetooth device info @param scanData The actual packet bytes @param rssi The measured signal strength of the packet @param device The Bluetooth device that was detected @return An instance of a <code>Beacon</code>
[ "Construct", "a", "Beacon", "from", "a", "Bluetooth", "LE", "packet", "collected", "by", "Android", "s", "Bluetooth", "APIs", "including", "the", "raw", "Bluetooth", "device", "info" ]
train
https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconParser.java#L417-L419
fuinorg/utils4j
src/main/java/org/fuin/utils4j/Utils4J.java
Utils4J.createHash
public static String createHash(final File file, final String algorithm) { checkNotNull("file", file); checkNotNull("algorithm", algorithm); try { try (final FileInputStream in = new FileInputStream(file)) { return createHash(in, algorithm); } ...
java
public static String createHash(final File file, final String algorithm) { checkNotNull("file", file); checkNotNull("algorithm", algorithm); try { try (final FileInputStream in = new FileInputStream(file)) { return createHash(in, algorithm); } ...
[ "public", "static", "String", "createHash", "(", "final", "File", "file", ",", "final", "String", "algorithm", ")", "{", "checkNotNull", "(", "\"file\"", ",", "file", ")", ";", "checkNotNull", "(", "\"algorithm\"", ",", "algorithm", ")", ";", "try", "{", "...
Creates a HEX encoded hash from a file. @param file File to create a hash for - Cannot be <code>null</code>. @param algorithm Hash algorithm like "MD5" or "SHA" - Cannot be <code>null</code>. @return HEX encoded hash.
[ "Creates", "a", "HEX", "encoded", "hash", "from", "a", "file", "." ]
train
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L324-L334
pugwoo/nimble-orm
src/main/java/com/pugwoo/dbhelper/DBHelperInterceptor.java
DBHelperInterceptor.beforeUpdate
public boolean beforeUpdate(List<Object> tList, String setSql, List<Object> setSqlArgs) { return true; }
java
public boolean beforeUpdate(List<Object> tList, String setSql, List<Object> setSqlArgs) { return true; }
[ "public", "boolean", "beforeUpdate", "(", "List", "<", "Object", ">", "tList", ",", "String", "setSql", ",", "List", "<", "Object", ">", "setSqlArgs", ")", "{", "return", "true", ";", "}" ]
update前执行 @param tList 更新前的对象列表 @param setSql 如果使用了updateCustom方法,传入的setSql将传入。否则该值为null @param setSqlArgs 如果使用了updateCustom方法,传入的args将传入,否则该值为null。 注意,修改此值会修改实际被设置的值,谨慎! @return 返回true继续执行,返回false中断执行并抛出NotAllowQueryException
[ "update前执行" ]
train
https://github.com/pugwoo/nimble-orm/blob/dd496f3e57029e4f22f9a2f00d18a6513ef94d08/src/main/java/com/pugwoo/dbhelper/DBHelperInterceptor.java#L70-L72
GenesysPureEngage/authentication-client-java
src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java
AuthenticationApi.signOut
public ModelApiResponse signOut(String authorization, Boolean global) throws ApiException { ApiResponse<ModelApiResponse> resp = signOutWithHttpInfo(authorization, global); return resp.getData(); }
java
public ModelApiResponse signOut(String authorization, Boolean global) throws ApiException { ApiResponse<ModelApiResponse> resp = signOutWithHttpInfo(authorization, global); return resp.getData(); }
[ "public", "ModelApiResponse", "signOut", "(", "String", "authorization", ",", "Boolean", "global", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ModelApiResponse", ">", "resp", "=", "signOutWithHttpInfo", "(", "authorization", ",", "global", ")", ";", "...
Sign-out a logged in user Sign-out the current user and invalidate either the current token or all tokens associated with the user. @param authorization The OAuth 2 bearer access token you received from [/auth/v3/oauth/token](/reference/authentication/Authentication/index.html#retrieveToken). For example: \&quot;Author...
[ "Sign", "-", "out", "a", "logged", "in", "user", "Sign", "-", "out", "the", "current", "user", "and", "invalidate", "either", "the", "current", "token", "or", "all", "tokens", "associated", "with", "the", "user", "." ]
train
https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java#L1328-L1331
alkacon/opencms-core
src/org/opencms/ugc/CmsUgcSession.java
CmsUgcSession.checkNotFinished
private void checkNotFinished() throws CmsUgcException { if (m_finished) { String message = Messages.get().container(Messages.ERR_FORM_SESSION_ALREADY_FINISHED_0).key( getCmsObject().getRequestContext().getLocale()); throw new CmsUgcException(CmsUgcConstants.ErrorCode.er...
java
private void checkNotFinished() throws CmsUgcException { if (m_finished) { String message = Messages.get().container(Messages.ERR_FORM_SESSION_ALREADY_FINISHED_0).key( getCmsObject().getRequestContext().getLocale()); throw new CmsUgcException(CmsUgcConstants.ErrorCode.er...
[ "private", "void", "checkNotFinished", "(", ")", "throws", "CmsUgcException", "{", "if", "(", "m_finished", ")", "{", "String", "message", "=", "Messages", ".", "get", "(", ")", ".", "container", "(", "Messages", ".", "ERR_FORM_SESSION_ALREADY_FINISHED_0", ")", ...
Checks that the session is not finished, and throws an exception otherwise.<p> @throws CmsUgcException if the session is finished
[ "Checks", "that", "the", "session", "is", "not", "finished", "and", "throws", "an", "exception", "otherwise", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L688-L695
saxsys/SynchronizeFX
synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/metamodel/CommandListCreator.java
CommandListCreator.commandsForDomainModel
public void commandsForDomainModel(final Object root, final CommandsForDomainModelCallback callback) { final State state = createCommandList(new WithCommandType() { @Override public void invoke(final State state) { createObservableObject(root, state); } ...
java
public void commandsForDomainModel(final Object root, final CommandsForDomainModelCallback callback) { final State state = createCommandList(new WithCommandType() { @Override public void invoke(final State state) { createObservableObject(root, state); } ...
[ "public", "void", "commandsForDomainModel", "(", "final", "Object", "root", ",", "final", "CommandsForDomainModelCallback", "callback", ")", "{", "final", "State", "state", "=", "createCommandList", "(", "new", "WithCommandType", "(", ")", "{", "@", "Override", "p...
@see MetaModel#commandsForDomainModel() @param root The root object of the domain model. @param callback The callback that takes the commands necessary to rebuild the domain model at it's current state.
[ "@see", "MetaModel#commandsForDomainModel", "()" ]
train
https://github.com/saxsys/SynchronizeFX/blob/f3683020e4749110b38514eb5bc73a247998b579/synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/metamodel/CommandListCreator.java#L98-L112
apache/flink
flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/InterpreterUtils.java
InterpreterUtils.initAndExecPythonScript
public static void initAndExecPythonScript(PythonEnvironmentFactory factory, java.nio.file.Path scriptDirectory, String scriptName, String[] args) { String[] fullArgs = new String[args.length + 1]; fullArgs[0] = scriptDirectory.resolve(scriptName).toString(); System.arraycopy(args, 0, fullArgs, 1, args.length); ...
java
public static void initAndExecPythonScript(PythonEnvironmentFactory factory, java.nio.file.Path scriptDirectory, String scriptName, String[] args) { String[] fullArgs = new String[args.length + 1]; fullArgs[0] = scriptDirectory.resolve(scriptName).toString(); System.arraycopy(args, 0, fullArgs, 1, args.length); ...
[ "public", "static", "void", "initAndExecPythonScript", "(", "PythonEnvironmentFactory", "factory", ",", "java", ".", "nio", ".", "file", ".", "Path", "scriptDirectory", ",", "String", "scriptName", ",", "String", "[", "]", "args", ")", "{", "String", "[", "]",...
Initializes the Jython interpreter and executes a python script. @param factory environment factory @param scriptDirectory the directory containing all required user python scripts @param scriptName the name of the main python script @param args Command line arguments that will be delivered to the executed python scri...
[ "Initializes", "the", "Jython", "interpreter", "and", "executes", "a", "python", "script", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/InterpreterUtils.java#L105-L114
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/filter/CompareFileFilter.java
CompareFileFilter.init
public void init(Record record, String fieldNameToCheck, String strToCompare, String strSeekSign, Converter pconvFlag, boolean bDontFilterIfNullCompare, BaseField fldToCheck, BaseField fldToCompare) { super.init(record); this.setMasterSlaveFlag(FileListener.RUN_IN_SLAVE); // This runs on the slave...
java
public void init(Record record, String fieldNameToCheck, String strToCompare, String strSeekSign, Converter pconvFlag, boolean bDontFilterIfNullCompare, BaseField fldToCheck, BaseField fldToCompare) { super.init(record); this.setMasterSlaveFlag(FileListener.RUN_IN_SLAVE); // This runs on the slave...
[ "public", "void", "init", "(", "Record", "record", ",", "String", "fieldNameToCheck", ",", "String", "strToCompare", ",", "String", "strSeekSign", ",", "Converter", "pconvFlag", ",", "boolean", "bDontFilterIfNullCompare", ",", "BaseField", "fldToCheck", ",", "BaseFi...
Constructor. @param fsToCheck The field sequence in this record to compare (see m_fldToCheck). @param fldToCheck The field in this record to compare. @param szstrSeekSign The comparison sign. @param pconvFlag If this field is non-null and the state is false, don't do this comparison. @param pfldToCompare The field to c...
[ "Constructor", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/filter/CompareFileFilter.java#L144-L159
zaproxy/zaproxy
src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java
HttpSessionsSite.renameHttpSession
public boolean renameHttpSession(String oldName, String newName) { // Check new name validity if (newName == null || newName.isEmpty()) { log.warn("Trying to rename session from " + oldName + " illegal name: " + newName); return false; } // Check existing old name HttpSession session = getHttpSession(o...
java
public boolean renameHttpSession(String oldName, String newName) { // Check new name validity if (newName == null || newName.isEmpty()) { log.warn("Trying to rename session from " + oldName + " illegal name: " + newName); return false; } // Check existing old name HttpSession session = getHttpSession(o...
[ "public", "boolean", "renameHttpSession", "(", "String", "oldName", ",", "String", "newName", ")", "{", "// Check new name validity", "if", "(", "newName", "==", "null", "||", "newName", ".", "isEmpty", "(", ")", ")", "{", "log", ".", "warn", "(", "\"Trying ...
Renames a http session, making sure the new name is unique for the site. @param oldName the old name @param newName the new name @return true, if successful
[ "Renames", "a", "http", "session", "making", "sure", "the", "new", "name", "is", "unique", "for", "the", "site", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsSite.java#L615-L639
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java
HeaderAndFooterGridView.getNumColumnsCompatible
protected final int getNumColumnsCompatible() { try { Field numColumns = GridView.class.getDeclaredField("mNumColumns"); numColumns.setAccessible(true); return numColumns.getInt(this); } catch (Exception e) { throw new RuntimeException("Unable to retrieve ...
java
protected final int getNumColumnsCompatible() { try { Field numColumns = GridView.class.getDeclaredField("mNumColumns"); numColumns.setAccessible(true); return numColumns.getInt(this); } catch (Exception e) { throw new RuntimeException("Unable to retrieve ...
[ "protected", "final", "int", "getNumColumnsCompatible", "(", ")", "{", "try", "{", "Field", "numColumns", "=", "GridView", ".", "class", ".", "getDeclaredField", "(", "\"mNumColumns\"", ")", ";", "numColumns", ".", "setAccessible", "(", "true", ")", ";", "retu...
Returns the number of the grid view's columns by either using the <code>getNumColumns</code>-method on devices with API level 11 or greater, or via reflection on older devices. @return The number of the grid view's columns as an {@link Integer} value or {@link #AUTO_FIT}, if the layout is pending
[ "Returns", "the", "number", "of", "the", "grid", "view", "s", "columns", "by", "either", "using", "the", "<code", ">", "getNumColumns<", "/", "code", ">", "-", "method", "on", "devices", "with", "API", "level", "11", "or", "greater", "or", "via", "reflec...
train
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java#L436-L444
intellimate/Izou
src/main/java/org/intellimate/izou/events/EventDistributor.java
EventDistributor.unregisterEventListener
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void unregisterEventListener(EventModel<EventModel> event, EventListenerModel eventListener) throws IllegalArgumentException { for (String id : event.getAllInformations()) { ArrayList<EventListenerModel> listenersList = ...
java
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void unregisterEventListener(EventModel<EventModel> event, EventListenerModel eventListener) throws IllegalArgumentException { for (String id : event.getAllInformations()) { ArrayList<EventListenerModel> listenersList = ...
[ "@", "SuppressWarnings", "(", "\"SynchronizationOnLocalVariableOrMethodParameter\"", ")", "public", "void", "unregisterEventListener", "(", "EventModel", "<", "EventModel", ">", "event", ",", "EventListenerModel", "eventListener", ")", "throws", "IllegalArgumentException", "{...
unregister an EventListener It will unregister for all Descriptors individually! It will also ignore if this listener is not listening to an Event. Method is thread-safe. @param event the Event to stop listen to @param eventListener the ActivatorEventListener used to listen for events @throws IllegalArgumentException...
[ "unregister", "an", "EventListener" ]
train
https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/events/EventDistributor.java#L158-L169
symphonyoss/messageml-utils
src/main/java/org/symphonyoss/symphony/messageml/util/IndentedPrintStream.java
IndentedPrintStream.printAlignedBlock
private void printAlignedBlock(String separator, String terminator) { if (alignedBlock != null) { alignedBlock.print(separator, terminator); alignedBlock = null; } }
java
private void printAlignedBlock(String separator, String terminator) { if (alignedBlock != null) { alignedBlock.print(separator, terminator); alignedBlock = null; } }
[ "private", "void", "printAlignedBlock", "(", "String", "separator", ",", "String", "terminator", ")", "{", "if", "(", "alignedBlock", "!=", "null", ")", "{", "alignedBlock", ".", "print", "(", "separator", ",", "terminator", ")", ";", "alignedBlock", "=", "n...
Prints the alignedblock, with all strings aligned in columns dependent on the order in which they were declared in Align @param separator text added to the end of each line except the last line @param terminator text added to the end of the last line of the block
[ "Prints", "the", "alignedblock", "with", "all", "strings", "aligned", "in", "columns", "dependent", "on", "the", "order", "in", "which", "they", "were", "declared", "in", "Align" ]
train
https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/IndentedPrintStream.java#L76-L81
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java
Hierarchy.findXField
public static @CheckForNull XField findXField(FieldInstruction fins, @Nonnull ConstantPoolGen cpg) { String className = fins.getClassName(cpg); String fieldName = fins.getFieldName(cpg); String fieldSig = fins.getSignature(cpg); boolean isStatic = (fins.getOpcode() == Const.GETSTATIC |...
java
public static @CheckForNull XField findXField(FieldInstruction fins, @Nonnull ConstantPoolGen cpg) { String className = fins.getClassName(cpg); String fieldName = fins.getFieldName(cpg); String fieldSig = fins.getSignature(cpg); boolean isStatic = (fins.getOpcode() == Const.GETSTATIC |...
[ "public", "static", "@", "CheckForNull", "XField", "findXField", "(", "FieldInstruction", "fins", ",", "@", "Nonnull", "ConstantPoolGen", "cpg", ")", "{", "String", "className", "=", "fins", ".", "getClassName", "(", "cpg", ")", ";", "String", "fieldName", "="...
Look up the field referenced by given FieldInstruction, returning it as an {@link XField XField} object. @param fins the FieldInstruction @param cpg the ConstantPoolGen used by the class containing the instruction @return an XField object representing the field, or null if no such field could be found
[ "Look", "up", "the", "field", "referenced", "by", "given", "FieldInstruction", "returning", "it", "as", "an", "{", "@link", "XField", "XField", "}", "object", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L941-L957
google/j2objc
jre_emul/android/frameworks/base/core/java/android/util/Log.java
Log.isLoggable
public static boolean isLoggable(String tag, int level) { Integer minimumLevel = tagLevels.get(tag); if (minimumLevel != null) { return level > minimumLevel.intValue(); } return true; // Let java.util.logging filter it. }
java
public static boolean isLoggable(String tag, int level) { Integer minimumLevel = tagLevels.get(tag); if (minimumLevel != null) { return level > minimumLevel.intValue(); } return true; // Let java.util.logging filter it. }
[ "public", "static", "boolean", "isLoggable", "(", "String", "tag", ",", "int", "level", ")", "{", "Integer", "minimumLevel", "=", "tagLevels", ".", "get", "(", "tag", ")", ";", "if", "(", "minimumLevel", "!=", "null", ")", "{", "return", "level", ">", ...
Checks to see whether or not a log for the specified tag is loggable at the specified level. The default level of any tag is set to INFO. This means that any level above and including INFO will be logged. Before you make any calls to a logging method you should check to see if your tag should be logged. You can change...
[ "Checks", "to", "see", "whether", "or", "not", "a", "log", "for", "the", "specified", "tag", "is", "loggable", "at", "the", "specified", "level", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/Log.java#L258-L264
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java
SimpleRandomSampling.randomSampling
public static FlatDataCollection randomSampling(FlatDataList idList, int n, boolean withReplacement) { FlatDataList sampledIds = new FlatDataList(); int populationN = idList.size(); for(int i=0;i<n;) { if(withReplacement==false && populationN<=n) { /...
java
public static FlatDataCollection randomSampling(FlatDataList idList, int n, boolean withReplacement) { FlatDataList sampledIds = new FlatDataList(); int populationN = idList.size(); for(int i=0;i<n;) { if(withReplacement==false && populationN<=n) { /...
[ "public", "static", "FlatDataCollection", "randomSampling", "(", "FlatDataList", "idList", ",", "int", "n", ",", "boolean", "withReplacement", ")", "{", "FlatDataList", "sampledIds", "=", "new", "FlatDataList", "(", ")", ";", "int", "populationN", "=", "idList", ...
Samples n ids by using SimpleRandomSampling (Simple Random Sampling). @param idList @param n @param withReplacement @return
[ "Samples", "n", "ids", "by", "using", "SimpleRandomSampling", "(", "Simple", "Random", "Sampling", ")", "." ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java#L84-L110
janus-project/guava.janusproject.io
guava/src/com/google/common/base/Objects.java
Objects.firstNonNull
@Deprecated public static <T> T firstNonNull(@Nullable T first, @Nullable T second) { return MoreObjects.firstNonNull(first, second); }
java
@Deprecated public static <T> T firstNonNull(@Nullable T first, @Nullable T second) { return MoreObjects.firstNonNull(first, second); }
[ "@", "Deprecated", "public", "static", "<", "T", ">", "T", "firstNonNull", "(", "@", "Nullable", "T", "first", ",", "@", "Nullable", "T", "second", ")", "{", "return", "MoreObjects", ".", "firstNonNull", "(", "first", ",", "second", ")", ";", "}" ]
Returns the first of two given parameters that is not {@code null}, if either is, or otherwise throws a {@link NullPointerException}. <p><b>Note:</b> if {@code first} is represented as an {@link Optional}, this can be accomplished with {@linkplain Optional#or(Object) first.or(second)}. That approach also allows for la...
[ "Returns", "the", "first", "of", "two", "given", "parameters", "that", "is", "not", "{", "@code", "null", "}", "if", "either", "is", "or", "otherwise", "throws", "a", "{", "@link", "NullPointerException", "}", "." ]
train
https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/base/Objects.java#L184-L187
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/OffsetTime.java
OffsetTime.ofInstant
public static OffsetTime ofInstant(Instant instant, ZoneId zone) { Objects.requireNonNull(instant, "instant"); Objects.requireNonNull(zone, "zone"); ZoneRules rules = zone.getRules(); ZoneOffset offset = rules.getOffset(instant); long localSecond = instant.getEpochSecond() + offs...
java
public static OffsetTime ofInstant(Instant instant, ZoneId zone) { Objects.requireNonNull(instant, "instant"); Objects.requireNonNull(zone, "zone"); ZoneRules rules = zone.getRules(); ZoneOffset offset = rules.getOffset(instant); long localSecond = instant.getEpochSecond() + offs...
[ "public", "static", "OffsetTime", "ofInstant", "(", "Instant", "instant", ",", "ZoneId", "zone", ")", "{", "Objects", ".", "requireNonNull", "(", "instant", ",", "\"instant\"", ")", ";", "Objects", ".", "requireNonNull", "(", "zone", ",", "\"zone\"", ")", ";...
Obtains an instance of {@code OffsetTime} from an {@code Instant} and zone ID. <p> This creates an offset time with the same instant as that specified. Finding the offset from UTC/Greenwich is simple as there is only one valid offset for each instant. <p> The date component of the instant is dropped during the conversi...
[ "Obtains", "an", "instance", "of", "{", "@code", "OffsetTime", "}", "from", "an", "{", "@code", "Instant", "}", "and", "zone", "ID", ".", "<p", ">", "This", "creates", "an", "offset", "time", "with", "the", "same", "instant", "as", "that", "specified", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/OffsetTime.java#L249-L258
VoltDB/voltdb
src/frontend/org/voltdb/StatsProcProfTable.java
StatsProcProfTable.compareByAvg
public int compareByAvg(ProcProfRow lhs, ProcProfRow rhs) { if (lhs.avg * lhs.invocations > rhs.avg * rhs.invocations) { return 1; } else if (lhs.avg * lhs.invocations < rhs.avg * rhs.invocations) { return -1; } else { return 0; } }
java
public int compareByAvg(ProcProfRow lhs, ProcProfRow rhs) { if (lhs.avg * lhs.invocations > rhs.avg * rhs.invocations) { return 1; } else if (lhs.avg * lhs.invocations < rhs.avg * rhs.invocations) { return -1; } else { return 0; } }
[ "public", "int", "compareByAvg", "(", "ProcProfRow", "lhs", ",", "ProcProfRow", "rhs", ")", "{", "if", "(", "lhs", ".", "avg", "*", "lhs", ".", "invocations", ">", "rhs", ".", "avg", "*", "rhs", ".", "invocations", ")", "{", "return", "1", ";", "}", ...
Sort by average, weighting the sampled average by the real invocation count.
[ "Sort", "by", "average", "weighting", "the", "sampled", "average", "by", "the", "real", "invocation", "count", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StatsProcProfTable.java#L169-L178
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java
Form.renderNameAndId
private String renderNameAndId(HttpServletRequest request, String id) { // if id is not set then we need to exit if (id == null) return null; // Legacy Java Script support -- This writes out a single table with both the id and names // mixed. This is legacy support to m...
java
private String renderNameAndId(HttpServletRequest request, String id) { // if id is not set then we need to exit if (id == null) return null; // Legacy Java Script support -- This writes out a single table with both the id and names // mixed. This is legacy support to m...
[ "private", "String", "renderNameAndId", "(", "HttpServletRequest", "request", ",", "String", "id", ")", "{", "// if id is not set then we need to exit", "if", "(", "id", "==", "null", ")", "return", "null", ";", "// Legacy Java Script support -- This writes out a single tab...
This mehtod will render the JavaScript associated with the id lookup if id has been set. @param request @param id @return
[ "This", "mehtod", "will", "render", "the", "JavaScript", "associated", "with", "the", "id", "lookup", "if", "id", "has", "been", "set", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Form.java#L826-L854
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/util/PropertiesBasedServerSetupBuilder.java
PropertiesBasedServerSetupBuilder.build
public ServerSetup[] build(Properties properties) { List<ServerSetup> serverSetups = new ArrayList<>(); String hostname = properties.getProperty("greenmail.hostname", ServerSetup.getLocalHostAddress()); long serverStartupTimeout = Long.parseLong(properties.getProperty("greenmail...
java
public ServerSetup[] build(Properties properties) { List<ServerSetup> serverSetups = new ArrayList<>(); String hostname = properties.getProperty("greenmail.hostname", ServerSetup.getLocalHostAddress()); long serverStartupTimeout = Long.parseLong(properties.getProperty("greenmail...
[ "public", "ServerSetup", "[", "]", "build", "(", "Properties", "properties", ")", "{", "List", "<", "ServerSetup", ">", "serverSetups", "=", "new", "ArrayList", "<>", "(", ")", ";", "String", "hostname", "=", "properties", ".", "getProperty", "(", "\"greenma...
Creates a server setup based on provided properties. @param properties the properties. @return the server setup, or an empty array.
[ "Creates", "a", "server", "setup", "based", "on", "provided", "properties", "." ]
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/PropertiesBasedServerSetupBuilder.java#L58-L86
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/map/store/DefaultRasterLayerStore.java
DefaultRasterLayerStore.getOrientedJDiff
private int getOrientedJDiff(RasterTile tile1, RasterTile tile2) { double dy = tile2.getBounds().getY() - tile1.getBounds().getY(); int dj = tile2.getCode().getY() - tile1.getCode().getY(); return (dj * dy) > 0 ? dj : -dj; }
java
private int getOrientedJDiff(RasterTile tile1, RasterTile tile2) { double dy = tile2.getBounds().getY() - tile1.getBounds().getY(); int dj = tile2.getCode().getY() - tile1.getCode().getY(); return (dj * dy) > 0 ? dj : -dj; }
[ "private", "int", "getOrientedJDiff", "(", "RasterTile", "tile1", ",", "RasterTile", "tile2", ")", "{", "double", "dy", "=", "tile2", ".", "getBounds", "(", ")", ".", "getY", "(", ")", "-", "tile1", ".", "getBounds", "(", ")", ".", "getY", "(", ")", ...
Returns the difference in j index, taking orientation of y-axis into account. Some layers (WMS 1.8.0) have different j-index orientation than screen coordinates (lower-left = (0,0) vs upper-left = (0,0)). @param tile1 tile @param tile2 tile @return +/-(j2-j1)
[ "Returns", "the", "difference", "in", "j", "index", "taking", "orientation", "of", "y", "-", "axis", "into", "account", ".", "Some", "layers", "(", "WMS", "1", ".", "8", ".", "0", ")", "have", "different", "j", "-", "index", "orientation", "than", "scr...
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/store/DefaultRasterLayerStore.java#L177-L181
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/Record.java
Record.addSortParams
public String addSortParams(boolean bIncludeFileName, boolean bForceUniqueKey) { String strSort = DBConstants.BLANK; KeyArea keyArea = this.getKeyArea(-1); if (keyArea != null) // Leave orderby blank if no index specified strSort = keyArea.addSortParams(bIncludeFileName, b...
java
public String addSortParams(boolean bIncludeFileName, boolean bForceUniqueKey) { String strSort = DBConstants.BLANK; KeyArea keyArea = this.getKeyArea(-1); if (keyArea != null) // Leave orderby blank if no index specified strSort = keyArea.addSortParams(bIncludeFileName, b...
[ "public", "String", "addSortParams", "(", "boolean", "bIncludeFileName", ",", "boolean", "bForceUniqueKey", ")", "{", "String", "strSort", "=", "DBConstants", ".", "BLANK", ";", "KeyArea", "keyArea", "=", "this", ".", "getKeyArea", "(", "-", "1", ")", ";", "...
Setup the SQL Sort String. (ie., (ORDER BY) 'AgencyName, AgencyNo'). @param bIncludeFileName If true, include the filename with the fieldname in the string. @param bForceUniqueKey If params must be unique, if they aren't, add the unique key to the end. @return The SQL sort string. @see KeyArea
[ "Setup", "the", "SQL", "Sort", "String", ".", "(", "ie", ".", "(", "ORDER", "BY", ")", "AgencyName", "AgencyNo", ")", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1329-L1336
undertow-io/undertow
core/src/main/java/io/undertow/Handlers.java
Handlers.virtualHost
public static NameVirtualHostHandler virtualHost(final HttpHandler defaultHandler, final HttpHandler hostHandler, String... hostnames) { return virtualHost(hostHandler, hostnames).setDefaultHandler(defaultHandler); }
java
public static NameVirtualHostHandler virtualHost(final HttpHandler defaultHandler, final HttpHandler hostHandler, String... hostnames) { return virtualHost(hostHandler, hostnames).setDefaultHandler(defaultHandler); }
[ "public", "static", "NameVirtualHostHandler", "virtualHost", "(", "final", "HttpHandler", "defaultHandler", ",", "final", "HttpHandler", "hostHandler", ",", "String", "...", "hostnames", ")", "{", "return", "virtualHost", "(", "hostHandler", ",", "hostnames", ")", "...
Creates a new virtual host handler that uses the provided handler as the root handler for the given hostnames. @param defaultHandler The default handler @param hostHandler The host handler @param hostnames The host names @return A new virtual host handler
[ "Creates", "a", "new", "virtual", "host", "handler", "that", "uses", "the", "provided", "handler", "as", "the", "root", "handler", "for", "the", "given", "hostnames", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/Handlers.java#L167-L169
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java
ListManagementTermsImpl.getAllTermsAsync
public Observable<Terms> getAllTermsAsync(String listId, String language, GetAllTermsOptionalParameter getAllTermsOptionalParameter) { return getAllTermsWithServiceResponseAsync(listId, language, getAllTermsOptionalParameter).map(new Func1<ServiceResponse<Terms>, Terms>() { @Override pub...
java
public Observable<Terms> getAllTermsAsync(String listId, String language, GetAllTermsOptionalParameter getAllTermsOptionalParameter) { return getAllTermsWithServiceResponseAsync(listId, language, getAllTermsOptionalParameter).map(new Func1<ServiceResponse<Terms>, Terms>() { @Override pub...
[ "public", "Observable", "<", "Terms", ">", "getAllTermsAsync", "(", "String", "listId", ",", "String", "language", ",", "GetAllTermsOptionalParameter", "getAllTermsOptionalParameter", ")", "{", "return", "getAllTermsWithServiceResponseAsync", "(", "listId", ",", "language...
Gets all terms from the list with list Id equal to the list Id passed. @param listId List Id of the image list. @param language Language of the terms. @param getAllTermsOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if paramet...
[ "Gets", "all", "terms", "from", "the", "list", "with", "list", "Id", "equal", "to", "the", "list", "Id", "passed", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java#L299-L306
Steveice10/OpenNBT
src/main/java/com/github/steveice10/opennbt/tag/TagRegistry.java
TagRegistry.createInstance
public static Tag createInstance(int id, String tagName) throws TagCreateException { Class<? extends Tag> clazz = idToTag.get(id); if(clazz == null) { throw new TagCreateException("Could not find tag with ID \"" + id + "\"."); } try { Constructor<? extends Tag> c...
java
public static Tag createInstance(int id, String tagName) throws TagCreateException { Class<? extends Tag> clazz = idToTag.get(id); if(clazz == null) { throw new TagCreateException("Could not find tag with ID \"" + id + "\"."); } try { Constructor<? extends Tag> c...
[ "public", "static", "Tag", "createInstance", "(", "int", "id", ",", "String", "tagName", ")", "throws", "TagCreateException", "{", "Class", "<", "?", "extends", "Tag", ">", "clazz", "=", "idToTag", ".", "get", "(", "id", ")", ";", "if", "(", "clazz", "...
Creates an instance of the tag with the given id, using the String constructor. @param id Id of the tag. @param tagName Name to give the tag. @return The created tag. @throws TagCreateException If an error occurs while creating the tag.
[ "Creates", "an", "instance", "of", "the", "tag", "with", "the", "given", "id", "using", "the", "String", "constructor", "." ]
train
https://github.com/Steveice10/OpenNBT/blob/9bf4adb2afd206a21bc4309c85d642494d1fb536/src/main/java/com/github/steveice10/opennbt/tag/TagRegistry.java#L116-L129
Baidu-AIP/java-sdk
src/main/java/com/baidu/aip/nlp/AipNlp.java
AipNlp.simnet
public JSONObject simnet(String text1, String text2, HashMap<String, Object> options) { AipRequest request = new AipRequest(); preOperation(request); request.addBody("text_1", text1); request.addBody("text_2", text2); if (options != null) { ...
java
public JSONObject simnet(String text1, String text2, HashMap<String, Object> options) { AipRequest request = new AipRequest(); preOperation(request); request.addBody("text_1", text1); request.addBody("text_2", text2); if (options != null) { ...
[ "public", "JSONObject", "simnet", "(", "String", "text1", ",", "String", "text2", ",", "HashMap", "<", "String", ",", "Object", ">", "options", ")", "{", "AipRequest", "request", "=", "new", "AipRequest", "(", ")", ";", "preOperation", "(", "request", ")",...
短文本相似度接口 短文本相似度接口用来判断两个文本的相似度得分。 @param text1 - 待比较文本1(GBK编码),最大512字节* @param text2 - 待比较文本2(GBK编码),最大512字节 @param options - 可选参数对象,key: value都为string类型 options - options列表: model 默认为"BOW",可选"BOW"、"CNN"与"GRNN" @return JSONObject
[ "短文本相似度接口", "短文本相似度接口用来判断两个文本的相似度得分。" ]
train
https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/nlp/AipNlp.java#L204-L221
google/closure-templates
java/src/com/google/template/soy/jbcsrc/restricted/Expression.java
Expression.invokeVoid
public Statement invokeVoid(MethodRef method, Expression... args) { return method.invokeVoid(ImmutableList.<Expression>builder().add(this).add(args).build()); }
java
public Statement invokeVoid(MethodRef method, Expression... args) { return method.invokeVoid(ImmutableList.<Expression>builder().add(this).add(args).build()); }
[ "public", "Statement", "invokeVoid", "(", "MethodRef", "method", ",", "Expression", "...", "args", ")", "{", "return", "method", ".", "invokeVoid", "(", "ImmutableList", ".", "<", "Expression", ">", "builder", "(", ")", ".", "add", "(", "this", ")", ".", ...
A simple helper that calls through to {@link MethodRef#invokeVoid(Expression...)}, but allows a more natural fluent call style.
[ "A", "simple", "helper", "that", "calls", "through", "to", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/Expression.java#L392-L394
geomajas/geomajas-project-client-gwt
common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java
HtmlBuilder.tagClass
public static String tagClass(String tag, String clazz, String... content) { return openTagClass(tag, clazz, content) + closeTag(tag); }
java
public static String tagClass(String tag, String clazz, String... content) { return openTagClass(tag, clazz, content) + closeTag(tag); }
[ "public", "static", "String", "tagClass", "(", "String", "tag", ",", "String", "clazz", ",", "String", "...", "content", ")", "{", "return", "openTagClass", "(", "tag", ",", "clazz", ",", "content", ")", "+", "closeTag", "(", "tag", ")", ";", "}" ]
Build a String containing a HTML opening tag with given CSS class, content and closing tag. Content should contain no HTML, because it is prepared with {@link #htmlEncode(String)}. @param tag String name of HTML tag @param clazz CSS class of the tag @param content content string @return HTML tag element as string
[ "Build", "a", "String", "containing", "a", "HTML", "opening", "tag", "with", "given", "CSS", "class", "content", "and", "closing", "tag", ".", "Content", "should", "contain", "no", "HTML", "because", "it", "is", "prepared", "with", "{", "@link", "#htmlEncode...
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L301-L303
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/workspace/VoiceApi.java
VoiceApi.setAgentNotReady
public void setAgentNotReady( String workMode, String reasonCode, KeyValueCollection reasons, KeyValueCollection extensions ) throws WorkspaceApiException { try { NotReadyData data = new NotReadyData(); VoicenotreadyData notRe...
java
public void setAgentNotReady( String workMode, String reasonCode, KeyValueCollection reasons, KeyValueCollection extensions ) throws WorkspaceApiException { try { NotReadyData data = new NotReadyData(); VoicenotreadyData notRe...
[ "public", "void", "setAgentNotReady", "(", "String", "workMode", ",", "String", "reasonCode", ",", "KeyValueCollection", "reasons", ",", "KeyValueCollection", "extensions", ")", "throws", "WorkspaceApiException", "{", "try", "{", "NotReadyData", "data", "=", "new", ...
Set the current agent's state to NotReady on the voice channel. @param workMode The agent workmode. Possible values are `AfterCallWork`, `AuxWork`, `LegalGuard`, `NoCallDisconnect`, `WalkAway`. (optional) @param reasonCode The reason code representing why the agent is not ready. These codes are a business-defined set o...
[ "Set", "the", "current", "agent", "s", "state", "to", "NotReady", "on", "the", "voice", "channel", "." ]
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L359-L384
Jasig/uPortal
uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java
AuthorizationImpl.primGetPermissionsForPrincipal
private IPermission[] primGetPermissionsForPrincipal(IAuthorizationPrincipal principal) throws AuthorizationException { if (!this.cachePermissions) { return getUncachedPermissionsForPrincipal(principal, null, null, null); } IPermissionSet ps = null; // Check the ...
java
private IPermission[] primGetPermissionsForPrincipal(IAuthorizationPrincipal principal) throws AuthorizationException { if (!this.cachePermissions) { return getUncachedPermissionsForPrincipal(principal, null, null, null); } IPermissionSet ps = null; // Check the ...
[ "private", "IPermission", "[", "]", "primGetPermissionsForPrincipal", "(", "IAuthorizationPrincipal", "principal", ")", "throws", "AuthorizationException", "{", "if", "(", "!", "this", ".", "cachePermissions", ")", "{", "return", "getUncachedPermissionsForPrincipal", "(",...
Returns permissions for a principal. First check the entity caching service, and if the permissions have not been cached, retrieve and cache them. @return IPermission[] @param principal org.apereo.portal.security.IAuthorizationPrincipal
[ "Returns", "permissions", "for", "a", "principal", ".", "First", "check", "the", "entity", "caching", "service", "and", "if", "the", "permissions", "have", "not", "been", "cached", "retrieve", "and", "cache", "them", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L974-L995
allure-framework/allure1
allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java
AllureResultsUtils.setPropertySafely
public static void setPropertySafely(Marshaller marshaller, String name, Object value) { try { marshaller.setProperty(name, value); } catch (PropertyException e) { LOGGER.warn(String.format("Can't set \"%s\" property to given marshaller", name), e); } }
java
public static void setPropertySafely(Marshaller marshaller, String name, Object value) { try { marshaller.setProperty(name, value); } catch (PropertyException e) { LOGGER.warn(String.format("Can't set \"%s\" property to given marshaller", name), e); } }
[ "public", "static", "void", "setPropertySafely", "(", "Marshaller", "marshaller", ",", "String", "name", ",", "Object", "value", ")", "{", "try", "{", "marshaller", ".", "setProperty", "(", "name", ",", "value", ")", ";", "}", "catch", "(", "PropertyExceptio...
Try to set specified property to given marshaller @param marshaller specified marshaller @param name name of property to set @param value value of property to set
[ "Try", "to", "set", "specified", "property", "to", "given", "marshaller" ]
train
https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java#L194-L200
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
DependencyBundlingAnalyzer.cpeIdentifiersMatch
private boolean cpeIdentifiersMatch(Dependency dependency1, Dependency dependency2) { if (dependency1 == null || dependency1.getVulnerableSoftwareIdentifiers() == null || dependency2 == null || dependency2.getVulnerableSoftwareIdentifiers() == null) { return false; } ...
java
private boolean cpeIdentifiersMatch(Dependency dependency1, Dependency dependency2) { if (dependency1 == null || dependency1.getVulnerableSoftwareIdentifiers() == null || dependency2 == null || dependency2.getVulnerableSoftwareIdentifiers() == null) { return false; } ...
[ "private", "boolean", "cpeIdentifiersMatch", "(", "Dependency", "dependency1", ",", "Dependency", "dependency2", ")", "{", "if", "(", "dependency1", "==", "null", "||", "dependency1", ".", "getVulnerableSoftwareIdentifiers", "(", ")", "==", "null", "||", "dependency...
Returns true if the CPE identifiers in the two supplied dependencies are equal. @param dependency1 a dependency2 to compare @param dependency2 a dependency2 to compare @return true if the identifiers in the two supplied dependencies are equal
[ "Returns", "true", "if", "the", "CPE", "identifiers", "in", "the", "two", "supplied", "dependencies", "are", "equal", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L258-L276
JCTools/JCTools
jctools-core/src/main/java/org/jctools/queues/atomic/BaseSpscLinkedAtomicArrayQueue.java
BaseSpscLinkedAtomicArrayQueue.poll
@SuppressWarnings("unchecked") @Override public E poll() { // local load of field to avoid repeated loads after volatile reads final AtomicReferenceArray<E> buffer = consumerBuffer; final long index = lpConsumerIndex(); final long mask = consumerMask; final int offset = c...
java
@SuppressWarnings("unchecked") @Override public E poll() { // local load of field to avoid repeated loads after volatile reads final AtomicReferenceArray<E> buffer = consumerBuffer; final long index = lpConsumerIndex(); final long mask = consumerMask; final int offset = c...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "E", "poll", "(", ")", "{", "// local load of field to avoid repeated loads after volatile reads", "final", "AtomicReferenceArray", "<", "E", ">", "buffer", "=", "consumerBuffer", ";", "final...
{@inheritDoc} <p> This implementation is correct for single consumer thread use only.
[ "{" ]
train
https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-core/src/main/java/org/jctools/queues/atomic/BaseSpscLinkedAtomicArrayQueue.java#L289-L309
kiegroup/drools
drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationUtils.java
TypeDeclarationUtils.toBuildableType
public static String toBuildableType(String className, ClassLoader loader) { int arrayDim = BuildUtils.externalArrayDimSize(className); String prefix = ""; String coreType = arrayDim == 0 ? className : className.substring(0, className.indexOf("[")); coreType = typeName2ClassName(coreTyp...
java
public static String toBuildableType(String className, ClassLoader loader) { int arrayDim = BuildUtils.externalArrayDimSize(className); String prefix = ""; String coreType = arrayDim == 0 ? className : className.substring(0, className.indexOf("[")); coreType = typeName2ClassName(coreTyp...
[ "public", "static", "String", "toBuildableType", "(", "String", "className", ",", "ClassLoader", "loader", ")", "{", "int", "arrayDim", "=", "BuildUtils", ".", "externalArrayDimSize", "(", "className", ")", ";", "String", "prefix", "=", "\"\"", ";", "String", ...
not the cleanest logic, but this is what the builders expect downstream
[ "not", "the", "cleanest", "logic", "but", "this", "is", "what", "the", "builders", "expect", "downstream" ]
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationUtils.java#L273-L290
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/util/Memory.java
Memory.getBytes
public void getBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count) { if (buffer == null) throw new NullPointerException(); else if (bufferOffset < 0 || count < 0 || count > buffer.length - bufferOffset) throw new IndexOutOfBoundsException(); else if (...
java
public void getBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count) { if (buffer == null) throw new NullPointerException(); else if (bufferOffset < 0 || count < 0 || count > buffer.length - bufferOffset) throw new IndexOutOfBoundsException(); else if (...
[ "public", "void", "getBytes", "(", "long", "memoryOffset", ",", "byte", "[", "]", "buffer", ",", "int", "bufferOffset", ",", "int", "count", ")", "{", "if", "(", "buffer", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "else", ...
Transfers count bytes from Memory starting at memoryOffset to buffer starting at bufferOffset @param memoryOffset start offset in the memory @param buffer the data buffer @param bufferOffset start offset of the buffer @param count number of bytes to transfer
[ "Transfers", "count", "bytes", "from", "Memory", "starting", "at", "memoryOffset", "to", "buffer", "starting", "at", "bufferOffset" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/util/Memory.java#L311-L322
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_binding.java
lbvserver_binding.get
public static lbvserver_binding get(nitro_service service, String name) throws Exception{ lbvserver_binding obj = new lbvserver_binding(); obj.set_name(name); lbvserver_binding response = (lbvserver_binding) obj.get_resource(service); return response; }
java
public static lbvserver_binding get(nitro_service service, String name) throws Exception{ lbvserver_binding obj = new lbvserver_binding(); obj.set_name(name); lbvserver_binding response = (lbvserver_binding) obj.get_resource(service); return response; }
[ "public", "static", "lbvserver_binding", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "lbvserver_binding", "obj", "=", "new", "lbvserver_binding", "(", ")", ";", "obj", ".", "set_name", "(", "name", ")", ";", ...
Use this API to fetch lbvserver_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "lbvserver_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_binding.java#L345-L350
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EcKey.java
EcKey.fromJsonWebKey
public static EcKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters, Provider provider) { try { if (jwk.kid() != null) { return new EcKey(jwk.kid(), jwk.toEC(includePrivateParameters, provider)); } else { throw new IllegalArgumentException(...
java
public static EcKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters, Provider provider) { try { if (jwk.kid() != null) { return new EcKey(jwk.kid(), jwk.toEC(includePrivateParameters, provider)); } else { throw new IllegalArgumentException(...
[ "public", "static", "EcKey", "fromJsonWebKey", "(", "JsonWebKey", "jwk", ",", "boolean", "includePrivateParameters", ",", "Provider", "provider", ")", "{", "try", "{", "if", "(", "jwk", ".", "kid", "(", ")", "!=", "null", ")", "{", "return", "new", "EcKey"...
Converts JSON web key to EC key pair and include the private key if set to true. @param jwk @param includePrivateParameters true if the EC key pair should include the private key. False otherwise. @param provider the Java Security Provider @return EcKey
[ "Converts", "JSON", "web", "key", "to", "EC", "key", "pair", "and", "include", "the", "private", "key", "if", "set", "to", "true", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EcKey.java#L222-L232
JodaOrg/joda-time
src/main/java/org/joda/time/PeriodType.java
PeriodType.addIndexedField
boolean addIndexedField(ReadablePeriod period, int index, int[] values, int valueToAdd) { if (valueToAdd == 0) { return false; } int realIndex = iIndices[index]; if (realIndex == -1) { throw new UnsupportedOperationException("Field is not supported"); } ...
java
boolean addIndexedField(ReadablePeriod period, int index, int[] values, int valueToAdd) { if (valueToAdd == 0) { return false; } int realIndex = iIndices[index]; if (realIndex == -1) { throw new UnsupportedOperationException("Field is not supported"); } ...
[ "boolean", "addIndexedField", "(", "ReadablePeriod", "period", ",", "int", "index", ",", "int", "[", "]", "values", ",", "int", "valueToAdd", ")", "{", "if", "(", "valueToAdd", "==", "0", ")", "{", "return", "false", ";", "}", "int", "realIndex", "=", ...
Adds to the indexed field part of the period. @param period the period to query @param index the index to use @param values the array to populate @param valueToAdd the value to add @return true if the array is updated @throws UnsupportedOperationException if not supported
[ "Adds", "to", "the", "indexed", "field", "part", "of", "the", "period", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L706-L716
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/SubscriptionMessageHandler.java
SubscriptionMessageHandler.resetCreateSubscriptionMessage
protected void resetCreateSubscriptionMessage(MESubscription subscription, boolean isLocalBus) { if (tc.isEntryEnabled()) SibTr.entry(tc, "resetCreateSubscriptionMessage", new Object[]{subscription, new Boolean(isLocalBus)}); // Reset the state reset(); // Indicate that this is a create messag...
java
protected void resetCreateSubscriptionMessage(MESubscription subscription, boolean isLocalBus) { if (tc.isEntryEnabled()) SibTr.entry(tc, "resetCreateSubscriptionMessage", new Object[]{subscription, new Boolean(isLocalBus)}); // Reset the state reset(); // Indicate that this is a create messag...
[ "protected", "void", "resetCreateSubscriptionMessage", "(", "MESubscription", "subscription", ",", "boolean", "isLocalBus", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"resetCreateSubscriptionMessage\"", ...
Method to reset the Subscription message object and reinitialise it as a create proxy subscription message @param subscription The subscription to add to the message. @param isLocalBus The subscription is being sent to a the local bus
[ "Method", "to", "reset", "the", "Subscription", "message", "object", "and", "reinitialise", "it", "as", "a", "create", "proxy", "subscription", "message" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/SubscriptionMessageHandler.java#L172-L208
beihaifeiwu/dolphin
dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/formatter/StringHelper.java
StringHelper.partiallyUnqualify
public static String partiallyUnqualify(String name, String qualifierBase) { if (name == null || !name.startsWith(qualifierBase)) { return name; } return name.substring(qualifierBase.length() + 1); // +1 to start after the following '.' }
java
public static String partiallyUnqualify(String name, String qualifierBase) { if (name == null || !name.startsWith(qualifierBase)) { return name; } return name.substring(qualifierBase.length() + 1); // +1 to start after the following '.' }
[ "public", "static", "String", "partiallyUnqualify", "(", "String", "name", ",", "String", "qualifierBase", ")", "{", "if", "(", "name", "==", "null", "||", "!", "name", ".", "startsWith", "(", "qualifierBase", ")", ")", "{", "return", "name", ";", "}", "...
Partially unqualifies a qualified name. For example, with a base of 'org.hibernate' the name 'org.hibernate.internal.util.StringHelper' would become 'util.StringHelper'. @param name The (potentially) qualified name. @param qualifierBase The qualifier base. @return The name itself, or the partially unqualifie...
[ "Partially", "unqualifies", "a", "qualified", "name", ".", "For", "example", "with", "a", "base", "of", "org", ".", "hibernate", "the", "name", "org", ".", "hibernate", ".", "internal", ".", "util", ".", "StringHelper", "would", "become", "util", ".", "Str...
train
https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/formatter/StringHelper.java#L270-L275
apache/predictionio-sdk-java
client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java
EventClient.deleteItemAsFuture
public FutureAPIResponse deleteItemAsFuture(String iid, DateTime eventTime) throws IOException { return createEventAsFuture(new Event() .event("$delete") .entityType("item") .entityId(iid) .eventTime(eventTime)); }
java
public FutureAPIResponse deleteItemAsFuture(String iid, DateTime eventTime) throws IOException { return createEventAsFuture(new Event() .event("$delete") .entityType("item") .entityId(iid) .eventTime(eventTime)); }
[ "public", "FutureAPIResponse", "deleteItemAsFuture", "(", "String", "iid", ",", "DateTime", "eventTime", ")", "throws", "IOException", "{", "return", "createEventAsFuture", "(", "new", "Event", "(", ")", ".", "event", "(", "\"$delete\"", ")", ".", "entityType", ...
Sends a delete item request. @param iid ID of the item @param eventTime timestamp of the event
[ "Sends", "a", "delete", "item", "request", "." ]
train
https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L562-L569
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.putAt
public static void putAt(List self, List splice, List values) { if (splice.isEmpty()) { if ( ! values.isEmpty() ) throw new IllegalArgumentException("Trying to replace 0 elements with "+values.size()+" elements"); return; } Object first = splice.iterator()...
java
public static void putAt(List self, List splice, List values) { if (splice.isEmpty()) { if ( ! values.isEmpty() ) throw new IllegalArgumentException("Trying to replace 0 elements with "+values.size()+" elements"); return; } Object first = splice.iterator()...
[ "public", "static", "void", "putAt", "(", "List", "self", ",", "List", "splice", ",", "List", "values", ")", "{", "if", "(", "splice", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "!", "values", ".", "isEmpty", "(", ")", ")", "throw", "new", "I...
A helper method to allow lists to work with subscript operators. <pre class="groovyTestCase">def list = ["a", true, 42, 9.4] list[1, 4] = ["x", false] assert list == ["a", "x", 42, 9.4, false]</pre> @param self a List @param splice the subset of the list to set @param values the value to put at the given sublist @si...
[ "A", "helper", "method", "to", "allow", "lists", "to", "work", "with", "subscript", "operators", ".", "<pre", "class", "=", "groovyTestCase", ">", "def", "list", "=", "[", "a", "true", "42", "9", ".", "4", "]", "list", "[", "1", "4", "]", "=", "[",...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8081-L8098
threerings/nenya
core/src/main/java/com/threerings/miso/client/SceneObject.java
SceneObject.relocateObject
public void relocateObject (MisoSceneMetrics metrics, int tx, int ty) { // Log.info("Relocating object " + this + " to " + // StringUtil.coordsToString(tx, ty)); info.x = tx; info.y = ty; computeInfo(metrics); }
java
public void relocateObject (MisoSceneMetrics metrics, int tx, int ty) { // Log.info("Relocating object " + this + " to " + // StringUtil.coordsToString(tx, ty)); info.x = tx; info.y = ty; computeInfo(metrics); }
[ "public", "void", "relocateObject", "(", "MisoSceneMetrics", "metrics", ",", "int", "tx", ",", "int", "ty", ")", "{", "// Log.info(\"Relocating object \" + this + \" to \" +", "// StringUtil.coordsToString(tx, ty));", "info", ".", "x", "=", "tx", ";...
Updates this object's origin tile coordinate. Its bounds and other cached screen coordinate information are updated.
[ "Updates", "this", "object", "s", "origin", "tile", "coordinate", ".", "Its", "bounds", "and", "other", "cached", "screen", "coordinate", "information", "are", "updated", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneObject.java#L248-L255
jfinal/jfinal
src/main/java/com/jfinal/plugin/redis/Cache.java
Cache.pexpire
public Long pexpire(Object key, long milliseconds) { Jedis jedis = getJedis(); try { return jedis.pexpire(keyToBytes(key), milliseconds); } finally {close(jedis);} }
java
public Long pexpire(Object key, long milliseconds) { Jedis jedis = getJedis(); try { return jedis.pexpire(keyToBytes(key), milliseconds); } finally {close(jedis);} }
[ "public", "Long", "pexpire", "(", "Object", "key", ",", "long", "milliseconds", ")", "{", "Jedis", "jedis", "=", "getJedis", "(", ")", ";", "try", "{", "return", "jedis", ".", "pexpire", "(", "keyToBytes", "(", "key", ")", ",", "milliseconds", ")", ";"...
这个命令和 EXPIRE 命令的作用类似,但是它以毫秒为单位设置 key 的生存时间,而不像 EXPIRE 命令那样,以秒为单位。
[ "这个命令和", "EXPIRE", "命令的作用类似,但是它以毫秒为单位设置", "key", "的生存时间,而不像", "EXPIRE", "命令那样,以秒为单位。" ]
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L340-L346
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/ProcessorDef.java
ProcessorDef.getRebuild
public boolean getRebuild(final ProcessorDef[] defaultProviders, final int index) { if (isReference()) { return ((ProcessorDef) getCheckedRef(ProcessorDef.class, "ProcessorDef")).getRebuild(defaultProviders, index); } if (this.rebuild != null) { return this.rebuild.booleanValue(); } else { ...
java
public boolean getRebuild(final ProcessorDef[] defaultProviders, final int index) { if (isReference()) { return ((ProcessorDef) getCheckedRef(ProcessorDef.class, "ProcessorDef")).getRebuild(defaultProviders, index); } if (this.rebuild != null) { return this.rebuild.booleanValue(); } else { ...
[ "public", "boolean", "getRebuild", "(", "final", "ProcessorDef", "[", "]", "defaultProviders", ",", "final", "int", "index", ")", "{", "if", "(", "isReference", "(", ")", ")", "{", "return", "(", "(", "ProcessorDef", ")", "getCheckedRef", "(", "ProcessorDef"...
Gets a boolean value indicating whether all targets must be rebuilt regardless of dependency analysis. @param defaultProviders array of ProcessorDef's in descending priority @param index index to first element in array that should be considered @return true if all targets should be rebuilt.
[ "Gets", "a", "boolean", "value", "indicating", "whether", "all", "targets", "must", "be", "rebuilt", "regardless", "of", "dependency", "analysis", "." ]
train
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/ProcessorDef.java#L407-L419
alibaba/otter
node/etl/src/main/java/com/alibaba/otter/node/etl/transform/transformer/RowDataTransformer.java
RowDataTransformer.buildName
private void buildName(EventData data, EventData result, DataMediaPair pair) { DataMedia targetDataMedia = pair.getTarget(); DataMedia sourceDataMedia = pair.getSource(); String schemaName = buildName(data.getSchemaName(), sourceDataMedia.getNamespaceMode(), targetDataMed...
java
private void buildName(EventData data, EventData result, DataMediaPair pair) { DataMedia targetDataMedia = pair.getTarget(); DataMedia sourceDataMedia = pair.getSource(); String schemaName = buildName(data.getSchemaName(), sourceDataMedia.getNamespaceMode(), targetDataMed...
[ "private", "void", "buildName", "(", "EventData", "data", ",", "EventData", "result", ",", "DataMediaPair", "pair", ")", "{", "DataMedia", "targetDataMedia", "=", "pair", ".", "getTarget", "(", ")", ";", "DataMedia", "sourceDataMedia", "=", "pair", ".", "getSo...
设置对应的目标库schema.name,需要考虑mutl配置情况 <pre> case: 1. 源:offer , 目:offer 2. 源:offer[1-128] , 目:offer 3. 源:offer[1-128] , 目:offer[1-128] 4. 源:offer , 目:offer[1-128] 不支持,会报错
[ "设置对应的目标库schema", ".", "name,需要考虑mutl配置情况" ]
train
https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/node/etl/src/main/java/com/alibaba/otter/node/etl/transform/transformer/RowDataTransformer.java#L146-L155
JavaMoney/jsr354-ri
moneta-core/src/main/java/org/javamoney/moneta/Money.java
Money.ofMinor
public static Money ofMinor(CurrencyUnit currency, long amountMinor) { return ofMinor(currency, amountMinor, currency.getDefaultFractionDigits()); }
java
public static Money ofMinor(CurrencyUnit currency, long amountMinor) { return ofMinor(currency, amountMinor, currency.getDefaultFractionDigits()); }
[ "public", "static", "Money", "ofMinor", "(", "CurrencyUnit", "currency", ",", "long", "amountMinor", ")", "{", "return", "ofMinor", "(", "currency", ",", "amountMinor", ",", "currency", ".", "getDefaultFractionDigits", "(", ")", ")", ";", "}" ]
Obtains an instance of {@code Money} from an amount in minor units. For example, {@code ofMinor(USD, 1234)} creates the instance {@code USD 12.34}. @param currency the currency @param amountMinor the amount of money in the minor division of the currency @return the Money from minor units @throws NullPointerException ...
[ "Obtains", "an", "instance", "of", "{" ]
train
https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/Money.java#L814-L816
fracpete/multisearch-weka-package
src/main/java/weka/classifiers/meta/multisearch/AbstractSearch.java
AbstractSearch.logPerformances
protected void logPerformances(Space space, Vector<Performance> performances) { m_Owner.logPerformances(space, performances); }
java
protected void logPerformances(Space space, Vector<Performance> performances) { m_Owner.logPerformances(space, performances); }
[ "protected", "void", "logPerformances", "(", "Space", "space", ",", "Vector", "<", "Performance", ">", "performances", ")", "{", "m_Owner", ".", "logPerformances", "(", "space", ",", "performances", ")", ";", "}" ]
aligns all performances in the space and prints those tables to the log file. @param space the current space to align the performances to @param performances the performances to align
[ "aligns", "all", "performances", "in", "the", "space", "and", "prints", "those", "tables", "to", "the", "log", "file", "." ]
train
https://github.com/fracpete/multisearch-weka-package/blob/756fcf343e7cc9fd3844c99a0e1e828368f393d0/src/main/java/weka/classifiers/meta/multisearch/AbstractSearch.java#L273-L275
NessComputing/service-discovery
client/src/main/java/com/nesscomputing/service/discovery/client/internal/ServiceDiscoveryRunnable.java
ServiceDiscoveryRunnable.determineCurrentGeneration
@Override public long determineCurrentGeneration(final AtomicLong generation, final long tick) { // If the scan interval was reached, trigger the // run. if (tick - lastScan >= scanTicks) { lastScan = tick; return generation.incrementAndGet(); } /...
java
@Override public long determineCurrentGeneration(final AtomicLong generation, final long tick) { // If the scan interval was reached, trigger the // run. if (tick - lastScan >= scanTicks) { lastScan = tick; return generation.incrementAndGet(); } /...
[ "@", "Override", "public", "long", "determineCurrentGeneration", "(", "final", "AtomicLong", "generation", ",", "final", "long", "tick", ")", "{", "// If the scan interval was reached, trigger the", "// run.", "if", "(", "tick", "-", "lastScan", ">=", "scanTicks", ")"...
Trigger the loop every time enough ticks have been accumulated, or whenever any of the visitors requests it.
[ "Trigger", "the", "loop", "every", "time", "enough", "ticks", "have", "been", "accumulated", "or", "whenever", "any", "of", "the", "visitors", "requests", "it", "." ]
train
https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/client/src/main/java/com/nesscomputing/service/discovery/client/internal/ServiceDiscoveryRunnable.java#L68-L85
dimaki/refuel
src/main/java/de/dimaki/refuel/updater/boundary/Updater.java
Updater.getApplicationStatus
public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl) { return getApplicationStatus(localVersion, updateUrl, null, AppcastManager.DEFAULT_CONNECT_TIMEOUT, AppcastManager.DEFAULT_READ_TIMEOUT); }
java
public ApplicationStatus getApplicationStatus(String localVersion, final URL updateUrl) { return getApplicationStatus(localVersion, updateUrl, null, AppcastManager.DEFAULT_CONNECT_TIMEOUT, AppcastManager.DEFAULT_READ_TIMEOUT); }
[ "public", "ApplicationStatus", "getApplicationStatus", "(", "String", "localVersion", ",", "final", "URL", "updateUrl", ")", "{", "return", "getApplicationStatus", "(", "localVersion", ",", "updateUrl", ",", "null", ",", "AppcastManager", ".", "DEFAULT_CONNECT_TIMEOUT",...
Get the update status of the application specified. @param localVersion The local version string, e.g. "2.0.1344" @param updateUrl The update URL (Appcast URL) @return The application status or 'null' if the status could not be evaluated
[ "Get", "the", "update", "status", "of", "the", "application", "specified", "." ]
train
https://github.com/dimaki/refuel/blob/8024ac34f52b33de291d859c3b12fc237783f873/src/main/java/de/dimaki/refuel/updater/boundary/Updater.java#L68-L70
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java
CPDefinitionLinkPersistenceImpl.findByCP_T
@Override public List<CPDefinitionLink> findByCP_T(long CProductId, String type, int start, int end) { return findByCP_T(CProductId, type, start, end, null); }
java
@Override public List<CPDefinitionLink> findByCP_T(long CProductId, String type, int start, int end) { return findByCP_T(CProductId, type, start, end, null); }
[ "@", "Override", "public", "List", "<", "CPDefinitionLink", ">", "findByCP_T", "(", "long", "CProductId", ",", "String", "type", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCP_T", "(", "CProductId", ",", "type", ",", "start", ",", ...
Returns a range of all the cp definition links where CProductId = &#63; and type = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the fir...
[ "Returns", "a", "range", "of", "all", "the", "cp", "definition", "links", "where", "CProductId", "=", "&#63", ";", "and", "type", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L3153-L3157
OpenLiberty/open-liberty
dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java
AppBndAuthorizationTableService.establishInitialTable
private boolean establishInitialTable(String appName, Collection<SecurityRole> secRoles) { // Create and add a new table if we don't have a cached copy if (resourceToAuthzInfoMap.putIfAbsent(appName, new AuthzInfo(appName, secRoles)) == null) { if (TraceComponent.isAnyTracingEnabled() && tc....
java
private boolean establishInitialTable(String appName, Collection<SecurityRole> secRoles) { // Create and add a new table if we don't have a cached copy if (resourceToAuthzInfoMap.putIfAbsent(appName, new AuthzInfo(appName, secRoles)) == null) { if (TraceComponent.isAnyTracingEnabled() && tc....
[ "private", "boolean", "establishInitialTable", "(", "String", "appName", ",", "Collection", "<", "SecurityRole", ">", "secRoles", ")", "{", "// Create and add a new table if we don't have a cached copy", "if", "(", "resourceToAuthzInfoMap", ".", "putIfAbsent", "(", "appName...
Establishes the basic information that comprises an authorization table, but all real work is deferred until later. This has some benefits:<p> <ol> <li>Faster application deployment</li> <li>If the authorization table is not used, such as for SAF authorization, we do not incur much cost to establish the table.</li> </o...
[ "Establishes", "the", "basic", "information", "that", "comprises", "an", "authorization", "table", "but", "all", "real", "work", "is", "deferred", "until", "later", ".", "This", "has", "some", "benefits", ":", "<p", ">", "<ol", ">", "<li", ">", "Faster", "...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.appbnd/src/com/ibm/ws/security/appbnd/internal/authorization/AppBndAuthorizationTableService.java#L210-L219
tvesalainen/util
util/src/main/java/org/vesalainen/util/InterfaceTracer.java
InterfaceTracer.getTracer
public static <T> T getTracer(Class<T> intf, T ob) { return getTracer(intf, new InterfaceTracer(ob), ob); }
java
public static <T> T getTracer(Class<T> intf, T ob) { return getTracer(intf, new InterfaceTracer(ob), ob); }
[ "public", "static", "<", "T", ">", "T", "getTracer", "(", "Class", "<", "T", ">", "intf", ",", "T", "ob", ")", "{", "return", "getTracer", "(", "intf", ",", "new", "InterfaceTracer", "(", "ob", ")", ",", "ob", ")", ";", "}" ]
Creates a tracer for intf @param <T> @param intf Implemented interface @param ob Class instance for given interface or null @return
[ "Creates", "a", "tracer", "for", "intf" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/InterfaceTracer.java#L62-L65
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java
AbstractSelectCodeGenerator.generateSQLBuild
private static void generateSQLBuild(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, SplittedSql splittedSql, boolean countQuery) { methodBuilder.addStatement("$T _sqlBuilder=sqlBuilder()", StringBuilder.class); methodBuilder.addStatement("_sqlBuilder.append($S)", splittedSql.sqlBasic.trim()); SqlMod...
java
private static void generateSQLBuild(SQLiteModelMethod method, MethodSpec.Builder methodBuilder, SplittedSql splittedSql, boolean countQuery) { methodBuilder.addStatement("$T _sqlBuilder=sqlBuilder()", StringBuilder.class); methodBuilder.addStatement("_sqlBuilder.append($S)", splittedSql.sqlBasic.trim()); SqlMod...
[ "private", "static", "void", "generateSQLBuild", "(", "SQLiteModelMethod", "method", ",", "MethodSpec", ".", "Builder", "methodBuilder", ",", "SplittedSql", "splittedSql", ",", "boolean", "countQuery", ")", "{", "methodBuilder", ".", "addStatement", "(", "\"$T _sqlBui...
Generate SQL build. @param method the method @param methodBuilder the method builder @param splittedSql the splitted sql @param countQuery is true, the query manage the count query for paged result
[ "Generate", "SQL", "build", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/AbstractSelectCodeGenerator.java#L825-L837
samskivert/samskivert
src/main/java/com/samskivert/util/MethodFinder.java
MethodFinder.findMemberIn
protected Member findMemberIn (List<Member> memberList, Class<?>[] parameterTypes) throws NoSuchMethodException { List<Member> matchingMembers = new ArrayList<Member>(); for (Iterator<Member> it = memberList.iterator(); it.hasNext();) { Member member = it.next(); Cla...
java
protected Member findMemberIn (List<Member> memberList, Class<?>[] parameterTypes) throws NoSuchMethodException { List<Member> matchingMembers = new ArrayList<Member>(); for (Iterator<Member> it = memberList.iterator(); it.hasNext();) { Member member = it.next(); Cla...
[ "protected", "Member", "findMemberIn", "(", "List", "<", "Member", ">", "memberList", ",", "Class", "<", "?", ">", "[", "]", "parameterTypes", ")", "throws", "NoSuchMethodException", "{", "List", "<", "Member", ">", "matchingMembers", "=", "new", "ArrayList", ...
Basis of {@link #findConstructor} and {@link #findMethod}. The member list fed to this method will be either all {@link Constructor} objects or all {@link Method} objects.
[ "Basis", "of", "{" ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/MethodFinder.java#L144-L172
google/error-prone-javac
make/src/classes/build/tools/symbolgenerator/CreateSymbols.java
CreateSymbols.createSymbols
@SuppressWarnings("unchecked") public void createSymbols(String ctDescriptionFile, String ctSymLocation, CtSymKind ctSymKind) throws IOException { ClassList classes = load(Paths.get(ctDescriptionFile)); splitHeaders(classes); for (ClassDescription classDescription : classes) { ...
java
@SuppressWarnings("unchecked") public void createSymbols(String ctDescriptionFile, String ctSymLocation, CtSymKind ctSymKind) throws IOException { ClassList classes = load(Paths.get(ctDescriptionFile)); splitHeaders(classes); for (ClassDescription classDescription : classes) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "createSymbols", "(", "String", "ctDescriptionFile", ",", "String", "ctSymLocation", ",", "CtSymKind", "ctSymKind", ")", "throws", "IOException", "{", "ClassList", "classes", "=", "load", "(", "...
Create sig files for ct.sym reading the classes description from the directory that contains {@code ctDescriptionFile}, using the file as a recipe to create the sigfiles.
[ "Create", "sig", "files", "for", "ct", ".", "sym", "reading", "the", "classes", "description", "from", "the", "directory", "that", "contains", "{" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/make/src/classes/build/tools/symbolgenerator/CreateSymbols.java#L165-L191
meertensinstituut/mtas
src/main/java/mtas/codec/util/CodecInfo.java
CodecInfo.getNumberOfTokens
public Integer getNumberOfTokens(String field, int docId) { if (fieldReferences.containsKey(field)) { IndexDoc doc = getDoc(field, docId); if (doc != null) { return doc.size; } } return null; }
java
public Integer getNumberOfTokens(String field, int docId) { if (fieldReferences.containsKey(field)) { IndexDoc doc = getDoc(field, docId); if (doc != null) { return doc.size; } } return null; }
[ "public", "Integer", "getNumberOfTokens", "(", "String", "field", ",", "int", "docId", ")", "{", "if", "(", "fieldReferences", ".", "containsKey", "(", "field", ")", ")", "{", "IndexDoc", "doc", "=", "getDoc", "(", "field", ",", "docId", ")", ";", "if", ...
Gets the number of tokens. @param field the field @param docId the doc id @return the number of tokens
[ "Gets", "the", "number", "of", "tokens", "." ]
train
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/util/CodecInfo.java#L690-L698
CenturyLinkCloud/mdw
mdw-workflow/assets/com/centurylink/mdw/drools/RulesBasedStrategy.java
RulesBasedStrategy.getClassLoader
public ClassLoader getClassLoader() throws StrategyException { // Determine the package by parsing the attribute name (different name for different types of Rules based strategies) String kbAttributeName = getKnowledgeBaseAttributeName(); Object kbName = getParameter(kbAttributeName); i...
java
public ClassLoader getClassLoader() throws StrategyException { // Determine the package by parsing the attribute name (different name for different types of Rules based strategies) String kbAttributeName = getKnowledgeBaseAttributeName(); Object kbName = getParameter(kbAttributeName); i...
[ "public", "ClassLoader", "getClassLoader", "(", ")", "throws", "StrategyException", "{", "// Determine the package by parsing the attribute name (different name for different types of Rules based strategies)", "String", "kbAttributeName", "=", "getKnowledgeBaseAttributeName", "(", ")", ...
<p> By default returns the package CloudClassloader The knowledge based name is of the format "packageName/assetName", e.g "com.centurylink.mdw.test/TestDroolsRules.drl" If an application needs a different class loader for Strategies then this method should be overridden </p> @return Class Loader used for Knowledge bas...
[ "<p", ">", "By", "default", "returns", "the", "package", "CloudClassloader", "The", "knowledge", "based", "name", "is", "of", "the", "format", "packageName", "/", "assetName", "e", ".", "g", "com", ".", "centurylink", ".", "mdw", ".", "test", "/", "TestDro...
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/assets/com/centurylink/mdw/drools/RulesBasedStrategy.java#L73-L96
bazaarvoice/ostrich
core/src/main/java/com/bazaarvoice/ostrich/pool/ServicePoolBuilder.java
ServicePoolBuilder.withHostDiscoverySource
public ServicePoolBuilder<S> withHostDiscoverySource(HostDiscoverySource hostDiscoverySource) { checkNotNull(hostDiscoverySource); return withHostDiscovery(hostDiscoverySource, true); }
java
public ServicePoolBuilder<S> withHostDiscoverySource(HostDiscoverySource hostDiscoverySource) { checkNotNull(hostDiscoverySource); return withHostDiscovery(hostDiscoverySource, true); }
[ "public", "ServicePoolBuilder", "<", "S", ">", "withHostDiscoverySource", "(", "HostDiscoverySource", "hostDiscoverySource", ")", "{", "checkNotNull", "(", "hostDiscoverySource", ")", ";", "return", "withHostDiscovery", "(", "hostDiscoverySource", ",", "true", ")", ";",...
Adds a {@link HostDiscoverySource} instance to the builder. Multiple instances of {@code HostDiscoverySource} may be specified. The service pool will query the sources in the order they were registered and use the first non-null {@link HostDiscovery} returned for the service name provided by the {@link ServiceFactory...
[ "Adds", "a", "{", "@link", "HostDiscoverySource", "}", "instance", "to", "the", "builder", ".", "Multiple", "instances", "of", "{", "@code", "HostDiscoverySource", "}", "may", "be", "specified", ".", "The", "service", "pool", "will", "query", "the", "sources",...
train
https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/ServicePoolBuilder.java#L75-L78
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/TableForm.java
TableForm.addField
public void addField(String label,Element field) { if (label==null) label="&nbsp;"; else label="<b>"+label+":</b>"; if (extendRow) { column.add(field); extendRow=false; } else { column.newRow(); ...
java
public void addField(String label,Element field) { if (label==null) label="&nbsp;"; else label="<b>"+label+":</b>"; if (extendRow) { column.add(field); extendRow=false; } else { column.newRow(); ...
[ "public", "void", "addField", "(", "String", "label", ",", "Element", "field", ")", "{", "if", "(", "label", "==", "null", ")", "label", "=", "\"&nbsp;\"", ";", "else", "label", "=", "\"<b>\"", "+", "label", "+", "\":</b>\"", ";", "if", "(", "extendRow...
Add an arbitrary element to the table. @param label The label for the element in the table.
[ "Add", "an", "arbitrary", "element", "to", "the", "table", "." ]
train
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L327-L353
sarl/sarl
main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/TypeParameterBuilderImpl.java
TypeParameterBuilderImpl.eInit
public void eInit(EObject context, String name, IJvmTypeProvider typeContext) { setTypeResolutionContext(typeContext); this.context = context; this.parameter = this.jvmTypesFactory.createJvmTypeParameter(); this.parameter.setName(name); }
java
public void eInit(EObject context, String name, IJvmTypeProvider typeContext) { setTypeResolutionContext(typeContext); this.context = context; this.parameter = this.jvmTypesFactory.createJvmTypeParameter(); this.parameter.setName(name); }
[ "public", "void", "eInit", "(", "EObject", "context", ",", "String", "name", ",", "IJvmTypeProvider", "typeContext", ")", "{", "setTypeResolutionContext", "(", "typeContext", ")", ";", "this", ".", "context", "=", "context", ";", "this", ".", "parameter", "=",...
Initialize the type parameter. <p>Caution: This initialization function does not add the type parameter in its container. The container is responsible of adding the type parameter in its internal object. @param name the name of the type parameter. @param typeContext the provider of types or null.
[ "Initialize", "the", "type", "parameter", ".", "<p", ">", "Caution", ":", "This", "initialization", "function", "does", "not", "add", "the", "type", "parameter", "in", "its", "container", ".", "The", "container", "is", "responsible", "of", "adding", "the", "...
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/TypeParameterBuilderImpl.java#L55-L61
umeding/fuzzer
src/main/java/com/uwemeding/fuzzer/java/JavaOutputType.java
JavaOutputType.callFindAssociation
private void callFindAssociation(Java.METHOD method, String result, Variable variable, Member member) { String setName = variable.getName() + "$" + member.getName(); method.addS("Number " + result + " = findAssociation(" + variable.getName() + ", " + variable.getFrom() + ", " + variable.getTo() + ", " ...
java
private void callFindAssociation(Java.METHOD method, String result, Variable variable, Member member) { String setName = variable.getName() + "$" + member.getName(); method.addS("Number " + result + " = findAssociation(" + variable.getName() + ", " + variable.getFrom() + ", " + variable.getTo() + ", " ...
[ "private", "void", "callFindAssociation", "(", "Java", ".", "METHOD", "method", ",", "String", "result", ",", "Variable", "variable", ",", "Member", "member", ")", "{", "String", "setName", "=", "variable", ".", "getName", "(", ")", "+", "\"$\"", "+", "mem...
Call the find association method. <p> @param method the invoking method @param result the result variable @param variable the input variable @param member the member
[ "Call", "the", "find", "association", "method", ".", "<p", ">" ]
train
https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/java/JavaOutputType.java#L266-L275
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/FormLayoutFormBuilder.java
FormLayoutFormBuilder.addBinding
public JComponent addBinding(Binding binding, int column, int row) { return this.addBinding(binding, column, row, 1, 1); }
java
public JComponent addBinding(Binding binding, int column, int row) { return this.addBinding(binding, column, row, 1, 1); }
[ "public", "JComponent", "addBinding", "(", "Binding", "binding", ",", "int", "column", ",", "int", "row", ")", "{", "return", "this", ".", "addBinding", "(", "binding", ",", "column", ",", "row", ",", "1", ",", "1", ")", ";", "}" ]
Add a binder to a column and a row. Equals to builder.addBinding(component, column, row). @param binding The binding to add @param column The column on which the binding must be added @param column The row on which the binding must be added @return The component produced by the binding @see #addBinding(Binding, int,...
[ "Add", "a", "binder", "to", "a", "column", "and", "a", "row", ".", "Equals", "to", "builder", ".", "addBinding", "(", "component", "column", "row", ")", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/FormLayoutFormBuilder.java#L263-L266
lightbend/config
config/src/main/java/com/typesafe/config/ConfigException.java
ConfigException.setOriginField
private static <T> void setOriginField(T hasOriginField, Class<T> clazz, ConfigOrigin origin) throws IOException { // circumvent "final" Field f; try { f = clazz.getDeclaredField("origin"); } catch (NoSuchFieldException e) { throw new IOException(clazz...
java
private static <T> void setOriginField(T hasOriginField, Class<T> clazz, ConfigOrigin origin) throws IOException { // circumvent "final" Field f; try { f = clazz.getDeclaredField("origin"); } catch (NoSuchFieldException e) { throw new IOException(clazz...
[ "private", "static", "<", "T", ">", "void", "setOriginField", "(", "T", "hasOriginField", ",", "Class", "<", "T", ">", "clazz", ",", "ConfigOrigin", "origin", ")", "throws", "IOException", "{", "// circumvent \"final\"", "Field", "f", ";", "try", "{", "f", ...
For deserialization - uses reflection to set the final origin field on the object
[ "For", "deserialization", "-", "uses", "reflection", "to", "set", "the", "final", "origin", "field", "on", "the", "object" ]
train
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigException.java#L62-L82
RestComm/sipunit
src/main/java/org/cafesip/sipunit/EventSubscriber.java
EventSubscriber.replyToNotify
public boolean replyToNotify(RequestEvent reqevent, Response response) { initErrorInfo(); if ((reqevent == null) || (reqevent.getRequest() == null) || (response == null)) { setErrorMessage("Cannot send reply, request or response info is null"); setReturnCode(SipSession.INVALID_ARGUMENT); retu...
java
public boolean replyToNotify(RequestEvent reqevent, Response response) { initErrorInfo(); if ((reqevent == null) || (reqevent.getRequest() == null) || (response == null)) { setErrorMessage("Cannot send reply, request or response info is null"); setReturnCode(SipSession.INVALID_ARGUMENT); retu...
[ "public", "boolean", "replyToNotify", "(", "RequestEvent", "reqevent", ",", "Response", "response", ")", "{", "initErrorInfo", "(", ")", ";", "if", "(", "(", "reqevent", "==", "null", ")", "||", "(", "reqevent", ".", "getRequest", "(", ")", "==", "null", ...
This method sends the given response to the network in reply to the given request that was previously received. Call this method after processNotify() has handled the received request. @param reqevent The object returned by waitNotify(). @param response The object returned by processNotify(), or a user-modified versio...
[ "This", "method", "sends", "the", "given", "response", "to", "the", "network", "in", "reply", "to", "the", "given", "request", "that", "was", "previously", "received", ".", "Call", "this", "method", "after", "processNotify", "()", "has", "handled", "the", "r...
train
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/EventSubscriber.java#L992-L1022
alkacon/opencms-core
src/org/opencms/gwt/A_CmsClientMessageBundle.java
A_CmsClientMessageBundle.importMessage
public String importMessage(String key, Locale locale) { key = key.trim(); String[] tokens = key.split("#"); if (tokens.length != 2) { return null; } String className = tokens[0]; String messageName = tokens[1]; try { Method messagesGet = ...
java
public String importMessage(String key, Locale locale) { key = key.trim(); String[] tokens = key.split("#"); if (tokens.length != 2) { return null; } String className = tokens[0]; String messageName = tokens[1]; try { Method messagesGet = ...
[ "public", "String", "importMessage", "(", "String", "key", ",", "Locale", "locale", ")", "{", "key", "=", "key", ".", "trim", "(", ")", ";", "String", "[", "]", "tokens", "=", "key", ".", "split", "(", "\"#\"", ")", ";", "if", "(", "tokens", ".", ...
Imports a message from another bundle.<p> @param key a key of the form classname#MESSAGE_FIELD_NAME @param locale the locale for which to import the message @return the imported message string
[ "Imports", "a", "message", "from", "another", "bundle", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/A_CmsClientMessageBundle.java#L160-L177