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 |
|---|---|---|---|---|---|---|---|---|---|---|
RestComm/sipunit | src/main/java/org/cafesip/sipunit/PresenceNotifySender.java | PresenceNotifySender.sendNotify | public boolean sendNotify(Request req, boolean viaProxy) {
"""
This method sends the given request to the subscriber. Knowledge of JAIN-SIP API headers is
required. The request will be resent if challenged. Use this method only if you have previously
called processSubscribe(). Use this method if you don't care a... | java | public boolean sendNotify(Request req, boolean viaProxy) {
setErrorMessage("");
synchronized (dialogLock) {
if (dialog == null) {
setErrorMessage("Can't send notify, haven't received a request");
return false;
}
try {
phone.addAuthorizations(((CallIdHeader) req.getHea... | [
"public",
"boolean",
"sendNotify",
"(",
"Request",
"req",
",",
"boolean",
"viaProxy",
")",
"{",
"setErrorMessage",
"(",
"\"\"",
")",
";",
"synchronized",
"(",
"dialogLock",
")",
"{",
"if",
"(",
"dialog",
"==",
"null",
")",
"{",
"setErrorMessage",
"(",
"\"C... | This method sends the given request to the subscriber. Knowledge of JAIN-SIP API headers is
required. The request will be resent if challenged. Use this method only if you have previously
called processSubscribe(). Use this method if you don't care about checking the response to the
sent NOTIFY, otherwise use sendState... | [
"This",
"method",
"sends",
"the",
"given",
"request",
"to",
"the",
"subscriber",
".",
"Knowledge",
"of",
"JAIN",
"-",
"SIP",
"API",
"headers",
"is",
"required",
".",
"The",
"request",
"will",
"be",
"resent",
"if",
"challenged",
".",
"Use",
"this",
"method"... | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/PresenceNotifySender.java#L556-L586 |
Erudika/para | para-server/src/main/java/com/erudika/para/security/filters/PasswordAuthFilter.java | PasswordAuthFilter.attemptAuthentication | @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
"""
Handles an authentication request.
@param request HTTP request
@param response HTTP response
@return an authentication object that contains the principal... | java | @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
String requestURI = request.getRequestURI();
UserAuthentication userAuth = null;
User user = null;
if (requestURI.endsWith(PASSWORD_ACTION)) {
user = new... | [
"@",
"Override",
"public",
"Authentication",
"attemptAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"requestURI",
"=",
"request",
".",
"getRequestURI",
... | Handles an authentication request.
@param request HTTP request
@param response HTTP response
@return an authentication object that contains the principal object if successful.
@throws IOException ex
@throws ServletException ex | [
"Handles",
"an",
"authentication",
"request",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/filters/PasswordAuthFilter.java#L65-L90 |
Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/interval/DiscreteInterval.java | DiscreteInterval.minus | public DiscreteInterval minus(DiscreteInterval other) {
"""
Returns an interval representing the subtraction of the
given interval from this one.
@param other interval to subtract from this one
@return result of subtraction
"""
return new DiscreteInterval(this.min - other.max, this.max - other.min);... | java | public DiscreteInterval minus(DiscreteInterval other) {
return new DiscreteInterval(this.min - other.max, this.max - other.min);
} | [
"public",
"DiscreteInterval",
"minus",
"(",
"DiscreteInterval",
"other",
")",
"{",
"return",
"new",
"DiscreteInterval",
"(",
"this",
".",
"min",
"-",
"other",
".",
"max",
",",
"this",
".",
"max",
"-",
"other",
".",
"min",
")",
";",
"}"
] | Returns an interval representing the subtraction of the
given interval from this one.
@param other interval to subtract from this one
@return result of subtraction | [
"Returns",
"an",
"interval",
"representing",
"the",
"subtraction",
"of",
"the",
"given",
"interval",
"from",
"this",
"one",
"."
] | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/interval/DiscreteInterval.java#L91-L93 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java | JDBCResultSet.getDate | public Date getDate(int columnIndex, Calendar cal) throws SQLException {
"""
<!-- start generic documentation -->
Retrieves the value of the designated column in the current row
of this <code>ResultSet</code> object as a <code>java.sql.Date</code> object
in the Java programming language.
This method uses the g... | java | public Date getDate(int columnIndex, Calendar cal) throws SQLException {
TimestampData t = (TimestampData) getColumnInType(columnIndex,
Type.SQL_DATE);
long millis = t.getSeconds() * 1000;
int zoneOffset = HsqlDateTime.getZoneMillis(cal, millis);
return new Date(millis... | [
"public",
"Date",
"getDate",
"(",
"int",
"columnIndex",
",",
"Calendar",
"cal",
")",
"throws",
"SQLException",
"{",
"TimestampData",
"t",
"=",
"(",
"TimestampData",
")",
"getColumnInType",
"(",
"columnIndex",
",",
"Type",
".",
"SQL_DATE",
")",
";",
"long",
"... | <!-- start generic documentation -->
Retrieves the value of the designated column in the current row
of this <code>ResultSet</code> object as a <code>java.sql.Date</code> object
in the Java programming language.
This method uses the given calendar to construct an appropriate millisecond
value for the date if the underl... | [
"<!",
"--",
"start",
"generic",
"documentation",
"--",
">",
"Retrieves",
"the",
"value",
"of",
"the",
"designated",
"column",
"in",
"the",
"current",
"row",
"of",
"this",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"object",
"as",
"a",
"<code",
">",
"j... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L4499-L4507 |
VoltDB/voltdb | src/frontend/org/voltdb/ClientInterface.java | ClientInterface.callExecuteTask | public ClientResponse callExecuteTask(long timeoutMS, byte[] params) throws IOException, InterruptedException {
"""
Call @ExecuteTask to generate a MP transaction.
@param timeoutMS timeout in milliseconds
@param params actual parameter(s) for sub task to run
@return
@throws IOException
@throws Interrupted... | java | public ClientResponse callExecuteTask(long timeoutMS, byte[] params) throws IOException, InterruptedException {
SimpleClientResponseAdapter.SyncCallback syncCb = new SimpleClientResponseAdapter.SyncCallback();
callExecuteTaskAsync(syncCb, params);
return syncCb.getResponse(timeoutMS);
} | [
"public",
"ClientResponse",
"callExecuteTask",
"(",
"long",
"timeoutMS",
",",
"byte",
"[",
"]",
"params",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"SimpleClientResponseAdapter",
".",
"SyncCallback",
"syncCb",
"=",
"new",
"SimpleClientResponseAdapt... | Call @ExecuteTask to generate a MP transaction.
@param timeoutMS timeout in milliseconds
@param params actual parameter(s) for sub task to run
@return
@throws IOException
@throws InterruptedException | [
"Call",
"@ExecuteTask",
"to",
"generate",
"a",
"MP",
"transaction",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ClientInterface.java#L2076-L2080 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.callStaticMethod | public static Object callStaticMethod(Class clazz, String methodName, Object[] args) throws PageException {
"""
calls a Static Method on the given CLass
@param clazz Class to call Method on it
@param methodName Name of the Method to get
@param args Arguments of the Method to get
@return return return value o... | java | public static Object callStaticMethod(Class clazz, String methodName, Object[] args) throws PageException {
try {
return getMethodInstance(null, clazz, methodName, args).invoke(null);
}
catch (InvocationTargetException e) {
Throwable target = e.getTargetException();
if (target instanceof PageException... | [
"public",
"static",
"Object",
"callStaticMethod",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"PageException",
"{",
"try",
"{",
"return",
"getMethodInstance",
"(",
"null",
",",
"clazz",
",",
"methodName",... | calls a Static Method on the given CLass
@param clazz Class to call Method on it
@param methodName Name of the Method to get
@param args Arguments of the Method to get
@return return return value of the called Method
@throws PageException | [
"calls",
"a",
"Static",
"Method",
"on",
"the",
"given",
"CLass"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L923-L935 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setDate | public void setDate(int index, Date value) {
"""
Set a date value.
@param index date index (1-10)
@param value date value
"""
set(selectField(ResourceFieldLists.CUSTOM_DATE, index), value);
} | java | public void setDate(int index, Date value)
{
set(selectField(ResourceFieldLists.CUSTOM_DATE, index), value);
} | [
"public",
"void",
"setDate",
"(",
"int",
"index",
",",
"Date",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"CUSTOM_DATE",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a date value.
@param index date index (1-10)
@param value date value | [
"Set",
"a",
"date",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L1683-L1686 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getCategory | public Category getCategory(String title) throws WikiApiException {
"""
Gets the category for a given title.
If the {@link Category} title start with a lowercase letter it converts it to an uppercase letter, as each Wikipedia category title starts with an uppercase letter.
Spaces in the title are converted to un... | java | public Category getCategory(String title) throws WikiApiException {
Category cat = new Category(this, title);
return cat;
} | [
"public",
"Category",
"getCategory",
"(",
"String",
"title",
")",
"throws",
"WikiApiException",
"{",
"Category",
"cat",
"=",
"new",
"Category",
"(",
"this",
",",
"title",
")",
";",
"return",
"cat",
";",
"}"
] | Gets the category for a given title.
If the {@link Category} title start with a lowercase letter it converts it to an uppercase letter, as each Wikipedia category title starts with an uppercase letter.
Spaces in the title are converted to underscores, as this is a convention for Wikipedia category titles.
For example,... | [
"Gets",
"the",
"category",
"for",
"a",
"given",
"title",
".",
"If",
"the",
"{",
"@link",
"Category",
"}",
"title",
"start",
"with",
"a",
"lowercase",
"letter",
"it",
"converts",
"it",
"to",
"an",
"uppercase",
"letter",
"as",
"each",
"Wikipedia",
"category"... | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L463-L466 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/proxy/transport/ProxyTask.java | ProxyTask.getNextBooleanParam | public boolean getNextBooleanParam(InputStream in, String strName, Map<String, Object> properties) {
"""
Get the next (String) param.
@param strName The param name (in most implementations this is optional).
@param properties The temporary remote session properties
@return The next param as a string.
"""
... | java | public boolean getNextBooleanParam(InputStream in, String strName, Map<String, Object> properties)
{
String strBoolean = this.getNextStringParam(in, strName, properties);
return (DBConstants.FALSE.equals(strBoolean) ? false : true);
} | [
"public",
"boolean",
"getNextBooleanParam",
"(",
"InputStream",
"in",
",",
"String",
"strName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strBoolean",
"=",
"this",
".",
"getNextStringParam",
"(",
"in",
",",
"strName",
... | Get the next (String) param.
@param strName The param name (in most implementations this is optional).
@param properties The temporary remote session properties
@return The next param as a string. | [
"Get",
"the",
"next",
"(",
"String",
")",
"param",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/transport/ProxyTask.java#L272-L276 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/util/XMLMapHandler.java | XMLMapHandler.writeMap | @Nonnull
public static ESuccess writeMap (@Nonnull final Map <String, String> aMap, @Nonnull @WillClose final OutputStream aOS) {
"""
Write the passed map to the passed output stream using the predefined XML
layout.
@param aMap
The map to be written. May not be <code>null</code>.
@param aOS
The output str... | java | @Nonnull
public static ESuccess writeMap (@Nonnull final Map <String, String> aMap, @Nonnull @WillClose final OutputStream aOS)
{
ValueEnforcer.notNull (aMap, "Map");
ValueEnforcer.notNull (aOS, "OutputStream");
try
{
final IMicroDocument aDoc = createMapDocument (aMap);
return MicroWri... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeMap",
"(",
"@",
"Nonnull",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"aMap",
",",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"OutputStream",
"aOS",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(... | Write the passed map to the passed output stream using the predefined XML
layout.
@param aMap
The map to be written. May not be <code>null</code>.
@param aOS
The output stream to write to. The stream is closed independent of
success or failure. May not be <code>null</code>.
@return {@link ESuccess#SUCCESS} when everyt... | [
"Write",
"the",
"passed",
"map",
"to",
"the",
"passed",
"output",
"stream",
"using",
"the",
"predefined",
"XML",
"layout",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/util/XMLMapHandler.java#L228-L243 |
openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/fxml/FXMLProcessor.java | FXMLProcessor.loadFxmlPane | public static Pane loadFxmlPane(final String fxmlFileUri, final Class clazz) throws CouldNotPerformException {
"""
Method load the pane of the given fxml file.
@param fxmlFileUri the uri pointing to the fxml file within the classpath.
@param clazz the responsible class which is used for class path resolu... | java | public static Pane loadFxmlPane(final String fxmlFileUri, final Class clazz) throws CouldNotPerformException {
return loadFxmlPaneAndControllerPair(fxmlFileUri, clazz, DEFAULT_CONTROLLER_FACTORY).getKey();
} | [
"public",
"static",
"Pane",
"loadFxmlPane",
"(",
"final",
"String",
"fxmlFileUri",
",",
"final",
"Class",
"clazz",
")",
"throws",
"CouldNotPerformException",
"{",
"return",
"loadFxmlPaneAndControllerPair",
"(",
"fxmlFileUri",
",",
"clazz",
",",
"DEFAULT_CONTROLLER_FACTO... | Method load the pane of the given fxml file.
@param fxmlFileUri the uri pointing to the fxml file within the classpath.
@param clazz the responsible class which is used for class path resolution.
@return the new pane.
@throws CouldNotPerformException is thrown if something went wrong like for example the fxml ... | [
"Method",
"load",
"the",
"pane",
"of",
"the",
"given",
"fxml",
"file",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/fxml/FXMLProcessor.java#L107-L109 |
Hygieia/Hygieia | collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/QualityWidgetScore.java | QualityWidgetScore.fetchQualityValue | private Double fetchQualityValue(Iterable<CodeQuality> qualityIterable, String param) {
"""
Fetch param value by param name from quality values
@param qualityIterable
@param param quality param
@return Param Value
"""
Double paramValue = null;
Iterator<CodeQuality> qualityIterator = qualityIterabl... | java | private Double fetchQualityValue(Iterable<CodeQuality> qualityIterable, String param) {
Double paramValue = null;
Iterator<CodeQuality> qualityIterator = qualityIterable.iterator();
if (!qualityIterator.hasNext()) {
return paramValue;
}
CodeQuality codeQuality = qualityIterator.next();
f... | [
"private",
"Double",
"fetchQualityValue",
"(",
"Iterable",
"<",
"CodeQuality",
">",
"qualityIterable",
",",
"String",
"param",
")",
"{",
"Double",
"paramValue",
"=",
"null",
";",
"Iterator",
"<",
"CodeQuality",
">",
"qualityIterator",
"=",
"qualityIterable",
".",
... | Fetch param value by param name from quality values
@param qualityIterable
@param param quality param
@return Param Value | [
"Fetch",
"param",
"value",
"by",
"param",
"name",
"from",
"quality",
"values"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/QualityWidgetScore.java#L276-L293 |
apache/incubator-gobblin | gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/avro/HiveAvroSerDeManager.java | HiveAvroSerDeManager.addSerDeProperties | @Override
public void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit) throws IOException {
"""
Add an Avro {@link Schema} to the given {@link HiveRegistrationUnit}.
<p>
If {@link #USE_SCHEMA_FILE} is true, the schema will be added via {@link #SCHEMA_URL} pointing to
the schema file named {@link... | java | @Override
public void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit) throws IOException {
Preconditions.checkArgument(this.fs.getFileStatus(path).isDirectory(), path + " is not a directory.");
Schema schema;
try (Timer.Context context = metricContext.timer(HIVE_SPEC_SCHEMA_READING_TIMER).tim... | [
"@",
"Override",
"public",
"void",
"addSerDeProperties",
"(",
"Path",
"path",
",",
"HiveRegistrationUnit",
"hiveUnit",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"this",
".",
"fs",
".",
"getFileStatus",
"(",
"path",
")",
".",
... | Add an Avro {@link Schema} to the given {@link HiveRegistrationUnit}.
<p>
If {@link #USE_SCHEMA_FILE} is true, the schema will be added via {@link #SCHEMA_URL} pointing to
the schema file named {@link #SCHEMA_FILE_NAME}.
</p>
<p>
If {@link #USE_SCHEMA_FILE} is false, the schema will be obtained by {@link #getDirector... | [
"Add",
"an",
"Avro",
"{",
"@link",
"Schema",
"}",
"to",
"the",
"given",
"{",
"@link",
"HiveRegistrationUnit",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/avro/HiveAvroSerDeManager.java#L112-L127 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pep/src/main/java/org/fcrepo/server/security/xacml/pep/ResponseCacheImpl.java | ResponseCacheImpl.makeHash | private String makeHash(String request) throws CacheException {
"""
Given a request, this method generates a hash.
@param request
the request to hash
@return the hash
@throws CacheException
"""
RequestCtx reqCtx = null;
try {
reqCtx = m_contextUtil.makeRequestCtx(request);
... | java | private String makeHash(String request) throws CacheException {
RequestCtx reqCtx = null;
try {
reqCtx = m_contextUtil.makeRequestCtx(request);
} catch (MelcoeXacmlException pe) {
throw new CacheException("Error converting request", pe);
}
byte[] hash = nu... | [
"private",
"String",
"makeHash",
"(",
"String",
"request",
")",
"throws",
"CacheException",
"{",
"RequestCtx",
"reqCtx",
"=",
"null",
";",
"try",
"{",
"reqCtx",
"=",
"m_contextUtil",
".",
"makeRequestCtx",
"(",
"request",
")",
";",
"}",
"catch",
"(",
"Melcoe... | Given a request, this method generates a hash.
@param request
the request to hash
@return the hash
@throws CacheException | [
"Given",
"a",
"request",
"this",
"method",
"generates",
"a",
"hash",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pep/src/main/java/org/fcrepo/server/security/xacml/pep/ResponseCacheImpl.java#L254-L279 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoNotes.java | DaoNotes.getEnvelope | public static ReferencedEnvelope getEnvelope( IHMConnection connection, String noteTypeName ) throws Exception {
"""
Get the current data envelope.
@param connection the db connection.
@param noteTypeName if <code>null</code>, simple notes are handled. Else this
is taken as name for the note type.
@return th... | java | public static ReferencedEnvelope getEnvelope( IHMConnection connection, String noteTypeName ) throws Exception {
String query = "SELECT min(" + //
NotesTableFields.COLUMN_LON.getFieldName() + "), max(" + //
NotesTableFields.COLUMN_LON.getFieldName() + "), min(" + //
... | [
"public",
"static",
"ReferencedEnvelope",
"getEnvelope",
"(",
"IHMConnection",
"connection",
",",
"String",
"noteTypeName",
")",
"throws",
"Exception",
"{",
"String",
"query",
"=",
"\"SELECT min(\"",
"+",
"//",
"NotesTableFields",
".",
"COLUMN_LON",
".",
"getFieldName... | Get the current data envelope.
@param connection the db connection.
@param noteTypeName if <code>null</code>, simple notes are handled. Else this
is taken as name for the note type.
@return the envelope.
@throws Exception | [
"Get",
"the",
"current",
"data",
"envelope",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoNotes.java#L199-L230 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java | RTMPHandshake.calculateHMAC_SHA256 | public void calculateHMAC_SHA256(byte[] message, int messageOffset, int messageLen, byte[] key, int keyLen, byte[] digest, int digestOffset) {
"""
Calculates an HMAC SHA256 hash into the digest at the given offset.
@param message incoming bytes
@param messageOffset message offset
@param messageLen message len... | java | public void calculateHMAC_SHA256(byte[] message, int messageOffset, int messageLen, byte[] key, int keyLen, byte[] digest, int digestOffset) {
if (log.isTraceEnabled()) {
log.trace("calculateHMAC_SHA256 - messageOffset: {} messageLen: {}", messageOffset, messageLen);
log.trace("calcul... | [
"public",
"void",
"calculateHMAC_SHA256",
"(",
"byte",
"[",
"]",
"message",
",",
"int",
"messageOffset",
",",
"int",
"messageLen",
",",
"byte",
"[",
"]",
"key",
",",
"int",
"keyLen",
",",
"byte",
"[",
"]",
"digest",
",",
"int",
"digestOffset",
")",
"{",
... | Calculates an HMAC SHA256 hash into the digest at the given offset.
@param message incoming bytes
@param messageOffset message offset
@param messageLen message length
@param key incoming key bytes
@param keyLen the length of the key
@param digest contains the calculated digest
@param digestOffset digest offset | [
"Calculates",
"an",
"HMAC",
"SHA256",
"hash",
"into",
"the",
"digest",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java#L369-L391 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/utils/PropertiesParser.java | PropertiesParser.getStringProperty | public String getStringProperty (final String name, final String def) {
"""
Get the trimmed String value of the property with the given
<code>name</code> or the given default value if the value is null or empty
after trimming.
"""
String val = m_aProps.getProperty (name, def);
if (val == null)
... | java | public String getStringProperty (final String name, final String def)
{
String val = m_aProps.getProperty (name, def);
if (val == null)
return def;
val = val.trim ();
return val.length () == 0 ? def : val;
} | [
"public",
"String",
"getStringProperty",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"def",
")",
"{",
"String",
"val",
"=",
"m_aProps",
".",
"getProperty",
"(",
"name",
",",
"def",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"return",
"d... | Get the trimmed String value of the property with the given
<code>name</code> or the given default value if the value is null or empty
after trimming. | [
"Get",
"the",
"trimmed",
"String",
"value",
"of",
"the",
"property",
"with",
"the",
"given",
"<code",
">",
"name<",
"/",
"code",
">",
"or",
"the",
"given",
"default",
"value",
"if",
"the",
"value",
"is",
"null",
"or",
"empty",
"after",
"trimming",
"."
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/utils/PropertiesParser.java#L72-L79 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowController.java | PageFlowController.getPreviousPageInfoLegacy | public final PreviousPageInfo getPreviousPageInfoLegacy( PageFlowController curJpf, HttpServletRequest request ) {
"""
Get a legacy PreviousPageInfo.
@deprecated This method will be removed without replacement in the next release.
"""
if (PageFlowRequestWrapper.get(request).isReturningFromNesting())
... | java | public final PreviousPageInfo getPreviousPageInfoLegacy( PageFlowController curJpf, HttpServletRequest request )
{
if (PageFlowRequestWrapper.get(request).isReturningFromNesting())
{
return getCurrentPageInfo();
}
else
{
return getPreviousPageInfo();
... | [
"public",
"final",
"PreviousPageInfo",
"getPreviousPageInfoLegacy",
"(",
"PageFlowController",
"curJpf",
",",
"HttpServletRequest",
"request",
")",
"{",
"if",
"(",
"PageFlowRequestWrapper",
".",
"get",
"(",
"request",
")",
".",
"isReturningFromNesting",
"(",
")",
")",... | Get a legacy PreviousPageInfo.
@deprecated This method will be removed without replacement in the next release. | [
"Get",
"a",
"legacy",
"PreviousPageInfo",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowController.java#L650-L660 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java | MSPDIReader.readExceptionDay | private void readExceptionDay(ProjectCalendar calendar, Project.Calendars.Calendar.WeekDays.WeekDay day) {
"""
This method extracts data for an exception day from an MSPDI file.
@param calendar Calendar data
@param day Day data
"""
Project.Calendars.Calendar.WeekDays.WeekDay.TimePeriod timePeriod = d... | java | private void readExceptionDay(ProjectCalendar calendar, Project.Calendars.Calendar.WeekDays.WeekDay day)
{
Project.Calendars.Calendar.WeekDays.WeekDay.TimePeriod timePeriod = day.getTimePeriod();
Date fromDate = timePeriod.getFromDate();
Date toDate = timePeriod.getToDate();
Project.Calendars... | [
"private",
"void",
"readExceptionDay",
"(",
"ProjectCalendar",
"calendar",
",",
"Project",
".",
"Calendars",
".",
"Calendar",
".",
"WeekDays",
".",
"WeekDay",
"day",
")",
"{",
"Project",
".",
"Calendars",
".",
"Calendar",
".",
"WeekDays",
".",
"WeekDay",
".",
... | This method extracts data for an exception day from an MSPDI file.
@param calendar Calendar data
@param day Day data | [
"This",
"method",
"extracts",
"data",
"for",
"an",
"exception",
"day",
"from",
"an",
"MSPDI",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIReader.java#L550-L577 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.fromYamlFile | public static NetworkConfig fromYamlFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException {
"""
Creates a new NetworkConfig instance configured with details supplied in a YAML file.
@param configFile The file containing the network configuration
@return A new Network... | java | public static NetworkConfig fromYamlFile(File configFile) throws InvalidArgumentException, IOException, NetworkConfigurationException {
return fromFile(configFile, false);
} | [
"public",
"static",
"NetworkConfig",
"fromYamlFile",
"(",
"File",
"configFile",
")",
"throws",
"InvalidArgumentException",
",",
"IOException",
",",
"NetworkConfigurationException",
"{",
"return",
"fromFile",
"(",
"configFile",
",",
"false",
")",
";",
"}"
] | Creates a new NetworkConfig instance configured with details supplied in a YAML file.
@param configFile The file containing the network configuration
@return A new NetworkConfig instance
@throws InvalidArgumentException
@throws IOException | [
"Creates",
"a",
"new",
"NetworkConfig",
"instance",
"configured",
"with",
"details",
"supplied",
"in",
"a",
"YAML",
"file",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L242-L244 |
KostyaSha/yet-another-docker-plugin | yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/utils/HostAndPortChecker.java | HostAndPortChecker.withEveryRetryWaitFor | public boolean withEveryRetryWaitFor(int time, TimeUnit units) {
"""
Use {@link #openSocket()} to check.
Retries while attempts reached with delay
@return true if socket opened successfully, false otherwise
"""
for (int i = 1; i <= retries; i++) {
if (openSocket()) {
ret... | java | public boolean withEveryRetryWaitFor(int time, TimeUnit units) {
for (int i = 1; i <= retries; i++) {
if (openSocket()) {
return true;
}
sleepFor(time, units);
}
return false;
} | [
"public",
"boolean",
"withEveryRetryWaitFor",
"(",
"int",
"time",
",",
"TimeUnit",
"units",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"retries",
";",
"i",
"++",
")",
"{",
"if",
"(",
"openSocket",
"(",
")",
")",
"{",
"return",
"tru... | Use {@link #openSocket()} to check.
Retries while attempts reached with delay
@return true if socket opened successfully, false otherwise | [
"Use",
"{",
"@link",
"#openSocket",
"()",
"}",
"to",
"check",
".",
"Retries",
"while",
"attempts",
"reached",
"with",
"delay"
] | train | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/utils/HostAndPortChecker.java#L66-L74 |
selenide/selenide | src/main/java/com/codeborne/selenide/Condition.java | Condition.exactTextCaseSensitive | public static Condition exactTextCaseSensitive(final String text) {
"""
<p>Sample: <code>$("h1").shouldHave(exactTextCaseSensitive("Hello"))</code></p>
<p>NB! Ignores multiple whitespaces between words</p>
@param text expected text of HTML element
"""
return new Condition("exact text case sensitive")... | java | public static Condition exactTextCaseSensitive(final String text) {
return new Condition("exact text case sensitive") {
@Override
public boolean apply(Driver driver, WebElement element) {
return Html.text.equalsCaseSensitive(element.getText(), text);
}
@Override
public String ... | [
"public",
"static",
"Condition",
"exactTextCaseSensitive",
"(",
"final",
"String",
"text",
")",
"{",
"return",
"new",
"Condition",
"(",
"\"exact text case sensitive\"",
")",
"{",
"@",
"Override",
"public",
"boolean",
"apply",
"(",
"Driver",
"driver",
",",
"WebElem... | <p>Sample: <code>$("h1").shouldHave(exactTextCaseSensitive("Hello"))</code></p>
<p>NB! Ignores multiple whitespaces between words</p>
@param text expected text of HTML element | [
"<p",
">",
"Sample",
":",
"<code",
">",
"$",
"(",
"h1",
")",
".",
"shouldHave",
"(",
"exactTextCaseSensitive",
"(",
"Hello",
"))",
"<",
"/",
"code",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/Condition.java#L341-L353 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getDeletedSecretAsync | public Observable<DeletedSecretBundle> getDeletedSecretAsync(String vaultBaseUrl, String secretName) {
"""
Gets the specified deleted secret.
The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.
@param vaultBaseUrl ... | java | public Observable<DeletedSecretBundle> getDeletedSecretAsync(String vaultBaseUrl, String secretName) {
return getDeletedSecretWithServiceResponseAsync(vaultBaseUrl, secretName).map(new Func1<ServiceResponse<DeletedSecretBundle>, DeletedSecretBundle>() {
@Override
public DeletedSecretBund... | [
"public",
"Observable",
"<",
"DeletedSecretBundle",
">",
"getDeletedSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
")",
"{",
"return",
"getDeletedSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretName",
")",
".",
"map",
"(",
... | Gets the specified deleted secret.
The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param secretName The name of the secret.
@throws Ille... | [
"Gets",
"the",
"specified",
"deleted",
"secret",
".",
"The",
"Get",
"Deleted",
"Secret",
"operation",
"returns",
"the",
"specified",
"deleted",
"secret",
"along",
"with",
"its",
"attributes",
".",
"This",
"operation",
"requires",
"the",
"secrets",
"/",
"get",
... | 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#L4670-L4677 |
Jasig/uPortal | uPortal-tools/src/main/java/org/apereo/portal/version/dao/jpa/JpaVersionDao.java | JpaVersionDao.getSimpleVersion | private Version getSimpleVersion(String product) {
"""
Load a Version object with direct field queries. Used to deal with DB upgrades where not all
of the fields have been loaded
"""
final Tuple coreNumbers;
try {
final TypedQuery<Tuple> coreNumbersQuery =
this.... | java | private Version getSimpleVersion(String product) {
final Tuple coreNumbers;
try {
final TypedQuery<Tuple> coreNumbersQuery =
this.createQuery(this.findCoreVersionNumbers);
coreNumbersQuery.setParameter(this.productParameter, product);
coreNumbers =... | [
"private",
"Version",
"getSimpleVersion",
"(",
"String",
"product",
")",
"{",
"final",
"Tuple",
"coreNumbers",
";",
"try",
"{",
"final",
"TypedQuery",
"<",
"Tuple",
">",
"coreNumbersQuery",
"=",
"this",
".",
"createQuery",
"(",
"this",
".",
"findCoreVersionNumbe... | Load a Version object with direct field queries. Used to deal with DB upgrades where not all
of the fields have been loaded | [
"Load",
"a",
"Version",
"object",
"with",
"direct",
"field",
"queries",
".",
"Used",
"to",
"deal",
"with",
"DB",
"upgrades",
"where",
"not",
"all",
"of",
"the",
"fields",
"have",
"been",
"loaded"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-tools/src/main/java/org/apereo/portal/version/dao/jpa/JpaVersionDao.java#L109-L149 |
structurizr/java | structurizr-core/src/com/structurizr/view/View.java | View.setAutomaticLayout | public void setAutomaticLayout(AutomaticLayout.RankDirection rankDirection, int rankSeparation, int nodeSeparation, int edgeSeparation, boolean vertices) {
"""
Enables the automatic layout for this view, with the specified settings.
@param rankDirection the rank direction
@param rankSeparation the separ... | java | public void setAutomaticLayout(AutomaticLayout.RankDirection rankDirection, int rankSeparation, int nodeSeparation, int edgeSeparation, boolean vertices) {
this.automaticLayout = new AutomaticLayout(rankDirection, rankSeparation, nodeSeparation, edgeSeparation, vertices);
} | [
"public",
"void",
"setAutomaticLayout",
"(",
"AutomaticLayout",
".",
"RankDirection",
"rankDirection",
",",
"int",
"rankSeparation",
",",
"int",
"nodeSeparation",
",",
"int",
"edgeSeparation",
",",
"boolean",
"vertices",
")",
"{",
"this",
".",
"automaticLayout",
"="... | Enables the automatic layout for this view, with the specified settings.
@param rankDirection the rank direction
@param rankSeparation the separation between ranks (in pixels, a positive integer)
@param nodeSeparation the separation between nodes within the same rank (in pixels, a positive integer)
@param ed... | [
"Enables",
"the",
"automatic",
"layout",
"for",
"this",
"view",
"with",
"the",
"specified",
"settings",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/view/View.java#L169-L171 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java | SoundStore.playAsSound | int playAsSound(int buffer,float pitch,float gain,boolean loop) {
"""
Play the specified buffer as a sound effect with the specified
pitch and gain.
@param buffer The ID of the buffer to play
@param pitch The pitch to play at
@param gain The gain to play at
@param loop True if the sound should loop
@return... | java | int playAsSound(int buffer,float pitch,float gain,boolean loop) {
return playAsSoundAt(buffer, pitch, gain, loop, 0, 0, 0);
} | [
"int",
"playAsSound",
"(",
"int",
"buffer",
",",
"float",
"pitch",
",",
"float",
"gain",
",",
"boolean",
"loop",
")",
"{",
"return",
"playAsSoundAt",
"(",
"buffer",
",",
"pitch",
",",
"gain",
",",
"loop",
",",
"0",
",",
"0",
",",
"0",
")",
";",
"}"... | Play the specified buffer as a sound effect with the specified
pitch and gain.
@param buffer The ID of the buffer to play
@param pitch The pitch to play at
@param gain The gain to play at
@param loop True if the sound should loop
@return source The source that will be used | [
"Play",
"the",
"specified",
"buffer",
"as",
"a",
"sound",
"effect",
"with",
"the",
"specified",
"pitch",
"and",
"gain",
"."
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/SoundStore.java#L377-L379 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java | PathOverrideService.setContentType | public void setContentType(int pathId, String contentType) {
"""
Sets the content type for this ID
@param pathId ID of path
@param contentType content type value
"""
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sql... | java | public void setContentType(int pathId, String contentType) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_PATH +
" SET " + Const... | [
"public",
"void",
"setContentType",
"(",
"int",
"pathId",
",",
"String",
"contentType",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
"state... | Sets the content type for this ID
@param pathId ID of path
@param contentType content type value | [
"Sets",
"the",
"content",
"type",
"for",
"this",
"ID"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L1207-L1229 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/cache/ReflectCache.java | ReflectCache.getOverloadMethodCache | public static Method getOverloadMethodCache(String serviceName, String methodName, String[] methodSigs) {
"""
从缓存里获取方法
@param serviceName 服务名(非接口名)
@param methodName 方法名
@param methodSigs 方法描述
@return 方法
"""
ConcurrentHashMap<String, Method> methods = OVERLOAD_METHOD_CACHE.get(serviceName);
... | java | public static Method getOverloadMethodCache(String serviceName, String methodName, String[] methodSigs) {
ConcurrentHashMap<String, Method> methods = OVERLOAD_METHOD_CACHE.get(serviceName);
if (methods == null) {
return null;
}
StringBuilder mSigs = new StringBuilder(128);
... | [
"public",
"static",
"Method",
"getOverloadMethodCache",
"(",
"String",
"serviceName",
",",
"String",
"methodName",
",",
"String",
"[",
"]",
"methodSigs",
")",
"{",
"ConcurrentHashMap",
"<",
"String",
",",
"Method",
">",
"methods",
"=",
"OVERLOAD_METHOD_CACHE",
"."... | 从缓存里获取方法
@param serviceName 服务名(非接口名)
@param methodName 方法名
@param methodSigs 方法描述
@return 方法 | [
"从缓存里获取方法"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/cache/ReflectCache.java#L285-L296 |
real-logic/agrona | agrona/src/main/java/org/agrona/collections/CollectionUtil.java | CollectionUtil.getOrDefault | public static <K, V> V getOrDefault(final Map<K, V> map, final K key, final Function<K, V> supplier) {
"""
A getOrDefault that doesn't create garbage if its suppler is non-capturing.
@param map to perform the lookup on.
@param key on which the lookup is done.
@param supplier of the default value if ... | java | public static <K, V> V getOrDefault(final Map<K, V> map, final K key, final Function<K, V> supplier)
{
V value = map.get(key);
if (value == null)
{
value = supplier.apply(key);
map.put(key, value);
}
return value;
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"getOrDefault",
"(",
"final",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"K",
"key",
",",
"final",
"Function",
"<",
"K",
",",
"V",
">",
"supplier",
")",
"{",
"V",
"value",
"=",
"map",
... | A getOrDefault that doesn't create garbage if its suppler is non-capturing.
@param map to perform the lookup on.
@param key on which the lookup is done.
@param supplier of the default value if one is not found.
@param <K> type of the key
@param <V> type of the value
@return the value if found or a ... | [
"A",
"getOrDefault",
"that",
"doesn",
"t",
"create",
"garbage",
"if",
"its",
"suppler",
"is",
"non",
"-",
"capturing",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/collections/CollectionUtil.java#L39-L49 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/repository/jdbc/JdbcRepository.java | JdbcRepository.getNeedUpdateJsonObject | private JSONObject getNeedUpdateJsonObject(final JSONObject oldJsonObject, final JSONObject jsonObject) throws JSONException {
"""
Compares the specified old json object and the new json object, returns diff object for updating.
@param oldJsonObject the specified old json object
@param jsonObject the specif... | java | private JSONObject getNeedUpdateJsonObject(final JSONObject oldJsonObject, final JSONObject jsonObject) throws JSONException {
if (null == oldJsonObject) {
return jsonObject;
}
final JSONObject ret = new JSONObject();
final Iterator<String> keys = jsonObject.keys();
... | [
"private",
"JSONObject",
"getNeedUpdateJsonObject",
"(",
"final",
"JSONObject",
"oldJsonObject",
",",
"final",
"JSONObject",
"jsonObject",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"null",
"==",
"oldJsonObject",
")",
"{",
"return",
"jsonObject",
";",
"}",
"f... | Compares the specified old json object and the new json object, returns diff object for updating.
@param oldJsonObject the specified old json object
@param jsonObject the specified new json object
@return diff object for updating
@throws JSONException jsonObject | [
"Compares",
"the",
"specified",
"old",
"json",
"object",
"and",
"the",
"new",
"json",
"object",
"returns",
"diff",
"object",
"for",
"updating",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/repository/jdbc/JdbcRepository.java#L329-L347 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/AppUtil.java | AppUtil.startDialer | public static void startDialer(@NonNull final Context context, final int phoneNumber) {
"""
Starts the dialer in order to call a specific phone number. The call has to be manually
started by the user. If an error occurs while starting the dialer, an {@link
ActivityNotFoundException} will be thrown.
@param con... | java | public static void startDialer(@NonNull final Context context, final int phoneNumber) {
startDialer(context, Integer.toString(phoneNumber));
} | [
"public",
"static",
"void",
"startDialer",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"final",
"int",
"phoneNumber",
")",
"{",
"startDialer",
"(",
"context",
",",
"Integer",
".",
"toString",
"(",
"phoneNumber",
")",
")",
";",
"}"
] | Starts the dialer in order to call a specific phone number. The call has to be manually
started by the user. If an error occurs while starting the dialer, an {@link
ActivityNotFoundException} will be thrown.
@param context
The context, the dialer should be started from, as an instance of the class {@link
Context}. The... | [
"Starts",
"the",
"dialer",
"in",
"order",
"to",
"call",
"a",
"specific",
"phone",
"number",
".",
"The",
"call",
"has",
"to",
"be",
"manually",
"started",
"by",
"the",
"user",
".",
"If",
"an",
"error",
"occurs",
"while",
"starting",
"the",
"dialer",
"an",... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/AppUtil.java#L321-L323 |
taimos/dvalin | daemon/src/main/java/de/taimos/daemon/DaemonStarter.java | DaemonStarter.startDaemon | public static void startDaemon(final String _daemonName, final IDaemonLifecycleListener _lifecycleListener) {
"""
Starts the daemon and provides feedback through the life-cycle listener<br>
<br>
@param _daemonName the name of this daemon
@param _lifecycleListener the {@link IDaemonLifecycleListener} to... | java | public static void startDaemon(final String _daemonName, final IDaemonLifecycleListener _lifecycleListener) {
// Run de.taimos.daemon async
Executors.newSingleThreadExecutor().execute(() -> DaemonStarter.doStartDaemon(_daemonName, _lifecycleListener));
} | [
"public",
"static",
"void",
"startDaemon",
"(",
"final",
"String",
"_daemonName",
",",
"final",
"IDaemonLifecycleListener",
"_lifecycleListener",
")",
"{",
"// Run de.taimos.daemon async",
"Executors",
".",
"newSingleThreadExecutor",
"(",
")",
".",
"execute",
"(",
"(",
... | Starts the daemon and provides feedback through the life-cycle listener<br>
<br>
@param _daemonName the name of this daemon
@param _lifecycleListener the {@link IDaemonLifecycleListener} to use for phase call-backs | [
"Starts",
"the",
"daemon",
"and",
"provides",
"feedback",
"through",
"the",
"life",
"-",
"cycle",
"listener<br",
">",
"<br",
">"
] | train | https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/daemon/src/main/java/de/taimos/daemon/DaemonStarter.java#L138-L141 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/ControlBar.java | ControlBar.removeControlListener | public boolean removeControlListener(String name, Widget.OnTouchListener listener) {
"""
Remove a touch listener for the button specified by {@code name}.
@param name The {@linkplain Widget#getName() name} of the button to listen to
@param listener A valid listener or null to clear
"""
Widget control... | java | public boolean removeControlListener(String name, Widget.OnTouchListener listener) {
Widget control = findChildByName(name);
if (control != null) {
return control.removeTouchListener(listener);
}
return false;
} | [
"public",
"boolean",
"removeControlListener",
"(",
"String",
"name",
",",
"Widget",
".",
"OnTouchListener",
"listener",
")",
"{",
"Widget",
"control",
"=",
"findChildByName",
"(",
"name",
")",
";",
"if",
"(",
"control",
"!=",
"null",
")",
"{",
"return",
"con... | Remove a touch listener for the button specified by {@code name}.
@param name The {@linkplain Widget#getName() name} of the button to listen to
@param listener A valid listener or null to clear | [
"Remove",
"a",
"touch",
"listener",
"for",
"the",
"button",
"specified",
"by",
"{",
"@code",
"name",
"}",
".",
"@param",
"name",
"The",
"{",
"@linkplain",
"Widget#getName",
"()",
"name",
"}",
"of",
"the",
"button",
"to",
"listen",
"to",
"@param",
"listener... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/ControlBar.java#L246-L252 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/AbstractFieldValidator.java | AbstractFieldValidator.error | public void error(final CellField<T> cellField, final String messageKey, final Map<String, Object> messageVariables) {
"""
メッセージキーを指定して、エラー情報を追加します。
@param cellField フィールド情報
@param messageKey メッセージキー
@param messageVariables メッセージ中の変数
@throws IllegalArgumentException {@literal cellField == null or messageKey ==... | java | public void error(final CellField<T> cellField, final String messageKey, final Map<String, Object> messageVariables) {
ArgUtils.notEmpty(messageKey, "messageKey");
ArgUtils.notNull(cellField, "cellField");
ArgUtils.notNull(messageVariables, "messageVariables");
cellField.rejectValu... | [
"public",
"void",
"error",
"(",
"final",
"CellField",
"<",
"T",
">",
"cellField",
",",
"final",
"String",
"messageKey",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"messageVariables",
")",
"{",
"ArgUtils",
".",
"notEmpty",
"(",
"messageKey",
",... | メッセージキーを指定して、エラー情報を追加します。
@param cellField フィールド情報
@param messageKey メッセージキー
@param messageVariables メッセージ中の変数
@throws IllegalArgumentException {@literal cellField == null or messageKey == null or messageVariables == null}
@throws IllegalArgumentException {@literal messageKey.length() == 0} | [
"メッセージキーを指定して、エラー情報を追加します。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/AbstractFieldValidator.java#L113-L120 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.executeQueryAsync | public void executeQueryAsync(String query, CallbackHandler callbackHandler) throws FMSException {
"""
Method to retrieve records for the given list of query in asynchronous fashion
@param query
@param callbackHandler
the callback handler
@throws FMSException
"""
IntuitMessage intuitMessage = pre... | java | public void executeQueryAsync(String query, CallbackHandler callbackHandler) throws FMSException {
IntuitMessage intuitMessage = prepareQuery(query);
//set callback handler
intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);
//execute async interceptors
exec... | [
"public",
"void",
"executeQueryAsync",
"(",
"String",
"query",
",",
"CallbackHandler",
"callbackHandler",
")",
"throws",
"FMSException",
"{",
"IntuitMessage",
"intuitMessage",
"=",
"prepareQuery",
"(",
"query",
")",
";",
"//set callback handler",
"intuitMessage",
".",
... | Method to retrieve records for the given list of query in asynchronous fashion
@param query
@param callbackHandler
the callback handler
@throws FMSException | [
"Method",
"to",
"retrieve",
"records",
"for",
"the",
"given",
"list",
"of",
"query",
"in",
"asynchronous",
"fashion"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L965-L973 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java | LdapConnection.getDynamicGroups | public Map<String, LdapEntry> getDynamicGroups(String bases[], List<String> propNames, boolean getMbrshipAttr) throws WIMException {
"""
Get dynamic groups.
@param bases Search bases.
@param propNames Properties to return.
@param getMbrshipAttr Whether to request the membership attribute.
@return Map of grou... | java | public Map<String, LdapEntry> getDynamicGroups(String bases[], List<String> propNames, boolean getMbrshipAttr) throws WIMException {
Map<String, LdapEntry> dynaGrps = new HashMap<String, LdapEntry>();
String[] attrIds = iLdapConfigMgr.getAttributeNames(iLdapConfigMgr.getGroupTypes(), propNames, getMbrsh... | [
"public",
"Map",
"<",
"String",
",",
"LdapEntry",
">",
"getDynamicGroups",
"(",
"String",
"bases",
"[",
"]",
",",
"List",
"<",
"String",
">",
"propNames",
",",
"boolean",
"getMbrshipAttr",
")",
"throws",
"WIMException",
"{",
"Map",
"<",
"String",
",",
"Lda... | Get dynamic groups.
@param bases Search bases.
@param propNames Properties to return.
@param getMbrshipAttr Whether to request the membership attribute.
@return Map of group distinguished names to {@link LdapEntry}.
@throws WIMException If there was an error resolving the dynamic groups from the LDAP server. | [
"Get",
"dynamic",
"groups",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java#L1647-L1676 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/AbstractDatabase.java | AbstractDatabase.addChangeListener | @NonNull
public ListenerToken addChangeListener(Executor executor, @NonNull DatabaseChangeListener listener) {
"""
Set the given DatabaseChangeListener to the this database with an executor on which the
the changes will be posted to the listener.
@param listener
"""
if (listener == null) { thro... | java | @NonNull
public ListenerToken addChangeListener(Executor executor, @NonNull DatabaseChangeListener listener) {
if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }
synchronized (lock) {
mustBeOpen();
return addDatabaseChangeListener(execu... | [
"@",
"NonNull",
"public",
"ListenerToken",
"addChangeListener",
"(",
"Executor",
"executor",
",",
"@",
"NonNull",
"DatabaseChangeListener",
"listener",
")",
"{",
"if",
"(",
"listener",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"lis... | Set the given DatabaseChangeListener to the this database with an executor on which the
the changes will be posted to the listener.
@param listener | [
"Set",
"the",
"given",
"DatabaseChangeListener",
"to",
"the",
"this",
"database",
"with",
"an",
"executor",
"on",
"which",
"the",
"the",
"changes",
"will",
"be",
"posted",
"to",
"the",
"listener",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L622-L630 |
generators-io-projects/generators | generators-core/src/main/java/io/generators/core/FluentGenerator.java | FluentGenerator.publishTo | @CheckReturnValue
public FluentGenerator<T> publishTo(@Nonnull List<Consumer<T>> consumers) {
"""
Returns FluentGenerator that published generated values to provided {@code consumers}
@param consumers to publish/broadcast to
@return Broadcasting FluentGenerator
@see io.generators.core.BroadcastingGenerato... | java | @CheckReturnValue
public FluentGenerator<T> publishTo(@Nonnull List<Consumer<T>> consumers) {
return from(new BroadcastingGenerator<>(delegate, checkNotNull(consumers)));
} | [
"@",
"CheckReturnValue",
"public",
"FluentGenerator",
"<",
"T",
">",
"publishTo",
"(",
"@",
"Nonnull",
"List",
"<",
"Consumer",
"<",
"T",
">",
">",
"consumers",
")",
"{",
"return",
"from",
"(",
"new",
"BroadcastingGenerator",
"<>",
"(",
"delegate",
",",
"c... | Returns FluentGenerator that published generated values to provided {@code consumers}
@param consumers to publish/broadcast to
@return Broadcasting FluentGenerator
@see io.generators.core.BroadcastingGenerator | [
"Returns",
"FluentGenerator",
"that",
"published",
"generated",
"values",
"to",
"provided",
"{",
"@code",
"consumers",
"}"
] | train | https://github.com/generators-io-projects/generators/blob/bee273970e638b4ed144337c442b795c816d6d61/generators-core/src/main/java/io/generators/core/FluentGenerator.java#L124-L127 |
GCRC/nunaliit | nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/DateUtils.java | DateUtils.parseGpsTimestamp | static public Date parseGpsTimestamp(String gpsTimestamp) throws Exception {
"""
Parses a GPS timestamp with a 1 second precision.
@param gpsTimestamp String containing time stamp
@return A date, precise to the second, representing the given timestamp.
@throws Exception
"""
try {
Matcher matcherTime = ... | java | static public Date parseGpsTimestamp(String gpsTimestamp) throws Exception {
try {
Matcher matcherTime = patternTime.matcher(gpsTimestamp);
if( matcherTime.matches() ) {
int year = Integer.parseInt( matcherTime.group(1) );
int month = Integer.parseInt( matcherTime.group(2) );
int day = Integer.parse... | [
"static",
"public",
"Date",
"parseGpsTimestamp",
"(",
"String",
"gpsTimestamp",
")",
"throws",
"Exception",
"{",
"try",
"{",
"Matcher",
"matcherTime",
"=",
"patternTime",
".",
"matcher",
"(",
"gpsTimestamp",
")",
";",
"if",
"(",
"matcherTime",
".",
"matches",
... | Parses a GPS timestamp with a 1 second precision.
@param gpsTimestamp String containing time stamp
@return A date, precise to the second, representing the given timestamp.
@throws Exception | [
"Parses",
"a",
"GPS",
"timestamp",
"with",
"a",
"1",
"second",
"precision",
"."
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/DateUtils.java#L19-L42 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/http/conn/ssl/SdkTLSSocketFactory.java | SdkTLSSocketFactory.existsIn | private boolean existsIn(String element, String[] a) {
"""
Returns true if the given element exists in the given array; false otherwise.
"""
for (String s : a) {
if (element.equals(s)) {
return true;
}
}
return false;
} | java | private boolean existsIn(String element, String[] a) {
for (String s : a) {
if (element.equals(s)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"existsIn",
"(",
"String",
"element",
",",
"String",
"[",
"]",
"a",
")",
"{",
"for",
"(",
"String",
"s",
":",
"a",
")",
"{",
"if",
"(",
"element",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"r... | Returns true if the given element exists in the given array; false otherwise. | [
"Returns",
"true",
"if",
"the",
"given",
"element",
"exists",
"in",
"the",
"given",
"array",
";",
"false",
"otherwise",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/conn/ssl/SdkTLSSocketFactory.java#L120-L127 |
joniles/mpxj | src/main/java/net/sf/mpxj/ResourceAssignment.java | ResourceAssignment.fireFieldChangeEvent | private void fireFieldChangeEvent(AssignmentField field, Object oldValue, Object newValue) {
"""
Handle the change in a field value. Reset any cached calculated
values affected by this change, pass on the event to any external
listeners.
@param field field changed
@param oldValue old field value
@param newV... | java | private void fireFieldChangeEvent(AssignmentField field, Object oldValue, Object newValue)
{
//
// Internal event handling
//
switch (field)
{
case START:
case BASELINE_START:
{
m_array[AssignmentField.START_VARIANCE.getValue()] = null;
... | [
"private",
"void",
"fireFieldChangeEvent",
"(",
"AssignmentField",
"field",
",",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"//",
"// Internal event handling",
"//",
"switch",
"(",
"field",
")",
"{",
"case",
"START",
":",
"case",
"BASELINE_START",
... | Handle the change in a field value. Reset any cached calculated
values affected by this change, pass on the event to any external
listeners.
@param field field changed
@param oldValue old field value
@param newValue new field value | [
"Handle",
"the",
"change",
"in",
"a",
"field",
"value",
".",
"Reset",
"any",
"cached",
"calculated",
"values",
"affected",
"by",
"this",
"change",
"pass",
"on",
"the",
"event",
"to",
"any",
"external",
"listeners",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L2736-L2802 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java | AjaxHelper.registerContainer | static AjaxOperation registerContainer(final String triggerId, final String containerId,
final String containerContentId) {
"""
This internal method is used to register an arbitrary target container. It must only used by components which
contain implicit AJAX capability.
@param triggerId the id of the trigg... | java | static AjaxOperation registerContainer(final String triggerId, final String containerId,
final String containerContentId) {
AjaxOperation operation = new AjaxOperation(triggerId, containerContentId);
operation.setTargetContainerId(containerId);
operation.setAction(AjaxOperation.AjaxAction.REPLACE_CONTENT);
r... | [
"static",
"AjaxOperation",
"registerContainer",
"(",
"final",
"String",
"triggerId",
",",
"final",
"String",
"containerId",
",",
"final",
"String",
"containerContentId",
")",
"{",
"AjaxOperation",
"operation",
"=",
"new",
"AjaxOperation",
"(",
"triggerId",
",",
"con... | This internal method is used to register an arbitrary target container. It must only used by components which
contain implicit AJAX capability.
@param triggerId the id of the trigger that will cause the component to be painted.
@param containerId the target container id. This is not necessarily a WComponent id.
@param... | [
"This",
"internal",
"method",
"is",
"used",
"to",
"register",
"an",
"arbitrary",
"target",
"container",
".",
"It",
"must",
"only",
"used",
"by",
"components",
"which",
"contain",
"implicit",
"AJAX",
"capability",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L128-L135 |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getTilePolygon | public static Polygon getTilePolygon (
MisoSceneMetrics metrics, int x, int y) {
"""
Return a polygon framing the specified tile.
@param x the tile x-position coordinate.
@param y the tile y-position coordinate.
"""
return getFootprintPolygon(metrics, x, y, 1, 1);
} | java | public static Polygon getTilePolygon (
MisoSceneMetrics metrics, int x, int y)
{
return getFootprintPolygon(metrics, x, y, 1, 1);
} | [
"public",
"static",
"Polygon",
"getTilePolygon",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"getFootprintPolygon",
"(",
"metrics",
",",
"x",
",",
"y",
",",
"1",
",",
"1",
")",
";",
"}"
] | Return a polygon framing the specified tile.
@param x the tile x-position coordinate.
@param y the tile y-position coordinate. | [
"Return",
"a",
"polygon",
"framing",
"the",
"specified",
"tile",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L407-L411 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java | StructuredQueryBuilder.temporalLsqtQuery | public StructuredQueryDefinition temporalLsqtQuery(String temporalCollection, String timestamp,
double weight, String... options) {
"""
Matches documents with LSQT prior to timestamp
@param temporalCollection the temporal collection to query
@param timestamp t... | java | public StructuredQueryDefinition temporalLsqtQuery(String temporalCollection, String timestamp,
double weight, String... options)
{
if ( temporalCollection == null ) throw new IllegalArgumentException("temporalCollection cannot be null");
return new Tempora... | [
"public",
"StructuredQueryDefinition",
"temporalLsqtQuery",
"(",
"String",
"temporalCollection",
",",
"String",
"timestamp",
",",
"double",
"weight",
",",
"String",
"...",
"options",
")",
"{",
"if",
"(",
"temporalCollection",
"==",
"null",
")",
"throw",
"new",
"Il... | Matches documents with LSQT prior to timestamp
@param temporalCollection the temporal collection to query
@param timestamp timestamp in ISO 8601 format - documents with lsqt equal to or
prior to this timestamp will match
@param weight the weight for this query
@param options string options from the list for
<a href="ht... | [
"Matches",
"documents",
"with",
"LSQT",
"prior",
"to",
"timestamp"
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L2866-L2871 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java | WindowUtils.centerOnParent | public static void centerOnParent(Window window, Component parent) {
"""
Center the window relative to it's parent. If the parent is null, or not showing,
the window will be centered on the screen
@param window the window to center
@param parent the parent
"""
if (parent == null || !parent.isShowing()) ... | java | public static void centerOnParent(Window window, Component parent) {
if (parent == null || !parent.isShowing()) {
// call our own centerOnScreen so we work around bug in
// setLocationRelativeTo(null)
centerOnScreen(window);
}
else {
window.setLocationRelativeTo(parent);
}
} | [
"public",
"static",
"void",
"centerOnParent",
"(",
"Window",
"window",
",",
"Component",
"parent",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
"||",
"!",
"parent",
".",
"isShowing",
"(",
")",
")",
"{",
"// call our own centerOnScreen so we work around bug in",
... | Center the window relative to it's parent. If the parent is null, or not showing,
the window will be centered on the screen
@param window the window to center
@param parent the parent | [
"Center",
"the",
"window",
"relative",
"to",
"it",
"s",
"parent",
".",
"If",
"the",
"parent",
"is",
"null",
"or",
"not",
"showing",
"the",
"window",
"will",
"be",
"centered",
"on",
"the",
"screen"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java#L114-L123 |
virgo47/javasimon | examples/src/main/java/org/javasimon/examples/MultithreadedContention.java | MultithreadedContention.main | public static void main(String[] args) throws InterruptedException {
"""
Entry point of the demo application.
@param args command line arguments
@throws InterruptedException when sleep is interrupted
"""
final ExecutorService executorService = Executors.newFixedThreadPool(1000);
BenchmarkUtils.run(1, 2... | java | public static void main(String[] args) throws InterruptedException {
final ExecutorService executorService = Executors.newFixedThreadPool(1000);
BenchmarkUtils.run(1, 2,
// low contention - single thread
new BenchmarkUtils.Task("1") {
@Override
public void perform() throws Exception {
new Multith... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"InterruptedException",
"{",
"final",
"ExecutorService",
"executorService",
"=",
"Executors",
".",
"newFixedThreadPool",
"(",
"1000",
")",
";",
"BenchmarkUtils",
".",
"run",
"(",... | Entry point of the demo application.
@param args command line arguments
@throws InterruptedException when sleep is interrupted | [
"Entry",
"point",
"of",
"the",
"demo",
"application",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/examples/src/main/java/org/javasimon/examples/MultithreadedContention.java#L34-L80 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.shiftTo | public Point2D shiftTo(final double DISTANCE, final double ANGLE) {
"""
Moves the poi to the position defined by the given distance and angle
@param DISTANCE
@param ANGLE
@return the poi moved by the given distance and angle
"""
final double EARTH_RADIUS = 6371000.0; // m
final double LON1 =... | java | public Point2D shiftTo(final double DISTANCE, final double ANGLE) {
final double EARTH_RADIUS = 6371000.0; // m
final double LON1 = Math.toRadians(this.lon);
final double LAT1 = Math.toRadians(this.lat);
final double LAT2 = Math.asin(Math.sin(LAT1) * Math.cos(DISTANCE / EARTH_RADIUS) + M... | [
"public",
"Point2D",
"shiftTo",
"(",
"final",
"double",
"DISTANCE",
",",
"final",
"double",
"ANGLE",
")",
"{",
"final",
"double",
"EARTH_RADIUS",
"=",
"6371000.0",
";",
"// m",
"final",
"double",
"LON1",
"=",
"Math",
".",
"toRadians",
"(",
"this",
".",
"lo... | Moves the poi to the position defined by the given distance and angle
@param DISTANCE
@param ANGLE
@return the poi moved by the given distance and angle | [
"Moves",
"the",
"poi",
"to",
"the",
"position",
"defined",
"by",
"the",
"given",
"distance",
"and",
"angle"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L382-L393 |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/MessageParserFactory.java | MessageParserFactory.createParser | private static final AbstractMessageParser createParser (final ProtocolDataUnit protocolDataUnit, final OperationCode operationCode) {
"""
Creates an instance of a concrete <code>AbstractMessageParser</code> object.
@param protocolDataUnit The reference <code>ProtocolDataUnit</code> instance, which contains thi... | java | private static final AbstractMessageParser createParser (final ProtocolDataUnit protocolDataUnit, final OperationCode operationCode) {
switch (operationCode) {
case LOGIN_REQUEST :
return new LoginRequestParser(protocolDataUnit);
case LOGIN_RESPONSE :
ret... | [
"private",
"static",
"final",
"AbstractMessageParser",
"createParser",
"(",
"final",
"ProtocolDataUnit",
"protocolDataUnit",
",",
"final",
"OperationCode",
"operationCode",
")",
"{",
"switch",
"(",
"operationCode",
")",
"{",
"case",
"LOGIN_REQUEST",
":",
"return",
"ne... | Creates an instance of a concrete <code>AbstractMessageParser</code> object.
@param protocolDataUnit The reference <code>ProtocolDataUnit</code> instance, which contains this
<code>AbstractMessageParser</code> object.
@param operationCode The operation code of the requested <code>AbstractMessageParser</code>.
@return ... | [
"Creates",
"an",
"instance",
"of",
"a",
"concrete",
"<code",
">",
"AbstractMessageParser<",
"/",
"code",
">",
"object",
"."
] | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/MessageParserFactory.java#L95-L138 |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/ModuleDescription.java | ModuleDescription.addOutput | public void addOutput( String fieldName, String type, String description, String defaultValue, String uiHint ) {
"""
Adds an output field to the module.
@param fieldName the name of the field (accessed through reflection).
@param type the chanonical name of the class of the field.
@param description a descrip... | java | public void addOutput( String fieldName, String type, String description, String defaultValue, String uiHint ) {
if (fieldName == null) {
throw new IllegalArgumentException("field name is mandatory");
}
if (type == null) {
throw new IllegalArgumentException("field type is... | [
"public",
"void",
"addOutput",
"(",
"String",
"fieldName",
",",
"String",
"type",
",",
"String",
"description",
",",
"String",
"defaultValue",
",",
"String",
"uiHint",
")",
"{",
"if",
"(",
"fieldName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgument... | Adds an output field to the module.
@param fieldName the name of the field (accessed through reflection).
@param type the chanonical name of the class of the field.
@param description a description of the field.
@param defaultValue a default value or <code>null</code>.
@param uiHint | [
"Adds",
"an",
"output",
"field",
"to",
"the",
"module",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/spatialtoolbox/core/ModuleDescription.java#L153-L177 |
cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MMFF94ParametersCall.java | MMFF94ParametersCall.getAngleData | public List getAngleData(String angleType, String id1, String id2, String id3) throws Exception {
"""
Gets the angle parameter set.
@param id1 ID from Atom 1.
@param id2 ID from Atom 2.
@param id3 ID from Atom 3.
@return The angle data from the force field p... | java | public List getAngleData(String angleType, String id1, String id2, String id3) throws Exception {
String akey = "";
if (pSet.containsKey(("angle" + angleType + ";" + id1 + ";" + id2 + ";" + id3))) {
akey = "angle" + angleType + ";" + id1 + ";" + id2 + ";" + id3;
} else if (pSet.conta... | [
"public",
"List",
"getAngleData",
"(",
"String",
"angleType",
",",
"String",
"id1",
",",
"String",
"id2",
",",
"String",
"id3",
")",
"throws",
"Exception",
"{",
"String",
"akey",
"=",
"\"\"",
";",
"if",
"(",
"pSet",
".",
"containsKey",
"(",
"(",
"\"angle... | Gets the angle parameter set.
@param id1 ID from Atom 1.
@param id2 ID from Atom 2.
@param id3 ID from Atom 3.
@return The angle data from the force field parameter set
@exception Exception Description of the Exception | [
"Gets",
"the",
"angle",
"parameter",
"set",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MMFF94ParametersCall.java#L65-L80 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java | ExtractionUtil.extractFilesUsingFilter | public static void extractFilesUsingFilter(File archive, File destination, FilenameFilter filter) throws ExtractionException {
"""
Extracts the contents of an archive into the specified directory.
@param archive an archive file such as a WAR or EAR
@param destination a directory to extract the contents to
@pa... | java | public static void extractFilesUsingFilter(File archive, File destination, FilenameFilter filter) throws ExtractionException {
if (archive == null || destination == null) {
return;
}
try (FileInputStream fis = new FileInputStream(archive)) {
extractArchive(new ZipArchive... | [
"public",
"static",
"void",
"extractFilesUsingFilter",
"(",
"File",
"archive",
",",
"File",
"destination",
",",
"FilenameFilter",
"filter",
")",
"throws",
"ExtractionException",
"{",
"if",
"(",
"archive",
"==",
"null",
"||",
"destination",
"==",
"null",
")",
"{"... | Extracts the contents of an archive into the specified directory.
@param archive an archive file such as a WAR or EAR
@param destination a directory to extract the contents to
@param filter determines which files get extracted
@throws ExtractionException thrown if the archive is not found | [
"Extracts",
"the",
"contents",
"of",
"an",
"archive",
"into",
"the",
"specified",
"directory",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L208-L224 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java | Assert.checkNotNull | public static void checkNotNull(String parameterName, Object object) {
"""
Check that the parameter is not {@code null}.
@param parameterName
The name of the user-supplied parameter that we are validating
so that the user can easily find the error in their code.
@param object
The parameter object can be any... | java | public static void checkNotNull(String parameterName, Object object) {
if (object == null) {
throw Exceptions.IllegalArgument("Input %s can't be null.",
parameterName);
}
} | [
"public",
"static",
"void",
"checkNotNull",
"(",
"String",
"parameterName",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"Exceptions",
".",
"IllegalArgument",
"(",
"\"Input %s can't be null.\"",
",",
"parameterName",
"... | Check that the parameter is not {@code null}.
@param parameterName
The name of the user-supplied parameter that we are validating
so that the user can easily find the error in their code.
@param object
The parameter object can be any Java reference type, including
arrays.
@throws IllegalArgumentException
If the object... | [
"Check",
"that",
"the",
"parameter",
"is",
"not",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java#L47-L52 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/Pager.java | Pager.getIntHeaderValue | private int getIntHeaderValue(Response response, String key) throws GitLabApiException {
"""
Get the specified integer header value from the Response instance.
@param response the Response instance to get the value from
@param key the HTTP header key to get the value for
@return the specified integer header v... | java | private int getIntHeaderValue(Response response, String key) throws GitLabApiException {
String value = getHeaderValue(response, key);
if (value == null) {
return -1;
}
try {
return (Integer.parseInt(value));
} catch (NumberFormatException nfe) ... | [
"private",
"int",
"getIntHeaderValue",
"(",
"Response",
"response",
",",
"String",
"key",
")",
"throws",
"GitLabApiException",
"{",
"String",
"value",
"=",
"getHeaderValue",
"(",
"response",
",",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
... | Get the specified integer header value from the Response instance.
@param response the Response instance to get the value from
@param key the HTTP header key to get the value for
@return the specified integer header value from the Response instance, or -1 if the header is not present
@throws GitLabApiException if any ... | [
"Get",
"the",
"specified",
"integer",
"header",
"value",
"from",
"the",
"Response",
"instance",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/Pager.java#L158-L170 |
qiniu/java-sdk | src/main/java/com/qiniu/storage/BucketManager.java | BucketManager.fetch | public FetchRet fetch(String url, String bucket, String key) throws QiniuException {
"""
抓取指定地址的文件,以指定名称保存在指定空间
要求指定url可访问,大文件不建议使用此接口抓取。可先下载再上传
@param url 待抓取的文件链接
@param bucket 文件抓取后保存的空间
@param key 文件抓取后保存的文件名
@throws QiniuException
"""
String resource = UrlSafeBase64.encodeToString(url... | java | public FetchRet fetch(String url, String bucket, String key) throws QiniuException {
String resource = UrlSafeBase64.encodeToString(url);
String to = encodedEntry(bucket, key);
String path = String.format("/fetch/%s/to/%s", resource, to);
Response res = ioPost(bucket, path);
if (... | [
"public",
"FetchRet",
"fetch",
"(",
"String",
"url",
",",
"String",
"bucket",
",",
"String",
"key",
")",
"throws",
"QiniuException",
"{",
"String",
"resource",
"=",
"UrlSafeBase64",
".",
"encodeToString",
"(",
"url",
")",
";",
"String",
"to",
"=",
"encodedEn... | 抓取指定地址的文件,以指定名称保存在指定空间
要求指定url可访问,大文件不建议使用此接口抓取。可先下载再上传
@param url 待抓取的文件链接
@param bucket 文件抓取后保存的空间
@param key 文件抓取后保存的文件名
@throws QiniuException | [
"抓取指定地址的文件,以指定名称保存在指定空间",
"要求指定url可访问,大文件不建议使用此接口抓取。可先下载再上传"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/storage/BucketManager.java#L449-L460 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceNotifierFactory.java | TaskInstanceNotifierFactory.getNotifierSpecs | public List<String> getNotifierSpecs(Long taskId, String outcome) throws ObserverException {
"""
Returns a list of notifier class name and template name pairs, delimited by colon
@param taskId
@param outcome
@return the registered notifier or null if not found
"""
TaskTemplate taskVO = TaskTemplateC... | java | public List<String> getNotifierSpecs(Long taskId, String outcome) throws ObserverException {
TaskTemplate taskVO = TaskTemplateCache.getTaskTemplate(taskId);
if (taskVO != null) {
String noticesAttr = taskVO.getAttribute(TaskAttributeConstant.NOTICES);
if (!StringHelper.isEmpty(n... | [
"public",
"List",
"<",
"String",
">",
"getNotifierSpecs",
"(",
"Long",
"taskId",
",",
"String",
"outcome",
")",
"throws",
"ObserverException",
"{",
"TaskTemplate",
"taskVO",
"=",
"TaskTemplateCache",
".",
"getTaskTemplate",
"(",
"taskId",
")",
";",
"if",
"(",
... | Returns a list of notifier class name and template name pairs, delimited by colon
@param taskId
@param outcome
@return the registered notifier or null if not found | [
"Returns",
"a",
"list",
"of",
"notifier",
"class",
"name",
"and",
"template",
"name",
"pairs",
"delimited",
"by",
"colon"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceNotifierFactory.java#L59-L68 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectOneMenu/SelectOneMenuRenderer.java | SelectOneMenuRenderer.addLabel | protected void addLabel(ResponseWriter rw, String clientId, SelectOneMenu menu, String outerClientId)
throws IOException {
"""
Renders the optional label. This method is protected in order to allow
third-party frameworks to derive from it.
@param rw
the response writer
@param clientId
the id used by the ... | java | protected void addLabel(ResponseWriter rw, String clientId, SelectOneMenu menu, String outerClientId)
throws IOException {
String label = menu.getLabel();
{
if (!menu.isRenderLabel()) {
label = null;
}
}
if (label != null) {
rw.startElement("label", menu);
rw.writeAttribute("for", clientId, "... | [
"protected",
"void",
"addLabel",
"(",
"ResponseWriter",
"rw",
",",
"String",
"clientId",
",",
"SelectOneMenu",
"menu",
",",
"String",
"outerClientId",
")",
"throws",
"IOException",
"{",
"String",
"label",
"=",
"menu",
".",
"getLabel",
"(",
")",
";",
"{",
"if... | Renders the optional label. This method is protected in order to allow
third-party frameworks to derive from it.
@param rw
the response writer
@param clientId
the id used by the label to refernce the input field
@throws IOException
may be thrown by the response writer | [
"Renders",
"the",
"optional",
"label",
".",
"This",
"method",
"is",
"protected",
"in",
"order",
"to",
"allow",
"third",
"-",
"party",
"frameworks",
"to",
"derive",
"from",
"it",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectOneMenu/SelectOneMenuRenderer.java#L199-L216 |
cortical-io/java-client-sdk | retina-service-java-api-client/src/main/java/io/cortical/services/RetinaApiUtils.java | RetinaApiUtils.generateBasepath | public static String generateBasepath(final String ip, Short port) {
"""
Generate the base path for the retina.
@param ip : retina server ip.
@param port : retina service port.
@return : the retina's API base path.
"""
if (isEmpty(ip)) {
throw new IllegalArgumentException(NULL_SERVER_I... | java | public static String generateBasepath(final String ip, Short port) {
if (isEmpty(ip)) {
throw new IllegalArgumentException(NULL_SERVER_IP_MSG);
}
if (port == null) {
port = 80;
}
StringBuilder basePath = new StringBuilder();
basePath.append("http:/... | [
"public",
"static",
"String",
"generateBasepath",
"(",
"final",
"String",
"ip",
",",
"Short",
"port",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"ip",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"NULL_SERVER_IP_MSG",
")",
";",
"}",
"if",
"(",... | Generate the base path for the retina.
@param ip : retina server ip.
@param port : retina service port.
@return : the retina's API base path. | [
"Generate",
"the",
"base",
"path",
"for",
"the",
"retina",
"."
] | train | https://github.com/cortical-io/java-client-sdk/blob/7a1ee811cd7c221690dc0a7e643c286c56cab921/retina-service-java-api-client/src/main/java/io/cortical/services/RetinaApiUtils.java#L26-L36 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/NodePackageAnalyzer.java | NodePackageAnalyzer.prepareFileTypeAnalyzer | @Override
protected void prepareFileTypeAnalyzer(Engine engine) throws InitializationException {
"""
Performs validation on the configuration to ensure that the correct
analyzers are in place.
@param engine the dependency-check engine
@throws InitializationException thrown if there is a configuration erro... | java | @Override
protected void prepareFileTypeAnalyzer(Engine engine) throws InitializationException {
if (engine.getMode() != Mode.EVIDENCE_COLLECTION) {
try {
final Settings settings = engine.getSettings();
final String[] tmp = settings.getArray(Settings.KEYS.ECOSYSTE... | [
"@",
"Override",
"protected",
"void",
"prepareFileTypeAnalyzer",
"(",
"Engine",
"engine",
")",
"throws",
"InitializationException",
"{",
"if",
"(",
"engine",
".",
"getMode",
"(",
")",
"!=",
"Mode",
".",
"EVIDENCE_COLLECTION",
")",
"{",
"try",
"{",
"final",
"Se... | Performs validation on the configuration to ensure that the correct
analyzers are in place.
@param engine the dependency-check engine
@throws InitializationException thrown if there is a configuration error | [
"Performs",
"validation",
"on",
"the",
"configuration",
"to",
"ensure",
"that",
"the",
"correct",
"analyzers",
"are",
"in",
"place",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/NodePackageAnalyzer.java#L111-L133 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/DNS.java | DNS.reverseDns | @Deprecated
public static String reverseDns(InetAddress hostIp, String ns)
throws NamingException {
"""
Returns the hostname associated with the specified IP address by the
provided nameserver.
@param hostIp
The address to reverse lookup
@param ns
The host name of a reachable DNS server
@return The h... | java | @Deprecated
public static String reverseDns(InetAddress hostIp, String ns)
throws NamingException {
//
// Builds the reverse IP lookup form
// This is formed by reversing the IP numbers and appending in-addr.arpa
//
String[] parts = hostIp.getHostAddress().split("\\.");
String reverseIP = ... | [
"@",
"Deprecated",
"public",
"static",
"String",
"reverseDns",
"(",
"InetAddress",
"hostIp",
",",
"String",
"ns",
")",
"throws",
"NamingException",
"{",
"//",
"// Builds the reverse IP lookup form",
"// This is formed by reversing the IP numbers and appending in-addr.arpa",
"//... | Returns the hostname associated with the specified IP address by the
provided nameserver.
@param hostIp
The address to reverse lookup
@param ns
The host name of a reachable DNS server
@return The host name associated with the provided IP
@throws NamingException
If a NamingException is encountered
@deprecated Reliance ... | [
"Returns",
"the",
"hostname",
"associated",
"with",
"the",
"specified",
"IP",
"address",
"by",
"the",
"provided",
"nameserver",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/DNS.java#L58-L78 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java | ServiceEndpointPoliciesInner.getByResourceGroup | public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName, String expand) {
"""
Gets the specified service Endpoint Policies in a specified resource group.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of... | java | public ServiceEndpointPolicyInner getByResourceGroup(String resourceGroupName, String serviceEndpointPolicyName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand).toBlocking().single().body();
} | [
"public",
"ServiceEndpointPolicyInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"serviceEndpointPolicyName",
",",
"String",
"expand",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serviceEndpoi... | Gets the specified service Endpoint Policies in a specified resource group.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of the service endpoint policy.
@param expand Expands referenced resources.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Gets",
"the",
"specified",
"service",
"Endpoint",
"Policies",
"in",
"a",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java#L356-L358 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfSignatureAppearance.java | PdfSignatureAppearance.setVisibleSignature | public void setVisibleSignature(String fieldName) {
"""
Sets the signature to be visible. An empty signature field with the same name must already exist.
@param fieldName the existing empty signature field name
"""
AcroFields af = writer.getAcroFields();
AcroFields.Item item = af.getFieldItem(... | java | public void setVisibleSignature(String fieldName) {
AcroFields af = writer.getAcroFields();
AcroFields.Item item = af.getFieldItem(fieldName);
if (item == null)
throw new IllegalArgumentException("The field " + fieldName + " does not exist.");
PdfDictionary merged = item.getM... | [
"public",
"void",
"setVisibleSignature",
"(",
"String",
"fieldName",
")",
"{",
"AcroFields",
"af",
"=",
"writer",
".",
"getAcroFields",
"(",
")",
";",
"AcroFields",
".",
"Item",
"item",
"=",
"af",
".",
"getFieldItem",
"(",
"fieldName",
")",
";",
"if",
"(",... | Sets the signature to be visible. An empty signature field with the same name must already exist.
@param fieldName the existing empty signature field name | [
"Sets",
"the",
"signature",
"to",
"be",
"visible",
".",
"An",
"empty",
"signature",
"field",
"with",
"the",
"same",
"name",
"must",
"already",
"exist",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfSignatureAppearance.java#L290-L335 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/sorting/SortUtils.java | SortUtils.getComparator | public static IntComparator getComparator(Table table, Sort key) {
"""
Returns a comparator that can be used to sort the records in this table according to the given sort key
"""
Iterator<Map.Entry<String, Sort.Order>> entries = key.iterator();
Map.Entry<String, Sort.Order> sort = entries.next(... | java | public static IntComparator getComparator(Table table, Sort key) {
Iterator<Map.Entry<String, Sort.Order>> entries = key.iterator();
Map.Entry<String, Sort.Order> sort = entries.next();
Column<?> column = table.column(sort.getKey());
return SortUtils.rowComparator(column, sort.getValue()... | [
"public",
"static",
"IntComparator",
"getComparator",
"(",
"Table",
"table",
",",
"Sort",
"key",
")",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Sort",
".",
"Order",
">",
">",
"entries",
"=",
"key",
".",
"iterator",
"(",
")",
";",
... | Returns a comparator that can be used to sort the records in this table according to the given sort key | [
"Returns",
"a",
"comparator",
"that",
"can",
"be",
"used",
"to",
"sort",
"the",
"records",
"in",
"this",
"table",
"according",
"to",
"the",
"given",
"sort",
"key"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/sorting/SortUtils.java#L49-L54 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java | HttpAuthServiceBuilder.addBasicAuth | public HttpAuthServiceBuilder addBasicAuth(Authorizer<? super BasicToken> authorizer, AsciiString header) {
"""
Adds an HTTP basic {@link Authorizer} for the given {@code header}.
"""
return addTokenAuthorizer(new BasicTokenExtractor(requireNonNull(header, "header")),
... | java | public HttpAuthServiceBuilder addBasicAuth(Authorizer<? super BasicToken> authorizer, AsciiString header) {
return addTokenAuthorizer(new BasicTokenExtractor(requireNonNull(header, "header")),
requireNonNull(authorizer, "authorizer"));
} | [
"public",
"HttpAuthServiceBuilder",
"addBasicAuth",
"(",
"Authorizer",
"<",
"?",
"super",
"BasicToken",
">",
"authorizer",
",",
"AsciiString",
"header",
")",
"{",
"return",
"addTokenAuthorizer",
"(",
"new",
"BasicTokenExtractor",
"(",
"requireNonNull",
"(",
"header",
... | Adds an HTTP basic {@link Authorizer} for the given {@code header}. | [
"Adds",
"an",
"HTTP",
"basic",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java#L85-L88 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F4.andThen | public <T> F4<P1, P2, P3, P4, T> andThen(final Function<? super R, ? extends T> f) {
"""
Returns a composed function from this function and the specified function that takes the
result of this function. When applying the composed function, this function is applied
first to given parameter and then the specified ... | java | public <T> F4<P1, P2, P3, P4, T> andThen(final Function<? super R, ? extends T> f) {
E.NPE(f);
final Func4<P1, P2, P3, P4, R> me = this;
return new F4<P1, P2, P3, P4, T>() {
@Override
public T apply(P1 p1, P2 p2, P3 p3, P4 p4) {
R r... | [
"public",
"<",
"T",
">",
"F4",
"<",
"P1",
",",
"P2",
",",
"P3",
",",
"P4",
",",
"T",
">",
"andThen",
"(",
"final",
"Function",
"<",
"?",
"super",
"R",
",",
"?",
"extends",
"T",
">",
"f",
")",
"{",
"E",
".",
"NPE",
"(",
"f",
")",
";",
"fin... | Returns a composed function from this function and the specified function that takes the
result of this function. When applying the composed function, this function is applied
first to given parameter and then the specified function is applied to the result of
this function.
@param f
the function takes the <code>R</co... | [
"Returns",
"a",
"composed",
"function",
"from",
"this",
"function",
"and",
"the",
"specified",
"function",
"that",
"takes",
"the",
"result",
"of",
"this",
"function",
".",
"When",
"applying",
"the",
"composed",
"function",
"this",
"function",
"is",
"applied",
... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1550-L1560 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java | AnnotationCollectorTransform.addError | protected void addError(String message, ASTNode node, SourceUnit source) {
"""
Adds a new syntax error to the source unit and then continues.
@param message the message
@param node the node for the error report
@param source the source unit for the error report
"""
source.getErrorCollect... | java | protected void addError(String message, ASTNode node, SourceUnit source) {
source.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(new SyntaxException(
message, node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber()
), so... | [
"protected",
"void",
"addError",
"(",
"String",
"message",
",",
"ASTNode",
"node",
",",
"SourceUnit",
"source",
")",
"{",
"source",
".",
"getErrorCollector",
"(",
")",
".",
"addErrorAndContinue",
"(",
"new",
"SyntaxErrorMessage",
"(",
"new",
"SyntaxException",
"... | Adds a new syntax error to the source unit and then continues.
@param message the message
@param node the node for the error report
@param source the source unit for the error report | [
"Adds",
"a",
"new",
"syntax",
"error",
"to",
"the",
"source",
"unit",
"and",
"then",
"continues",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/AnnotationCollectorTransform.java#L196-L200 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/common/NumberGenerator.java | NumberGenerator.getNextValAsLong | public Long getNextValAsLong()
throws EFapsException {
"""
Method to get the next long value for this sequence. To get the formated
value use {@link #getNextVal()}
@return next value for this sequence
@throws EFapsException on error
"""
long ret = 0;
try {
ret = Context... | java | public Long getNextValAsLong()
throws EFapsException
{
long ret = 0;
try {
ret = Context.getDbType().nextSequence(Context.getThreadContext().getConnectionResource(),
getDBName());
} catch (final SQLException e) {
throw new EFapsExce... | [
"public",
"Long",
"getNextValAsLong",
"(",
")",
"throws",
"EFapsException",
"{",
"long",
"ret",
"=",
"0",
";",
"try",
"{",
"ret",
"=",
"Context",
".",
"getDbType",
"(",
")",
".",
"nextSequence",
"(",
"Context",
".",
"getThreadContext",
"(",
")",
".",
"ge... | Method to get the next long value for this sequence. To get the formated
value use {@link #getNextVal()}
@return next value for this sequence
@throws EFapsException on error | [
"Method",
"to",
"get",
"the",
"next",
"long",
"value",
"for",
"this",
"sequence",
".",
"To",
"get",
"the",
"formated",
"value",
"use",
"{",
"@link",
"#getNextVal",
"()",
"}"
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/common/NumberGenerator.java#L223-L234 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setEnterpriseNumber | public void setEnterpriseNumber(int index, Number value) {
"""
Set an enterprise field value.
@param index field index
@param value field value
"""
set(selectField(ResourceFieldLists.ENTERPRISE_NUMBER, index), value);
} | java | public void setEnterpriseNumber(int index, Number value)
{
set(selectField(ResourceFieldLists.ENTERPRISE_NUMBER, index), value);
} | [
"public",
"void",
"setEnterpriseNumber",
"(",
"int",
"index",
",",
"Number",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"ENTERPRISE_NUMBER",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set an enterprise field value.
@param index field index
@param value field value | [
"Set",
"an",
"enterprise",
"field",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L2139-L2142 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.findChoiceSubMessage | private static int findChoiceSubMessage(MessagePattern pattern, int partIndex, double number) {
"""
Finds the ChoiceFormat sub-message for the given number.
@param pattern A MessagePattern.
@param partIndex the index of the first ChoiceFormat argument style part.
@param number a number to be mapped to one of th... | java | private static int findChoiceSubMessage(MessagePattern pattern, int partIndex, double number) {
int count=pattern.countParts();
int msgStart;
// Iterate over (ARG_INT|DOUBLE, ARG_SELECTOR, message) tuples
// until ARG_LIMIT or end of choice-only pattern.
// Ignore the first numbe... | [
"private",
"static",
"int",
"findChoiceSubMessage",
"(",
"MessagePattern",
"pattern",
",",
"int",
"partIndex",
",",
"double",
"number",
")",
"{",
"int",
"count",
"=",
"pattern",
".",
"countParts",
"(",
")",
";",
"int",
"msgStart",
";",
"// Iterate over (ARG_INT|... | Finds the ChoiceFormat sub-message for the given number.
@param pattern A MessagePattern.
@param partIndex the index of the first ChoiceFormat argument style part.
@param number a number to be mapped to one of the ChoiceFormat argument's intervals
@return the sub-message start part index. | [
"Finds",
"the",
"ChoiceFormat",
"sub",
"-",
"message",
"for",
"the",
"given",
"number",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L1830-L1868 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.executeQuery | public <T> T executeQuery(@NotNull ResultSetProcessor<T> processor, @NotNull SqlQuery query) {
"""
Executes a query and processes the results with given {@link ResultSetProcessor}.
All other findXXX-methods are just convenience methods for this one.
"""
return withCurrentTransaction(query, tx -> {
... | java | public <T> T executeQuery(@NotNull ResultSetProcessor<T> processor, @NotNull SqlQuery query) {
return withCurrentTransaction(query, tx -> {
logQuery(query);
try (PreparedStatement ps = tx.getConnection().prepareStatement(query.getSql())) {
prepareStatementFromQuery(ps, q... | [
"public",
"<",
"T",
">",
"T",
"executeQuery",
"(",
"@",
"NotNull",
"ResultSetProcessor",
"<",
"T",
">",
"processor",
",",
"@",
"NotNull",
"SqlQuery",
"query",
")",
"{",
"return",
"withCurrentTransaction",
"(",
"query",
",",
"tx",
"->",
"{",
"logQuery",
"("... | Executes a query and processes the results with given {@link ResultSetProcessor}.
All other findXXX-methods are just convenience methods for this one. | [
"Executes",
"a",
"query",
"and",
"processes",
"the",
"results",
"with",
"given",
"{"
] | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L271-L285 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDefinitionInventoryPersistenceImpl.java | CPDefinitionInventoryPersistenceImpl.findAll | @Override
public List<CPDefinitionInventory> findAll() {
"""
Returns all the cp definition inventories.
@return the cp definition inventories
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionInventory> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionInventory",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition inventories.
@return the cp definition inventories | [
"Returns",
"all",
"the",
"cp",
"definition",
"inventories",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDefinitionInventoryPersistenceImpl.java#L2331-L2334 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_vm_vmId_backupJob_restorePoints_restorePointId_restore_POST | public OvhTask serviceName_datacenter_datacenterId_vm_vmId_backupJob_restorePoints_restorePointId_restore_POST(String serviceName, Long datacenterId, Long vmId, Long restorePointId, Long filerId) throws IOException {
"""
Restore this restore point
REST: POST /dedicatedCloud/{serviceName}/datacenter/{datacenterI... | java | public OvhTask serviceName_datacenter_datacenterId_vm_vmId_backupJob_restorePoints_restorePointId_restore_POST(String serviceName, Long datacenterId, Long vmId, Long restorePointId, Long filerId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob/restorePo... | [
"public",
"OvhTask",
"serviceName_datacenter_datacenterId_vm_vmId_backupJob_restorePoints_restorePointId_restore_POST",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"vmId",
",",
"Long",
"restorePointId",
",",
"Long",
"filerId",
")",
"throws",
"IOExc... | Restore this restore point
REST: POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob/restorePoints/{restorePointId}/restore
@param filerId [required] Id of the filer where we should restore this Backup.
@param serviceName [required] Domain of the service
@param datacenterId [required]
@par... | [
"Restore",
"this",
"restore",
"point"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2092-L2099 |
buschmais/jqa-java-plugin | src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/AbstractAnnotationVisitor.java | AbstractAnnotationVisitor.createValue | private <T extends ValueDescriptor<?>> T createValue(Class<T> type, String name) {
"""
Create a value descriptor of given type and name and initializes it.
@param type
The class type.
@param name
The name
@param <T>
The type.
@return The initialized descriptor.
"""
if (name != null) {
... | java | private <T extends ValueDescriptor<?>> T createValue(Class<T> type, String name) {
if (name != null) {
this.arrayValueDescriptor = null;
}
String valueName;
if (arrayValueDescriptor != null) {
valueName = "[" + getArrayValue().size() + "]";
} else {
... | [
"private",
"<",
"T",
"extends",
"ValueDescriptor",
"<",
"?",
">",
">",
"T",
"createValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"this",
".",
"arrayValueDescriptor",
"=",
"nul... | Create a value descriptor of given type and name and initializes it.
@param type
The class type.
@param name
The name
@param <T>
The type.
@return The initialized descriptor. | [
"Create",
"a",
"value",
"descriptor",
"of",
"given",
"type",
"and",
"name",
"and",
"initializes",
"it",
"."
] | train | https://github.com/buschmais/jqa-java-plugin/blob/4c050943e9c28cf1c4a08aa962d5b5bf03c4fe54/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/AbstractAnnotationVisitor.java#L98-L111 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java | CommerceTierPriceEntryPersistenceImpl.removeByUUID_G | @Override
public CommerceTierPriceEntry removeByUUID_G(String uuid, long groupId)
throws NoSuchTierPriceEntryException {
"""
Removes the commerce tier price entry where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the commerce tier price entry... | java | @Override
public CommerceTierPriceEntry removeByUUID_G(String uuid, long groupId)
throws NoSuchTierPriceEntryException {
CommerceTierPriceEntry commerceTierPriceEntry = findByUUID_G(uuid,
groupId);
return remove(commerceTierPriceEntry);
} | [
"@",
"Override",
"public",
"CommerceTierPriceEntry",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchTierPriceEntryException",
"{",
"CommerceTierPriceEntry",
"commerceTierPriceEntry",
"=",
"findByUUID_G",
"(",
"uuid",
",",
"groupId",... | Removes the commerce tier price entry where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the commerce tier price entry that was removed | [
"Removes",
"the",
"commerce",
"tier",
"price",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java#L818-L825 |
google/gson | gson/src/main/java/com/google/gson/Gson.java | Gson.fromJson | @SuppressWarnings("unchecked")
public <T> T fromJson(JsonElement json, Type typeOfT) throws JsonSyntaxException {
"""
This method deserializes the Json read from the specified parse tree into an object of the
specified type. This method is useful if the specified object is a generic type. For
non-generic objec... | java | @SuppressWarnings("unchecked")
public <T> T fromJson(JsonElement json, Type typeOfT) throws JsonSyntaxException {
if (json == null) {
return null;
}
return (T) fromJson(new JsonTreeReader(json), typeOfT);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"fromJson",
"(",
"JsonElement",
"json",
",",
"Type",
"typeOfT",
")",
"throws",
"JsonSyntaxException",
"{",
"if",
"(",
"json",
"==",
"null",
")",
"{",
"return",
"null",
";",
... | This method deserializes the Json read from the specified parse tree into an object of the
specified type. This method is useful if the specified object is a generic type. For
non-generic objects, use {@link #fromJson(JsonElement, Class)} instead.
@param <T> the type of the desired object
@param json the root of the p... | [
"This",
"method",
"deserializes",
"the",
"Json",
"read",
"from",
"the",
"specified",
"parse",
"tree",
"into",
"an",
"object",
"of",
"the",
"specified",
"type",
".",
"This",
"method",
"is",
"useful",
"if",
"the",
"specified",
"object",
"is",
"a",
"generic",
... | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/Gson.java#L998-L1004 |
apptik/JustJson | json-core/src/main/java/io/apptik/json/JsonObject.java | JsonObject.optLong | public Long optLong(String name, Long fallback) {
"""
Returns the value mapped by {@code name} if it exists and is a long or
can be coerced to a long, or {@code fallback} otherwise. Note that Util represents
numbers as doubles, so this is <a href="#lossy">lossy</a>; use strings to transfer
numbers via Util.
... | java | public Long optLong(String name, Long fallback) {
return optLong(name, fallback, true);
} | [
"public",
"Long",
"optLong",
"(",
"String",
"name",
",",
"Long",
"fallback",
")",
"{",
"return",
"optLong",
"(",
"name",
",",
"fallback",
",",
"true",
")",
";",
"}"
] | Returns the value mapped by {@code name} if it exists and is a long or
can be coerced to a long, or {@code fallback} otherwise. Note that Util represents
numbers as doubles, so this is <a href="#lossy">lossy</a>; use strings to transfer
numbers via Util. | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/JsonObject.java#L556-L558 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/ValidatingStreamReader.java | ValidatingStreamReader.createValidatingStreamReader | public static ValidatingStreamReader createValidatingStreamReader
(BranchingReaderSource input, ReaderCreator owner,
ReaderConfig cfg, InputBootstrapper bs, boolean forER)
throws XMLStreamException {
"""
Factory method for constructing readers.
@param owner "Owner" of this reader, facto... | java | public static ValidatingStreamReader createValidatingStreamReader
(BranchingReaderSource input, ReaderCreator owner,
ReaderConfig cfg, InputBootstrapper bs, boolean forER)
throws XMLStreamException
{
ValidatingStreamReader sr = new ValidatingStreamReader
(bs, input, owne... | [
"public",
"static",
"ValidatingStreamReader",
"createValidatingStreamReader",
"(",
"BranchingReaderSource",
"input",
",",
"ReaderCreator",
"owner",
",",
"ReaderConfig",
"cfg",
",",
"InputBootstrapper",
"bs",
",",
"boolean",
"forER",
")",
"throws",
"XMLStreamException",
"{... | Factory method for constructing readers.
@param owner "Owner" of this reader, factory that created the reader;
needed for returning updated symbol table information after parsing.
@param input Input source used to read the XML document.
@param cfg Object that contains reader configuration info.
@param bs Bootstrapper ... | [
"Factory",
"method",
"for",
"constructing",
"readers",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/ValidatingStreamReader.java#L124-L132 |
primefaces/primefaces | src/main/java/org/primefaces/renderkit/InputRenderer.java | InputRenderer.renderARIAInvalid | protected void renderARIAInvalid(FacesContext context, UIInput component) throws IOException {
"""
Adds "aria-invalid" if the component is invalid.
@param context the {@link FacesContext}
@param component the {@link UIInput} component to add attributes for
@throws IOException if any error occurs writing the r... | java | protected void renderARIAInvalid(FacesContext context, UIInput component) throws IOException {
if (!component.isValid()) {
ResponseWriter writer = context.getResponseWriter();
writer.writeAttribute(HTML.ARIA_INVALID, "true", null);
}
} | [
"protected",
"void",
"renderARIAInvalid",
"(",
"FacesContext",
"context",
",",
"UIInput",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isValid",
"(",
")",
")",
"{",
"ResponseWriter",
"writer",
"=",
"context",
".",
"getResp... | Adds "aria-invalid" if the component is invalid.
@param context the {@link FacesContext}
@param component the {@link UIInput} component to add attributes for
@throws IOException if any error occurs writing the response | [
"Adds",
"aria",
"-",
"invalid",
"if",
"the",
"component",
"is",
"invalid",
"."
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/renderkit/InputRenderer.java#L95-L100 |
alkacon/opencms-core | src/org/opencms/i18n/CmsEncoder.java | CmsEncoder.unescape | public static String unescape(String source, String encoding) {
"""
Decodes a String in a way similar to the JavaScript "decodeURIcomponent" function.<p>
This method can decode Strings that have been encoded in JavaScript with "encodeURIcomponent",
provided "UTF-8" is used as encoding.<p>
<b>Directly expose... | java | public static String unescape(String source, String encoding) {
if (source == null) {
return null;
}
int len = source.length();
// to use standard decoder we need to replace '+' with "%20" (space)
StringBuffer preparedSource = new StringBuffer(len);
for (int ... | [
"public",
"static",
"String",
"unescape",
"(",
"String",
"source",
",",
"String",
"encoding",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"len",
"=",
"source",
".",
"length",
"(",
")",
";",
"// to use stand... | Decodes a String in a way similar to the JavaScript "decodeURIcomponent" function.<p>
This method can decode Strings that have been encoded in JavaScript with "encodeURIcomponent",
provided "UTF-8" is used as encoding.<p>
<b>Directly exposed for JSP EL<b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p... | [
"Decodes",
"a",
"String",
"in",
"a",
"way",
"similar",
"to",
"the",
"JavaScript",
"decodeURIcomponent",
"function",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsEncoder.java#L889-L906 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/AbstractConverter.java | AbstractConverter.canConvert | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
"""
Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@retu... | java | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
boolean canConvert = getSourceType()
.filter(sourceType -> !Object.class.equals(sourceType))
.map(sourceType -> assignableTo(fromType, sourceType))
.orElse(true);
// targetType should be assignable to or a subclass o... | [
"@",
"Override",
"public",
"boolean",
"canConvert",
"(",
"Class",
"<",
"?",
">",
"fromType",
",",
"Class",
"<",
"?",
">",
"toType",
")",
"{",
"boolean",
"canConvert",
"=",
"getSourceType",
"(",
")",
".",
"filter",
"(",
"sourceType",
"->",
"!",
"Object",
... | Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@return a boolean indicating whether this {@link Converter} can convert {@link Object Objects}
... | [
"Determines",
"whether",
"this",
"{",
"@link",
"Converter",
"}",
"can",
"convert",
"{",
"@link",
"Object",
"Objects",
"}",
"{",
"@link",
"Class",
"from",
"type",
"}",
"{",
"@link",
"Class",
"to",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/AbstractConverter.java#L214-L230 |
apache/incubator-atlas | graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/GraphDbObjectFactory.java | GraphDbObjectFactory.createVertex | public static Titan0Vertex createVertex(Titan0Graph graph, Vertex source) {
"""
Creates a Titan0Vertex that corresponds to the given Gremlin Vertex.
@param graph The graph that contains the vertex
@param source the Gremlin vertex
"""
if (source == null) {
return null;
}
... | java | public static Titan0Vertex createVertex(Titan0Graph graph, Vertex source) {
if (source == null) {
return null;
}
return new Titan0Vertex(graph, source);
} | [
"public",
"static",
"Titan0Vertex",
"createVertex",
"(",
"Titan0Graph",
"graph",
",",
"Vertex",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"Titan0Vertex",
"(",
"graph",
",",
"source",
")",
... | Creates a Titan0Vertex that corresponds to the given Gremlin Vertex.
@param graph The graph that contains the vertex
@param source the Gremlin vertex | [
"Creates",
"a",
"Titan0Vertex",
"that",
"corresponds",
"to",
"the",
"given",
"Gremlin",
"Vertex",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/GraphDbObjectFactory.java#L71-L77 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsFadeAnimation.java | CmsFadeAnimation.fadeIn | public static CmsFadeAnimation fadeIn(Element element, Command callback, int duration) {
"""
Fades the given element into view executing the callback afterwards.<p>
@param element the element to fade in
@param callback the callback
@param duration the animation duration
@return the running animation object... | java | public static CmsFadeAnimation fadeIn(Element element, Command callback, int duration) {
CmsFadeAnimation animation = new CmsFadeAnimation(element, true, callback);
animation.run(duration);
return animation;
} | [
"public",
"static",
"CmsFadeAnimation",
"fadeIn",
"(",
"Element",
"element",
",",
"Command",
"callback",
",",
"int",
"duration",
")",
"{",
"CmsFadeAnimation",
"animation",
"=",
"new",
"CmsFadeAnimation",
"(",
"element",
",",
"true",
",",
"callback",
")",
";",
... | Fades the given element into view executing the callback afterwards.<p>
@param element the element to fade in
@param callback the callback
@param duration the animation duration
@return the running animation object | [
"Fades",
"the",
"given",
"element",
"into",
"view",
"executing",
"the",
"callback",
"afterwards",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsFadeAnimation.java#L69-L74 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java | EnvironmentsInner.beginResetPassword | public void beginResetPassword(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) {
"""
Resets the user password on an environment This operation can take a while to complete.
@param resourceGroupName... | java | public void beginResetPassword(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, ResetPasswordPayload resetPasswordPayload) {
beginResetPasswordWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, envir... | [
"public",
"void",
"beginResetPassword",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"String",
"environmentName",
",",
"ResetPasswordPayload",
"resetPasswordPayload",
")",
"{",... | Resets the user password on an environment This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting.
@param environmentNa... | [
"Resets",
"the",
"user",
"password",
"on",
"an",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java#L1276-L1278 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.drawImage | public void drawImage(Image image, float x, float y, Color col) {
"""
Draw an image to the screen
@param image
The image to draw to the screen
@param x
The x location at which to draw the image
@param y
The y location at which to draw the image
@param col
The color to apply to the image as a filter
"... | java | public void drawImage(Image image, float x, float y, Color col) {
predraw();
image.draw(x, y, col);
currentColor.bind();
postdraw();
} | [
"public",
"void",
"drawImage",
"(",
"Image",
"image",
",",
"float",
"x",
",",
"float",
"y",
",",
"Color",
"col",
")",
"{",
"predraw",
"(",
")",
";",
"image",
".",
"draw",
"(",
"x",
",",
"y",
",",
"col",
")",
";",
"currentColor",
".",
"bind",
"(",... | Draw an image to the screen
@param image
The image to draw to the screen
@param x
The x location at which to draw the image
@param y
The y location at which to draw the image
@param col
The color to apply to the image as a filter | [
"Draw",
"an",
"image",
"to",
"the",
"screen"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L1382-L1387 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/obl/StateSet.java | StateSet.addObligation | public void addObligation(final Obligation obligation, int basicBlockId) throws ObligationAcquiredOrReleasedInLoopException {
"""
Add an obligation to every State in the StateSet.
@param obligation
the obligation to add
@param basicBlockId
the id of the basic block (path component) adding the
obligation
... | java | public void addObligation(final Obligation obligation, int basicBlockId) throws ObligationAcquiredOrReleasedInLoopException {
Map<ObligationSet, State> updatedStateMap = new HashMap<>();
if (stateMap.isEmpty()) {
State s = new State(factory);
s.getObligationSet().add(obligation);... | [
"public",
"void",
"addObligation",
"(",
"final",
"Obligation",
"obligation",
",",
"int",
"basicBlockId",
")",
"throws",
"ObligationAcquiredOrReleasedInLoopException",
"{",
"Map",
"<",
"ObligationSet",
",",
"State",
">",
"updatedStateMap",
"=",
"new",
"HashMap",
"<>",
... | Add an obligation to every State in the StateSet.
@param obligation
the obligation to add
@param basicBlockId
the id of the basic block (path component) adding the
obligation | [
"Add",
"an",
"obligation",
"to",
"every",
"State",
"in",
"the",
"StateSet",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/obl/StateSet.java#L189-L204 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/cost/SemiJoinStatsCalculator.java | SemiJoinStatsCalculator.computeSemiJoin | public static PlanNodeStatsEstimate computeSemiJoin(PlanNodeStatsEstimate sourceStats, PlanNodeStatsEstimate filteringSourceStats, Symbol sourceJoinSymbol, Symbol filteringSourceJoinSymbol) {
"""
Basically it works as low and high values were the same for source and filteringSource and just looks at NDVs.
"""
... | java | public static PlanNodeStatsEstimate computeSemiJoin(PlanNodeStatsEstimate sourceStats, PlanNodeStatsEstimate filteringSourceStats, Symbol sourceJoinSymbol, Symbol filteringSourceJoinSymbol)
{
return compute(sourceStats, filteringSourceStats, sourceJoinSymbol, filteringSourceJoinSymbol,
(sour... | [
"public",
"static",
"PlanNodeStatsEstimate",
"computeSemiJoin",
"(",
"PlanNodeStatsEstimate",
"sourceStats",
",",
"PlanNodeStatsEstimate",
"filteringSourceStats",
",",
"Symbol",
"sourceJoinSymbol",
",",
"Symbol",
"filteringSourceJoinSymbol",
")",
"{",
"return",
"compute",
"("... | Basically it works as low and high values were the same for source and filteringSource and just looks at NDVs. | [
"Basically",
"it",
"works",
"as",
"low",
"and",
"high",
"values",
"were",
"the",
"same",
"for",
"source",
"and",
"filteringSource",
"and",
"just",
"looks",
"at",
"NDVs",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/cost/SemiJoinStatsCalculator.java#L33-L38 |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/JDBCUtil.java | JDBCUtil.changeColumn | public static void changeColumn (Connection conn, String table, String cname, String cdef)
throws SQLException {
"""
Changes a column's definition. Takes a full column definition 'cdef' (including the name of
the column) with which to replace the specified column 'cname'.
NOTE: A handy thing you can do... | java | public static void changeColumn (Connection conn, String table, String cname, String cdef)
throws SQLException
{
String update = "ALTER TABLE " + table + " CHANGE " + cname + " " + cdef;
PreparedStatement stmt = null;
try {
stmt = conn.prepareStatement(update);
... | [
"public",
"static",
"void",
"changeColumn",
"(",
"Connection",
"conn",
",",
"String",
"table",
",",
"String",
"cname",
",",
"String",
"cdef",
")",
"throws",
"SQLException",
"{",
"String",
"update",
"=",
"\"ALTER TABLE \"",
"+",
"table",
"+",
"\" CHANGE \"",
"+... | Changes a column's definition. Takes a full column definition 'cdef' (including the name of
the column) with which to replace the specified column 'cname'.
NOTE: A handy thing you can do with this is to rename a column by providing a column
definition that has a different name, but the same column type. | [
"Changes",
"a",
"column",
"s",
"definition",
".",
"Takes",
"a",
"full",
"column",
"definition",
"cdef",
"(",
"including",
"the",
"name",
"of",
"the",
"column",
")",
"with",
"which",
"to",
"replace",
"the",
"specified",
"column",
"cname",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/JDBCUtil.java#L515-L528 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/core/contents/ContentsDao.java | ContentsDao.deleteCascade | public int deleteCascade(Contents contents, boolean userTable)
throws SQLException {
"""
Delete the Contents, cascading optionally including the user table
@param contents
contents
@param userTable
true if a user table
@return deleted count
@throws SQLException
upon deletion error
"""
int count =... | java | public int deleteCascade(Contents contents, boolean userTable)
throws SQLException {
int count = deleteCascade(contents);
if (userTable) {
dropTable(contents.getTableName());
}
return count;
} | [
"public",
"int",
"deleteCascade",
"(",
"Contents",
"contents",
",",
"boolean",
"userTable",
")",
"throws",
"SQLException",
"{",
"int",
"count",
"=",
"deleteCascade",
"(",
"contents",
")",
";",
"if",
"(",
"userTable",
")",
"{",
"dropTable",
"(",
"contents",
"... | Delete the Contents, cascading optionally including the user table
@param contents
contents
@param userTable
true if a user table
@return deleted count
@throws SQLException
upon deletion error | [
"Delete",
"the",
"Contents",
"cascading",
"optionally",
"including",
"the",
"user",
"table"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/core/contents/ContentsDao.java#L355-L364 |
js-lib-com/commons | src/main/java/js/converter/BooleansConverter.java | BooleansConverter.asObject | @Override
public <T> T asObject(String string, Class<T> valueType) {
"""
Create a boolean value from given string. Returns boolean true only if string is one of next constants: <em>true</em>,
<em>yes</em>, <em>1</em>, <em>on</em>; otherwise returns false. Note that comparison is not case sensitive.
"""
/... | java | @Override
public <T> T asObject(String string, Class<T> valueType) {
// at this point value type is a boolean or a boxing boolean
string = string.toLowerCase();
if (string.equals("true")) {
return (T) (Boolean) true;
}
if (string.equals("yes")) {
return (T) (Boolean) true;
}
if (string.eq... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"asObject",
"(",
"String",
"string",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"{",
"// at this point value type is a boolean or a boxing boolean\r",
"string",
"=",
"string",
".",
"toLowerCase",
"(",
")",
";",
... | Create a boolean value from given string. Returns boolean true only if string is one of next constants: <em>true</em>,
<em>yes</em>, <em>1</em>, <em>on</em>; otherwise returns false. Note that comparison is not case sensitive. | [
"Create",
"a",
"boolean",
"value",
"from",
"given",
"string",
".",
"Returns",
"boolean",
"true",
"only",
"if",
"string",
"is",
"one",
"of",
"next",
"constants",
":",
"<em",
">",
"true<",
"/",
"em",
">",
"<em",
">",
"yes<",
"/",
"em",
">",
"<em",
">",... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/converter/BooleansConverter.java#L19-L36 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/locale/Locale.java | Locale.getStringWithDefault | @Pure
public static String getStringWithDefault(Class<?> resource, String key, String defaultValue, Object... params) {
"""
Replies the text that corresponds to the specified resource.
@param resource is the name of the resource file
@param key is the name of the resource into the specified file
@param defau... | java | @Pure
public static String getStringWithDefault(Class<?> resource, String key, String defaultValue, Object... params) {
return getStringWithDefault(ClassLoaderFinder.findClassLoader(), detectResourceClass(resource),
key, defaultValue, params);
} | [
"@",
"Pure",
"public",
"static",
"String",
"getStringWithDefault",
"(",
"Class",
"<",
"?",
">",
"resource",
",",
"String",
"key",
",",
"String",
"defaultValue",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"getStringWithDefault",
"(",
"ClassLoaderFinder",... | Replies the text that corresponds to the specified resource.
@param resource is the name of the resource file
@param key is the name of the resource into the specified file
@param defaultValue is the default value to replies if the resource does not contain the specified key.
@param params is the the list of parameter... | [
"Replies",
"the",
"text",
"that",
"corresponds",
"to",
"the",
"specified",
"resource",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/locale/Locale.java#L341-L345 |
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/TiffReaderWriter.java | TiffReaderWriter.reportResults | private static void reportResults(TiffReader tiffReader, int result, String filename,
String output_file) {
"""
Report the results of the reading process to the console.
@param tiffReader the tiff reader
@param result the result
@param filename the filename
@param output_file the output_file
"""
... | java | private static void reportResults(TiffReader tiffReader, int result, String filename,
String output_file) {
TiffDocument to = tiffReader.getModel();
if (output_file != null) {
// TODO: Create xml file with report
} else {
// Display results human readable
switch (result) {
ca... | [
"private",
"static",
"void",
"reportResults",
"(",
"TiffReader",
"tiffReader",
",",
"int",
"result",
",",
"String",
"filename",
",",
"String",
"output_file",
")",
"{",
"TiffDocument",
"to",
"=",
"tiffReader",
".",
"getModel",
"(",
")",
";",
"if",
"(",
"outpu... | Report the results of the reading process to the console.
@param tiffReader the tiff reader
@param result the result
@param filename the filename
@param output_file the output_file | [
"Report",
"the",
"results",
"of",
"the",
"reading",
"process",
"to",
"the",
"console",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/TiffReaderWriter.java#L143-L200 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.allParametersHaveDefaults | public static boolean allParametersHaveDefaults(Map<String, QueryParameter> map) {
"""
See if all parameters have default values
@param map map of parameters
@return true if all parameters have default values
"""
for (QueryParameter qp : map.values()) {
if ((qp.getDefaultValues() == nul... | java | public static boolean allParametersHaveDefaults(Map<String, QueryParameter> map) {
for (QueryParameter qp : map.values()) {
if ((qp.getDefaultValues() == null) || (qp.getDefaultValues().size() == 0)) {
if ((qp.getDefaultSource() == null) || "".equals(qp.getDefaultSource().trim())) {
... | [
"public",
"static",
"boolean",
"allParametersHaveDefaults",
"(",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"map",
")",
"{",
"for",
"(",
"QueryParameter",
"qp",
":",
"map",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"(",
"qp",
".",
"getDefaultV... | See if all parameters have default values
@param map map of parameters
@return true if all parameters have default values | [
"See",
"if",
"all",
"parameters",
"have",
"default",
"values"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L816-L825 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java | CmsListItemWidget.initAdditionalInfo | protected void initAdditionalInfo(CmsListInfoBean infoBean) {
"""
Initializes the additional info.<p>
@param infoBean the info bean
"""
// create the state info
CmsResourceState state = infoBean.getResourceState();
if (state != null) {
String stateKey = Messages.get().ke... | java | protected void initAdditionalInfo(CmsListInfoBean infoBean) {
// create the state info
CmsResourceState state = infoBean.getResourceState();
if (state != null) {
String stateKey = Messages.get().key(Messages.GUI_RESOURCE_STATE_0);
String stateValue = CmsResourceStateUtil... | [
"protected",
"void",
"initAdditionalInfo",
"(",
"CmsListInfoBean",
"infoBean",
")",
"{",
"// create the state info",
"CmsResourceState",
"state",
"=",
"infoBean",
".",
"getResourceState",
"(",
")",
";",
"if",
"(",
"state",
"!=",
"null",
")",
"{",
"String",
"stateK... | Initializes the additional info.<p>
@param infoBean the info bean | [
"Initializes",
"the",
"additional",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsListItemWidget.java#L1137-L1156 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/Cipher.java | Cipher.getInstance | public static final Cipher getInstance(String transformation,
String provider)
throws NoSuchAlgorithmException, NoSuchProviderException,
NoSuchPaddingException {
"""
Returns a <code>Cipher</code> object that implements the specified
transformation... | java | public static final Cipher getInstance(String transformation,
String provider)
throws NoSuchAlgorithmException, NoSuchProviderException,
NoSuchPaddingException
{
if ((provider == null) || (provider.length() == 0)) {
throw new Ill... | [
"public",
"static",
"final",
"Cipher",
"getInstance",
"(",
"String",
"transformation",
",",
"String",
"provider",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchProviderException",
",",
"NoSuchPaddingException",
"{",
"if",
"(",
"(",
"provider",
"==",
"null",
... | Returns a <code>Cipher</code> object that implements the specified
transformation.
<p> A new Cipher object encapsulating the
CipherSpi implementation from the specified provider
is returned. The specified provider must be registered
in the security provider list.
<p> Note that the list of registered providers may be... | [
"Returns",
"a",
"<code",
">",
"Cipher<",
"/",
"code",
">",
"object",
"that",
"implements",
"the",
"specified",
"transformation",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/Cipher.java#L852-L866 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java | BufferUtil.readStr | public static String readStr(ByteBuffer buffer, Charset charset) {
"""
读取剩余部分并转为字符串
@param buffer ByteBuffer
@param charset 编码
@return 字符串
@since 4.5.0
"""
return StrUtil.str(readBytes(buffer), charset);
} | java | public static String readStr(ByteBuffer buffer, Charset charset) {
return StrUtil.str(readBytes(buffer), charset);
} | [
"public",
"static",
"String",
"readStr",
"(",
"ByteBuffer",
"buffer",
",",
"Charset",
"charset",
")",
"{",
"return",
"StrUtil",
".",
"str",
"(",
"readBytes",
"(",
"buffer",
")",
",",
"charset",
")",
";",
"}"
] | 读取剩余部分并转为字符串
@param buffer ByteBuffer
@param charset 编码
@return 字符串
@since 4.5.0 | [
"读取剩余部分并转为字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java#L89-L91 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/database/CmsDatabaseImportFromServer.java | CmsDatabaseImportFromServer.getFileListFromServer | protected static List getFileListFromServer(boolean includeFolders) {
"""
Returns the list of all uploadable zip files and uploadable folders available on the server.<p>
@param includeFolders if true, the uploadable folders are included in the list
@return the list of all uploadable zip files and uploadable fo... | java | protected static List getFileListFromServer(boolean includeFolders) {
List result = new ArrayList();
// get the RFS package export path
String exportpath = OpenCms.getSystemInfo().getPackagesRfsPath();
File folder = new File(exportpath);
// get a list of all files of the packa... | [
"protected",
"static",
"List",
"getFileListFromServer",
"(",
"boolean",
"includeFolders",
")",
"{",
"List",
"result",
"=",
"new",
"ArrayList",
"(",
")",
";",
"// get the RFS package export path",
"String",
"exportpath",
"=",
"OpenCms",
".",
"getSystemInfo",
"(",
")"... | Returns the list of all uploadable zip files and uploadable folders available on the server.<p>
@param includeFolders if true, the uploadable folders are included in the list
@return the list of all uploadable zip files and uploadable folders available on the server | [
"Returns",
"the",
"list",
"of",
"all",
"uploadable",
"zip",
"files",
"and",
"uploadable",
"folders",
"available",
"on",
"the",
"server",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/database/CmsDatabaseImportFromServer.java#L117-L142 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java | JQLChecker.replaceFromVariableStatementInternal | private String replaceFromVariableStatementInternal(JQLContext context, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
"""
Replace from variable statement internal.
@param context
the context
@param jql
the jql
@param replace
the replace
@param rewriterLi... | java | private String replaceFromVariableStatementInternal(JQLContext context, String jql, final List<Triple<Token, Token, String>> replace, JqlBaseListener rewriterListener) {
Pair<ParserRuleContext, CommonTokenStream> parser = prepareVariableStatement(context, jql);
walker.walk(rewriterListener, parser.value0);
Token... | [
"private",
"String",
"replaceFromVariableStatementInternal",
"(",
"JQLContext",
"context",
",",
"String",
"jql",
",",
"final",
"List",
"<",
"Triple",
"<",
"Token",
",",
"Token",
",",
"String",
">",
">",
"replace",
",",
"JqlBaseListener",
"rewriterListener",
")",
... | Replace from variable statement internal.
@param context
the context
@param jql
the jql
@param replace
the replace
@param rewriterListener
the rewriter listener
@return the string | [
"Replace",
"from",
"variable",
"statement",
"internal",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLChecker.java#L723-L734 |
wcm-io/wcm-io-tooling | netbeans/sightly/src/main/java/io/wcm/tooling/netbeans/sightly/completion/AbstractCompleter.java | AbstractCompleter.getRowFirstNonWhite | protected int getRowFirstNonWhite(StyledDocument doc, int offset) throws BadLocationException {
"""
iterates through the text to find first nonwhite
@param doc
@param offset
@return the offset of the first non-white
@throws BadLocationException
"""
Element lineElement = doc.getParagraphElement(offset... | java | protected int getRowFirstNonWhite(StyledDocument doc, int offset) throws BadLocationException {
Element lineElement = doc.getParagraphElement(offset);
int start = lineElement.getStartOffset();
while (start + 1 < lineElement.getEndOffset()) {
try {
if (doc.getText(start, 1).charAt(0) != ' ') {
... | [
"protected",
"int",
"getRowFirstNonWhite",
"(",
"StyledDocument",
"doc",
",",
"int",
"offset",
")",
"throws",
"BadLocationException",
"{",
"Element",
"lineElement",
"=",
"doc",
".",
"getParagraphElement",
"(",
"offset",
")",
";",
"int",
"start",
"=",
"lineElement"... | iterates through the text to find first nonwhite
@param doc
@param offset
@return the offset of the first non-white
@throws BadLocationException | [
"iterates",
"through",
"the",
"text",
"to",
"find",
"first",
"nonwhite"
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/netbeans/sightly/src/main/java/io/wcm/tooling/netbeans/sightly/completion/AbstractCompleter.java#L103-L119 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java | MapExtensions.operator_remove | public static <K, V> void operator_remove(Map<K, V> map, Iterable<? super K> keysToRemove) {
"""
Remove pairs with the given keys from the map.
@param <K> type of the map keys.
@param <V> type of the map values.
@param map the map to update.
@param keysToRemove the keys of the pairs to remove.
@since 2.15
... | java | public static <K, V> void operator_remove(Map<K, V> map, Iterable<? super K> keysToRemove) {
for (final Object key : keysToRemove) {
map.remove(key);
}
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"operator_remove",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Iterable",
"<",
"?",
"super",
"K",
">",
"keysToRemove",
")",
"{",
"for",
"(",
"final",
"Object",
"key",
":",
"keysToRemove",
"... | Remove pairs with the given keys from the map.
@param <K> type of the map keys.
@param <V> type of the map values.
@param map the map to update.
@param keysToRemove the keys of the pairs to remove.
@since 2.15 | [
"Remove",
"pairs",
"with",
"the",
"given",
"keys",
"from",
"the",
"map",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java#L248-L252 |
mangstadt/biweekly | src/main/java/biweekly/io/xml/XCalWriterBase.java | XCalWriterBase.registerParameterDataType | public void registerParameterDataType(String parameterName, ICalDataType dataType) {
"""
Registers the data type of an experimental parameter. Experimental
parameters use the "unknown" data type by default.
@param parameterName the parameter name (e.g. "x-foo")
@param dataType the data type or null to remove
... | java | public void registerParameterDataType(String parameterName, ICalDataType dataType) {
parameterName = parameterName.toLowerCase();
if (dataType == null) {
parameterDataTypes.remove(parameterName);
} else {
parameterDataTypes.put(parameterName, dataType);
}
} | [
"public",
"void",
"registerParameterDataType",
"(",
"String",
"parameterName",
",",
"ICalDataType",
"dataType",
")",
"{",
"parameterName",
"=",
"parameterName",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"dataType",
"==",
"null",
")",
"{",
"parameterDataTypes",... | Registers the data type of an experimental parameter. Experimental
parameters use the "unknown" data type by default.
@param parameterName the parameter name (e.g. "x-foo")
@param dataType the data type or null to remove | [
"Registers",
"the",
"data",
"type",
"of",
"an",
"experimental",
"parameter",
".",
"Experimental",
"parameters",
"use",
"the",
"unknown",
"data",
"type",
"by",
"default",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalWriterBase.java#L90-L97 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.perspectiveRect | public Matrix4d perspectiveRect(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
"""
Apply a symmetric perspective projection frustum transformation using for a right-handed coordinate system
the given NDC z range to this matrix.
<p>
If <code>M</code> is <code>this</code> matrix and... | java | public Matrix4d perspectiveRect(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
return perspectiveRect(width, height, zNear, zFar, zZeroToOne, this);
} | [
"public",
"Matrix4d",
"perspectiveRect",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"return",
"perspectiveRect",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFa... | Apply a symmetric perspective projection frustum transformation using for a right-handed coordinate system
the given NDC z range to this matrix.
<p>
If <code>M</code> is <code>this</code> matrix and <code>P</code> the perspective projection matrix,
then the new matrix will be <code>M * P</code>. So when transforming a
... | [
"Apply",
"a",
"symmetric",
"perspective",
"projection",
"frustum",
"transformation",
"using",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L12294-L12296 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.