repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
sirensolutions/siren-join
src/main/java/solutions/siren/join/common/Bytes.java
Bytes.writeVInt
public final static void writeVInt(BytesRef dst, int i) { """ Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers will always use all 5 bytes and are therefore better serialized using {@link #writeInt}. """ while ((i & ~0x7F) != ...
java
public final static void writeVInt(BytesRef dst, int i) { while ((i & ~0x7F) != 0) { dst.bytes[dst.offset++] = (byte) ((i & 0x7f) | 0x80); i >>>= 7; } dst.bytes[dst.offset++] = (byte) i; }
[ "public", "final", "static", "void", "writeVInt", "(", "BytesRef", "dst", ",", "int", "i", ")", "{", "while", "(", "(", "i", "&", "~", "0x7F", ")", "!=", "0", ")", "{", "dst", ".", "bytes", "[", "dst", ".", "offset", "++", "]", "=", "(", "byte"...
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers will always use all 5 bytes and are therefore better serialized using {@link #writeInt}.
[ "Writes", "an", "int", "in", "a", "variable", "-", "length", "format", ".", "Writes", "between", "one", "and", "five", "bytes", ".", "Smaller", "values", "take", "fewer", "bytes", ".", "Negative", "numbers", "will", "always", "use", "all", "5", "bytes", ...
train
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/common/Bytes.java#L72-L78
lightblueseas/vintage-time
src/main/java/de/alpharogroup/date/CalculateDateExtensions.java
CalculateDateExtensions.addYears
public static Date addYears(final Date date, final int addYears) { """ Adds years to the given Date object and returns it. Note: you can add negative values too for get date in past. @param date The Date object to add the years. @param addYears The years to add. @return The resulted Date object. """ ...
java
public static Date addYears(final Date date, final int addYears) { final Calendar dateOnCalendar = Calendar.getInstance(); dateOnCalendar.setTime(date); dateOnCalendar.add(Calendar.YEAR, addYears); return dateOnCalendar.getTime(); }
[ "public", "static", "Date", "addYears", "(", "final", "Date", "date", ",", "final", "int", "addYears", ")", "{", "final", "Calendar", "dateOnCalendar", "=", "Calendar", ".", "getInstance", "(", ")", ";", "dateOnCalendar", ".", "setTime", "(", "date", ")", ...
Adds years to the given Date object and returns it. Note: you can add negative values too for get date in past. @param date The Date object to add the years. @param addYears The years to add. @return The resulted Date object.
[ "Adds", "years", "to", "the", "given", "Date", "object", "and", "returns", "it", ".", "Note", ":", "you", "can", "add", "negative", "values", "too", "for", "get", "date", "in", "past", "." ]
train
https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/CalculateDateExtensions.java#L179-L185
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java
EJSContainer.preInvoke
public EnterpriseBean preInvoke(EJSWrapper wrapper, int methodId, EJSDeployedSupport s) throws RemoteException { """ Perform container actions prior to invocation of bean method. <p> This method is called before every bean method. It is responsible for informing all containe...
java
public EnterpriseBean preInvoke(EJSWrapper wrapper, int methodId, EJSDeployedSupport s) throws RemoteException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "old preinvoke called by EJBDeploy, not new JACC preinvoke"); Ob...
[ "public", "EnterpriseBean", "preInvoke", "(", "EJSWrapper", "wrapper", ",", "int", "methodId", ",", "EJSDeployedSupport", "s", ")", "throws", "RemoteException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnable...
Perform container actions prior to invocation of bean method. <p> This method is called before every bean method. It is responsible for informing all container collaborators that a method invocation is beginning. <p> This method must return a <code>BeanO</code> instance that the method may be invoked on. <p> @param ...
[ "Perform", "container", "actions", "prior", "to", "invocation", "of", "bean", "method", ".", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java#L2232-L2239
VoltDB/voltdb
src/frontend/org/voltdb/utils/VoltBaseServlet.java
VoltBaseServlet.handleReportPage
void handleReportPage(HttpServletRequest request, HttpServletResponse response) { """ Draw the catalog report page, mostly by pulling it from the JAR. """ try { String report = ReportMaker.liveReport(); response.setContentType(HTML_CONTENT_TYPE); response.setStatus(...
java
void handleReportPage(HttpServletRequest request, HttpServletResponse response) { try { String report = ReportMaker.liveReport(); response.setContentType(HTML_CONTENT_TYPE); response.setStatus(HttpServletResponse.SC_OK); response.getWriter().print(report); ...
[ "void", "handleReportPage", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "try", "{", "String", "report", "=", "ReportMaker", ".", "liveReport", "(", ")", ";", "response", ".", "setContentType", "(", "HTML_CONTENT_TYPE", "...
Draw the catalog report page, mostly by pulling it from the JAR.
[ "Draw", "the", "catalog", "report", "page", "mostly", "by", "pulling", "it", "from", "the", "JAR", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltBaseServlet.java#L118-L129
igniterealtime/Smack
smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java
OXInstantMessagingManager.addOxMessage
public OpenPgpMetadata addOxMessage(Message message, OpenPgpContact contact, List<ExtensionElement> payload) throws SmackException.NotLoggedInException, PGPException, IOException { """ Add an OX-IM message element to a message. @param message message @param contact recipient of the message @param ...
java
public OpenPgpMetadata addOxMessage(Message message, OpenPgpContact contact, List<ExtensionElement> payload) throws SmackException.NotLoggedInException, PGPException, IOException { return addOxMessage(message, Collections.singleton(contact), payload); }
[ "public", "OpenPgpMetadata", "addOxMessage", "(", "Message", "message", ",", "OpenPgpContact", "contact", ",", "List", "<", "ExtensionElement", ">", "payload", ")", "throws", "SmackException", ".", "NotLoggedInException", ",", "PGPException", ",", "IOException", "{", ...
Add an OX-IM message element to a message. @param message message @param contact recipient of the message @param payload payload which will be encrypted and signed @return {@link OpenPgpMetadata} about the messages encryption + metadata. @throws SmackException.NotLoggedInException in case we are not logged in @throw...
[ "Add", "an", "OX", "-", "IM", "message", "element", "to", "a", "message", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java#L253-L256
web3j/web3j
crypto/src/main/java/org/web3j/crypto/Sign.java
Sign.publicKeyFromPrivate
public static BigInteger publicKeyFromPrivate(BigInteger privKey) { """ Returns public key from the given private key. @param privKey the private key to derive the public key from @return BigInteger encoded public key """ ECPoint point = publicPointFromPrivate(privKey); byte[] encoded = po...
java
public static BigInteger publicKeyFromPrivate(BigInteger privKey) { ECPoint point = publicPointFromPrivate(privKey); byte[] encoded = point.getEncoded(false); return new BigInteger(1, Arrays.copyOfRange(encoded, 1, encoded.length)); // remove prefix }
[ "public", "static", "BigInteger", "publicKeyFromPrivate", "(", "BigInteger", "privKey", ")", "{", "ECPoint", "point", "=", "publicPointFromPrivate", "(", "privKey", ")", ";", "byte", "[", "]", "encoded", "=", "point", ".", "getEncoded", "(", "false", ")", ";",...
Returns public key from the given private key. @param privKey the private key to derive the public key from @return BigInteger encoded public key
[ "Returns", "public", "key", "from", "the", "given", "private", "key", "." ]
train
https://github.com/web3j/web3j/blob/f99ceb19cdd65895c18e0a565034767ca18ea9fc/crypto/src/main/java/org/web3j/crypto/Sign.java#L245-L250
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.findResult
public static <T,K,V> T findResult(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure<T> closure) { """ Returns the first non-null closure result found by passing each map entry to the closure, otherwise null is returned. If the closure takes two parameters, the entry key and value are passed. If t...
java
public static <T,K,V> T findResult(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure<T> closure) { for (Map.Entry<K, V> entry : self.entrySet()) { T result = callClosureForMapEntry(closure, entry); if (result != null) { return result; } ...
[ "public", "static", "<", "T", ",", "K", ",", "V", ">", "T", "findResult", "(", "Map", "<", "K", ",", "V", ">", "self", ",", "@", "ClosureParams", "(", "MapEntryOrKeyValue", ".", "class", ")", "Closure", "<", "T", ">", "closure", ")", "{", "for", ...
Returns the first non-null closure result found by passing each map entry to the closure, otherwise null is returned. If the closure takes two parameters, the entry key and value are passed. If the closure takes one parameter, the Map.Entry object is passed. <pre class="groovyTestCase"> assert "Found b:3" == [a:1, b:3]...
[ "Returns", "the", "first", "non", "-", "null", "closure", "result", "found", "by", "passing", "each", "map", "entry", "to", "the", "closure", "otherwise", "null", "is", "returned", ".", "If", "the", "closure", "takes", "two", "parameters", "the", "entry", ...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4105-L4113
googleapis/google-cloud-java
google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TimestampBound.java
TimestampBound.ofMinReadTimestamp
public static TimestampBound ofMinReadTimestamp(Timestamp timestamp) { """ Returns a timestamp bound that will perform reads and queries at a timestamp chosen to be at least {@code timestamp}. This is useful for requesting fresher data than some previous read, or data that is fresh enough to observe the effects ...
java
public static TimestampBound ofMinReadTimestamp(Timestamp timestamp) { return new TimestampBound(Mode.MIN_READ_TIMESTAMP, checkNotNull(timestamp), null); }
[ "public", "static", "TimestampBound", "ofMinReadTimestamp", "(", "Timestamp", "timestamp", ")", "{", "return", "new", "TimestampBound", "(", "Mode", ".", "MIN_READ_TIMESTAMP", ",", "checkNotNull", "(", "timestamp", ")", ",", "null", ")", ";", "}" ]
Returns a timestamp bound that will perform reads and queries at a timestamp chosen to be at least {@code timestamp}. This is useful for requesting fresher data than some previous read, or data that is fresh enough to observe the effects of some previously committed transaction whose timestamp is known. <p>Note that t...
[ "Returns", "a", "timestamp", "bound", "that", "will", "perform", "reads", "and", "queries", "at", "a", "timestamp", "chosen", "to", "be", "at", "least", "{", "@code", "timestamp", "}", ".", "This", "is", "useful", "for", "requesting", "fresher", "data", "t...
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TimestampBound.java#L165-L167
jmeetsma/Iglu-Util
src/main/java/org/ijsberg/iglu/util/io/FileSupport.java
FileSupport.getFilesInDirectoryTree
public static ArrayList<File> getFilesInDirectoryTree(String path, FileFilterRuleSet includeRuleSet) { """ Retrieves files for a given mask from a directory and its subdirectories. @param path root of directory tree @param includeRuleSet rule set defining precisely which files to include @return A list contai...
java
public static ArrayList<File> getFilesInDirectoryTree(String path, FileFilterRuleSet includeRuleSet) { File file = new File(path); return getContentsInDirectoryTree(file, includeRuleSet, true, false); }
[ "public", "static", "ArrayList", "<", "File", ">", "getFilesInDirectoryTree", "(", "String", "path", ",", "FileFilterRuleSet", "includeRuleSet", ")", "{", "File", "file", "=", "new", "File", "(", "path", ")", ";", "return", "getContentsInDirectoryTree", "(", "fi...
Retrieves files for a given mask from a directory and its subdirectories. @param path root of directory tree @param includeRuleSet rule set defining precisely which files to include @return A list containing the found files
[ "Retrieves", "files", "for", "a", "given", "mask", "from", "a", "directory", "and", "its", "subdirectories", "." ]
train
https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/io/FileSupport.java#L81-L84
UrielCh/ovh-java-sdk
ovh-java-sdk-licenseoffice/src/main/java/net/minidev/ovh/api/ApiOvhLicenseoffice.java
ApiOvhLicenseoffice.serviceName_user_GET
public ArrayList<String> serviceName_user_GET(String serviceName, String activationEmail, String firstName, String lastName, OvhLicenceEnum[] licences) throws IOException { """ Accounts associated to this office tenant REST: GET /license/office/{serviceName}/user @param firstName [required] Filter the value of...
java
public ArrayList<String> serviceName_user_GET(String serviceName, String activationEmail, String firstName, String lastName, OvhLicenceEnum[] licences) throws IOException { String qPath = "/license/office/{serviceName}/user"; StringBuilder sb = path(qPath, serviceName); query(sb, "activationEmail", activationEmai...
[ "public", "ArrayList", "<", "String", ">", "serviceName_user_GET", "(", "String", "serviceName", ",", "String", "activationEmail", ",", "String", "firstName", ",", "String", "lastName", ",", "OvhLicenceEnum", "[", "]", "licences", ")", "throws", "IOException", "{"...
Accounts associated to this office tenant REST: GET /license/office/{serviceName}/user @param firstName [required] Filter the value of firstName property (like) @param licences [required] Filter the value of licences property (=) @param lastName [required] Filter the value of lastName property (like) @param activation...
[ "Accounts", "associated", "to", "this", "office", "tenant" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licenseoffice/src/main/java/net/minidev/ovh/api/ApiOvhLicenseoffice.java#L195-L204
spring-projects/spring-data-solr
src/main/java/org/springframework/data/solr/core/SolrTemplate.java
SolrTemplate.constructQuery
protected SolrQuery constructQuery(SolrDataQuery query, @Nullable Class<?> domainType) { """ Create the native {@link SolrQuery} from a given {@link SolrDataQuery}. @param query never {@literal null}. @return never {@literal null}. @since 2.1.11 """ return lookupQueryParser(query).constructSolrQuery(que...
java
protected SolrQuery constructQuery(SolrDataQuery query, @Nullable Class<?> domainType) { return lookupQueryParser(query).constructSolrQuery(query, domainType); }
[ "protected", "SolrQuery", "constructQuery", "(", "SolrDataQuery", "query", ",", "@", "Nullable", "Class", "<", "?", ">", "domainType", ")", "{", "return", "lookupQueryParser", "(", "query", ")", ".", "constructSolrQuery", "(", "query", ",", "domainType", ")", ...
Create the native {@link SolrQuery} from a given {@link SolrDataQuery}. @param query never {@literal null}. @return never {@literal null}. @since 2.1.11
[ "Create", "the", "native", "{", "@link", "SolrQuery", "}", "from", "a", "given", "{", "@link", "SolrDataQuery", "}", "." ]
train
https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/SolrTemplate.java#L529-L531
SahaginOrg/sahagin-java
src/main/java/org/sahagin/share/yaml/YamlUtils.java
YamlUtils.getCaptureStyleValue
public static CaptureStyle getCaptureStyleValue(Map<String, Object> yamlObject, String key, boolean allowsEmpty) throws YamlConvertException { """ if allowsEmpty, returns null for the case no key entry or null value """ Object obj = getObjectValue(yamlObject, key, allowsEmpty); if (...
java
public static CaptureStyle getCaptureStyleValue(Map<String, Object> yamlObject, String key, boolean allowsEmpty) throws YamlConvertException { Object obj = getObjectValue(yamlObject, key, allowsEmpty); if (obj == null && allowsEmpty) { return null; } String objStr...
[ "public", "static", "CaptureStyle", "getCaptureStyleValue", "(", "Map", "<", "String", ",", "Object", ">", "yamlObject", ",", "String", "key", ",", "boolean", "allowsEmpty", ")", "throws", "YamlConvertException", "{", "Object", "obj", "=", "getObjectValue", "(", ...
if allowsEmpty, returns null for the case no key entry or null value
[ "if", "allowsEmpty", "returns", "null", "for", "the", "case", "no", "key", "entry", "or", "null", "value" ]
train
https://github.com/SahaginOrg/sahagin-java/blob/7ace428adebe3466ceb5826bc9681f8e3d52be68/src/main/java/org/sahagin/share/yaml/YamlUtils.java#L136-L154
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/VariablesInner.java
VariablesInner.createOrUpdate
public VariableInner createOrUpdate(String resourceGroupName, String automationAccountName, String variableName, VariableCreateOrUpdateParameters parameters) { """ Create a variable. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @par...
java
public VariableInner createOrUpdate(String resourceGroupName, String automationAccountName, String variableName, VariableCreateOrUpdateParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, variableName, parameters).toBlocking().single().body(); }
[ "public", "VariableInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "variableName", ",", "VariableCreateOrUpdateParameters", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "r...
Create a variable. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param variableName The variable name. @param parameters The parameters supplied to the create or update variable operation. @throws IllegalArgumentException thrown if parameter...
[ "Create", "a", "variable", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/VariablesInner.java#L105-L107
3redronin/mu-server
src/main/java/io/muserver/Mutils.java
Mutils.copy
public static void copy(InputStream from, OutputStream to, int bufferSize) throws IOException { """ Copies an input stream to another stream @param from The source of the bytes @param to The destination of the bytes @param bufferSize The size of the byte buffer to use as bytes are copied @throw...
java
public static void copy(InputStream from, OutputStream to, int bufferSize) throws IOException { byte[] buffer = new byte[bufferSize]; int read; while ((read = from.read(buffer)) > -1) { to.write(buffer, 0, read); } }
[ "public", "static", "void", "copy", "(", "InputStream", "from", ",", "OutputStream", "to", ",", "int", "bufferSize", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "bufferSize", "]", ";", "int", "read", ";", "whil...
Copies an input stream to another stream @param from The source of the bytes @param to The destination of the bytes @param bufferSize The size of the byte buffer to use as bytes are copied @throws IOException Thrown if there is a problem reading from or writing to either stream
[ "Copies", "an", "input", "stream", "to", "another", "stream" ]
train
https://github.com/3redronin/mu-server/blob/51598606a3082a121fbd785348ee9770b40308e6/src/main/java/io/muserver/Mutils.java#L59-L65
alkacon/opencms-core
src/org/opencms/db/CmsDriverManager.java
CmsDriverManager.readAliasesBySite
public List<CmsAlias> readAliasesBySite(CmsDbContext dbc, CmsProject currentProject, String siteRoot) throws CmsException { """ Reads the aliases for a given site root.<p> @param dbc the current database context @param currentProject the current project @param siteRoot the site root @return the list of...
java
public List<CmsAlias> readAliasesBySite(CmsDbContext dbc, CmsProject currentProject, String siteRoot) throws CmsException { return getVfsDriver(dbc).readAliases(dbc, currentProject, new CmsAliasFilter(siteRoot, null, null)); }
[ "public", "List", "<", "CmsAlias", ">", "readAliasesBySite", "(", "CmsDbContext", "dbc", ",", "CmsProject", "currentProject", ",", "String", "siteRoot", ")", "throws", "CmsException", "{", "return", "getVfsDriver", "(", "dbc", ")", ".", "readAliases", "(", "dbc"...
Reads the aliases for a given site root.<p> @param dbc the current database context @param currentProject the current project @param siteRoot the site root @return the list of aliases for the given site root @throws CmsException if something goes wrong
[ "Reads", "the", "aliases", "for", "a", "given", "site", "root", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L6365-L6369
intive-FDV/DynamicJasper
src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java
DynamicReportBuilder.setProperty
public DynamicReportBuilder setProperty(String name, String value) { """ Adds a property to report design, this properties are mostly used by exporters to know if any specific configuration is needed @param name @param value @return A Dynamic Report Builder """ this.report.setProperty(name, value...
java
public DynamicReportBuilder setProperty(String name, String value) { this.report.setProperty(name, value); return this; }
[ "public", "DynamicReportBuilder", "setProperty", "(", "String", "name", ",", "String", "value", ")", "{", "this", ".", "report", ".", "setProperty", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds a property to report design, this properties are mostly used by exporters to know if any specific configuration is needed @param name @param value @return A Dynamic Report Builder
[ "Adds", "a", "property", "to", "report", "design", "this", "properties", "are", "mostly", "used", "by", "exporters", "to", "know", "if", "any", "specific", "configuration", "is", "needed" ]
train
https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java#L1581-L1584
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/input/location/CmsLocationPicker.java
CmsLocationPicker.setLocationInfo
protected void setLocationInfo(Map<String, String> infos) { """ Sets the location info to the info panel.<p> @param infos the location info items """ if (infos.isEmpty()) { m_locationInfoPanel.getStyle().setDisplay(Display.NONE); } else { StringBuffer infoHtml = new ...
java
protected void setLocationInfo(Map<String, String> infos) { if (infos.isEmpty()) { m_locationInfoPanel.getStyle().setDisplay(Display.NONE); } else { StringBuffer infoHtml = new StringBuffer(); for (Entry<String, String> info : infos.entrySet()) { info...
[ "protected", "void", "setLocationInfo", "(", "Map", "<", "String", ",", "String", ">", "infos", ")", "{", "if", "(", "infos", ".", "isEmpty", "(", ")", ")", "{", "m_locationInfoPanel", ".", "getStyle", "(", ")", ".", "setDisplay", "(", "Display", ".", ...
Sets the location info to the info panel.<p> @param infos the location info items
[ "Sets", "the", "location", "info", "to", "the", "info", "panel", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/location/CmsLocationPicker.java#L202-L215
CenturyLinkCloud/mdw
mdw-common/src/com/centurylink/mdw/util/StringHelper.java
StringHelper.PreFormatString
private static String PreFormatString(String aAttrName, boolean aPrependSeparator) { """ Creates the pre-format string for <code>toString()</code>. Returns a string <code>aAttrName=</code>. If aPrependSeparator is true then prepends a comma(,) separator before the formatted string. <p> Example: aAttrName= or ,...
java
private static String PreFormatString(String aAttrName, boolean aPrependSeparator) { StringBuffer mStrBuff = new StringBuffer(); if (aPrependSeparator) mStrBuff.append(","); mStrBuff.append(aAttrName); mStrBuff.append("="); return mStrBuff.toString(); }
[ "private", "static", "String", "PreFormatString", "(", "String", "aAttrName", ",", "boolean", "aPrependSeparator", ")", "{", "StringBuffer", "mStrBuff", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "aPrependSeparator", ")", "mStrBuff", ".", "append", "(...
Creates the pre-format string for <code>toString()</code>. Returns a string <code>aAttrName=</code>. If aPrependSeparator is true then prepends a comma(,) separator before the formatted string. <p> Example: aAttrName= or ,aAttrName= where the "," is controlled using the aPrependSeparator set to true. @param aAttrName ...
[ "Creates", "the", "pre", "-", "format", "string", "for", "<code", ">", "toString", "()", "<", "/", "code", ">", ".", "Returns", "a", "string", "<code", ">", "aAttrName", "=", "<", "/", "code", ">", ".", "If", "aPrependSeparator", "is", "true", "then", ...
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/StringHelper.java#L858-L865
OpenLiberty/open-liberty
dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/util/Util.java
Util.decodeDN
public static String decodeDN(Codec codec, byte[] encodedDN) throws SASException { """ Decode a distinguished name from an ASN.1 X501 encoded Distinguished Name @param codec The codec to do the decoding of the Any. @param encodedDN The codec encoded byte[] containing the ASN.1 X501 encoded Distinguished Name. ...
java
public static String decodeDN(Codec codec, byte[] encodedDN) throws SASException { String dn = null; try { Any any = codec.decode_value(encodedDN, X501DistinguishedNameHelper.type()); byte[] asnX501DN = X501DistinguishedNameHelper.extract(any); X500Principal x500Pri...
[ "public", "static", "String", "decodeDN", "(", "Codec", "codec", ",", "byte", "[", "]", "encodedDN", ")", "throws", "SASException", "{", "String", "dn", "=", "null", ";", "try", "{", "Any", "any", "=", "codec", ".", "decode_value", "(", "encodedDN", ",",...
Decode a distinguished name from an ASN.1 X501 encoded Distinguished Name @param codec The codec to do the decoding of the Any. @param encodedDN The codec encoded byte[] containing the ASN.1 X501 encoded Distinguished Name. @return the distinguished name. @throws SASException
[ "Decode", "a", "distinguished", "name", "from", "an", "ASN", ".", "1", "X501", "encoded", "Distinguished", "Name" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/util/Util.java#L711-L726
grpc/grpc-java
core/src/main/java/io/grpc/internal/ReadableBuffers.java
ReadableBuffers.openStream
public static InputStream openStream(ReadableBuffer buffer, boolean owner) { """ Creates a new {@link InputStream} backed by the given buffer. Any read taken on the stream will automatically increment the read position of this buffer. Closing the stream, however, does not affect the original buffer. @param bu...
java
public static InputStream openStream(ReadableBuffer buffer, boolean owner) { return new BufferInputStream(owner ? buffer : ignoreClose(buffer)); }
[ "public", "static", "InputStream", "openStream", "(", "ReadableBuffer", "buffer", ",", "boolean", "owner", ")", "{", "return", "new", "BufferInputStream", "(", "owner", "?", "buffer", ":", "ignoreClose", "(", "buffer", ")", ")", ";", "}" ]
Creates a new {@link InputStream} backed by the given buffer. Any read taken on the stream will automatically increment the read position of this buffer. Closing the stream, however, does not affect the original buffer. @param buffer the buffer backing the new {@link InputStream}. @param owner if {@code true}, the ret...
[ "Creates", "a", "new", "{", "@link", "InputStream", "}", "backed", "by", "the", "given", "buffer", ".", "Any", "read", "taken", "on", "the", "stream", "will", "automatically", "increment", "the", "read", "position", "of", "this", "buffer", ".", "Closing", ...
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/ReadableBuffers.java#L104-L106
ysc/QuestionAnsweringSystem
deep-qa/src/main/java/org/apdplat/qa/util/TextExtract.java
TextExtract.parse
public static String parse(String _html, boolean _flag) { """ 判断传入HTML,若是主题类网页,则抽取正文;否则输出<b>"unkown"</b>。 @param _html 网页HTML字符串 @param _flag true进行主题类判断, 省略此参数则默认为false @return 网页正文string """ flag = _flag; html = _html; preProcess(); // System.out.println(html); re...
java
public static String parse(String _html, boolean _flag) { flag = _flag; html = _html; preProcess(); // System.out.println(html); return getText(); }
[ "public", "static", "String", "parse", "(", "String", "_html", ",", "boolean", "_flag", ")", "{", "flag", "=", "_flag", ";", "html", "=", "_html", ";", "preProcess", "(", ")", ";", "//\t\tSystem.out.println(html);\r", "return", "getText", "(", ")", ";", "}...
判断传入HTML,若是主题类网页,则抽取正文;否则输出<b>"unkown"</b>。 @param _html 网页HTML字符串 @param _flag true进行主题类判断, 省略此参数则默认为false @return 网页正文string
[ "判断传入HTML,若是主题类网页,则抽取正文;否则输出<b", ">", "unkown", "<", "/", "b", ">", "。" ]
train
https://github.com/ysc/QuestionAnsweringSystem/blob/83f43625f1e0c2f4b72ebca7b0d8282fdf77c997/deep-qa/src/main/java/org/apdplat/qa/util/TextExtract.java#L81-L87
haraldk/TwelveMonkeys
common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java
IndexImage.createSolid
private static BufferedImage createSolid(BufferedImage pOriginal, Color pBackground) { """ Creates a copy of the given image, with a solid background @param pOriginal the original image @param pBackground the background color @return a new {@code BufferedImage} """ // Create a temporary image o...
java
private static BufferedImage createSolid(BufferedImage pOriginal, Color pBackground) { // Create a temporary image of same dimension and type BufferedImage solid = new BufferedImage(pOriginal.getColorModel(), pOriginal.copyData(null), pOriginal.isAlphaPremultiplied(), null); Graphics2D g = so...
[ "private", "static", "BufferedImage", "createSolid", "(", "BufferedImage", "pOriginal", ",", "Color", "pBackground", ")", "{", "// Create a temporary image of same dimension and type\r", "BufferedImage", "solid", "=", "new", "BufferedImage", "(", "pOriginal", ".", "getColor...
Creates a copy of the given image, with a solid background @param pOriginal the original image @param pBackground the background color @return a new {@code BufferedImage}
[ "Creates", "a", "copy", "of", "the", "given", "image", "with", "a", "solid", "background" ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java#L1164-L1180
elki-project/elki
elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java
Logging.debugFiner
public void debugFiner(CharSequence message, Throwable e) { """ Log a message at the 'finer' debugging level. You should check isDebugging() before building the message. @param message Informational log message. @param e Exception """ log(Level.FINER, message, e); }
java
public void debugFiner(CharSequence message, Throwable e) { log(Level.FINER, message, e); }
[ "public", "void", "debugFiner", "(", "CharSequence", "message", ",", "Throwable", "e", ")", "{", "log", "(", "Level", ".", "FINER", ",", "message", ",", "e", ")", ";", "}" ]
Log a message at the 'finer' debugging level. You should check isDebugging() before building the message. @param message Informational log message. @param e Exception
[ "Log", "a", "message", "at", "the", "finer", "debugging", "level", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/Logging.java#L491-L493
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.deleteSasDefinition
public DeletedSasDefinitionBundle deleteSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { """ Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. @param vaultBaseUrl The vault name, for example https://myvau...
java
public DeletedSasDefinitionBundle deleteSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) { return deleteSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).toBlocking().single().body(); }
[ "public", "DeletedSasDefinitionBundle", "deleteSasDefinition", "(", "String", "vaultBaseUrl", ",", "String", "storageAccountName", ",", "String", "sasDefinitionName", ")", "{", "return", "deleteSasDefinitionWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "storageAccountNam...
Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param storageAccountName The name of the storage account. @param sasDefinitionName The name of the SAS definition. @thro...
[ "Deletes", "a", "SAS", "definition", "from", "a", "specified", "storage", "account", ".", "This", "operation", "requires", "the", "storage", "/", "deletesas", "permission", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L11069-L11071
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/jaxrs/utils/ThreadLocalProxyCopyOnWriteArrayList.java
ThreadLocalProxyCopyOnWriteArrayList.set
@Override public E set(int index, E element) { """ Replaces the element at the specified position in this list with the specified element. @throws IndexOutOfBoundsException {@inheritDoc} """ final ReentrantLock lock = this.lock; lock.lock(); try { Object[] elements =...
java
@Override public E set(int index, E element) { final ReentrantLock lock = this.lock; lock.lock(); try { Object[] elements = getArray(); E oldValue = get(elements, index); if (oldValue != element) { int len = elements.length; ...
[ "@", "Override", "public", "E", "set", "(", "int", "index", ",", "E", "element", ")", "{", "final", "ReentrantLock", "lock", "=", "this", ".", "lock", ";", "lock", ".", "lock", "(", ")", ";", "try", "{", "Object", "[", "]", "elements", "=", "getArr...
Replaces the element at the specified position in this list with the specified element. @throws IndexOutOfBoundsException {@inheritDoc}
[ "Replaces", "the", "element", "at", "the", "specified", "position", "in", "this", "list", "with", "the", "specified", "element", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/jaxrs/utils/ThreadLocalProxyCopyOnWriteArrayList.java#L325-L346
alexcojocaru/elasticsearch-maven-plugin
src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/util/FilesystemUtil.java
FilesystemUtil.setScriptPermission
public static void setScriptPermission(InstanceConfiguration config, String scriptName) { """ Set the 755 permissions on the given script. @param config - the instance config @param scriptName - the name of the script (located in the bin directory) to make executable """ if (SystemUtils.IS_OS_WINDOWS...
java
public static void setScriptPermission(InstanceConfiguration config, String scriptName) { if (SystemUtils.IS_OS_WINDOWS) { // we do not have file permissions on windows return; } if (VersionUtil.isEqualOrGreater_7_0_0(config.getClusterConfiguration().getVersio...
[ "public", "static", "void", "setScriptPermission", "(", "InstanceConfiguration", "config", ",", "String", "scriptName", ")", "{", "if", "(", "SystemUtils", ".", "IS_OS_WINDOWS", ")", "{", "// we do not have file permissions on windows", "return", ";", "}", "if", "(", ...
Set the 755 permissions on the given script. @param config - the instance config @param scriptName - the name of the script (located in the bin directory) to make executable
[ "Set", "the", "755", "permissions", "on", "the", "given", "script", "." ]
train
https://github.com/alexcojocaru/elasticsearch-maven-plugin/blob/c283053cf99dc6b6d411b58629364b6aae62b7f8/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/util/FilesystemUtil.java#L83-L106
xmlunit/xmlunit
xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java
DefaultComparisonFormatter.appendProcessingInstruction
protected void appendProcessingInstruction(StringBuilder sb, ProcessingInstruction instr) { """ Formats a processing instruction for {@link #getShortString}. @param sb the builder to append to @param instr the processing instruction @since XMLUnit 2.4.0 """ sb.append("<?") .append(in...
java
protected void appendProcessingInstruction(StringBuilder sb, ProcessingInstruction instr) { sb.append("<?") .append(instr.getTarget()) .append(' ').append(instr.getData()) .append("?>"); }
[ "protected", "void", "appendProcessingInstruction", "(", "StringBuilder", "sb", ",", "ProcessingInstruction", "instr", ")", "{", "sb", ".", "append", "(", "\"<?\"", ")", ".", "append", "(", "instr", ".", "getTarget", "(", ")", ")", ".", "append", "(", "'", ...
Formats a processing instruction for {@link #getShortString}. @param sb the builder to append to @param instr the processing instruction @since XMLUnit 2.4.0
[ "Formats", "a", "processing", "instruction", "for", "{", "@link", "#getShortString", "}", "." ]
train
https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L248-L253
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ComponentAccess.java
ComponentAccess.getMethodOfInterest
@SuppressWarnings("unchecked") private static Method getMethodOfInterest(Object cmp, Class<? extends Annotation> ann) { """ Find the execute method. @Execute or execute() will match in this order. @param cmp the Object where to look for @return the method """ Class cmpClass = cmp.getClass(); ...
java
@SuppressWarnings("unchecked") private static Method getMethodOfInterest(Object cmp, Class<? extends Annotation> ann) { Class cmpClass = cmp.getClass(); Class infoClass = infoClass(cmpClass); Method[] ms = infoClass.getMethods(); for (Method m : ms) { if (m.getAnnotation(...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "Method", "getMethodOfInterest", "(", "Object", "cmp", ",", "Class", "<", "?", "extends", "Annotation", ">", "ann", ")", "{", "Class", "cmpClass", "=", "cmp", ".", "getClass", "(", ")",...
Find the execute method. @Execute or execute() will match in this order. @param cmp the Object where to look for @return the method
[ "Find", "the", "execute", "method", ".", "@Execute", "or", "execute", "()", "will", "match", "in", "this", "order", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ComponentAccess.java#L208-L226
aws/aws-sdk-java
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/DescribeTrainingJobResult.java
DescribeTrainingJobResult.withHyperParameters
public DescribeTrainingJobResult withHyperParameters(java.util.Map<String, String> hyperParameters) { """ <p> Algorithm-specific parameters. </p> @param hyperParameters Algorithm-specific parameters. @return Returns a reference to this object so that method calls can be chained together. """ set...
java
public DescribeTrainingJobResult withHyperParameters(java.util.Map<String, String> hyperParameters) { setHyperParameters(hyperParameters); return this; }
[ "public", "DescribeTrainingJobResult", "withHyperParameters", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "hyperParameters", ")", "{", "setHyperParameters", "(", "hyperParameters", ")", ";", "return", "this", ";", "}" ]
<p> Algorithm-specific parameters. </p> @param hyperParameters Algorithm-specific parameters. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Algorithm", "-", "specific", "parameters", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/DescribeTrainingJobResult.java#L1832-L1835
google/error-prone
check_api/src/main/java/com/google/errorprone/matchers/Matchers.java
Matchers.compoundAssignment
public static CompoundAssignment compoundAssignment( Kind operator, Matcher<ExpressionTree> leftOperandMatcher, Matcher<ExpressionTree> rightOperandMatcher) { """ Matches a compound assignment operator AST node which matches a given left-operand matcher, a given right-operand matcher, and a spec...
java
public static CompoundAssignment compoundAssignment( Kind operator, Matcher<ExpressionTree> leftOperandMatcher, Matcher<ExpressionTree> rightOperandMatcher) { Set<Kind> operators = new HashSet<>(1); operators.add(operator); return new CompoundAssignment(operators, leftOperandMatcher, right...
[ "public", "static", "CompoundAssignment", "compoundAssignment", "(", "Kind", "operator", ",", "Matcher", "<", "ExpressionTree", ">", "leftOperandMatcher", ",", "Matcher", "<", "ExpressionTree", ">", "rightOperandMatcher", ")", "{", "Set", "<", "Kind", ">", "operator...
Matches a compound assignment operator AST node which matches a given left-operand matcher, a given right-operand matcher, and a specific compound assignment operator. @param operator Which compound assignment operator to match against. @param leftOperandMatcher The matcher to apply to the left operand. @param rightOp...
[ "Matches", "a", "compound", "assignment", "operator", "AST", "node", "which", "matches", "a", "given", "left", "-", "operand", "matcher", "a", "given", "right", "-", "operand", "matcher", "and", "a", "specific", "compound", "assignment", "operator", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L254-L261
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainImpl.java
JsMainImpl.getMessagingEngine
public JsMessagingEngine getMessagingEngine(String busName, String engine) { """ Get an instance of a messaging engine @param busName @param engine @return JsMessagingEngine """ String thisMethodName = CLASS_NAME + ".getMessagingEngine(String, String)"; if...
java
public JsMessagingEngine getMessagingEngine(String busName, String engine) { String thisMethodName = CLASS_NAME + ".getMessagingEngine(String, String)"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, new Ob...
[ "public", "JsMessagingEngine", "getMessagingEngine", "(", "String", "busName", ",", "String", "engine", ")", "{", "String", "thisMethodName", "=", "CLASS_NAME", "+", "\".getMessagingEngine(String, String)\"", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", ...
Get an instance of a messaging engine @param busName @param engine @return JsMessagingEngine
[ "Get", "an", "instance", "of", "a", "messaging", "engine" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainImpl.java#L655-L690
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/handler/impl/CudaZeroHandler.java
CudaZeroHandler.memcpyBlocking
@Override public void memcpyBlocking(DataBuffer dstBuffer, Pointer srcPointer, long length, long dstOffset) { """ Synchronous version of memcpy. @param dstBuffer @param srcPointer @param length @param dstOffset """ // internally it's just memcpyAsync + sync CudaContext context = get...
java
@Override public void memcpyBlocking(DataBuffer dstBuffer, Pointer srcPointer, long length, long dstOffset) { // internally it's just memcpyAsync + sync CudaContext context = getCudaContext(); memcpyAsync(dstBuffer, srcPointer, length, dstOffset); context.syncOldStream(); }
[ "@", "Override", "public", "void", "memcpyBlocking", "(", "DataBuffer", "dstBuffer", ",", "Pointer", "srcPointer", ",", "long", "length", ",", "long", "dstOffset", ")", "{", "// internally it's just memcpyAsync + sync", "CudaContext", "context", "=", "getCudaContext", ...
Synchronous version of memcpy. @param dstBuffer @param srcPointer @param length @param dstOffset
[ "Synchronous", "version", "of", "memcpy", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/handler/impl/CudaZeroHandler.java#L696-L702
OpenBEL/openbel-framework
org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/CacheUtil.java
CacheUtil.copyWithDecompression
private static File copyWithDecompression(final File resource, final String resourceLocation, final File copy) throws ResourceDownloadError { """ Copies the <tt>resource</tt> to <tt>copy</tt>. Decompression is performed if the resource file is identified as a GZIP-encoded file. @param ...
java
private static File copyWithDecompression(final File resource, final String resourceLocation, final File copy) throws ResourceDownloadError { GZIPInputStream gzipis = null; FileOutputStream fout = null; try { MagicNumberFileFilter mnff = new MagicNumberFileFil...
[ "private", "static", "File", "copyWithDecompression", "(", "final", "File", "resource", ",", "final", "String", "resourceLocation", ",", "final", "File", "copy", ")", "throws", "ResourceDownloadError", "{", "GZIPInputStream", "gzipis", "=", "null", ";", "FileOutputS...
Copies the <tt>resource</tt> to <tt>copy</tt>. Decompression is performed if the resource file is identified as a GZIP-encoded file. @param resource {@link File}, the resource to copy @param resourceLocation {@link String}, the resource location url @param copy {@link File}, the file to copy to @return {@link File}, ...
[ "Copies", "the", "<tt", ">", "resource<", "/", "tt", ">", "to", "<tt", ">", "copy<", "/", "tt", ">", ".", "Decompression", "is", "performed", "if", "the", "resource", "file", "is", "identified", "as", "a", "GZIP", "-", "encoded", "file", "." ]
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/CacheUtil.java#L297-L333
moparisthebest/beehive
beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java
SqlStatement.loadSQLAnnotationStatmentOptions
private void loadSQLAnnotationStatmentOptions(ControlBeanContext context, Method method) { """ Load element values from the SQL annotation which apply to Statements. @param context ControlBeanContext instance. @param method Annotated method. """ final JdbcControl.SQL methodSQL = (JdbcControl.SQL)...
java
private void loadSQLAnnotationStatmentOptions(ControlBeanContext context, Method method) { final JdbcControl.SQL methodSQL = (JdbcControl.SQL) context.getMethodPropertySet(method, JdbcControl.SQL.class); _batchUpdate = methodSQL.batchUpdate(); _getGeneratedKeys = methodSQL.getGeneratedKeys(); ...
[ "private", "void", "loadSQLAnnotationStatmentOptions", "(", "ControlBeanContext", "context", ",", "Method", "method", ")", "{", "final", "JdbcControl", ".", "SQL", "methodSQL", "=", "(", "JdbcControl", ".", "SQL", ")", "context", ".", "getMethodPropertySet", "(", ...
Load element values from the SQL annotation which apply to Statements. @param context ControlBeanContext instance. @param method Annotated method.
[ "Load", "element", "values", "from", "the", "SQL", "annotation", "which", "apply", "to", "Statements", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/SqlStatement.java#L455-L470
QSFT/Doradus
doradus-common/src/main/java/com/dell/doradus/management/CronUtils.java
CronUtils.replaceChars
private static String replaceChars(String e, String chars1, String chars2) { """ Replaces in first argument string all the characters of the second argument string to the characters of the third argument string. Actually the source string is divided into "parts", and replacing takes place in every part before a ...
java
private static String replaceChars(String e, String chars1, String chars2) { assert chars1.length() == chars2.length(); String[] parts = e.split(","); for (int i = 0; i < parts.length; ++i) { String[] elems = parts[i].split("/"); for (int j = 0; j < chars1.length(); ++j) { elems[0] = elems[0]....
[ "private", "static", "String", "replaceChars", "(", "String", "e", ",", "String", "chars1", ",", "String", "chars2", ")", "{", "assert", "chars1", ".", "length", "(", ")", "==", "chars2", ".", "length", "(", ")", ";", "String", "[", "]", "parts", "=", ...
Replaces in first argument string all the characters of the second argument string to the characters of the third argument string. Actually the source string is divided into "parts", and replacing takes place in every part before a slash symbol (if exists), but not after it. @param e Source string @param chars1 Char...
[ "Replaces", "in", "first", "argument", "string", "all", "the", "characters", "of", "the", "second", "argument", "string", "to", "the", "characters", "of", "the", "third", "argument", "string", ".", "Actually", "the", "source", "string", "is", "divided", "into"...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/management/CronUtils.java#L153-L165
redkale/redkale
src/org/redkale/net/http/HttpResponse.java
HttpResponse.finishJson
public void finishJson(final JsonConvert convert, final Object obj) { """ 将对象以JSON格式输出 @param convert 指定的JsonConvert @param obj 输出对象 """ this.contentType = this.jsonContentType; if (this.recycleListener != null) this.output = obj; finish(convert.convertTo(getBodyBufferSupplie...
java
public void finishJson(final JsonConvert convert, final Object obj) { this.contentType = this.jsonContentType; if (this.recycleListener != null) this.output = obj; finish(convert.convertTo(getBodyBufferSupplier(), obj)); }
[ "public", "void", "finishJson", "(", "final", "JsonConvert", "convert", ",", "final", "Object", "obj", ")", "{", "this", ".", "contentType", "=", "this", ".", "jsonContentType", ";", "if", "(", "this", ".", "recycleListener", "!=", "null", ")", "this", "."...
将对象以JSON格式输出 @param convert 指定的JsonConvert @param obj 输出对象
[ "将对象以JSON格式输出" ]
train
https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpResponse.java#L321-L325
gresrun/jesque
src/main/java/net/greghaines/jesque/utils/JesqueUtils.java
JesqueUtils.createKey
public static String createKey(final String namespace, final Iterable<String> parts) { """ Builds a namespaced Redis key with the given arguments. @param namespace the namespace to use @param parts the key parts to be joined @return an assembled String key """ final List<String> list = new Linke...
java
public static String createKey(final String namespace, final Iterable<String> parts) { final List<String> list = new LinkedList<String>(); if (!"".equals(namespace)) { list.add(namespace); } for (final String part : parts) { list.add(part); } retur...
[ "public", "static", "String", "createKey", "(", "final", "String", "namespace", ",", "final", "Iterable", "<", "String", ">", "parts", ")", "{", "final", "List", "<", "String", ">", "list", "=", "new", "LinkedList", "<", "String", ">", "(", ")", ";", "...
Builds a namespaced Redis key with the given arguments. @param namespace the namespace to use @param parts the key parts to be joined @return an assembled String key
[ "Builds", "a", "namespaced", "Redis", "key", "with", "the", "given", "arguments", "." ]
train
https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L111-L120
alkacon/opencms-core
src-modules/org/opencms/workplace/commons/CmsDelete.java
CmsDelete.actionDelete
public void actionDelete() throws JspException { """ Performs the delete action, will be called by the JSP page.<p> @throws JspException if problems including sub-elements occur """ // save initialized instance of this class in request attribute for included sub-elements getJsp().getRequest...
java
public void actionDelete() throws JspException { // save initialized instance of this class in request attribute for included sub-elements getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this); try { boolean isFolder = false; if (!isMultiOperation()) { ...
[ "public", "void", "actionDelete", "(", ")", "throws", "JspException", "{", "// save initialized instance of this class in request attribute for included sub-elements", "getJsp", "(", ")", ".", "getRequest", "(", ")", ".", "setAttribute", "(", "SESSION_WORKPLACE_CLASS", ",", ...
Performs the delete action, will be called by the JSP page.<p> @throws JspException if problems including sub-elements occur
[ "Performs", "the", "delete", "action", "will", "be", "called", "by", "the", "JSP", "page", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsDelete.java#L126-L152
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java
BuildTasksInner.listAsync
public Observable<Page<BuildTaskInner>> listAsync(final String resourceGroupName, final String registryName, final String filter, final String skipToken) { """ Lists all the build tasks for a specified container registry. @param resourceGroupName The name of the resource group to which the container registry be...
java
public Observable<Page<BuildTaskInner>> listAsync(final String resourceGroupName, final String registryName, final String filter, final String skipToken) { return listWithServiceResponseAsync(resourceGroupName, registryName, filter, skipToken) .map(new Func1<ServiceResponse<Page<BuildTaskInner>>, Pa...
[ "public", "Observable", "<", "Page", "<", "BuildTaskInner", ">", ">", "listAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "registryName", ",", "final", "String", "filter", ",", "final", "String", "skipToken", ")", "{", "return", "...
Lists all the build tasks for a specified container registry. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param filter The build task filter to apply on the operation. @param skipToken $skipToken is supported ...
[ "Lists", "all", "the", "build", "tasks", "for", "a", "specified", "container", "registry", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java#L280-L288
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/ImplementationImpl.java
ImplementationImpl.newDBag
public DBag newDBag() { """ Create a new <code>DBag</code> object. @return The new <code>DBag</code> object. @see DBag """ if ((getCurrentDatabase() == null)) { throw new DatabaseClosedException("Database is NULL, cannot create a DBag with a null database."); } ...
java
public DBag newDBag() { if ((getCurrentDatabase() == null)) { throw new DatabaseClosedException("Database is NULL, cannot create a DBag with a null database."); } return (DBag) DBagFactory.singleton.createCollectionOrMap(getCurrentPBKey()); }
[ "public", "DBag", "newDBag", "(", ")", "{", "if", "(", "(", "getCurrentDatabase", "(", ")", "==", "null", ")", ")", "{", "throw", "new", "DatabaseClosedException", "(", "\"Database is NULL, cannot create a DBag with a null database.\"", ")", ";", "}", "return", "(...
Create a new <code>DBag</code> object. @return The new <code>DBag</code> object. @see DBag
[ "Create", "a", "new", "<code", ">", "DBag<", "/", "code", ">", "object", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ImplementationImpl.java#L225-L232
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceGraphModule.java
ServiceGraphModule.removeDependency
public ServiceGraphModule removeDependency(Key<?> key, Key<?> keyDependency) { """ Removes the dependency @param key key for removing dependency @param keyDependency key of dependency @return ServiceGraphModule with change """ removedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).a...
java
public ServiceGraphModule removeDependency(Key<?> key, Key<?> keyDependency) { removedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).add(keyDependency); return this; }
[ "public", "ServiceGraphModule", "removeDependency", "(", "Key", "<", "?", ">", "key", ",", "Key", "<", "?", ">", "keyDependency", ")", "{", "removedDependencies", ".", "computeIfAbsent", "(", "key", ",", "key1", "->", "new", "HashSet", "<>", "(", ")", ")",...
Removes the dependency @param key key for removing dependency @param keyDependency key of dependency @return ServiceGraphModule with change
[ "Removes", "the", "dependency" ]
train
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceGraphModule.java#L185-L188
jamesagnew/hapi-fhir
hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Date.java
Date.trySeconds
private Long trySeconds(String str) { """ /* Try to parse `str` into a Date and return this Date as seconds since EPOCH, or null if it could not be parsed. """ for(String pattern : datePatterns) { SimpleDateFormat parser = new SimpleDateFormat(pattern, locale); try { ...
java
private Long trySeconds(String str) { for(String pattern : datePatterns) { SimpleDateFormat parser = new SimpleDateFormat(pattern, locale); try { long milliseconds = parser.parse(str).getTime(); return milliseconds / 1000L; } cat...
[ "private", "Long", "trySeconds", "(", "String", "str", ")", "{", "for", "(", "String", "pattern", ":", "datePatterns", ")", "{", "SimpleDateFormat", "parser", "=", "new", "SimpleDateFormat", "(", "pattern", ",", "locale", ")", ";", "try", "{", "long", "mil...
/* Try to parse `str` into a Date and return this Date as seconds since EPOCH, or null if it could not be parsed.
[ "/", "*", "Try", "to", "parse", "str", "into", "a", "Date", "and", "return", "this", "Date", "as", "seconds", "since", "EPOCH", "or", "null", "if", "it", "could", "not", "be", "parsed", "." ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Date.java#L237-L254
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrTokenizer.java
StrTokenizer.readNextToken
private int readNextToken(final char[] srcChars, int start, final int len, final StrBuilder workArea, final List<String> tokenList) { """ Reads character by character through the String to get the next token. @param srcChars the character array being tokenized @param start the first character of field @para...
java
private int readNextToken(final char[] srcChars, int start, final int len, final StrBuilder workArea, final List<String> tokenList) { // skip all leading whitespace, unless it is the // field delimiter or the quote character while (start < len) { final int removeLen = Math.max( ...
[ "private", "int", "readNextToken", "(", "final", "char", "[", "]", "srcChars", ",", "int", "start", ",", "final", "int", "len", ",", "final", "StrBuilder", "workArea", ",", "final", "List", "<", "String", ">", "tokenList", ")", "{", "// skip all leading whit...
Reads character by character through the String to get the next token. @param srcChars the character array being tokenized @param start the first character of field @param len the length of the character array being tokenized @param workArea a temporary work area @param tokenList the list of parsed tokens @return...
[ "Reads", "character", "by", "character", "through", "the", "String", "to", "get", "the", "next", "token", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrTokenizer.java#L694-L728
threerings/playn
core/src/playn/core/gl/GLContext.java
GLContext.pushScissorState
protected Rectangle pushScissorState (int x, int y, int width, int height) { """ Adds the given rectangle to the scissors stack, intersecting with the previous one if it exists. Intended for use by subclasses to implement {@link #startClipped} and {@link #endClipped}. <p>NOTE: calls to this method <b>must</b>...
java
protected Rectangle pushScissorState (int x, int y, int width, int height) { // grow the scissors buffer if necessary if (scissorDepth == scissors.size()) { scissors.add(new Rectangle()); } Rectangle r = scissors.get(scissorDepth); if (scissorDepth == 0) { r.setBounds(x, y...
[ "protected", "Rectangle", "pushScissorState", "(", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ")", "{", "// grow the scissors buffer if necessary", "if", "(", "scissorDepth", "==", "scissors", ".", "size", "(", ")", ")", "{", "sc...
Adds the given rectangle to the scissors stack, intersecting with the previous one if it exists. Intended for use by subclasses to implement {@link #startClipped} and {@link #endClipped}. <p>NOTE: calls to this method <b>must</b> be matched by a corresponding call {@link #popScissorState}, or all hell will break loose...
[ "Adds", "the", "given", "rectangle", "to", "the", "scissors", "stack", "intersecting", "with", "the", "previous", "one", "if", "it", "exists", ".", "Intended", "for", "use", "by", "subclasses", "to", "implement", "{", "@link", "#startClipped", "}", "and", "{...
train
https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/gl/GLContext.java#L361-L379
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.rotateZYX
public Matrix4d rotateZYX(Vector3d angles) { """ Apply rotation of <code>angles.z</code> radians about the Z axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and followed by a rotation of <code>angles.x</code> radians about the X axis. <p> When used with a right-handed coordinate s...
java
public Matrix4d rotateZYX(Vector3d angles) { return rotateZYX(angles.z, angles.y, angles.x); }
[ "public", "Matrix4d", "rotateZYX", "(", "Vector3d", "angles", ")", "{", "return", "rotateZYX", "(", "angles", ".", "z", ",", "angles", ".", "y", ",", "angles", ".", "x", ")", ";", "}" ]
Apply rotation of <code>angles.z</code> radians about the Z axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and followed by a rotation of <code>angles.x</code> radians about the X axis. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter...
[ "Apply", "rotation", "of", "<code", ">", "angles", ".", "z<", "/", "code", ">", "radians", "about", "the", "Z", "axis", "followed", "by", "a", "rotation", "of", "<code", ">", "angles", ".", "y<", "/", "code", ">", "radians", "about", "the", "Y", "axi...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L6437-L6439
qiniu/java-sdk
src/main/java/com/qiniu/storage/BucketManager.java
BucketManager.listV1
public Response listV1(String bucket, String prefix, String marker, int limit, String delimiter) throws QiniuException { """ 列举空间文件 v1 接口,返回一个 response 对象。 @param bucket 空间名 @param prefix 文件名前缀 @param marker 上一次获取文件列表时返回的 marker @param limit 每次迭代的长度限制,最大1000,推荐值 100 @param delimiter...
java
public Response listV1(String bucket, String prefix, String marker, int limit, String delimiter) throws QiniuException { String url = String.format("%s/list?%s", configuration.rsfHost(auth.accessKey, bucket), listQuery(bucket, prefix, marker, limit, delimiter)); return get(ur...
[ "public", "Response", "listV1", "(", "String", "bucket", ",", "String", "prefix", ",", "String", "marker", ",", "int", "limit", ",", "String", "delimiter", ")", "throws", "QiniuException", "{", "String", "url", "=", "String", ".", "format", "(", "\"%s/list?%...
列举空间文件 v1 接口,返回一个 response 对象。 @param bucket 空间名 @param prefix 文件名前缀 @param marker 上一次获取文件列表时返回的 marker @param limit 每次迭代的长度限制,最大1000,推荐值 100 @param delimiter 指定目录分隔符,列出所有公共前缀(模拟列出目录效果)。缺省值为空字符串 @return @throws QiniuException
[ "列举空间文件", "v1", "接口,返回一个", "response", "对象。" ]
train
https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/storage/BucketManager.java#L170-L175
grpc/grpc-java
context/src/main/java/io/grpc/Context.java
Context.addListener
public void addListener(final CancellationListener cancellationListener, final Executor executor) { """ Add a listener that will be notified when the context becomes cancelled. """ checkNotNull(cancellationListener, "cancellationListener"); checkNotNull(executor, "executor"); ...
java
public void addListener(final CancellationListener cancellationListener, final Executor executor) { checkNotNull(cancellationListener, "cancellationListener"); checkNotNull(executor, "executor"); if (canBeCancelled()) { ExecutableListener executableListener = new Ex...
[ "public", "void", "addListener", "(", "final", "CancellationListener", "cancellationListener", ",", "final", "Executor", "executor", ")", "{", "checkNotNull", "(", "cancellationListener", ",", "\"cancellationListener\"", ")", ";", "checkNotNull", "(", "executor", ",", ...
Add a listener that will be notified when the context becomes cancelled.
[ "Add", "a", "listener", "that", "will", "be", "notified", "when", "the", "context", "becomes", "cancelled", "." ]
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/context/src/main/java/io/grpc/Context.java#L460-L485
alibaba/jstorm
jstorm-core/src/main/java/backtype/storm/task/GeneralTopologyContext.java
GeneralTopologyContext.getComponentOutputFields
public Fields getComponentOutputFields(String componentId, String streamId) { """ Gets the declared output fields for the specified component/stream. """ Fields ret = _componentToStreamToFields.get(componentId).get(streamId); if (ret == null) { throw new IllegalArgumentException("No...
java
public Fields getComponentOutputFields(String componentId, String streamId) { Fields ret = _componentToStreamToFields.get(componentId).get(streamId); if (ret == null) { throw new IllegalArgumentException("No output fields defined for component:stream " + componentId + ":" + streamId); ...
[ "public", "Fields", "getComponentOutputFields", "(", "String", "componentId", ",", "String", "streamId", ")", "{", "Fields", "ret", "=", "_componentToStreamToFields", ".", "get", "(", "componentId", ")", ".", "get", "(", "streamId", ")", ";", "if", "(", "ret",...
Gets the declared output fields for the specified component/stream.
[ "Gets", "the", "declared", "output", "fields", "for", "the", "specified", "component", "/", "stream", "." ]
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/task/GeneralTopologyContext.java#L145-L151
Azure/azure-sdk-for-java
iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java
IotHubResourcesInner.importDevicesAsync
public Observable<JobResponseInner> importDevicesAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { """ Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot...
java
public Observable<JobResponseInner> importDevicesAsync(String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { return importDevicesWithServiceResponseAsync(resourceGroupName, resourceName, importDevicesParameters).map(new Func1<ServiceResponse<JobResponseInner>, JobRespons...
[ "public", "Observable", "<", "JobResponseInner", ">", "importDevicesAsync", "(", "String", "resourceGroupName", ",", "String", "resourceName", ",", "ImportDevicesRequest", "importDevicesParameters", ")", "{", "return", "importDevicesWithServiceResponseAsync", "(", "resourceGr...
Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. Import, update, or delete device identities in the IoT hub identity registry from a blob. ...
[ "Import", "update", "or", "delete", "device", "identities", "in", "the", "IoT", "hub", "identity", "registry", "from", "a", "blob", ".", "For", "more", "information", "see", ":", "https", ":", "//", "docs", ".", "microsoft", ".", "com", "/", "azure", "/"...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L3194-L3201
thymeleaf/thymeleaf
src/main/java/org/thymeleaf/util/StringUtils.java
StringUtils.substring
public static String substring(final Object target, final int beginIndex) { """ <p> copy a part of target start beginIndex to the end of target. If non-String object, toString() will be called. </p> @param target source of the copy. @param beginIndex index where the copy start. @return part of target, or {...
java
public static String substring(final Object target, final int beginIndex) { if (target == null) { return null; } final String str = target.toString(); final int len = str.length(); Validate.isTrue(beginIndex >= 0 && beginIndex < len, "beginIndex must be >= 0 and < " ...
[ "public", "static", "String", "substring", "(", "final", "Object", "target", ",", "final", "int", "beginIndex", ")", "{", "if", "(", "target", "==", "null", ")", "{", "return", "null", ";", "}", "final", "String", "str", "=", "target", ".", "toString", ...
<p> copy a part of target start beginIndex to the end of target. If non-String object, toString() will be called. </p> @param target source of the copy. @param beginIndex index where the copy start. @return part of target, or {@code null} if target is null. @since 1.1.2
[ "<p", ">", "copy", "a", "part", "of", "target", "start", "beginIndex", "to", "the", "end", "of", "target", ".", "If", "non", "-", "String", "object", "toString", "()", "will", "be", "called", ".", "<", "/", "p", ">" ]
train
https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/util/StringUtils.java#L204-L215
glyptodon/guacamole-client
guacamole-common/src/main/java/org/apache/guacamole/websocket/GuacamoleWebSocketTunnelEndpoint.java
GuacamoleWebSocketTunnelEndpoint.closeConnection
private void closeConnection(Session session, int guacamoleStatusCode, int webSocketCode) { """ Sends the numeric Guacaomle Status Code and Web Socket code and closes the connection. @param session The outbound WebSocket connection to close. @param guacamoleStatusCode The numeric Guacamole sta...
java
private void closeConnection(Session session, int guacamoleStatusCode, int webSocketCode) { try { CloseCode code = CloseReason.CloseCodes.getCloseCode(webSocketCode); String message = Integer.toString(guacamoleStatusCode); session.close(new CloseReason(code, mess...
[ "private", "void", "closeConnection", "(", "Session", "session", ",", "int", "guacamoleStatusCode", ",", "int", "webSocketCode", ")", "{", "try", "{", "CloseCode", "code", "=", "CloseReason", ".", "CloseCodes", ".", "getCloseCode", "(", "webSocketCode", ")", ";"...
Sends the numeric Guacaomle Status Code and Web Socket code and closes the connection. @param session The outbound WebSocket connection to close. @param guacamoleStatusCode The numeric Guacamole status to send. @param webSocketCode The numeric WebSocket status to send.
[ "Sends", "the", "numeric", "Guacaomle", "Status", "Code", "and", "Web", "Socket", "code", "and", "closes", "the", "connection", "." ]
train
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole-common/src/main/java/org/apache/guacamole/websocket/GuacamoleWebSocketTunnelEndpoint.java#L100-L112
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java
RequestUtils.hasValidAuthentication
public static boolean hasValidAuthentication(String cookie) { """ Checks if the given header contains a valid authentication @param cookie The cookie to parse @return True if the cookie contains a valid authentication, false otherwise """ boolean valid = false; if (StringUtils.isNotBlank(co...
java
public static boolean hasValidAuthentication(String cookie) { boolean valid = false; if (StringUtils.isNotBlank(cookie)) { Config config = Application.getInstance(Config.class); String value = null; String [] contents = cookie.split(";"); for (String cont...
[ "public", "static", "boolean", "hasValidAuthentication", "(", "String", "cookie", ")", "{", "boolean", "valid", "=", "false", ";", "if", "(", "StringUtils", ".", "isNotBlank", "(", "cookie", ")", ")", "{", "Config", "config", "=", "Application", ".", "getIns...
Checks if the given header contains a valid authentication @param cookie The cookie to parse @return True if the cookie contains a valid authentication, false otherwise
[ "Checks", "if", "the", "given", "header", "contains", "a", "valid", "authentication" ]
train
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java#L121-L154
samskivert/samskivert
src/main/java/com/samskivert/swing/Label.java
Label.unescapeColors
private static String unescapeColors (String txt, boolean restore) { """ Un-escape escaped tags so that they look as the users intended. """ if (txt == null) return null; String prefix = restore ? "#" : "%"; return ESCAPED_PATTERN.matcher(txt).replaceAll(prefix + "$1"); }
java
private static String unescapeColors (String txt, boolean restore) { if (txt == null) return null; String prefix = restore ? "#" : "%"; return ESCAPED_PATTERN.matcher(txt).replaceAll(prefix + "$1"); }
[ "private", "static", "String", "unescapeColors", "(", "String", "txt", ",", "boolean", "restore", ")", "{", "if", "(", "txt", "==", "null", ")", "return", "null", ";", "String", "prefix", "=", "restore", "?", "\"#\"", ":", "\"%\"", ";", "return", "ESCAPE...
Un-escape escaped tags so that they look as the users intended.
[ "Un", "-", "escape", "escaped", "tags", "so", "that", "they", "look", "as", "the", "users", "intended", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/Label.java#L84-L89
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/io/TileProperties.java
TileProperties.getDoubleProperty
public Double getDoubleProperty(String property, boolean required) { """ Get the Double property @param property property @param required required flag @return double property """ Double doubleValue = null; String value = getProperty(property, required); if (value != null) { try { doubleVal...
java
public Double getDoubleProperty(String property, boolean required) { Double doubleValue = null; String value = getProperty(property, required); if (value != null) { try { doubleValue = Double.valueOf(value); } catch (NumberFormatException e) { throw new GeoPackageException(GEOPACKAGE_PROPERTIES_FILE...
[ "public", "Double", "getDoubleProperty", "(", "String", "property", ",", "boolean", "required", ")", "{", "Double", "doubleValue", "=", "null", ";", "String", "value", "=", "getProperty", "(", "property", ",", "required", ")", ";", "if", "(", "value", "!=", ...
Get the Double property @param property property @param required required flag @return double property
[ "Get", "the", "Double", "property" ]
train
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileProperties.java#L160-L173
cloudant/java-cloudant
cloudant-client/src/main/java/com/cloudant/client/internal/DatabaseURIHelper.java
DatabaseURIHelper.documentUri
public URI documentUri(String documentId, String key, Object value) { """ Returns URI for {@code documentId} with {@code query} key and value. """ return this.documentId(documentId).query(key, value).build(); }
java
public URI documentUri(String documentId, String key, Object value) { return this.documentId(documentId).query(key, value).build(); }
[ "public", "URI", "documentUri", "(", "String", "documentId", ",", "String", "key", ",", "Object", "value", ")", "{", "return", "this", ".", "documentId", "(", "documentId", ")", ".", "query", "(", "key", ",", "value", ")", ".", "build", "(", ")", ";", ...
Returns URI for {@code documentId} with {@code query} key and value.
[ "Returns", "URI", "for", "{" ]
train
https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/internal/DatabaseURIHelper.java#L134-L136
apache/groovy
subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java
SwingGroovyMethods.leftShift
public static JToolBar leftShift(JToolBar self, Action action) { """ Overloads the left shift operator to provide an easy way to add components to a toolBar.<p> @param self a JToolBar @param action an Action to be added to the toolBar. @return same toolBar, after the value was added to it. @since 1.6.4 ...
java
public static JToolBar leftShift(JToolBar self, Action action) { self.add(action); return self; }
[ "public", "static", "JToolBar", "leftShift", "(", "JToolBar", "self", ",", "Action", "action", ")", "{", "self", ".", "add", "(", "action", ")", ";", "return", "self", ";", "}" ]
Overloads the left shift operator to provide an easy way to add components to a toolBar.<p> @param self a JToolBar @param action an Action to be added to the toolBar. @return same toolBar, after the value was added to it. @since 1.6.4
[ "Overloads", "the", "left", "shift", "operator", "to", "provide", "an", "easy", "way", "to", "add", "components", "to", "a", "toolBar", ".", "<p", ">" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L1035-L1038
nohana/Amalgam
amalgam/src/main/java/com/amalgam/os/BundleUtils.java
BundleUtils.optBoolean
public static boolean optBoolean(@Nullable Bundle bundle, @Nullable String key, boolean fallback) { """ Returns a optional boolean value. In other words, returns the value mapped by key if it exists and is a boolean. The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a f...
java
public static boolean optBoolean(@Nullable Bundle bundle, @Nullable String key, boolean fallback) { if (bundle == null) { return fallback; } return bundle.getBoolean(key, fallback); }
[ "public", "static", "boolean", "optBoolean", "(", "@", "Nullable", "Bundle", "bundle", ",", "@", "Nullable", "String", "key", ",", "boolean", "fallback", ")", "{", "if", "(", "bundle", "==", "null", ")", "{", "return", "fallback", ";", "}", "return", "bu...
Returns a optional boolean value. In other words, returns the value mapped by key if it exists and is a boolean. The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value. @param bundle a bundle. If the bundle is null, this method will return a fallback value. @param...
[ "Returns", "a", "optional", "boolean", "value", ".", "In", "other", "words", "returns", "the", "value", "mapped", "by", "key", "if", "it", "exists", "and", "is", "a", "boolean", ".", "The", "bundle", "argument", "is", "allowed", "to", "be", "{" ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L138-L143
alkacon/opencms-core
src-modules/org/opencms/workplace/CmsMultiDialog.java
CmsMultiDialog.checkResourcePermissions
@Override protected boolean checkResourcePermissions(CmsPermissionSet required, boolean neededForFolder) { """ Checks if the permissions of the current user on the single resource to use in the dialog are sufficient.<p> For a multi resource operation, this returns always true, checks only for single resourc...
java
@Override protected boolean checkResourcePermissions(CmsPermissionSet required, boolean neededForFolder) { if (isMultiOperation()) { // for multi resource operation, return always true return true; } else { // check for single resource operation retur...
[ "@", "Override", "protected", "boolean", "checkResourcePermissions", "(", "CmsPermissionSet", "required", ",", "boolean", "neededForFolder", ")", "{", "if", "(", "isMultiOperation", "(", ")", ")", "{", "// for multi resource operation, return always true", "return", "true...
Checks if the permissions of the current user on the single resource to use in the dialog are sufficient.<p> For a multi resource operation, this returns always true, checks only for single resource operations.<p> @see CmsDialog#checkResourcePermissions(CmsPermissionSet, boolean) @param required the required permiss...
[ "Checks", "if", "the", "permissions", "of", "the", "current", "user", "on", "the", "single", "resource", "to", "use", "in", "the", "dialog", "are", "sufficient", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsMultiDialog.java#L324-L334
apache/groovy
subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
NioGroovyMethods.asType
@SuppressWarnings("unchecked") public static <T> T asType(Path path, Class<T> c) { """ Converts this Path to a {@link groovy.lang.Writable} or delegates to default {@link org.codehaus.groovy.runtime.DefaultGroovyMethods#asType(Object, Class)}. @param path a Path @param c the desired class @return the ...
java
@SuppressWarnings("unchecked") public static <T> T asType(Path path, Class<T> c) { if (c == Writable.class) { return (T) asWritable(path); } return DefaultGroovyMethods.asType((Object) path, c); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "T", "asType", "(", "Path", "path", ",", "Class", "<", "T", ">", "c", ")", "{", "if", "(", "c", "==", "Writable", ".", "class", ")", "{", "return", "(", "T", "...
Converts this Path to a {@link groovy.lang.Writable} or delegates to default {@link org.codehaus.groovy.runtime.DefaultGroovyMethods#asType(Object, Class)}. @param path a Path @param c the desired class @return the converted object @since 2.3.0
[ "Converts", "this", "Path", "to", "a", "{", "@link", "groovy", ".", "lang", ".", "Writable", "}", "or", "delegates", "to", "default", "{", "@link", "org", ".", "codehaus", ".", "groovy", ".", "runtime", ".", "DefaultGroovyMethods#asType", "(", "Object", "C...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1370-L1376
lucee/Lucee
core/src/main/java/lucee/runtime/db/DataSourceSupport.java
DataSourceSupport._initializeDriver
private static Driver _initializeDriver(ClassDefinition cd, Config config) throws ClassException, BundleException, InstantiationException, IllegalAccessException { """ /* private static ClassDefinition _initializeCD(JDBCDriver jdbc, ClassDefinition cd, Config config) { // try to link the class definition with a ...
java
private static Driver _initializeDriver(ClassDefinition cd, Config config) throws ClassException, BundleException, InstantiationException, IllegalAccessException { // load the class Class clazz = cd.getClazz(); return (Driver) clazz.newInstance(); }
[ "private", "static", "Driver", "_initializeDriver", "(", "ClassDefinition", "cd", ",", "Config", "config", ")", "throws", "ClassException", ",", "BundleException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "// load the class", "Class", "clazz", ...
/* private static ClassDefinition _initializeCD(JDBCDriver jdbc, ClassDefinition cd, Config config) { // try to link the class definition with a jdbc driver definition if (!cd.isBundle()) { if ("com.microsoft.jdbc.sqlserver.SQLServerDriver".equals(cd .getClassName())) { cd = new ClassDefinitionImpl( "com.microsoft.sqls...
[ "/", "*", "private", "static", "ClassDefinition", "_initializeCD", "(", "JDBCDriver", "jdbc", "ClassDefinition", "cd", "Config", "config", ")", "{", "//", "try", "to", "link", "the", "class", "definition", "with", "a", "jdbc", "driver", "definition", "if", "("...
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/DataSourceSupport.java#L130-L134
google/closure-compiler
src/com/google/javascript/jscomp/Tracer.java
Tracer.appendSpaces
@VisibleForTesting static void appendSpaces(StringBuilder sb, int numSpaces) { """ Gets a string of spaces of the length specified. @param sb The string builder to append to. @param numSpaces The number of spaces in the string. """ if (numSpaces > 16) { logger.warning("Tracer.appendSpaces called ...
java
@VisibleForTesting static void appendSpaces(StringBuilder sb, int numSpaces) { if (numSpaces > 16) { logger.warning("Tracer.appendSpaces called with large numSpaces"); // Avoid long loop in case some bug in the caller numSpaces = 16; } while (numSpaces >= 5) { sb.append(" "); ...
[ "@", "VisibleForTesting", "static", "void", "appendSpaces", "(", "StringBuilder", "sb", ",", "int", "numSpaces", ")", "{", "if", "(", "numSpaces", ">", "16", ")", "{", "logger", ".", "warning", "(", "\"Tracer.appendSpaces called with large numSpaces\"", ")", ";", ...
Gets a string of spaces of the length specified. @param sb The string builder to append to. @param numSpaces The number of spaces in the string.
[ "Gets", "a", "string", "of", "spaces", "of", "the", "length", "specified", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Tracer.java#L323-L350
xqbase/tuna
misc/src/main/java/com/xqbase/tuna/misc/DoSServerFilter.java
DoSServerFilter.setParameters
public void setParameters(int period, int connections, int requests, int bytes) { """ Reset the parameters @param period - The period, in milliseconds. @param connections - Maximum concurrent connections the same IP. @param requests - Maximum requests (connection events) in the period from the same IP. @para...
java
public void setParameters(int period, int connections, int requests, int bytes) { this.period = period; this.connections_ = connections; this.requests_ = requests; this.bytes_ = bytes; }
[ "public", "void", "setParameters", "(", "int", "period", ",", "int", "connections", ",", "int", "requests", ",", "int", "bytes", ")", "{", "this", ".", "period", "=", "period", ";", "this", ".", "connections_", "=", "connections", ";", "this", ".", "requ...
Reset the parameters @param period - The period, in milliseconds. @param connections - Maximum concurrent connections the same IP. @param requests - Maximum requests (connection events) in the period from the same IP. @param bytes - Maximum sent bytes in the period from the same IP.
[ "Reset", "the", "parameters" ]
train
https://github.com/xqbase/tuna/blob/60d05a9e03877a3daafe9de83dc4427c6cbb9995/misc/src/main/java/com/xqbase/tuna/misc/DoSServerFilter.java#L127-L132
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/gen/MasterStorableGenerator.java
MasterStorableGenerator.addEnterTransaction
private Label addEnterTransaction(CodeBuilder b, String opType, LocalVariable txnVar) { """ Generates code to enter a transaction, if required and if none in progress. @param opType type of operation, Insert, Update, or Delete @param txnVar required variable of type Transaction for storing transaction @return...
java
private Label addEnterTransaction(CodeBuilder b, String opType, LocalVariable txnVar) { if (!alwaysHasTxn(opType)) { return null; } // Repository repo = masterSupport.getRootRepository(); TypeDesc repositoryType = TypeDesc.forClass(Repository.class); TypeDes...
[ "private", "Label", "addEnterTransaction", "(", "CodeBuilder", "b", ",", "String", "opType", ",", "LocalVariable", "txnVar", ")", "{", "if", "(", "!", "alwaysHasTxn", "(", "opType", ")", ")", "{", "return", "null", ";", "}", "// Repository repo = masterSupport.g...
Generates code to enter a transaction, if required and if none in progress. @param opType type of operation, Insert, Update, or Delete @param txnVar required variable of type Transaction for storing transaction @return optional try start label for transaction
[ "Generates", "code", "to", "enter", "a", "transaction", "if", "required", "and", "if", "none", "in", "progress", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/MasterStorableGenerator.java#L1002-L1063
kaazing/java.client
amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java
AmqpChannel.closeChannel
public AmqpChannel closeChannel(int replyCode, String replyText, int classId, int methodId1) { """ This method indicates that the sender wants to close the channel. @param replyCode @param replyText @param classId @param methodId1 @return AmqpChannel """ if (readyState == ReadyState.CLOSED) { ...
java
public AmqpChannel closeChannel(int replyCode, String replyText, int classId, int methodId1) { if (readyState == ReadyState.CLOSED) { return this; } Object[] args = {replyCode, replyText, classId, methodId1}; WrappedByteBuffer bodyArg = null; HashMap<String, ...
[ "public", "AmqpChannel", "closeChannel", "(", "int", "replyCode", ",", "String", "replyText", ",", "int", "classId", ",", "int", "methodId1", ")", "{", "if", "(", "readyState", "==", "ReadyState", ".", "CLOSED", ")", "{", "return", "this", ";", "}", "Objec...
This method indicates that the sender wants to close the channel. @param replyCode @param replyText @param classId @param methodId1 @return AmqpChannel
[ "This", "method", "indicates", "that", "the", "sender", "wants", "to", "close", "the", "channel", "." ]
train
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L395-L410
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/VariableHelpers.java
VariableHelpers.updateNetworkVariables
static void updateNetworkVariables( Map<String,String> instanceExports, String ipAddress ) { """ Updates the exports of an instance with network values. <p> For the moment, only IP is supported. </p> @param instanceExports a non-null map of instance exports @param ipAddress the IP address to set """ ...
java
static void updateNetworkVariables( Map<String,String> instanceExports, String ipAddress ) { // Find the keys to update ( xxx.ip ) Set<String> keysToUpdate = new HashSet<> (); for( Map.Entry<String,String> entry : instanceExports.entrySet()) { String suffix = parseVariableName( entry.getKey()).getValue(); ...
[ "static", "void", "updateNetworkVariables", "(", "Map", "<", "String", ",", "String", ">", "instanceExports", ",", "String", "ipAddress", ")", "{", "// Find the keys to update ( xxx.ip )", "Set", "<", "String", ">", "keysToUpdate", "=", "new", "HashSet", "<>", "("...
Updates the exports of an instance with network values. <p> For the moment, only IP is supported. </p> @param instanceExports a non-null map of instance exports @param ipAddress the IP address to set
[ "Updates", "the", "exports", "of", "an", "instance", "with", "network", "values", ".", "<p", ">", "For", "the", "moment", "only", "IP", "is", "supported", ".", "<", "/", "p", ">" ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/VariableHelpers.java#L244-L257
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/I18nUtilities.java
I18nUtilities.asMessage
public static Serializable asMessage(final String text, final Serializable... args) { """ Converts a message String and optional message arguments to a an appropriate format for internationalisation. @param text the message text. @param args the message arguments. @return a message in an appropriate format fo...
java
public static Serializable asMessage(final String text, final Serializable... args) { if (text == null) { return null; } else if (args == null || args.length == 0) { return text; } else { return new Message(text, args); } }
[ "public", "static", "Serializable", "asMessage", "(", "final", "String", "text", ",", "final", "Serializable", "...", "args", ")", "{", "if", "(", "text", "==", "null", ")", "{", "return", "null", ";", "}", "else", "if", "(", "args", "==", "null", "||"...
Converts a message String and optional message arguments to a an appropriate format for internationalisation. @param text the message text. @param args the message arguments. @return a message in an appropriate format for internationalisation, may be null.
[ "Converts", "a", "message", "String", "and", "optional", "message", "arguments", "to", "a", "an", "appropriate", "format", "for", "internationalisation", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/I18nUtilities.java#L56-L64
matomo-org/piwik-java-tracker
src/main/java/org/piwik/java/tracking/PiwikRequest.java
PiwikRequest.setUserCustomVariable
@Deprecated public void setUserCustomVariable(String key, String value) { """ Set a visit custom variable with the specified key and value at the first available index. All visit custom variables with this key will be overwritten or deleted @param key the key of the variable to set @param value the value of...
java
@Deprecated public void setUserCustomVariable(String key, String value){ if (value == null){ removeCustomVariable(VISIT_CUSTOM_VARIABLE, key); } else { setCustomVariable(VISIT_CUSTOM_VARIABLE, new CustomVariable(key, value), null); } }
[ "@", "Deprecated", "public", "void", "setUserCustomVariable", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "removeCustomVariable", "(", "VISIT_CUSTOM_VARIABLE", ",", "key", ")", ";", "}", "else", "{", ...
Set a visit custom variable with the specified key and value at the first available index. All visit custom variables with this key will be overwritten or deleted @param key the key of the variable to set @param value the value of the variable to set at the specified key. A null value will remove this parameter @depre...
[ "Set", "a", "visit", "custom", "variable", "with", "the", "specified", "key", "and", "value", "at", "the", "first", "available", "index", ".", "All", "visit", "custom", "variables", "with", "this", "key", "will", "be", "overwritten", "or", "deleted" ]
train
https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1382-L1389
alkacon/opencms-core
src/org/opencms/db/generic/CmsVfsDriver.java
CmsVfsDriver.moveRelations
protected void moveRelations(CmsDbContext dbc, CmsUUID projectId, CmsUUID structureId, String rootPath) throws CmsDataAccessException { """ Moves all relations of a resource to the new path.<p> @param dbc the current database context @param projectId the id of the project to apply the changes @param struc...
java
protected void moveRelations(CmsDbContext dbc, CmsUUID projectId, CmsUUID structureId, String rootPath) throws CmsDataAccessException { Connection conn = null; PreparedStatement stmt = null; try { conn = m_sqlManager.getConnection(dbc); stmt = m_sqlManager.getPrepar...
[ "protected", "void", "moveRelations", "(", "CmsDbContext", "dbc", ",", "CmsUUID", "projectId", ",", "CmsUUID", "structureId", ",", "String", "rootPath", ")", "throws", "CmsDataAccessException", "{", "Connection", "conn", "=", "null", ";", "PreparedStatement", "stmt"...
Moves all relations of a resource to the new path.<p> @param dbc the current database context @param projectId the id of the project to apply the changes @param structureId the structure id of the resource to apply the changes to @param rootPath the new root path @throws CmsDataAccessException if something goes wrong
[ "Moves", "all", "relations", "of", "a", "resource", "to", "the", "new", "path", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L4113-L4140
census-instrumentation/opencensus-java
contrib/dropwizard/src/main/java/io/opencensus/contrib/dropwizard/DropWizardMetrics.java
DropWizardMetrics.collectGauge
@SuppressWarnings("rawtypes") @Nullable private Metric collectGauge(String dropwizardName, Gauge gauge) { """ Returns a {@code Metric} collected from {@link Gauge}. @param dropwizardName the metric name. @param gauge the gauge object to collect. @return a {@code Metric}. """ String metricName = Dr...
java
@SuppressWarnings("rawtypes") @Nullable private Metric collectGauge(String dropwizardName, Gauge gauge) { String metricName = DropWizardUtils.generateFullMetricName(dropwizardName, "gauge"); String metricDescription = DropWizardUtils.generateFullMetricDescription(dropwizardName, gauge); // Figure out w...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "@", "Nullable", "private", "Metric", "collectGauge", "(", "String", "dropwizardName", ",", "Gauge", "gauge", ")", "{", "String", "metricName", "=", "DropWizardUtils", ".", "generateFullMetricName", "(", "dropwizard...
Returns a {@code Metric} collected from {@link Gauge}. @param dropwizardName the metric name. @param gauge the gauge object to collect. @return a {@code Metric}.
[ "Returns", "a", "{", "@code", "Metric", "}", "collected", "from", "{", "@link", "Gauge", "}", "." ]
train
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/contrib/dropwizard/src/main/java/io/opencensus/contrib/dropwizard/DropWizardMetrics.java#L103-L132
ChannelFinder/javaCFClient
src/main/java/gov/bnl/channelfinder/api/ChannelFinderClientImpl.java
ChannelFinderClientImpl.findByTag
public Collection<Channel> findByTag(String pattern) throws ChannelFinderException { """ Search for channels with tags who's name match the pattern <tt>pattern</tt>.<br> The pattern can contain wildcard char * or ?.<br> @param pattern - the search pattern for the tag names @return A Collection of channels w...
java
public Collection<Channel> findByTag(String pattern) throws ChannelFinderException { // return wrappedSubmit(new FindByParam("~tag", pattern)); List<String> and = Arrays.asList(pattern.split("&")); MultivaluedMap<String, String> searchMap = new MultivaluedMapImpl(); for (String string : and) { searchMap.add(...
[ "public", "Collection", "<", "Channel", ">", "findByTag", "(", "String", "pattern", ")", "throws", "ChannelFinderException", "{", "// return wrappedSubmit(new FindByParam(\"~tag\", pattern));", "List", "<", "String", ">", "and", "=", "Arrays", ".", "asList", "(", "pat...
Search for channels with tags who's name match the pattern <tt>pattern</tt>.<br> The pattern can contain wildcard char * or ?.<br> @param pattern - the search pattern for the tag names @return A Collection of channels which contain tags who's name match the pattern <tt>pattern</tt> @throws ChannelFinderException - cha...
[ "Search", "for", "channels", "with", "tags", "who", "s", "name", "match", "the", "pattern", "<tt", ">", "pattern<", "/", "tt", ">", ".", "<br", ">", "The", "pattern", "can", "contain", "wildcard", "char", "*", "or", "?", ".", "<br", ">" ]
train
https://github.com/ChannelFinder/javaCFClient/blob/000fce53ad2b8f8c38ef24fec5b5ec65e383ac9d/src/main/java/gov/bnl/channelfinder/api/ChannelFinderClientImpl.java#L978-L986
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java
DatabasesInner.renameAsync
public Observable<Void> renameAsync(String resourceGroupName, String serverName, String databaseName, String id) { """ Renames a database. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serv...
java
public Observable<Void> renameAsync(String resourceGroupName, String serverName, String databaseName, String id) { return renameWithServiceResponseAsync(resourceGroupName, serverName, databaseName, id).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceRespo...
[ "public", "Observable", "<", "Void", ">", "renameAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ",", "String", "id", ")", "{", "return", "renameWithServiceResponseAsync", "(", "resourceGroupName", ",", "server...
Renames a database. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param databaseName The name of the database to rename. @param id The target ID for the resource...
[ "Renames", "a", "database", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L1598-L1605
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java
BaseNDArrayFactory.randn
@Override public INDArray randn(int[] shape, org.nd4j.linalg.api.rng.Random r) { """ Random normal using the given rng @param shape the shape of the ndarray @param r the random generator to use @return """ return r.nextGaussian(shape); }
java
@Override public INDArray randn(int[] shape, org.nd4j.linalg.api.rng.Random r) { return r.nextGaussian(shape); }
[ "@", "Override", "public", "INDArray", "randn", "(", "int", "[", "]", "shape", ",", "org", ".", "nd4j", ".", "linalg", ".", "api", ".", "rng", ".", "Random", "r", ")", "{", "return", "r", ".", "nextGaussian", "(", "shape", ")", ";", "}" ]
Random normal using the given rng @param shape the shape of the ndarray @param r the random generator to use @return
[ "Random", "normal", "using", "the", "given", "rng" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java#L635-L638
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/map/MapModel.java
MapModel.accept
public void accept(PainterVisitor visitor, Object group, Bbox bounds, boolean recursive) { """ Paintable implementation. First let the PainterVisitor paint this object, then if recursive is true, painter the layers in order. """ // Paint the MapModel itself (see MapModelPainter): visitor.visit(this, group...
java
public void accept(PainterVisitor visitor, Object group, Bbox bounds, boolean recursive) { // Paint the MapModel itself (see MapModelPainter): visitor.visit(this, group); // Paint the layers: if (recursive) { for (Layer<?> layer : layers) { if (layer.isShowing()) { layer.accept(visitor, group, boun...
[ "public", "void", "accept", "(", "PainterVisitor", "visitor", ",", "Object", "group", ",", "Bbox", "bounds", ",", "boolean", "recursive", ")", "{", "// Paint the MapModel itself (see MapModelPainter):", "visitor", ".", "visit", "(", "this", ",", "group", ")", ";",...
Paintable implementation. First let the PainterVisitor paint this object, then if recursive is true, painter the layers in order.
[ "Paintable", "implementation", ".", "First", "let", "the", "PainterVisitor", "paint", "this", "object", "then", "if", "recursive", "is", "true", "painter", "the", "layers", "in", "order", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapModel.java#L325-L345
vlingo/vlingo-actors
src/main/java/io/vlingo/actors/World.java
World.actorFor
public <T> T actorFor(final Class<T> protocol, final Class<? extends Actor> type, final Object...parameters) { """ Answers the {@code T} protocol of the newly created {@code Actor} that implements the {@code protocol}. @param protocol the {@code Class<T>} protocol @param type the {@code Class<? extends Actor>} o...
java
public <T> T actorFor(final Class<T> protocol, final Class<? extends Actor> type, final Object...parameters) { if (isTerminated()) { throw new IllegalStateException("vlingo/actors: Stopped."); } return stage().actorFor(protocol, type, parameters); }
[ "public", "<", "T", ">", "T", "actorFor", "(", "final", "Class", "<", "T", ">", "protocol", ",", "final", "Class", "<", "?", "extends", "Actor", ">", "type", ",", "final", "Object", "...", "parameters", ")", "{", "if", "(", "isTerminated", "(", ")", ...
Answers the {@code T} protocol of the newly created {@code Actor} that implements the {@code protocol}. @param protocol the {@code Class<T>} protocol @param type the {@code Class<? extends Actor>} of the {@code Actor} to create @param parameters the {@code Object[]} of constructor parameters @param <T> the protocol typ...
[ "Answers", "the", "{" ]
train
https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/World.java#L104-L110
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java
ColorConverter.newInstance
public static ColorConverter newInstance(Configuration config, String[] options) { """ Creates a new instance of the class. Required by Log4J2. @param config the configuration @param options the options @return a new instance, or {@code null} if the options are invalid """ if (options.length < 1) { LOG...
java
public static ColorConverter newInstance(Configuration config, String[] options) { if (options.length < 1) { LOGGER.error("Incorrect number of options on style. " + "Expected at least 1, received {}", options.length); return null; } if (options[0] == null) { LOGGER.error("No pattern supplied on styl...
[ "public", "static", "ColorConverter", "newInstance", "(", "Configuration", "config", ",", "String", "[", "]", "options", ")", "{", "if", "(", "options", ".", "length", "<", "1", ")", "{", "LOGGER", ".", "error", "(", "\"Incorrect number of options on style. \"",...
Creates a new instance of the class. Required by Log4J2. @param config the configuration @param options the options @return a new instance, or {@code null} if the options are invalid
[ "Creates", "a", "new", "instance", "of", "the", "class", ".", "Required", "by", "Log4J2", "." ]
train
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java#L92-L106
googleapis/google-http-java-client
google-http-client/src/main/java/com/google/api/client/http/HttpRequestFactory.java
HttpRequestFactory.buildPatchRequest
public HttpRequest buildPatchRequest(GenericUrl url, HttpContent content) throws IOException { """ Builds a {@code PATCH} request for the given URL and content. @param url HTTP request URL or {@code null} for none @param content HTTP request content or {@code null} for none @return new HTTP request """ ...
java
public HttpRequest buildPatchRequest(GenericUrl url, HttpContent content) throws IOException { return buildRequest(HttpMethods.PATCH, url, content); }
[ "public", "HttpRequest", "buildPatchRequest", "(", "GenericUrl", "url", ",", "HttpContent", "content", ")", "throws", "IOException", "{", "return", "buildRequest", "(", "HttpMethods", ".", "PATCH", ",", "url", ",", "content", ")", ";", "}" ]
Builds a {@code PATCH} request for the given URL and content. @param url HTTP request URL or {@code null} for none @param content HTTP request content or {@code null} for none @return new HTTP request
[ "Builds", "a", "{", "@code", "PATCH", "}", "request", "for", "the", "given", "URL", "and", "content", "." ]
train
https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpRequestFactory.java#L149-L151
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ThreadUtils.java
ThreadUtils.findThreadsByName
public static Collection<Thread> findThreadsByName(final String threadName, final ThreadGroup threadGroup) { """ Return active threads with the specified name if they belong to a specified thread group. @param threadName The thread name @param threadGroup The thread group @return The threads which belongs to ...
java
public static Collection<Thread> findThreadsByName(final String threadName, final ThreadGroup threadGroup) { return findThreads(threadGroup, false, new NamePredicate(threadName)); }
[ "public", "static", "Collection", "<", "Thread", ">", "findThreadsByName", "(", "final", "String", "threadName", ",", "final", "ThreadGroup", "threadGroup", ")", "{", "return", "findThreads", "(", "threadGroup", ",", "false", ",", "new", "NamePredicate", "(", "t...
Return active threads with the specified name if they belong to a specified thread group. @param threadName The thread name @param threadGroup The thread group @return The threads which belongs to a thread group and the thread's name match the specified name, An empty collection is returned if no such thread exists. T...
[ "Return", "active", "threads", "with", "the", "specified", "name", "if", "they", "belong", "to", "a", "specified", "thread", "group", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ThreadUtils.java#L101-L103
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/ProjectApi.java
ProjectApi.getProject
public Project getProject(String namespace, String project, Boolean includeStatistics) throws GitLabApiException { """ Get a specific project, which is owned by the authentication user. <pre><code>GET /projects/:id</code></pre> @param namespace the name of the project namespace or group @param project the n...
java
public Project getProject(String namespace, String project, Boolean includeStatistics) throws GitLabApiException { if (namespace == null) { throw new RuntimeException("namespace cannot be null"); } if (project == null) { throw new RuntimeException("project cannot be nul...
[ "public", "Project", "getProject", "(", "String", "namespace", ",", "String", "project", ",", "Boolean", "includeStatistics", ")", "throws", "GitLabApiException", "{", "if", "(", "namespace", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"na...
Get a specific project, which is owned by the authentication user. <pre><code>GET /projects/:id</code></pre> @param namespace the name of the project namespace or group @param project the name of the project to get @param includeStatistics include project statistics @return the specified project @throws GitLabApiExce...
[ "Get", "a", "specific", "project", "which", "is", "owned", "by", "the", "authentication", "user", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L666-L686
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java
PathOverrideService.clearResponseSettings
public void clearResponseSettings(int pathId, String clientUUID) throws Exception { """ Clear all overrides, reset repeat counts for a response path @param pathId ID of path @param clientUUID UUID of client @throws Exception exception """ logger.info("clearing response settings"); this.set...
java
public void clearResponseSettings(int pathId, String clientUUID) throws Exception { logger.info("clearing response settings"); this.setResponseEnabled(pathId, false, clientUUID); OverrideService.getInstance().disableAllOverrides(pathId, clientUUID, Constants.OVERRIDE_TYPE_RESPONSE); Edit...
[ "public", "void", "clearResponseSettings", "(", "int", "pathId", ",", "String", "clientUUID", ")", "throws", "Exception", "{", "logger", ".", "info", "(", "\"clearing response settings\"", ")", ";", "this", ".", "setResponseEnabled", "(", "pathId", ",", "false", ...
Clear all overrides, reset repeat counts for a response path @param pathId ID of path @param clientUUID UUID of client @throws Exception exception
[ "Clear", "all", "overrides", "reset", "repeat", "counts", "for", "a", "response", "path" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L1494-L1499
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java
MonetaryFormat.repeatOptionalDecimals
public MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions) { """ <p> Set repeated additional groups of decimals to use after the minimum decimals, if they are useful for expressing precision. If the value precision exceeds all decimals specified (including minimum decimals), the value will be r...
java
public MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions) { checkArgument(repetitions >= 0); List<Integer> decimalGroups = new ArrayList<>(repetitions); for (int i = 0; i < repetitions; i++) decimalGroups.add(decimals); return new MonetaryFormat(negativeSign...
[ "public", "MonetaryFormat", "repeatOptionalDecimals", "(", "int", "decimals", ",", "int", "repetitions", ")", "{", "checkArgument", "(", "repetitions", ">=", "0", ")", ";", "List", "<", "Integer", ">", "decimalGroups", "=", "new", "ArrayList", "<>", "(", "repe...
<p> Set repeated additional groups of decimals to use after the minimum decimals, if they are useful for expressing precision. If the value precision exceeds all decimals specified (including minimum decimals), the value will be rounded. This configuration is not relevant for parsing. </p> <p> For example, if you pass...
[ "<p", ">", "Set", "repeated", "additional", "groups", "of", "decimals", "to", "use", "after", "the", "minimum", "decimals", "if", "they", "are", "useful", "for", "expressing", "precision", ".", "If", "the", "value", "precision", "exceeds", "all", "decimals", ...
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java#L191-L198
looly/hutool
hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java
SoapClient.setParam
public SoapClient setParam(String name, Object value) { """ 设置方法参数,使用方法的前缀 @param name 参数名 @param value 参数值,可以是字符串或Map或{@link SOAPElement} @return this """ return setParam(name, value, true); }
java
public SoapClient setParam(String name, Object value) { return setParam(name, value, true); }
[ "public", "SoapClient", "setParam", "(", "String", "name", ",", "Object", "value", ")", "{", "return", "setParam", "(", "name", ",", "value", ",", "true", ")", ";", "}" ]
设置方法参数,使用方法的前缀 @param name 参数名 @param value 参数值,可以是字符串或Map或{@link SOAPElement} @return this
[ "设置方法参数,使用方法的前缀" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java#L302-L304
alkacon/opencms-core
src/org/opencms/search/CmsSearchIndex.java
CmsSearchIndex.getLocaleForResource
@Override public Locale getLocaleForResource(CmsObject cms, CmsResource resource, List<Locale> availableLocales) { """ Returns the language locale for the given resource in this index.<p> @param cms the current OpenCms user context @param resource the resource to check @param availableLocales a list of lo...
java
@Override public Locale getLocaleForResource(CmsObject cms, CmsResource resource, List<Locale> availableLocales) { Locale result; List<Locale> defaultLocales = OpenCms.getLocaleManager().getDefaultLocales(cms, resource); List<Locale> locales = availableLocales; if ((locales == null)...
[ "@", "Override", "public", "Locale", "getLocaleForResource", "(", "CmsObject", "cms", ",", "CmsResource", "resource", ",", "List", "<", "Locale", ">", "availableLocales", ")", "{", "Locale", "result", ";", "List", "<", "Locale", ">", "defaultLocales", "=", "Op...
Returns the language locale for the given resource in this index.<p> @param cms the current OpenCms user context @param resource the resource to check @param availableLocales a list of locales supported by the resource @return the language locale for the given resource in this index
[ "Returns", "the", "language", "locale", "for", "the", "given", "resource", "in", "this", "index", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L679-L690
stratosphere/stratosphere
stratosphere-compiler/src/main/java/eu/stratosphere/compiler/PactCompiler.java
PactCompiler.getType
private InstanceTypeDescription getType(Map<InstanceType, InstanceTypeDescription> types) throws CompilerException { """ This utility method picks the instance type to be used for executing programs. <p> @param types The available types. @return The type to be used for scheduling. @throws CompilerExceptio...
java
private InstanceTypeDescription getType(Map<InstanceType, InstanceTypeDescription> types) throws CompilerException { if (types == null || types.size() < 1) { throw new IllegalArgumentException("No instance type found."); } InstanceTypeDescription retValue = null; long totalMemory = 0; int numInstances...
[ "private", "InstanceTypeDescription", "getType", "(", "Map", "<", "InstanceType", ",", "InstanceTypeDescription", ">", "types", ")", "throws", "CompilerException", "{", "if", "(", "types", "==", "null", "||", "types", ".", "size", "(", ")", "<", "1", ")", "{...
This utility method picks the instance type to be used for executing programs. <p> @param types The available types. @return The type to be used for scheduling. @throws CompilerException @throws IllegalArgumentException
[ "This", "utility", "method", "picks", "the", "instance", "type", "to", "be", "used", "for", "executing", "programs", ".", "<p", ">" ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-compiler/src/main/java/eu/stratosphere/compiler/PactCompiler.java#L1577-L1622
OpenTSDB/opentsdb
src/core/Internal.java
Internal.decodeHistogramDataPoint
public static HistogramDataPoint decodeHistogramDataPoint(final TSDB tsdb, final KeyValue kv) { """ Decode the histogram point from the given key value @param kv the key value that contains a histogram @return the decoded {@code HistogramDataPoint} ...
java
public static HistogramDataPoint decodeHistogramDataPoint(final TSDB tsdb, final KeyValue kv) { long timestamp = Internal.baseTime(kv.key()); return decodeHistogramDataPoint(tsdb, timestamp, kv.qualifier(), kv.value()); }
[ "public", "static", "HistogramDataPoint", "decodeHistogramDataPoint", "(", "final", "TSDB", "tsdb", ",", "final", "KeyValue", "kv", ")", "{", "long", "timestamp", "=", "Internal", ".", "baseTime", "(", "kv", ".", "key", "(", ")", ")", ";", "return", "decodeH...
Decode the histogram point from the given key value @param kv the key value that contains a histogram @return the decoded {@code HistogramDataPoint}
[ "Decode", "the", "histogram", "point", "from", "the", "given", "key", "value" ]
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Internal.java#L1060-L1064
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java
AnnotationTypeBuilder.buildAnnotationTypeSignature
public void buildAnnotationTypeSignature(XMLNode node, Content annotationInfoTree) { """ Build the signature of the current annotation type. @param node the XML element that specifies which components to document @param annotationInfoTree the content tree to which the documentation will be added """ ...
java
public void buildAnnotationTypeSignature(XMLNode node, Content annotationInfoTree) { writer.addAnnotationTypeSignature(utils.modifiersToString(annotationType, true), annotationInfoTree); }
[ "public", "void", "buildAnnotationTypeSignature", "(", "XMLNode", "node", ",", "Content", "annotationInfoTree", ")", "{", "writer", ".", "addAnnotationTypeSignature", "(", "utils", ".", "modifiersToString", "(", "annotationType", ",", "true", ")", ",", "annotationInfo...
Build the signature of the current annotation type. @param node the XML element that specifies which components to document @param annotationInfoTree the content tree to which the documentation will be added
[ "Build", "the", "signature", "of", "the", "current", "annotation", "type", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java#L180-L183
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java
VersionsImpl.updateAsync
public Observable<OperationStatus> updateAsync(UUID appId, String versionId, UpdateVersionsOptionalParameter updateOptionalParameter) { """ Updates the name or description of the application version. @param appId The application ID. @param versionId The version ID. @param updateOptionalParameter the object re...
java
public Observable<OperationStatus> updateAsync(UUID appId, String versionId, UpdateVersionsOptionalParameter updateOptionalParameter) { return updateWithServiceResponseAsync(appId, versionId, updateOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override ...
[ "public", "Observable", "<", "OperationStatus", ">", "updateAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UpdateVersionsOptionalParameter", "updateOptionalParameter", ")", "{", "return", "updateWithServiceResponseAsync", "(", "appId", ",", "versionId", ...
Updates the name or description of the application version. @param appId The application ID. @param versionId The version ID. @param updateOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @retur...
[ "Updates", "the", "name", "or", "description", "of", "the", "application", "version", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java#L562-L569
Ordinastie/MalisisCore
src/main/java/net/malisis/core/registry/MalisisRegistry.java
MalisisRegistry.onPreSetBlock
public static void onPreSetBlock(ISetBlockCallback callback, CallbackOption<ISetBlockCallbackPredicate> option) { """ Registers a {@link ISetBlockCallback} with the specified {@link CallbackOption} to be called after a {@link Block} is placed in the world. @param callback the callback @param option the option...
java
public static void onPreSetBlock(ISetBlockCallback callback, CallbackOption<ISetBlockCallbackPredicate> option) { preSetBlockRegistry.registerCallback(callback, option); }
[ "public", "static", "void", "onPreSetBlock", "(", "ISetBlockCallback", "callback", ",", "CallbackOption", "<", "ISetBlockCallbackPredicate", ">", "option", ")", "{", "preSetBlockRegistry", ".", "registerCallback", "(", "callback", ",", "option", ")", ";", "}" ]
Registers a {@link ISetBlockCallback} with the specified {@link CallbackOption} to be called after a {@link Block} is placed in the world. @param callback the callback @param option the option
[ "Registers", "a", "{", "@link", "ISetBlockCallback", "}", "with", "the", "specified", "{", "@link", "CallbackOption", "}", "to", "be", "called", "after", "a", "{", "@link", "Block", "}", "is", "placed", "in", "the", "world", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/registry/MalisisRegistry.java#L175-L178
alkacon/opencms-core
src/org/opencms/ui/CmsUserIconHelper.java
CmsUserIconHelper.handleImageUpload
public boolean handleImageUpload(CmsObject cms, List<String> uploadedFiles) { """ Handles a user image upload. The uploaded file will be scaled and save as a new file beneath /system/userimages/, the original file will be deleted.<p> @param cms the cms context @param uploadedFiles the uploaded file paths @...
java
public boolean handleImageUpload(CmsObject cms, List<String> uploadedFiles) { boolean result = false; if (uploadedFiles.size() == 1) { String tempFile = CmsStringUtil.joinPaths(USER_IMAGE_FOLDER, TEMP_FOLDER, uploadedFiles.get(0)); result = handleImageUpload(cms, cms.getRequestC...
[ "public", "boolean", "handleImageUpload", "(", "CmsObject", "cms", ",", "List", "<", "String", ">", "uploadedFiles", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "uploadedFiles", ".", "size", "(", ")", "==", "1", ")", "{", "String", "temp...
Handles a user image upload. The uploaded file will be scaled and save as a new file beneath /system/userimages/, the original file will be deleted.<p> @param cms the cms context @param uploadedFiles the uploaded file paths @return <code>true</code> in case the image was set successfully
[ "Handles", "a", "user", "image", "upload", ".", "The", "uploaded", "file", "will", "be", "scaled", "and", "save", "as", "a", "new", "file", "beneath", "/", "system", "/", "userimages", "/", "the", "original", "file", "will", "be", "deleted", ".", "<p", ...
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsUserIconHelper.java#L286-L294
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MoreLikeThis.java
MoreLikeThis.addTermFrequencies
private void addTermFrequencies(Reader r, Map<String, Int> termFreqMap, String fieldName) throws IOException { """ Adds term frequencies found by tokenizing text from reader into the Map words @param r a source of text to be tokenized @param termFreqMap a Map of terms and their frequencies @param fieldName Used...
java
private void addTermFrequencies(Reader r, Map<String, Int> termFreqMap, String fieldName) throws IOException { TokenStream ts = analyzer.tokenStream(fieldName, r); int tokenCount = 0; // for every token while (ts.incrementToken()) { CharTermAttribute term = ts.getAttribute(Char...
[ "private", "void", "addTermFrequencies", "(", "Reader", "r", ",", "Map", "<", "String", ",", "Int", ">", "termFreqMap", ",", "String", "fieldName", ")", "throws", "IOException", "{", "TokenStream", "ts", "=", "analyzer", ".", "tokenStream", "(", "fieldName", ...
Adds term frequencies found by tokenizing text from reader into the Map words @param r a source of text to be tokenized @param termFreqMap a Map of terms and their frequencies @param fieldName Used by analyzer for any special per-field analysis
[ "Adds", "term", "frequencies", "found", "by", "tokenizing", "text", "from", "reader", "into", "the", "Map", "words" ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MoreLikeThis.java#L792-L824
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java
JobHistoryFileParserHadoop2.getTaskKey
public byte[] getTaskKey(String prefix, String jobNumber, String fullId) { """ Returns the Task ID or Task Attempt ID, stripped of the leading job ID, appended to the job row key. """ String taskComponent = fullId; if (fullId == null) { taskComponent = ""; } else { String expectedPrefi...
java
public byte[] getTaskKey(String prefix, String jobNumber, String fullId) { String taskComponent = fullId; if (fullId == null) { taskComponent = ""; } else { String expectedPrefix = prefix + jobNumber + "_"; if ((fullId.startsWith(expectedPrefix)) && (fullId.length() > expectedPrefix.length...
[ "public", "byte", "[", "]", "getTaskKey", "(", "String", "prefix", ",", "String", "jobNumber", ",", "String", "fullId", ")", "{", "String", "taskComponent", "=", "fullId", ";", "if", "(", "fullId", "==", "null", ")", "{", "taskComponent", "=", "\"\"", ";...
Returns the Task ID or Task Attempt ID, stripped of the leading job ID, appended to the job row key.
[ "Returns", "the", "Task", "ID", "or", "Task", "Attempt", "ID", "stripped", "of", "the", "leading", "job", "ID", "appended", "to", "the", "job", "row", "key", "." ]
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L793-L804
jillesvangurp/jsonj
src/main/java/com/github/jsonj/tools/JsonBuilder.java
JsonBuilder.put
public @Nonnull JsonBuilder put(String key, Number n) { """ Add a number to the object. @param key key @param n value @return the builder """ object.put(key, primitive(n)); return this; }
java
public @Nonnull JsonBuilder put(String key, Number n) { object.put(key, primitive(n)); return this; }
[ "public", "@", "Nonnull", "JsonBuilder", "put", "(", "String", "key", ",", "Number", "n", ")", "{", "object", ".", "put", "(", "key", ",", "primitive", "(", "n", ")", ")", ";", "return", "this", ";", "}" ]
Add a number to the object. @param key key @param n value @return the builder
[ "Add", "a", "number", "to", "the", "object", "." ]
train
https://github.com/jillesvangurp/jsonj/blob/1da0c44c5bdb60c0cd806c48d2da5a8a75bf84af/src/main/java/com/github/jsonj/tools/JsonBuilder.java#L112-L115
dropbox/dropbox-sdk-java
examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java
DropboxAuth.doStart
public void doStart(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { """ Start the process of getting a Dropbox API access token for the user's Dropbox account. """ if (!common.checkPost(request, response)) return; User user = common.r...
java
public void doStart(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (!common.checkPost(request, response)) return; User user = common.requireLoggedInUser(request, response); if (user == null) return; // Start the authorizat...
[ "public", "void", "doStart", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "IOException", ",", "ServletException", "{", "if", "(", "!", "common", ".", "checkPost", "(", "request", ",", "response", ")", ")", "return"...
Start the process of getting a Dropbox API access token for the user's Dropbox account.
[ "Start", "the", "process", "of", "getting", "a", "Dropbox", "API", "access", "token", "for", "the", "user", "s", "Dropbox", "account", "." ]
train
https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java#L31-L48
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java
FindingReplacing.setBefore
public InclusMultiPos<S, String, String> setBefore(String right) { """ Sets the specified position substring before given right tag as the delegate string <p><b>The look result same as {@link StrMatcher#finder()}'s behavior</b> @see StrMatcher#finder() @param left @param right @return """ return new I...
java
public InclusMultiPos<S, String, String> setBefore(String right) { return new InclusMultiPos<S, String, String>(right, right) { @Override protected S result() { return delegateQueue('B', left, right, pos, position, inclusive, plusminus, filltgt); } }; }
[ "public", "InclusMultiPos", "<", "S", ",", "String", ",", "String", ">", "setBefore", "(", "String", "right", ")", "{", "return", "new", "InclusMultiPos", "<", "S", ",", "String", ",", "String", ">", "(", "right", ",", "right", ")", "{", "@", "Override...
Sets the specified position substring before given right tag as the delegate string <p><b>The look result same as {@link StrMatcher#finder()}'s behavior</b> @see StrMatcher#finder() @param left @param right @return
[ "Sets", "the", "specified", "position", "substring", "before", "given", "right", "tag", "as", "the", "delegate", "string", "<p", ">", "<b", ">", "The", "look", "result", "same", "as", "{", "@link", "StrMatcher#finder", "()", "}", "s", "behavior<", "/", "b"...
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java#L399-L406
attribyte/wpdb
src/main/java/org/attribyte/wp/model/Shortcode.java
Shortcode.appendAttributeValue
private StringBuilder appendAttributeValue(final String value, final StringBuilder buf) { """ Appends an attribute value with appropriate quoting. @param value The value. @param buf The buffer to append to. @return The input buffer. """ if(value.contains("\"")) { buf.append("\'").append(escap...
java
private StringBuilder appendAttributeValue(final String value, final StringBuilder buf) { if(value.contains("\"")) { buf.append("\'").append(escapeAttribute(value)).append("\'"); } else if(value.contains(" ") || value.contains("\'") || value.contains("=")) { buf.append("\"").append(escapeA...
[ "private", "StringBuilder", "appendAttributeValue", "(", "final", "String", "value", ",", "final", "StringBuilder", "buf", ")", "{", "if", "(", "value", ".", "contains", "(", "\"\\\"\"", ")", ")", "{", "buf", ".", "append", "(", "\"\\'\"", ")", ".", "appen...
Appends an attribute value with appropriate quoting. @param value The value. @param buf The buffer to append to. @return The input buffer.
[ "Appends", "an", "attribute", "value", "with", "appropriate", "quoting", "." ]
train
https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/model/Shortcode.java#L141-L150
the-fascinator/plugin-authentication-internal
src/main/java/com/googlecode/fascinator/authentication/internal/InternalAuthentication.java
InternalAuthentication.changePassword
@Override public void changePassword(String username, String password) throws AuthenticationException { """ Change a user's password. @param username The user changing their password. @param password The new password for the user. @throws AuthenticationException if there was an error changing ...
java
@Override public void changePassword(String username, String password) throws AuthenticationException { String user = file_store.getProperty(username); if (user == null) { throw new AuthenticationException("User '" + username + "' not found."); } ...
[ "@", "Override", "public", "void", "changePassword", "(", "String", "username", ",", "String", "password", ")", "throws", "AuthenticationException", "{", "String", "user", "=", "file_store", ".", "getProperty", "(", "username", ")", ";", "if", "(", "user", "==...
Change a user's password. @param username The user changing their password. @param password The new password for the user. @throws AuthenticationException if there was an error changing the password.
[ "Change", "a", "user", "s", "password", "." ]
train
https://github.com/the-fascinator/plugin-authentication-internal/blob/a2b9a0eda9b43bf20583036a406c83c938be3042/src/main/java/com/googlecode/fascinator/authentication/internal/InternalAuthentication.java#L368-L384
EasyinnovaSL/Tiff-Library-4J
src/main/java/com/easyinnova/tiff/profiles/TiffITProfile.java
TiffITProfile.validateIfdFP
private void validateIfdFP(IFD ifd, int p) { """ Validate Final Page. @param ifd the ifd @param p the profile (default = 0, P1 = 1, P2 = 2) """ IfdTags metadata = ifd.getMetadata(); checkRequiredTag(metadata, "ImageDescription", 1); checkRequiredTag(metadata, "StripOffsets", 1); if (p == 1...
java
private void validateIfdFP(IFD ifd, int p) { IfdTags metadata = ifd.getMetadata(); checkRequiredTag(metadata, "ImageDescription", 1); checkRequiredTag(metadata, "StripOffsets", 1); if (p == 1 || p == 2) { checkRequiredTag(metadata, "StripOffsets", 1, new long[]{0}); } checkRequiredTag(met...
[ "private", "void", "validateIfdFP", "(", "IFD", "ifd", ",", "int", "p", ")", "{", "IfdTags", "metadata", "=", "ifd", ".", "getMetadata", "(", ")", ";", "checkRequiredTag", "(", "metadata", ",", "\"ImageDescription\"", ",", "1", ")", ";", "checkRequiredTag", ...
Validate Final Page. @param ifd the ifd @param p the profile (default = 0, P1 = 1, P2 = 2)
[ "Validate", "Final", "Page", "." ]
train
https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/TiffITProfile.java#L589-L614
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/bos/BosClient.java
BosClient.putObject
public PutObjectResponse putObject(String bucketName, String key, String value) { """ Uploads the specified string to Bos under the specified bucket and key name. @param bucketName The name of an existing bucket, to which you have Write permission. @param key The key under which to store the specified file. @...
java
public PutObjectResponse putObject(String bucketName, String key, String value) { try { return this.putObject(bucketName, key, value.getBytes(DEFAULT_ENCODING), new ObjectMetadata()); } catch (UnsupportedEncodingException e) { throw new BceClientException("Fail to get bytes.", e)...
[ "public", "PutObjectResponse", "putObject", "(", "String", "bucketName", ",", "String", "key", ",", "String", "value", ")", "{", "try", "{", "return", "this", ".", "putObject", "(", "bucketName", ",", "key", ",", "value", ".", "getBytes", "(", "DEFAULT_ENCOD...
Uploads the specified string to Bos under the specified bucket and key name. @param bucketName The name of an existing bucket, to which you have Write permission. @param key The key under which to store the specified file. @param value The string containing the value to be uploaded to Bos. @return A PutObjectResponse ...
[ "Uploads", "the", "specified", "string", "to", "Bos", "under", "the", "specified", "bucket", "and", "key", "name", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L814-L820
Cornutum/tcases
tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java
SystemInputJson.getVarDefs
private static Stream<IVarDef> getVarDefs( String varType, JsonObject json) { """ Returns the variable definitions represented by the given JSON object. """ try { // Get annotations for this group of variables Annotated groupAnnotations = new Annotated(){}; Optional.ofNullable( json...
java
private static Stream<IVarDef> getVarDefs( String varType, JsonObject json) { try { // Get annotations for this group of variables Annotated groupAnnotations = new Annotated(){}; Optional.ofNullable( json.getJsonObject( HAS_KEY)) .ifPresent( has -> has.keySet().stream().forEach( ...
[ "private", "static", "Stream", "<", "IVarDef", ">", "getVarDefs", "(", "String", "varType", ",", "JsonObject", "json", ")", "{", "try", "{", "// Get annotations for this group of variables", "Annotated", "groupAnnotations", "=", "new", "Annotated", "(", ")", "{", ...
Returns the variable definitions represented by the given JSON object.
[ "Returns", "the", "variable", "definitions", "represented", "by", "the", "given", "JSON", "object", "." ]
train
https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java#L250-L269
GenesysPureEngage/authentication-client-java
src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java
AuthenticationApi.signInWithHttpInfo
public ApiResponse<Void> signInWithHttpInfo(String username, String password, Boolean saml) throws ApiException { """ Perform form-based authentication. Perform form-based authentication by submitting an agent&#39;s username and password. @param username The agent&#39;s username, formatted as &#39;tenant\\userna...
java
public ApiResponse<Void> signInWithHttpInfo(String username, String password, Boolean saml) throws ApiException { com.squareup.okhttp.Call call = signInValidateBeforeCall(username, password, saml, null, null); return apiClient.execute(call); }
[ "public", "ApiResponse", "<", "Void", ">", "signInWithHttpInfo", "(", "String", "username", ",", "String", "password", ",", "Boolean", "saml", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "signInValidateB...
Perform form-based authentication. Perform form-based authentication by submitting an agent&#39;s username and password. @param username The agent&#39;s username, formatted as &#39;tenant\\username&#39;. (required) @param password The agent&#39;s password. (required) @param saml Specifies whether to login using [Securi...
[ "Perform", "form", "-", "based", "authentication", ".", "Perform", "form", "-", "based", "authentication", "by", "submitting", "an", "agent&#39", ";", "s", "username", "and", "password", "." ]
train
https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java#L1212-L1215
SimiaCryptus/utilities
java-util/src/main/java/com/simiacryptus/util/io/IOUtil.java
IOUtil.writeJson
public static <T> void writeJson(T obj, File file) { """ Write json. @param <T> the type parameter @param obj the obj @param file the file """ StringWriter writer = new StringWriter(); try { objectMapper.writeValue(writer, obj); Files.write(file.toPath(), writer.toString().getBytes()...
java
public static <T> void writeJson(T obj, File file) { StringWriter writer = new StringWriter(); try { objectMapper.writeValue(writer, obj); Files.write(file.toPath(), writer.toString().getBytes()); } catch (IOException e) { throw new RuntimeException(e); } }
[ "public", "static", "<", "T", ">", "void", "writeJson", "(", "T", "obj", ",", "File", "file", ")", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "try", "{", "objectMapper", ".", "writeValue", "(", "writer", ",", "obj", ")", ...
Write json. @param <T> the type parameter @param obj the obj @param file the file
[ "Write", "json", "." ]
train
https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/io/IOUtil.java#L64-L72