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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/IntTrieBuilder.java | IntTrieBuilder.setValue | public boolean setValue(int ch, int value) {
"""
Sets a 32 bit data in the table data
@param ch codepoint which data is to be set
@param value to set
@return true if the set is successful, otherwise
if the table has been compacted return false
"""
// valid, uncompacted trie and valid c?
if... | java | public boolean setValue(int ch, int value)
{
// valid, uncompacted trie and valid c?
if (m_isCompacted_ || ch > UCharacter.MAX_VALUE || ch < 0) {
return false;
}
int block = getDataBlock(ch);
if (block < 0) {
return false;
}
... | [
"public",
"boolean",
"setValue",
"(",
"int",
"ch",
",",
"int",
"value",
")",
"{",
"// valid, uncompacted trie and valid c? ",
"if",
"(",
"m_isCompacted_",
"||",
"ch",
">",
"UCharacter",
".",
"MAX_VALUE",
"||",
"ch",
"<",
"0",
")",
"{",
"return",
"false",
";"... | Sets a 32 bit data in the table data
@param ch codepoint which data is to be set
@param value to set
@return true if the set is successful, otherwise
if the table has been compacted return false | [
"Sets",
"a",
"32",
"bit",
"data",
"in",
"the",
"table",
"data"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/IntTrieBuilder.java#L215-L229 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/ST_ConstrainedDelaunay.java | ST_ConstrainedDelaunay.createCDT | public static GeometryCollection createCDT(Geometry geometry, int flag) throws SQLException {
"""
Build a constrained delaunay triangulation based on a geometry
(point, line, polygon)
@param geometry
@param flag
@return a set of polygons (triangles)
@throws SQLException
"""
if (geometry != null)... | java | public static GeometryCollection createCDT(Geometry geometry, int flag) throws SQLException {
if (geometry != null) {
DelaunayData delaunayData = new DelaunayData();
delaunayData.put(geometry, DelaunayData.MODE.CONSTRAINED);
delaunayData.triangulate();
if (flag ==... | [
"public",
"static",
"GeometryCollection",
"createCDT",
"(",
"Geometry",
"geometry",
",",
"int",
"flag",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"!=",
"null",
")",
"{",
"DelaunayData",
"delaunayData",
"=",
"new",
"DelaunayData",
"(",
")",
";"... | Build a constrained delaunay triangulation based on a geometry
(point, line, polygon)
@param geometry
@param flag
@return a set of polygons (triangles)
@throws SQLException | [
"Build",
"a",
"constrained",
"delaunay",
"triangulation",
"based",
"on",
"a",
"geometry",
"(",
"point",
"line",
"polygon",
")"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/mesh/ST_ConstrainedDelaunay.java#L71-L85 |
belaban/JGroups | src/org/jgroups/jmx/ResourceDMBean.java | ResourceDMBean.findGetter | protected static Accessor findGetter(Object target, String attr_name) {
"""
Finds an accessor for an attribute. Tries to find getAttrName(), isAttrName(), attrName() methods. If not
found, tries to use reflection to get the value of attr_name. If still not found, creates a NullAccessor.
"""
final Stri... | java | protected static Accessor findGetter(Object target, String attr_name) {
final String name=Util.attributeNameToMethodName(attr_name);
Class<?> clazz=target.getClass();
Method method=Util.findMethod(target, Arrays.asList("get" + name, "is" + name, toLowerCase(name)));
if(method != null ... | [
"protected",
"static",
"Accessor",
"findGetter",
"(",
"Object",
"target",
",",
"String",
"attr_name",
")",
"{",
"final",
"String",
"name",
"=",
"Util",
".",
"attributeNameToMethodName",
"(",
"attr_name",
")",
";",
"Class",
"<",
"?",
">",
"clazz",
"=",
"targe... | Finds an accessor for an attribute. Tries to find getAttrName(), isAttrName(), attrName() methods. If not
found, tries to use reflection to get the value of attr_name. If still not found, creates a NullAccessor. | [
"Finds",
"an",
"accessor",
"for",
"an",
"attribute",
".",
"Tries",
"to",
"find",
"getAttrName",
"()",
"isAttrName",
"()",
"attrName",
"()",
"methods",
".",
"If",
"not",
"found",
"tries",
"to",
"use",
"reflection",
"to",
"get",
"the",
"value",
"of",
"attr_n... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/jmx/ResourceDMBean.java#L334-L349 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.notNull | public static <T> T notNull(final T object, final String message, final Object... values) {
"""
<p>Validate that the specified argument is not {@code null};
otherwise throwing an exception with the specified message.
<pre>Validate.notNull(myObject, "The object must not be null");</pre>
@param <T> the object... | java | public static <T> T notNull(final T object, final String message, final Object... values) {
if (object == null) {
throw new NullPointerException(StringUtils.simpleFormat(message, values));
}
return object;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"notNull",
"(",
"final",
"T",
"object",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"... | <p>Validate that the specified argument is not {@code null};
otherwise throwing an exception with the specified message.
<pre>Validate.notNull(myObject, "The object must not be null");</pre>
@param <T> the object type
@param object the object to check
@param message the {@link String#format(String, Object...)} exce... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"is",
"not",
"{",
"@code",
"null",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L225-L230 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CharsetDetector.java | CharsetDetector.getReader | public Reader getReader(InputStream in, String declaredEncoding) {
"""
Autodetect the charset of an inputStream, and return a Java Reader
to access the converted input data.
<p>
This is a convenience method that is equivalent to
<code>this.setDeclaredEncoding(declaredEncoding).setText(in).detect().getReader();... | java | public Reader getReader(InputStream in, String declaredEncoding) {
fDeclaredEncoding = declaredEncoding;
try {
setText(in);
CharsetMatch match = detect();
if (match == null) {
return null;
}
... | [
"public",
"Reader",
"getReader",
"(",
"InputStream",
"in",
",",
"String",
"declaredEncoding",
")",
"{",
"fDeclaredEncoding",
"=",
"declaredEncoding",
";",
"try",
"{",
"setText",
"(",
"in",
")",
";",
"CharsetMatch",
"match",
"=",
"detect",
"(",
")",
";",
"if"... | Autodetect the charset of an inputStream, and return a Java Reader
to access the converted input data.
<p>
This is a convenience method that is equivalent to
<code>this.setDeclaredEncoding(declaredEncoding).setText(in).detect().getReader();</code>
<p>
For the input stream that supplies the character data, markSupported... | [
"Autodetect",
"the",
"charset",
"of",
"an",
"inputStream",
"and",
"return",
"a",
"Java",
"Reader",
"to",
"access",
"the",
"converted",
"input",
"data",
".",
"<p",
">",
"This",
"is",
"a",
"convenience",
"method",
"that",
"is",
"equivalent",
"to",
"<code",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CharsetDetector.java#L220-L236 |
spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/common/OAuthCodec.java | OAuthCodec.oauthEncode | public static String oauthEncode(String value) {
"""
Encode the specified value.
@param value The value to encode.
@return The encoded value.
"""
if (value == null) {
return "";
}
try {
return new String(URLCodec.encodeUrl(SAFE_CHARACTERS, value.getBytes("UTF-8")), "US-ASCII");
... | java | public static String oauthEncode(String value) {
if (value == null) {
return "";
}
try {
return new String(URLCodec.encodeUrl(SAFE_CHARACTERS, value.getBytes("UTF-8")), "US-ASCII");
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"String",
"oauthEncode",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"try",
"{",
"return",
"new",
"String",
"(",
"URLCodec",
".",
"encodeUrl",
"(",
"SAFE_CHARACTERS",
",",
... | Encode the specified value.
@param value The value to encode.
@return The encoded value. | [
"Encode",
"the",
"specified",
"value",
"."
] | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/common/OAuthCodec.java#L52-L63 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.delegationWithIdToken | @SuppressWarnings("WeakerAccess")
public DelegationRequest<Delegation> delegationWithIdToken(@NonNull String idToken) {
"""
Performs a <a href="https://auth0.com/docs/api/authentication#delegation">delegation</a> request that will yield a new Auth0 'id_token'
Example usage:
<pre>
{@code
client.delegationWi... | java | @SuppressWarnings("WeakerAccess")
public DelegationRequest<Delegation> delegationWithIdToken(@NonNull String idToken) {
ParameterizableRequest<Delegation, AuthenticationException> request = delegation(Delegation.class)
.addParameter(ParameterBuilder.ID_TOKEN_KEY, idToken);
return ne... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"DelegationRequest",
"<",
"Delegation",
">",
"delegationWithIdToken",
"(",
"@",
"NonNull",
"String",
"idToken",
")",
"{",
"ParameterizableRequest",
"<",
"Delegation",
",",
"AuthenticationException",
">",
... | Performs a <a href="https://auth0.com/docs/api/authentication#delegation">delegation</a> request that will yield a new Auth0 'id_token'
Example usage:
<pre>
{@code
client.delegationWithIdToken("{id token}")
.start(new BaseCallback<Delegation>() {
{@literal}Override
public void onSuccess(Delegation payload) {}
{@litera... | [
"Performs",
"a",
"<a",
"href",
"=",
"https",
":",
"//",
"auth0",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"authentication#delegation",
">",
"delegation<",
"/",
"a",
">",
"request",
"that",
"will",
"yield",
"a",
"new",
"Auth0",
"id_token",
"Example",
"us... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L763-L770 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java | Widget.setScale | public void setScale(float x, float y, float z) {
"""
Set [X, Y, Z] current scale
@param x
Scaling factor on the 'X' axis.
@param y
Scaling factor on the 'Y' axis.
@param z
Scaling factor on the 'Z' axis.
"""
getTransform().setScale(x, y, z);
if (mTransformCache.setScale(x, y, z)) {
... | java | public void setScale(float x, float y, float z) {
getTransform().setScale(x, y, z);
if (mTransformCache.setScale(x, y, z)) {
onTransformChanged();
}
} | [
"public",
"void",
"setScale",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"getTransform",
"(",
")",
".",
"setScale",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"if",
"(",
"mTransformCache",
".",
"setScale",
"(",
"x",
",",
"y",... | Set [X, Y, Z] current scale
@param x
Scaling factor on the 'X' axis.
@param y
Scaling factor on the 'Y' axis.
@param z
Scaling factor on the 'Z' axis. | [
"Set",
"[",
"X",
"Y",
"Z",
"]",
"current",
"scale"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L1437-L1442 |
apache/groovy | subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java | SwingGroovyMethods.leftShift | public static DefaultListModel leftShift(DefaultListModel self, Object e) {
"""
Overloads the left shift operator to provide an easy way to add
elements to a DefaultListModel.
@param self a DefaultListModel
@param e an element to be added to the listModel.
@return same listModel, after the value was added... | java | public static DefaultListModel leftShift(DefaultListModel self, Object e) {
self.addElement(e);
return self;
} | [
"public",
"static",
"DefaultListModel",
"leftShift",
"(",
"DefaultListModel",
"self",
",",
"Object",
"e",
")",
"{",
"self",
".",
"addElement",
"(",
"e",
")",
";",
"return",
"self",
";",
"}"
] | Overloads the left shift operator to provide an easy way to add
elements to a DefaultListModel.
@param self a DefaultListModel
@param e an element to be added to the listModel.
@return same listModel, after the value was added to it.
@since 1.6.4 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"easy",
"way",
"to",
"add",
"elements",
"to",
"a",
"DefaultListModel",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L214-L217 |
groupon/robo-remote | RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/QueryBuilder.java | QueryBuilder.map | public QueryBuilder map(String query, String method_name, Object... items) throws Exception {
"""
Used to get the return from a method call
@param query
@param method_name
@param items
@return
@throws Exception
"""
JSONObject op = new JSONObject();
if (query != null)
op.put(Con... | java | public QueryBuilder map(String query, String method_name, Object... items) throws Exception {
JSONObject op = new JSONObject();
if (query != null)
op.put(Constants.REQUEST_QUERY, query);
java.util.Map<String, Object> operation = new LinkedHashMap<String, Object>();
operation... | [
"public",
"QueryBuilder",
"map",
"(",
"String",
"query",
",",
"String",
"method_name",
",",
"Object",
"...",
"items",
")",
"throws",
"Exception",
"{",
"JSONObject",
"op",
"=",
"new",
"JSONObject",
"(",
")",
";",
"if",
"(",
"query",
"!=",
"null",
")",
"op... | Used to get the return from a method call
@param query
@param method_name
@param items
@return
@throws Exception | [
"Used",
"to",
"get",
"the",
"return",
"from",
"a",
"method",
"call"
] | train | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClientCommon/src/main/com/groupon/roboremote/roboremoteclientcommon/QueryBuilder.java#L82-L104 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaCodeGen.java | RaCodeGen.writeXAResource | private void writeXAResource(Definition def, Writer out, int indent) throws IOException {
"""
Output getXAResources method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, i... | java | private void writeXAResource(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * This method is called by the application server during crash recovery.\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(o... | [
"private",
"void",
"writeXAResource",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"ind... | Output getXAResources method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"getXAResources",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaCodeGen.java#L223-L240 |
google/closure-compiler | src/com/google/javascript/jscomp/RemoveUnusedCode.java | RemoveUnusedCode.createPolyfillInfo | private PolyfillInfo createPolyfillInfo(Node call, Scope scope, String name) {
"""
Makes a new PolyfillInfo, including the correct Removable. Parses the name to determine whether
this is a global, static, or prototype polyfill.
"""
checkState(scope.isGlobal());
checkState(call.getParent().isExprResult... | java | private PolyfillInfo createPolyfillInfo(Node call, Scope scope, String name) {
checkState(scope.isGlobal());
checkState(call.getParent().isExprResult());
// Make the removable and polyfill info. Add continuations for all arguments.
RemovableBuilder builder = new RemovableBuilder();
for (Node n = ca... | [
"private",
"PolyfillInfo",
"createPolyfillInfo",
"(",
"Node",
"call",
",",
"Scope",
"scope",
",",
"String",
"name",
")",
"{",
"checkState",
"(",
"scope",
".",
"isGlobal",
"(",
")",
")",
";",
"checkState",
"(",
"call",
".",
"getParent",
"(",
")",
".",
"is... | Makes a new PolyfillInfo, including the correct Removable. Parses the name to determine whether
this is a global, static, or prototype polyfill. | [
"Makes",
"a",
"new",
"PolyfillInfo",
"including",
"the",
"correct",
"Removable",
".",
"Parses",
"the",
"name",
"to",
"determine",
"whether",
"this",
"is",
"a",
"global",
"static",
"or",
"prototype",
"polyfill",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RemoveUnusedCode.java#L2625-L2650 |
HubSpot/Singularity | SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java | SingularityExecutor.launchTask | @Override
public void launchTask(final ExecutorDriver executorDriver, final Protos.TaskInfo taskInfo) {
"""
Invoked when a task has been launched on this executor (initiated
via Scheduler::launchTasks). Note that this task can be realized
with a thread, a process, or some simple computation, however, no
other... | java | @Override
public void launchTask(final ExecutorDriver executorDriver, final Protos.TaskInfo taskInfo) {
final String taskId = taskInfo.getTaskId().getValue();
LOG.info("Asked to launch task {}", taskId);
try {
final ch.qos.logback.classic.Logger taskLog = taskBuilder.buildTaskLogger(taskId, taskIn... | [
"@",
"Override",
"public",
"void",
"launchTask",
"(",
"final",
"ExecutorDriver",
"executorDriver",
",",
"final",
"Protos",
".",
"TaskInfo",
"taskInfo",
")",
"{",
"final",
"String",
"taskId",
"=",
"taskInfo",
".",
"getTaskId",
"(",
")",
".",
"getValue",
"(",
... | Invoked when a task has been launched on this executor (initiated
via Scheduler::launchTasks). Note that this task can be realized
with a thread, a process, or some simple computation, however, no
other callbacks will be invoked on this executor until this
callback has returned. | [
"Invoked",
"when",
"a",
"task",
"has",
"been",
"launched",
"on",
"this",
"executor",
"(",
"initiated",
"via",
"Scheduler",
"::",
"launchTasks",
")",
".",
"Note",
"that",
"this",
"task",
"can",
"be",
"realized",
"with",
"a",
"thread",
"a",
"process",
"or",
... | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityExecutor/src/main/java/com/hubspot/singularity/executor/SingularityExecutor.java#L73-L102 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/io/i2c/I2CFactory.java | I2CFactory.getInstance | public static I2CBus getInstance(int busNumber, long lockAquireTimeout, TimeUnit lockAquireTimeoutUnit) throws UnsupportedBusNumberException, IOException {
"""
Create new I2CBus instance.
@param busNumber The bus number
@param lockAquireTimeout The timeout for locking the bus for exclusive communication
@para... | java | public static I2CBus getInstance(int busNumber, long lockAquireTimeout, TimeUnit lockAquireTimeoutUnit) throws UnsupportedBusNumberException, IOException {
return provider.getBus(busNumber, lockAquireTimeout, lockAquireTimeoutUnit);
} | [
"public",
"static",
"I2CBus",
"getInstance",
"(",
"int",
"busNumber",
",",
"long",
"lockAquireTimeout",
",",
"TimeUnit",
"lockAquireTimeoutUnit",
")",
"throws",
"UnsupportedBusNumberException",
",",
"IOException",
"{",
"return",
"provider",
".",
"getBus",
"(",
"busNum... | Create new I2CBus instance.
@param busNumber The bus number
@param lockAquireTimeout The timeout for locking the bus for exclusive communication
@param lockAquireTimeoutUnit The units of lockAquireTimeout
@return Return a new I2CBus instance
@throws UnsupportedBusNumberException If the given bus-number is not supporte... | [
"Create",
"new",
"I2CBus",
"instance",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/io/i2c/I2CFactory.java#L94-L96 |
finmath/finmath-lib | src/main/java/net/finmath/modelling/descriptor/xmlparser/FPMLParser.java | FPMLParser.getSwapProductDescriptor | private ProductDescriptor getSwapProductDescriptor(Element trade) {
"""
Construct an InterestRateSwapProductDescriptor from a node in a FpML file.
@param trade The node containing the swap.
@return Descriptor of the swap.
"""
InterestRateSwapLegProductDescriptor legReceiver = null;
InterestRateSwap... | java | private ProductDescriptor getSwapProductDescriptor(Element trade) {
InterestRateSwapLegProductDescriptor legReceiver = null;
InterestRateSwapLegProductDescriptor legPayer = null;
NodeList legs = trade.getElementsByTagName("swapStream");
for(int legIndex = 0; legIndex < legs.getLength(); legIndex++) {
... | [
"private",
"ProductDescriptor",
"getSwapProductDescriptor",
"(",
"Element",
"trade",
")",
"{",
"InterestRateSwapLegProductDescriptor",
"legReceiver",
"=",
"null",
";",
"InterestRateSwapLegProductDescriptor",
"legPayer",
"=",
"null",
";",
"NodeList",
"legs",
"=",
"trade",
... | Construct an InterestRateSwapProductDescriptor from a node in a FpML file.
@param trade The node containing the swap.
@return Descriptor of the swap. | [
"Construct",
"an",
"InterestRateSwapProductDescriptor",
"from",
"a",
"node",
"in",
"a",
"FpML",
"file",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/modelling/descriptor/xmlparser/FPMLParser.java#L101-L120 |
Waikato/jclasslocator | src/main/java/nz/ac/waikato/cms/locator/ClassPathTraversal.java | ClassPathTraversal.traverseJar | protected void traverseJar(File file, TraversalState state) {
"""
Fills the class cache with classes from the specified jar.
@param file the jar to inspect
@param state the traversal state
"""
JarFile jar;
JarEntry entry;
Enumeration enm;
if (isLoggingEnabled())
getLogger().log(... | java | protected void traverseJar(File file, TraversalState state) {
JarFile jar;
JarEntry entry;
Enumeration enm;
if (isLoggingEnabled())
getLogger().log(Level.INFO, "Analyzing jar: " + file);
if (!file.exists()) {
getLogger().log(Level.WARNING, "Jar does not exist: " + file);
retur... | [
"protected",
"void",
"traverseJar",
"(",
"File",
"file",
",",
"TraversalState",
"state",
")",
"{",
"JarFile",
"jar",
";",
"JarEntry",
"entry",
";",
"Enumeration",
"enm",
";",
"if",
"(",
"isLoggingEnabled",
"(",
")",
")",
"getLogger",
"(",
")",
".",
"log",
... | Fills the class cache with classes from the specified jar.
@param file the jar to inspect
@param state the traversal state | [
"Fills",
"the",
"class",
"cache",
"with",
"classes",
"from",
"the",
"specified",
"jar",
"."
] | train | https://github.com/Waikato/jclasslocator/blob/c899072fff607a56ee7f8c2d01fbeb15157ad144/src/main/java/nz/ac/waikato/cms/locator/ClassPathTraversal.java#L233-L259 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/json/JobResultDeserializer.java | JobResultDeserializer.assertNextToken | private static void assertNextToken(
final JsonParser p,
final JsonToken requiredJsonToken) throws IOException {
"""
Advances the token and asserts that it matches the required {@link JsonToken}.
"""
final JsonToken jsonToken = p.nextToken();
if (jsonToken != requiredJsonToken) {
throw new JsonMap... | java | private static void assertNextToken(
final JsonParser p,
final JsonToken requiredJsonToken) throws IOException {
final JsonToken jsonToken = p.nextToken();
if (jsonToken != requiredJsonToken) {
throw new JsonMappingException(p, String.format("Expected token %s (was %s)", requiredJsonToken, jsonToken));
}... | [
"private",
"static",
"void",
"assertNextToken",
"(",
"final",
"JsonParser",
"p",
",",
"final",
"JsonToken",
"requiredJsonToken",
")",
"throws",
"IOException",
"{",
"final",
"JsonToken",
"jsonToken",
"=",
"p",
".",
"nextToken",
"(",
")",
";",
"if",
"(",
"jsonTo... | Advances the token and asserts that it matches the required {@link JsonToken}. | [
"Advances",
"the",
"token",
"and",
"asserts",
"that",
"it",
"matches",
"the",
"required",
"{"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/json/JobResultDeserializer.java#L160-L167 |
deephacks/confit | provider-yaml/src/main/java/org/deephacks/confit/internal/core/yaml/YamlBeanManager.java | YamlBeanManager.hasReferences | private static boolean hasReferences(Bean target, BeanId reference) {
"""
Returns the a list of property names of the target bean that have
references to the bean id.
"""
for (String name : target.getReferenceNames()) {
for (BeanId ref : target.getReference(name)) {
if (ref... | java | private static boolean hasReferences(Bean target, BeanId reference) {
for (String name : target.getReferenceNames()) {
for (BeanId ref : target.getReference(name)) {
if (ref.equals(reference)) {
return true;
}
}
}
return... | [
"private",
"static",
"boolean",
"hasReferences",
"(",
"Bean",
"target",
",",
"BeanId",
"reference",
")",
"{",
"for",
"(",
"String",
"name",
":",
"target",
".",
"getReferenceNames",
"(",
")",
")",
"{",
"for",
"(",
"BeanId",
"ref",
":",
"target",
".",
"get... | Returns the a list of property names of the target bean that have
references to the bean id. | [
"Returns",
"the",
"a",
"list",
"of",
"property",
"names",
"of",
"the",
"target",
"bean",
"that",
"have",
"references",
"to",
"the",
"bean",
"id",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-yaml/src/main/java/org/deephacks/confit/internal/core/yaml/YamlBeanManager.java#L443-L452 |
lightblueseas/net-extensions | src/main/java/de/alpharogroup/net/socket/SocketExtensions.java | SocketExtensions.readObject | public static Object readObject(final InetAddress inetAddress, final int port)
throws IOException, ClassNotFoundException {
"""
Reads an object from the given socket InetAddress.
@param inetAddress
the InetAddress to read.
@param port
The port to read.
@return the object
@throws IOException
Signals tha... | java | public static Object readObject(final InetAddress inetAddress, final int port)
throws IOException, ClassNotFoundException
{
return readObject(new Socket(inetAddress, port));
} | [
"public",
"static",
"Object",
"readObject",
"(",
"final",
"InetAddress",
"inetAddress",
",",
"final",
"int",
"port",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"readObject",
"(",
"new",
"Socket",
"(",
"inetAddress",
",",
"port",
... | Reads an object from the given socket InetAddress.
@param inetAddress
the InetAddress to read.
@param port
The port to read.
@return the object
@throws IOException
Signals that an I/O exception has occurred.
@throws ClassNotFoundException
the class not found exception | [
"Reads",
"an",
"object",
"from",
"the",
"given",
"socket",
"InetAddress",
"."
] | train | https://github.com/lightblueseas/net-extensions/blob/771757a93fa9ad13ce0fe061c158e5cba43344cb/src/main/java/de/alpharogroup/net/socket/SocketExtensions.java#L213-L217 |
languagetool-org/languagetool | languagetool-gui-commons/src/main/java/org/languagetool/gui/Tools.java | Tools.openFileDialog | static File openFileDialog(Frame frame, FileFilter fileFilter, File initialDir) {
"""
Show a file chooser dialog in a specified directory
@param frame Owner frame
@param fileFilter The pattern of files to choose from
@param initialDir The initial directory
@return the selected file
@since 2.6
"""
retu... | java | static File openFileDialog(Frame frame, FileFilter fileFilter, File initialDir) {
return openFileDialog(frame, fileFilter, initialDir, JFileChooser.FILES_ONLY);
} | [
"static",
"File",
"openFileDialog",
"(",
"Frame",
"frame",
",",
"FileFilter",
"fileFilter",
",",
"File",
"initialDir",
")",
"{",
"return",
"openFileDialog",
"(",
"frame",
",",
"fileFilter",
",",
"initialDir",
",",
"JFileChooser",
".",
"FILES_ONLY",
")",
";",
"... | Show a file chooser dialog in a specified directory
@param frame Owner frame
@param fileFilter The pattern of files to choose from
@param initialDir The initial directory
@return the selected file
@since 2.6 | [
"Show",
"a",
"file",
"chooser",
"dialog",
"in",
"a",
"specified",
"directory"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-gui-commons/src/main/java/org/languagetool/gui/Tools.java#L69-L71 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/io/FileUtils.java | FileUtils.getPropertyAsDouble | public double getPropertyAsDouble(final String bundleName, final String key) {
"""
Gets the value as double from the resource bundles corresponding to the
supplied key. <br/>
@param bundleName
the name of the bundle to search in
@param key
the key to search for
@return {@code -1} if the property is not f... | java | public double getPropertyAsDouble(final String bundleName, final String key) {
LOG.info("Getting value for key: " + key + " from bundle: "
+ bundleName);
ResourceBundle bundle = bundles.get(bundleName);
try {
return Double.parseDouble(bundle.getString(key));
} catch (MissingResourceException e) {
LOG.... | [
"public",
"double",
"getPropertyAsDouble",
"(",
"final",
"String",
"bundleName",
",",
"final",
"String",
"key",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Getting value for key: \"",
"+",
"key",
"+",
"\" from bundle: \"",
"+",
"bundleName",
")",
";",
"ResourceBundle",
... | Gets the value as double from the resource bundles corresponding to the
supplied key. <br/>
@param bundleName
the name of the bundle to search in
@param key
the key to search for
@return {@code -1} if the property is not found or the value is not a
number; the corresponding value otherwise | [
"Gets",
"the",
"value",
"as",
"double",
"from",
"the",
"resource",
"bundles",
"corresponding",
"to",
"the",
"supplied",
"key",
".",
"<br",
"/",
">"
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/io/FileUtils.java#L386-L398 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.delegatedAccount_email_filter_name_changePriority_POST | public OvhTaskFilter delegatedAccount_email_filter_name_changePriority_POST(String email, String name, Long priority) throws IOException {
"""
Change filter priority
REST: POST /email/domain/delegatedAccount/{email}/filter/{name}/changePriority
@param priority [required] New priority
@param email [required] E... | java | public OvhTaskFilter delegatedAccount_email_filter_name_changePriority_POST(String email, String name, Long priority) throws IOException {
String qPath = "/email/domain/delegatedAccount/{email}/filter/{name}/changePriority";
StringBuilder sb = path(qPath, email, name);
HashMap<String, Object>o = new HashMap<Strin... | [
"public",
"OvhTaskFilter",
"delegatedAccount_email_filter_name_changePriority_POST",
"(",
"String",
"email",
",",
"String",
"name",
",",
"Long",
"priority",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/delegatedAccount/{email}/filter/{name}/change... | Change filter priority
REST: POST /email/domain/delegatedAccount/{email}/filter/{name}/changePriority
@param priority [required] New priority
@param email [required] Email
@param name [required] Filter name | [
"Change",
"filter",
"priority"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L144-L151 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.cleanup | public long cleanup() {
"""
Removes all expired objects.
@return the number of removed objects.
"""
int garbageSize = 0;
if (isCachingEnabled()) {
System.out.println(new LogEntry(Level.VERBOSE, "Identifying expired objects"));
ArrayList<K> garbage = getExpiredObjects();
garbageSize = garbage.si... | java | public long cleanup() {
int garbageSize = 0;
if (isCachingEnabled()) {
System.out.println(new LogEntry(Level.VERBOSE, "Identifying expired objects"));
ArrayList<K> garbage = getExpiredObjects();
garbageSize = garbage.size();
System.out.println(new LogEntry("cache cleanup: expired objects: " + garbageSiz... | [
"public",
"long",
"cleanup",
"(",
")",
"{",
"int",
"garbageSize",
"=",
"0",
";",
"if",
"(",
"isCachingEnabled",
"(",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"new",
"LogEntry",
"(",
"Level",
".",
"VERBOSE",
",",
"\"Identifying expired ob... | Removes all expired objects.
@return the number of removed objects. | [
"Removes",
"all",
"expired",
"objects",
"."
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L320-L332 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/lang/QuotedStringTokenizer.java | QuotedStringTokenizer.quoteOnly | public static void quoteOnly(Appendable buffer, String input) {
"""
Quote a string into an Appendable. Only quotes and backslash are escaped.
@param buffer The Appendable
@param input The String to quote.
"""
if (input == null)
return;
try {
buffer.append('"');
... | java | public static void quoteOnly(Appendable buffer, String input) {
if (input == null)
return;
try {
buffer.append('"');
for (int i = 0; i < input.length(); ++i) {
char c = input.charAt(i);
if (c == '"' || c == '\\')
bu... | [
"public",
"static",
"void",
"quoteOnly",
"(",
"Appendable",
"buffer",
",",
"String",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"return",
";",
"try",
"{",
"buffer",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"i",
"=",... | Quote a string into an Appendable. Only quotes and backslash are escaped.
@param buffer The Appendable
@param input The String to quote. | [
"Quote",
"a",
"string",
"into",
"an",
"Appendable",
".",
"Only",
"quotes",
"and",
"backslash",
"are",
"escaped",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/lang/QuotedStringTokenizer.java#L251-L267 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/painter/RasterLayerPainter.java | RasterLayerPainter.deleteShape | public void deleteShape(Paintable paintable, Object group, MapContext context) {
"""
Delete a {@link Paintable} object from the given {@link MapContext}. It the object does not exist, nothing
will be done.
@param paintable
The raster layer
@param group
The group where the object resides in (optional).
@par... | java | public void deleteShape(Paintable paintable, Object group, MapContext context) {
context.getRasterContext().deleteGroup(paintable);
} | [
"public",
"void",
"deleteShape",
"(",
"Paintable",
"paintable",
",",
"Object",
"group",
",",
"MapContext",
"context",
")",
"{",
"context",
".",
"getRasterContext",
"(",
")",
".",
"deleteGroup",
"(",
"paintable",
")",
";",
"}"
] | Delete a {@link Paintable} object from the given {@link MapContext}. It the object does not exist, nothing
will be done.
@param paintable
The raster layer
@param group
The group where the object resides in (optional).
@param graphics
The context to paint on. | [
"Delete",
"a",
"{",
"@link",
"Paintable",
"}",
"object",
"from",
"the",
"given",
"{",
"@link",
"MapContext",
"}",
".",
"It",
"the",
"object",
"does",
"not",
"exist",
"nothing",
"will",
"be",
"done",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/painter/RasterLayerPainter.java#L75-L77 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java | MLEDependencyGrammar.getStopProb | protected double getStopProb(IntDependency dependency) {
"""
Return the probability (as a real number between 0 and 1) of stopping
rather than generating another argument at this position.
@param dependency The dependency used as the basis for stopping on.
Tags are assumed to be in the TagProjection space.
@re... | java | protected double getStopProb(IntDependency dependency) {
short binDistance = distanceBin(dependency.distance);
IntTaggedWord unknownHead = new IntTaggedWord(-1, dependency.head.tag);
IntTaggedWord anyHead = new IntTaggedWord(ANY_WORD_INT, dependency.head.tag);
IntDependency temp = new IntDependenc... | [
"protected",
"double",
"getStopProb",
"(",
"IntDependency",
"dependency",
")",
"{",
"short",
"binDistance",
"=",
"distanceBin",
"(",
"dependency",
".",
"distance",
")",
";",
"IntTaggedWord",
"unknownHead",
"=",
"new",
"IntTaggedWord",
"(",
"-",
"1",
",",
"depend... | Return the probability (as a real number between 0 and 1) of stopping
rather than generating another argument at this position.
@param dependency The dependency used as the basis for stopping on.
Tags are assumed to be in the TagProjection space.
@return The probability of generating this stop probability | [
"Return",
"the",
"probability",
"(",
"as",
"a",
"real",
"number",
"between",
"0",
"and",
"1",
")",
"of",
"stopping",
"rather",
"than",
"generating",
"another",
"argument",
"at",
"this",
"position",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java#L716-L739 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java | SimpleOutputElement.createChild | protected SimpleOutputElement createChild(String prefix, String localName,
String uri) {
"""
Full factory method, used for 'normal' namespace qualified output
methods.
"""
/* At this point we can also discard attribute Map; it is assumed
* that wh... | java | protected SimpleOutputElement createChild(String prefix, String localName,
String uri)
{
/* At this point we can also discard attribute Map; it is assumed
* that when a child element has been opened, no more attributes
* can be output.
... | [
"protected",
"SimpleOutputElement",
"createChild",
"(",
"String",
"prefix",
",",
"String",
"localName",
",",
"String",
"uri",
")",
"{",
"/* At this point we can also discard attribute Map; it is assumed\n * that when a child element has been opened, no more attributes\n *... | Full factory method, used for 'normal' namespace qualified output
methods. | [
"Full",
"factory",
"method",
"used",
"for",
"normal",
"namespace",
"qualified",
"output",
"methods",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java#L184-L193 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/Props.java | Props.getLong | public long getLong(final String name, final long defaultValue) {
"""
Returns the long representation of the value. If the value is null, then the default value is
returned. If the value isn't a long, then a parse exception will be thrown.
"""
if (containsKey(name)) {
return Long.parseLong(get(name)... | java | public long getLong(final String name, final long defaultValue) {
if (containsKey(name)) {
return Long.parseLong(get(name));
} else {
return defaultValue;
}
} | [
"public",
"long",
"getLong",
"(",
"final",
"String",
"name",
",",
"final",
"long",
"defaultValue",
")",
"{",
"if",
"(",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"Long",
".",
"parseLong",
"(",
"get",
"(",
"name",
")",
")",
";",
"}",
"else"... | Returns the long representation of the value. If the value is null, then the default value is
returned. If the value isn't a long, then a parse exception will be thrown. | [
"Returns",
"the",
"long",
"representation",
"of",
"the",
"value",
".",
"If",
"the",
"value",
"is",
"null",
"then",
"the",
"default",
"value",
"is",
"returned",
".",
"If",
"the",
"value",
"isn",
"t",
"a",
"long",
"then",
"a",
"parse",
"exception",
"will",... | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Props.java#L534-L540 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java | OgmEntityPersister.getInverseOneToOneProperty | private String getInverseOneToOneProperty(String property, OgmEntityPersister otherSidePersister) {
"""
Returns the name from the inverse side if the given property de-notes a one-to-one association.
"""
for ( String candidate : otherSidePersister.getPropertyNames() ) {
Type candidateType = otherSidePersi... | java | private String getInverseOneToOneProperty(String property, OgmEntityPersister otherSidePersister) {
for ( String candidate : otherSidePersister.getPropertyNames() ) {
Type candidateType = otherSidePersister.getPropertyType( candidate );
if ( candidateType.isEntityType()
&& ( ( (EntityType) candidateType ).... | [
"private",
"String",
"getInverseOneToOneProperty",
"(",
"String",
"property",
",",
"OgmEntityPersister",
"otherSidePersister",
")",
"{",
"for",
"(",
"String",
"candidate",
":",
"otherSidePersister",
".",
"getPropertyNames",
"(",
")",
")",
"{",
"Type",
"candidateType",... | Returns the name from the inverse side if the given property de-notes a one-to-one association. | [
"Returns",
"the",
"name",
"from",
"the",
"inverse",
"side",
"if",
"the",
"given",
"property",
"de",
"-",
"notes",
"a",
"one",
"-",
"to",
"-",
"one",
"association",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/OgmEntityPersister.java#L415-L426 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/ArrayUtils.java | ArrayUtils.divideObjectArray | public static <T> List<T[]> divideObjectArray(T[] arr, Integer... cuts) {
"""
Divides the given object-array using the boundaries in <code>cuts</code>.
<br>
Cuts are interpreted in an inclusive way, which means that a single cut
at position i divides the given array in 0...i-1 + i...n<br>
This method deals wit... | java | public static <T> List<T[]> divideObjectArray(T[] arr, Integer... cuts) {
return divideArray(arr, cuts);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
"[",
"]",
">",
"divideObjectArray",
"(",
"T",
"[",
"]",
"arr",
",",
"Integer",
"...",
"cuts",
")",
"{",
"return",
"divideArray",
"(",
"arr",
",",
"cuts",
")",
";",
"}"
] | Divides the given object-array using the boundaries in <code>cuts</code>.
<br>
Cuts are interpreted in an inclusive way, which means that a single cut
at position i divides the given array in 0...i-1 + i...n<br>
This method deals with both cut positions including and excluding start
and end-indexes<br>
@param <T>
Obje... | [
"Divides",
"the",
"given",
"object",
"-",
"array",
"using",
"the",
"boundaries",
"in",
"<code",
">",
"cuts<",
"/",
"code",
">",
".",
"<br",
">",
"Cuts",
"are",
"interpreted",
"in",
"an",
"inclusive",
"way",
"which",
"means",
"that",
"a",
"single",
"cut",... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ArrayUtils.java#L320-L322 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java | Enter.topLevelEnv | Env<AttrContext> topLevelEnv(JCCompilationUnit tree) {
"""
Create a fresh environment for toplevels.
@param tree The toplevel tree.
"""
Env<AttrContext> localEnv = new Env<>(tree, new AttrContext());
localEnv.toplevel = tree;
localEnv.enclClass = predefClassDef;
tree.toplev... | java | Env<AttrContext> topLevelEnv(JCCompilationUnit tree) {
Env<AttrContext> localEnv = new Env<>(tree, new AttrContext());
localEnv.toplevel = tree;
localEnv.enclClass = predefClassDef;
tree.toplevelScope = WriteableScope.create(tree.packge);
tree.namedImportScope = new NamedImportSc... | [
"Env",
"<",
"AttrContext",
">",
"topLevelEnv",
"(",
"JCCompilationUnit",
"tree",
")",
"{",
"Env",
"<",
"AttrContext",
">",
"localEnv",
"=",
"new",
"Env",
"<>",
"(",
"tree",
",",
"new",
"AttrContext",
"(",
")",
")",
";",
"localEnv",
".",
"toplevel",
"=",
... | Create a fresh environment for toplevels.
@param tree The toplevel tree. | [
"Create",
"a",
"fresh",
"environment",
"for",
"toplevels",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java#L212-L222 |
landawn/AbacusUtil | src/com/landawn/abacus/util/PropertiesUtil.java | PropertiesUtil.xml2Java | public static void xml2Java(File file, String srcPath, String packageName, String className, boolean isPublicField) {
"""
Generate java code by the specified xml.
@param file
@param srcPath
@param packageName
@param className
@param isPublicField
"""
InputStream is = null;
try {
... | java | public static void xml2Java(File file, String srcPath, String packageName, String className, boolean isPublicField) {
InputStream is = null;
try {
is = new FileInputStream(file);
xml2Java(is, srcPath, packageName, className, isPublicField);
} catch (FileNotFoundE... | [
"public",
"static",
"void",
"xml2Java",
"(",
"File",
"file",
",",
"String",
"srcPath",
",",
"String",
"packageName",
",",
"String",
"className",
",",
"boolean",
"isPublicField",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"is",
"=",
"new",... | Generate java code by the specified xml.
@param file
@param srcPath
@param packageName
@param className
@param isPublicField | [
"Generate",
"java",
"code",
"by",
"the",
"specified",
"xml",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/PropertiesUtil.java#L837-L849 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SDLayerParams.java | SDLayerParams.addBiasParam | public void addBiasParam(@NonNull String paramKey, @NonNull long... paramShape) {
"""
Add a bias parameter to the layer, with the specified shape. For example, a standard fully connected layer
could have bias parameters with shape [1, layerSize]
@param paramKey The parameter key (name) for the bias parameter... | java | public void addBiasParam(@NonNull String paramKey, @NonNull long... paramShape) {
Preconditions.checkArgument(paramShape.length > 0, "Provided mia- parameter shape is"
+ " invalid: length 0 provided for shape. Parameter: " + paramKey);
biasParams.put(paramKey, paramShape);
... | [
"public",
"void",
"addBiasParam",
"(",
"@",
"NonNull",
"String",
"paramKey",
",",
"@",
"NonNull",
"long",
"...",
"paramShape",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"paramShape",
".",
"length",
">",
"0",
",",
"\"Provided mia- parameter shape is\"",... | Add a bias parameter to the layer, with the specified shape. For example, a standard fully connected layer
could have bias parameters with shape [1, layerSize]
@param paramKey The parameter key (name) for the bias parameter
@param paramShape Shape of the bias parameter array | [
"Add",
"a",
"bias",
"parameter",
"to",
"the",
"layer",
"with",
"the",
"specified",
"shape",
".",
"For",
"example",
"a",
"standard",
"fully",
"connected",
"layer",
"could",
"have",
"bias",
"parameters",
"with",
"shape",
"[",
"1",
"layerSize",
"]"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/samediff/SDLayerParams.java#L81-L88 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/jmx/ObjectNameBuilder.java | ObjectNameBuilder.addProperty | public ObjectNameBuilder addProperty(String key, String value) {
"""
Adds the key/value as a {@link ObjectName} property.
@param key the key to add
@param value the value to add
@return This builder
"""
nameStrBuilder.append(sanitizeValue(key))
.append('=')
.append(sanitizeValue(valu... | java | public ObjectNameBuilder addProperty(String key, String value) {
nameStrBuilder.append(sanitizeValue(key))
.append('=')
.append(sanitizeValue(value)).append(",");
return this;
} | [
"public",
"ObjectNameBuilder",
"addProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"nameStrBuilder",
".",
"append",
"(",
"sanitizeValue",
"(",
"key",
")",
")",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
"(",
"sanitizeValue",
"(",
... | Adds the key/value as a {@link ObjectName} property.
@param key the key to add
@param value the value to add
@return This builder | [
"Adds",
"the",
"key",
"/",
"value",
"as",
"a",
"{",
"@link",
"ObjectName",
"}",
"property",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/jmx/ObjectNameBuilder.java#L100-L105 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.getServerFarmSkusAsync | public Observable<Object> getServerFarmSkusAsync(String resourceGroupName, String name) {
"""
Gets all selectable sku's for a given App Service Plan.
Gets all selectable sku's for a given App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of A... | java | public Observable<Object> getServerFarmSkusAsync(String resourceGroupName, String name) {
return getServerFarmSkusWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<Object>, Object>() {
@Override
public Object call(ServiceResponse<Object> response) {
... | [
"public",
"Observable",
"<",
"Object",
">",
"getServerFarmSkusAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"getServerFarmSkusWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"map",
"(",
"new",
"Fun... | Gets all selectable sku's for a given App Service Plan.
Gets all selectable sku's for a given App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of App Service Plan
@throws IllegalArgumentException thrown if parameters fail the validation
@return the o... | [
"Gets",
"all",
"selectable",
"sku",
"s",
"for",
"a",
"given",
"App",
"Service",
"Plan",
".",
"Gets",
"all",
"selectable",
"sku",
"s",
"for",
"a",
"given",
"App",
"Service",
"Plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L2666-L2673 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/Branch.java | Branch.enableCookieBasedMatching | public static void enableCookieBasedMatching(String cookieMatchDomain, int delay) {
"""
<p>
Enabled Strong matching check using chrome cookies. This method should be called before
Branch#getAutoInstance(Context).</p>
@param cookieMatchDomain The domain for the url used to match the cookie (eg. example.app.lin... | java | public static void enableCookieBasedMatching(String cookieMatchDomain, int delay) {
cookieBasedMatchDomain_ = cookieMatchDomain;
BranchStrongMatchHelper.getInstance().setStrongMatchUrlHitDelay(delay);
} | [
"public",
"static",
"void",
"enableCookieBasedMatching",
"(",
"String",
"cookieMatchDomain",
",",
"int",
"delay",
")",
"{",
"cookieBasedMatchDomain_",
"=",
"cookieMatchDomain",
";",
"BranchStrongMatchHelper",
".",
"getInstance",
"(",
")",
".",
"setStrongMatchUrlHitDelay",... | <p>
Enabled Strong matching check using chrome cookies. This method should be called before
Branch#getAutoInstance(Context).</p>
@param cookieMatchDomain The domain for the url used to match the cookie (eg. example.app.link)
@param delay Time in millisecond to wait for the strong match to check to finish b... | [
"<p",
">",
"Enabled",
"Strong",
"matching",
"check",
"using",
"chrome",
"cookies",
".",
"This",
"method",
"should",
"be",
"called",
"before",
"Branch#getAutoInstance",
"(",
"Context",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L1458-L1461 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/viewer/LogViewer.java | LogViewer.createOutputStream | private PrintStream createOutputStream() {
"""
The createOutputSteam method.
<p>
Creates or sets up (in the case of the console) the output steam that LogViewer will use to write to.
@return PrintStream representing the output file or the System.out or console.
"""
if (outputLogFilename != null) {... | java | private PrintStream createOutputStream() {
if (outputLogFilename != null) {
try {
FileOutputStream fout = new FileOutputStream(outputLogFilename, false);
BufferedOutputStream bos = new BufferedOutputStream(fout, 4096);
// We are using a PrintStream for... | [
"private",
"PrintStream",
"createOutputStream",
"(",
")",
"{",
"if",
"(",
"outputLogFilename",
"!=",
"null",
")",
"{",
"try",
"{",
"FileOutputStream",
"fout",
"=",
"new",
"FileOutputStream",
"(",
"outputLogFilename",
",",
"false",
")",
";",
"BufferedOutputStream",... | The createOutputSteam method.
<p>
Creates or sets up (in the case of the console) the output steam that LogViewer will use to write to.
@return PrintStream representing the output file or the System.out or console. | [
"The",
"createOutputSteam",
"method",
".",
"<p",
">",
"Creates",
"or",
"sets",
"up",
"(",
"in",
"the",
"case",
"of",
"the",
"console",
")",
"the",
"output",
"steam",
"that",
"LogViewer",
"will",
"use",
"to",
"write",
"to",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/viewer/LogViewer.java#L1924-L1951 |
google/gson | gson/src/main/java/com/google/gson/Gson.java | Gson.toJsonTree | public JsonElement toJsonTree(Object src, Type typeOfSrc) {
"""
This method serializes the specified object, including those of generic types, into its
equivalent representation as a tree of {@link JsonElement}s. This method must be used if the
specified object is a generic type. For non-generic objects, use {@l... | java | public JsonElement toJsonTree(Object src, Type typeOfSrc) {
JsonTreeWriter writer = new JsonTreeWriter();
toJson(src, typeOfSrc, writer);
return writer.get();
} | [
"public",
"JsonElement",
"toJsonTree",
"(",
"Object",
"src",
",",
"Type",
"typeOfSrc",
")",
"{",
"JsonTreeWriter",
"writer",
"=",
"new",
"JsonTreeWriter",
"(",
")",
";",
"toJson",
"(",
"src",
",",
"typeOfSrc",
",",
"writer",
")",
";",
"return",
"writer",
"... | This method serializes the specified object, including those of generic types, into its
equivalent representation as a tree of {@link JsonElement}s. This method must be used if the
specified object is a generic type. For non-generic objects, use {@link #toJsonTree(Object)}
instead.
@param src the object for which JSON... | [
"This",
"method",
"serializes",
"the",
"specified",
"object",
"including",
"those",
"of",
"generic",
"types",
"into",
"its",
"equivalent",
"representation",
"as",
"a",
"tree",
"of",
"{",
"@link",
"JsonElement",
"}",
"s",
".",
"This",
"method",
"must",
"be",
... | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/Gson.java#L595-L599 |
jaxio/celerio | celerio-engine/src/main/java/com/jaxio/celerio/util/MiscUtil.java | MiscUtil.equalsIgnoreCase | public static boolean equalsIgnoreCase(String name, Iterable<String> patterns) {
"""
Does the given column name equals ignore case with one of pattern given in parameter
@param name the column
@param patterns table of patterns as strings
@return true if the column name equals ignore case with one of the g... | java | public static boolean equalsIgnoreCase(String name, Iterable<String> patterns) {
for (String pattern : patterns) {
if (name.equalsIgnoreCase(pattern)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"equalsIgnoreCase",
"(",
"String",
"name",
",",
"Iterable",
"<",
"String",
">",
"patterns",
")",
"{",
"for",
"(",
"String",
"pattern",
":",
"patterns",
")",
"{",
"if",
"(",
"name",
".",
"equalsIgnoreCase",
"(",
"pattern",
")"... | Does the given column name equals ignore case with one of pattern given in parameter
@param name the column
@param patterns table of patterns as strings
@return true if the column name equals ignore case with one of the given patterns, false otherwise | [
"Does",
"the",
"given",
"column",
"name",
"equals",
"ignore",
"case",
"with",
"one",
"of",
"pattern",
"given",
"in",
"parameter"
] | train | https://github.com/jaxio/celerio/blob/fbfacb639e286f9f3f3a18986f74ea275bebd887/celerio-engine/src/main/java/com/jaxio/celerio/util/MiscUtil.java#L211-L219 |
kikinteractive/ice | ice/src/main/java/com/kik/config/ice/source/DebugDynamicConfigSource.java | DebugDynamicConfigSource.fireEvent | @Override
public void fireEvent(String configName, Optional<String> valueOpt) throws ConfigException {
"""
A raw handle to cause this ConfigSource to be updated to the new value, emitting an event if it is different
than the previous value.
It is recommended to instead use {@link #set(Object)} to provide a t... | java | @Override
public void fireEvent(String configName, Optional<String> valueOpt) throws ConfigException
{
if (!subjectMap.containsKey(configName)) {
throw new ConfigException("Unknown configName {}", configName);
}
emitEvent(configName, valueOpt);
} | [
"@",
"Override",
"public",
"void",
"fireEvent",
"(",
"String",
"configName",
",",
"Optional",
"<",
"String",
">",
"valueOpt",
")",
"throws",
"ConfigException",
"{",
"if",
"(",
"!",
"subjectMap",
".",
"containsKey",
"(",
"configName",
")",
")",
"{",
"throw",
... | A raw handle to cause this ConfigSource to be updated to the new value, emitting an event if it is different
than the previous value.
It is recommended to instead use {@link #set(Object)} to provide a type-safe value rather than using this method
directly in tests.
@param configName the string name of the configuratio... | [
"A",
"raw",
"handle",
"to",
"cause",
"this",
"ConfigSource",
"to",
"be",
"updated",
"to",
"the",
"new",
"value",
"emitting",
"an",
"event",
"if",
"it",
"is",
"different",
"than",
"the",
"previous",
"value",
".",
"It",
"is",
"recommended",
"to",
"instead",
... | train | https://github.com/kikinteractive/ice/blob/0c58d7bf2d9f6504892d0768d6022fcfa6df7514/ice/src/main/java/com/kik/config/ice/source/DebugDynamicConfigSource.java#L156-L163 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.credit_code_POST | public OvhMovement credit_code_POST(String inputCode) throws IOException {
"""
Validate a code to generate associated credit movement
REST: POST /me/credit/code
@param inputCode [required] Code to validate
"""
String qPath = "/me/credit/code";
StringBuilder sb = path(qPath);
HashMap<String, Object>o ... | java | public OvhMovement credit_code_POST(String inputCode) throws IOException {
String qPath = "/me/credit/code";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "inputCode", inputCode);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(res... | [
"public",
"OvhMovement",
"credit_code_POST",
"(",
"String",
"inputCode",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/credit/code\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"HashMap",
"<",
"String",
",",
"Object",
... | Validate a code to generate associated credit movement
REST: POST /me/credit/code
@param inputCode [required] Code to validate | [
"Validate",
"a",
"code",
"to",
"generate",
"associated",
"credit",
"movement"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L868-L875 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.processSpecContents | protected ParserResults processSpecContents(ParserData parserData, final boolean processProcesses) {
"""
Process the contents of a content specification and parse it into a ContentSpec object.
@param parserData
@param processProcesses If processes should be processed to populate the relationships.
@return Tru... | java | protected ParserResults processSpecContents(ParserData parserData, final boolean processProcesses) {
parserData.setCurrentLevel(parserData.getContentSpec().getBaseLevel());
boolean error = false;
while (parserData.getLines().peek() != null) {
parserData.setLineCount(parserData.getLin... | [
"protected",
"ParserResults",
"processSpecContents",
"(",
"ParserData",
"parserData",
",",
"final",
"boolean",
"processProcesses",
")",
"{",
"parserData",
".",
"setCurrentLevel",
"(",
"parserData",
".",
"getContentSpec",
"(",
")",
".",
"getBaseLevel",
"(",
")",
")",... | Process the contents of a content specification and parse it into a ContentSpec object.
@param parserData
@param processProcesses If processes should be processed to populate the relationships.
@return True if the contents were processed successfully otherwise false. | [
"Process",
"the",
"contents",
"of",
"a",
"content",
"specification",
"and",
"parse",
"it",
"into",
"a",
"ContentSpec",
"object",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L375-L403 |
elki-project/elki | addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java | AbstractLayout3DPC.buildSpanningTree | protected N buildSpanningTree(int dim, double[] mat, Layout layout) {
"""
Build the minimum spanning tree.
@param mat Similarity matrix
@param layout Layout to write to
@return Root node id
"""
assert (layout.edges == null || layout.edges.size() == 0);
int[] iedges = PrimsMinimumSpanningTree.proce... | java | protected N buildSpanningTree(int dim, double[] mat, Layout layout) {
assert (layout.edges == null || layout.edges.size() == 0);
int[] iedges = PrimsMinimumSpanningTree.processDense(mat, new LowerTriangularAdapter(dim));
int root = findOptimalRoot(iedges);
// Convert edges:
ArrayList<Edge> edges = ... | [
"protected",
"N",
"buildSpanningTree",
"(",
"int",
"dim",
",",
"double",
"[",
"]",
"mat",
",",
"Layout",
"layout",
")",
"{",
"assert",
"(",
"layout",
".",
"edges",
"==",
"null",
"||",
"layout",
".",
"edges",
".",
"size",
"(",
")",
"==",
"0",
")",
"... | Build the minimum spanning tree.
@param mat Similarity matrix
@param layout Layout to write to
@return Root node id | [
"Build",
"the",
"minimum",
"spanning",
"tree",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/3dpc/src/main/java/de/lmu/ifi/dbs/elki/visualization/parallel3d/layout/AbstractLayout3DPC.java#L133-L154 |
pac4j/pac4j | pac4j-saml/src/main/java/org/pac4j/saml/config/SAML2Configuration.java | SAML2Configuration.createSelfSignedCert | private X509Certificate createSelfSignedCert(X500Name dn, String sigName, AlgorithmIdentifier sigAlgID, KeyPair keyPair)
throws Exception {
"""
Generate a self-signed certificate for dn using the provided signature algorithm and key pair.
@param dn X.500 name to associate with certificate issuer/s... | java | private X509Certificate createSelfSignedCert(X500Name dn, String sigName, AlgorithmIdentifier sigAlgID, KeyPair keyPair)
throws Exception {
final V3TBSCertificateGenerator certGen = new V3TBSCertificateGenerator();
certGen.setSerialNumber(new ASN1Integer(BigInteger.valueOf(1)));
certGen... | [
"private",
"X509Certificate",
"createSelfSignedCert",
"(",
"X500Name",
"dn",
",",
"String",
"sigName",
",",
"AlgorithmIdentifier",
"sigAlgID",
",",
"KeyPair",
"keyPair",
")",
"throws",
"Exception",
"{",
"final",
"V3TBSCertificateGenerator",
"certGen",
"=",
"new",
"V3T... | Generate a self-signed certificate for dn using the provided signature algorithm and key pair.
@param dn X.500 name to associate with certificate issuer/subject.
@param sigName name of the signature algorithm to use.
@param sigAlgID algorithm ID associated with the signature algorithm name.
@param keyPair the ... | [
"Generate",
"a",
"self",
"-",
"signed",
"certificate",
"for",
"dn",
"using",
"the",
"provided",
"signature",
"algorithm",
"and",
"key",
"pair",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-saml/src/main/java/org/pac4j/saml/config/SAML2Configuration.java#L621-L660 |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java | HttpContext.logResponse | private void logResponse(URI uri, Response response) {
"""
Log a HTTP error response.
@param uri The URI used for the HTTP call
@param response The HTTP call response
"""
if(logger.isLoggable(Level.FINE))
logger.fine(uri.toString()+" => "+response.getStatus());
if(response.getStat... | java | private void logResponse(URI uri, Response response)
{
if(logger.isLoggable(Level.FINE))
logger.fine(uri.toString()+" => "+response.getStatus());
if(response.getStatus() > 300)
logger.warning(response.toString());
} | [
"private",
"void",
"logResponse",
"(",
"URI",
"uri",
",",
"Response",
"response",
")",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"logger",
".",
"fine",
"(",
"uri",
".",
"toString",
"(",
")",
"+",
"\" => \"",
"+... | Log a HTTP error response.
@param uri The URI used for the HTTP call
@param response The HTTP call response | [
"Log",
"a",
"HTTP",
"error",
"response",
"."
] | train | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java#L608-L614 |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Assert.java | Assert.cookieEquals | @Override
public void cookieEquals(String cookieName, String expectedCookieValue) {
"""
Asserts that a cookies with the provided name has a value equal to the
expected value. This information will be logged and recorded, with a
screenshot for traceability and added debugging support.
@param cookieName ... | java | @Override
public void cookieEquals(String cookieName, String expectedCookieValue) {
assertEquals("Cookie Value Mismatch", expectedCookieValue, checkCookieEquals(cookieName, expectedCookieValue, 0, 0));
} | [
"@",
"Override",
"public",
"void",
"cookieEquals",
"(",
"String",
"cookieName",
",",
"String",
"expectedCookieValue",
")",
"{",
"assertEquals",
"(",
"\"Cookie Value Mismatch\"",
",",
"expectedCookieValue",
",",
"checkCookieEquals",
"(",
"cookieName",
",",
"expectedCooki... | Asserts that a cookies with the provided name has a value equal to the
expected value. This information will be logged and recorded, with a
screenshot for traceability and added debugging support.
@param cookieName the name of the cookie
@param expectedCookieValue the expected value of the cookie | [
"Asserts",
"that",
"a",
"cookies",
"with",
"the",
"provided",
"name",
"has",
"a",
"value",
"equal",
"to",
"the",
"expected",
"value",
".",
"This",
"information",
"will",
"be",
"logged",
"and",
"recorded",
"with",
"a",
"screenshot",
"for",
"traceability",
"an... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Assert.java#L315-L318 |
lucee/Lucee | core/src/main/java/lucee/runtime/ext/tag/TagImpl.java | TagImpl.required | public void required(String tagName, String actionName, String attributeName, Object attribute) throws ApplicationException {
"""
check if value is not empty
@param tagName
@param attributeName
@param attribute
@throws ApplicationException
"""
if (attribute == null)
throw new ApplicationException("... | java | public void required(String tagName, String actionName, String attributeName, Object attribute) throws ApplicationException {
if (attribute == null)
throw new ApplicationException("Attribute [" + attributeName + "] for tag [" + tagName + "] is required if attribute action has the value [" + actionName + "]");
... | [
"public",
"void",
"required",
"(",
"String",
"tagName",
",",
"String",
"actionName",
",",
"String",
"attributeName",
",",
"Object",
"attribute",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"attribute",
"==",
"null",
")",
"throw",
"new",
"ApplicationEx... | check if value is not empty
@param tagName
@param attributeName
@param attribute
@throws ApplicationException | [
"check",
"if",
"value",
"is",
"not",
"empty"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/ext/tag/TagImpl.java#L89-L93 |
flow/commons | src/main/java/com/flowpowered/commons/store/block/impl/AtomicShortIntArray.java | AtomicShortIntArray.compareAndSet | public boolean compareAndSet(int i, int expect, int update) {
"""
Sets the element at the given index, but only if the previous value was the expected value.
@param i the index
@param expect the expected value
@param update the new value
@return true on success
"""
while (true) {
try ... | java | public boolean compareAndSet(int i, int expect, int update) {
while (true) {
try {
updateLock.lock();
try {
return store.get().compareAndSet(i, expect, update);
} finally {
updateLock.unlock();
}
... | [
"public",
"boolean",
"compareAndSet",
"(",
"int",
"i",
",",
"int",
"expect",
",",
"int",
"update",
")",
"{",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"updateLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"store",
".",
"get",
"(",
")",
... | Sets the element at the given index, but only if the previous value was the expected value.
@param i the index
@param expect the expected value
@param update the new value
@return true on success | [
"Sets",
"the",
"element",
"at",
"the",
"given",
"index",
"but",
"only",
"if",
"the",
"previous",
"value",
"was",
"the",
"expected",
"value",
"."
] | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/store/block/impl/AtomicShortIntArray.java#L211-L233 |
joniles/mpxj | src/main/java/net/sf/mpxj/ProjectCalendar.java | ProjectCalendar.getTime | private long getTime(Date start1, Date end1, Date start2, Date end2) {
"""
This method returns the length of overlapping time between two time
ranges.
@param start1 start of first range
@param end1 end of first range
@param start2 start start of second range
@param end2 end of second range
@return overlapp... | java | private long getTime(Date start1, Date end1, Date start2, Date end2)
{
long total = 0;
if (start1 != null && end1 != null && start2 != null && end2 != null)
{
long start;
long end;
if (start1.getTime() < start2.getTime())
{
start = start2.getTime();... | [
"private",
"long",
"getTime",
"(",
"Date",
"start1",
",",
"Date",
"end1",
",",
"Date",
"start2",
",",
"Date",
"end2",
")",
"{",
"long",
"total",
"=",
"0",
";",
"if",
"(",
"start1",
"!=",
"null",
"&&",
"end1",
"!=",
"null",
"&&",
"start2",
"!=",
"nu... | This method returns the length of overlapping time between two time
ranges.
@param start1 start of first range
@param end1 end of first range
@param start2 start start of second range
@param end2 end of second range
@return overlapping time in milliseconds | [
"This",
"method",
"returns",
"the",
"length",
"of",
"overlapping",
"time",
"between",
"two",
"time",
"ranges",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ProjectCalendar.java#L1601-L1635 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandler.java | RTMPHandler.sendSOCreationFailed | private void sendSOCreationFailed(RTMPConnection conn, SharedObjectMessage message) {
"""
Create and send SO message stating that a SO could not be created.
@param conn
@param message
Shared object message that incurred the failure
"""
log.debug("sendSOCreationFailed - message: {} conn: {}", mess... | java | private void sendSOCreationFailed(RTMPConnection conn, SharedObjectMessage message) {
log.debug("sendSOCreationFailed - message: {} conn: {}", message, conn);
// reset the object so we can re-use it
message.reset();
// add the error event
message.addEvent(new SharedObjectEve... | [
"private",
"void",
"sendSOCreationFailed",
"(",
"RTMPConnection",
"conn",
",",
"SharedObjectMessage",
"message",
")",
"{",
"log",
".",
"debug",
"(",
"\"sendSOCreationFailed - message: {} conn: {}\"",
",",
"message",
",",
"conn",
")",
";",
"// reset the object so we can re... | Create and send SO message stating that a SO could not be created.
@param conn
@param message
Shared object message that incurred the failure | [
"Create",
"and",
"send",
"SO",
"message",
"stating",
"that",
"a",
"SO",
"could",
"not",
"be",
"created",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandler.java#L547-L561 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java | ServiceManagementRecord.isServiceEnabled | public static boolean isServiceEnabled(EntityManager em, Service service) {
"""
Determine a given service's enability.
@param em The EntityManager to use.
@param service The service for which to determine enability.
@return True or false depending on whether the service is enabled or disabled.
... | java | public static boolean isServiceEnabled(EntityManager em, Service service) {
ServiceManagementRecord record = findServiceManagementRecord(em, service);
return record == null ? true : record.isEnabled();
} | [
"public",
"static",
"boolean",
"isServiceEnabled",
"(",
"EntityManager",
"em",
",",
"Service",
"service",
")",
"{",
"ServiceManagementRecord",
"record",
"=",
"findServiceManagementRecord",
"(",
"em",
",",
"service",
")",
";",
"return",
"record",
"==",
"null",
"?",... | Determine a given service's enability.
@param em The EntityManager to use.
@param service The service for which to determine enability.
@return True or false depending on whether the service is enabled or disabled. | [
"Determine",
"a",
"given",
"service",
"s",
"enability",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java#L139-L143 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java | AbstractJsonDeserializer.getStringParam | protected String getStringParam(String paramName, String errorMessage)
throws IOException {
"""
Convenience method for subclasses. Uses the default map for parameterinput
@param paramName the name of the parameter
@param errorMessage the errormessage to add to the exception if the param does not... | java | protected String getStringParam(String paramName, String errorMessage)
throws IOException {
return getStringParam(paramName, errorMessage, (Map<String, Object>) inputParams.get());
} | [
"protected",
"String",
"getStringParam",
"(",
"String",
"paramName",
",",
"String",
"errorMessage",
")",
"throws",
"IOException",
"{",
"return",
"getStringParam",
"(",
"paramName",
",",
"errorMessage",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"... | Convenience method for subclasses. Uses the default map for parameterinput
@param paramName the name of the parameter
@param errorMessage the errormessage to add to the exception if the param does not exist.
@return a stringparameter with given name. If it does not exist and the errormessage is provided,
an IOExcep... | [
"Convenience",
"method",
"for",
"subclasses",
".",
"Uses",
"the",
"default",
"map",
"for",
"parameterinput"
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java#L110-L113 |
alkacon/opencms-core | src/org/opencms/xml/A_CmsXmlDocument.java | A_CmsXmlDocument.getBookmarkName | protected static final String getBookmarkName(String name, Locale locale) {
"""
Creates the bookmark name for a localized element to be used in the bookmark lookup table.<p>
@param name the element name
@param locale the element locale
@return the bookmark name for a localized element
"""
StringB... | java | protected static final String getBookmarkName(String name, Locale locale) {
StringBuffer result = new StringBuffer(64);
result.append('/');
result.append(locale.toString());
result.append('/');
result.append(name);
return result.toString();
} | [
"protected",
"static",
"final",
"String",
"getBookmarkName",
"(",
"String",
"name",
",",
"Locale",
"locale",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"64",
")",
";",
"result",
".",
"append",
"(",
"'",
"'",
")",
";",
"result",
... | Creates the bookmark name for a localized element to be used in the bookmark lookup table.<p>
@param name the element name
@param locale the element locale
@return the bookmark name for a localized element | [
"Creates",
"the",
"bookmark",
"name",
"for",
"a",
"localized",
"element",
"to",
"be",
"used",
"in",
"the",
"bookmark",
"lookup",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/A_CmsXmlDocument.java#L108-L116 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java | SelectStatement.addEOC | private static Composite addEOC(Composite composite, Bound eocBound) {
"""
Adds an EOC to the specified Composite.
@param composite the composite
@param eocBound the EOC bound
@return a new <code>Composite</code> with the EOC corresponding to the eocBound
"""
return eocBound == Bound.END ? composi... | java | private static Composite addEOC(Composite composite, Bound eocBound)
{
return eocBound == Bound.END ? composite.end() : composite.start();
} | [
"private",
"static",
"Composite",
"addEOC",
"(",
"Composite",
"composite",
",",
"Bound",
"eocBound",
")",
"{",
"return",
"eocBound",
"==",
"Bound",
".",
"END",
"?",
"composite",
".",
"end",
"(",
")",
":",
"composite",
".",
"start",
"(",
")",
";",
"}"
] | Adds an EOC to the specified Composite.
@param composite the composite
@param eocBound the EOC bound
@return a new <code>Composite</code> with the EOC corresponding to the eocBound | [
"Adds",
"an",
"EOC",
"to",
"the",
"specified",
"Composite",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L979-L982 |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.getAuthor | private String getAuthor(String clazz, ITestContext context) {
"""
Obtains the author of the current test suite being executed. If no author
was set, null will be returned
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications... | java | private String getAuthor(String clazz, ITestContext context) {
return (String) context.getAttribute(clazz + "Author");
} | [
"private",
"String",
"getAuthor",
"(",
"String",
"clazz",
",",
"ITestContext",
"context",
")",
"{",
"return",
"(",
"String",
")",
"context",
".",
"getAttribute",
"(",
"clazz",
"+",
"\"Author\"",
")",
";",
"}"
] | Obtains the author of the current test suite being executed. If no author
was set, null will be returned
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context associ... | [
"Obtains",
"the",
"author",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
".",
"If",
"no",
"author",
"was",
"set",
"null",
"will",
"be",
"returned"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L150-L152 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/interpreter/collection/CollectionInterpreter.java | CollectionInterpreter.addSurplusRow | protected void addSurplusRow( Example example, Example headers, Fixture rowFixtureAdapter) {
"""
<p>addSurplusRow.</p>
@param example a {@link com.greenpepper.Example} object.
@param headers a {@link com.greenpepper.Example} object.
@param rowFixtureAdapter a {@link com.greenpepper.reflect.Fixture} object.
... | java | protected void addSurplusRow( Example example, Example headers, Fixture rowFixtureAdapter)
{
Example row = example.addSibling();
for (int i = 0; i < headers.remainings(); i++)
{
ExpectedColumn column = (ExpectedColumn) columns[i];
Example cell = row.addChild();
... | [
"protected",
"void",
"addSurplusRow",
"(",
"Example",
"example",
",",
"Example",
"headers",
",",
"Fixture",
"rowFixtureAdapter",
")",
"{",
"Example",
"row",
"=",
"example",
".",
"addSibling",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<"... | <p>addSurplusRow.</p>
@param example a {@link com.greenpepper.Example} object.
@param headers a {@link com.greenpepper.Example} object.
@param rowFixtureAdapter a {@link com.greenpepper.reflect.Fixture} object. | [
"<p",
">",
"addSurplusRow",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/interpreter/collection/CollectionInterpreter.java#L158-L185 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.updateSubscriptionPreview | public Subscription updateSubscriptionPreview(final String uuid, final SubscriptionUpdate subscriptionUpdate) {
"""
Preview an update to a particular {@link Subscription} by it's UUID
<p>
Returns information about a single subscription.
@param uuid UUID of the subscription to preview an update for
@return Su... | java | public Subscription updateSubscriptionPreview(final String uuid, final SubscriptionUpdate subscriptionUpdate) {
return doPOST(Subscriptions.SUBSCRIPTIONS_RESOURCE
+ "/" + uuid + "/preview",
subscriptionUpdate,
Subscription.class);
} | [
"public",
"Subscription",
"updateSubscriptionPreview",
"(",
"final",
"String",
"uuid",
",",
"final",
"SubscriptionUpdate",
"subscriptionUpdate",
")",
"{",
"return",
"doPOST",
"(",
"Subscriptions",
".",
"SUBSCRIPTIONS_RESOURCE",
"+",
"\"/\"",
"+",
"uuid",
"+",
"\"/prev... | Preview an update to a particular {@link Subscription} by it's UUID
<p>
Returns information about a single subscription.
@param uuid UUID of the subscription to preview an update for
@return Subscription the updated subscription preview | [
"Preview",
"an",
"update",
"to",
"a",
"particular",
"{",
"@link",
"Subscription",
"}",
"by",
"it",
"s",
"UUID",
"<p",
">",
"Returns",
"information",
"about",
"a",
"single",
"subscription",
"."
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L603-L608 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/normalization/KerasBatchNormalization.java | KerasBatchNormalization.getMomentumFromConfig | private double getMomentumFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
"""
Get BatchNormalization momentum parameter from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return momentum
@throws InvalidKerasConfigurationE... | java | private double getMomentumFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if (!innerConfig.containsKey(LAYER_FIELD_MOMENTUM))
throw new InvalidKerasConf... | [
"private",
"double",
"getMomentumFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"innerConfig",
"=",
"KerasLayerUtils",
".",
"getInnerLayer... | Get BatchNormalization momentum parameter from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return momentum
@throws InvalidKerasConfigurationException Invalid Keras config | [
"Get",
"BatchNormalization",
"momentum",
"parameter",
"from",
"Keras",
"layer",
"configuration",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/normalization/KerasBatchNormalization.java#L251-L257 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getLeagueEntries | public Future<Map<String, List<LeagueItem>>> getLeagueEntries(String... teamIds) {
"""
Get a listing of all league entries in the teams' leagues
@param teamIds The ids of the teams
@return A mapping of teamIds to lists of league entries
@see <a href=https://developer.riotgames.com/api/methods#!/593/1861>Officia... | java | public Future<Map<String, List<LeagueItem>>> getLeagueEntries(String... teamIds) {
return new ApiFuture<>(() -> handler.getLeagueEntries(teamIds));
} | [
"public",
"Future",
"<",
"Map",
"<",
"String",
",",
"List",
"<",
"LeagueItem",
">",
">",
">",
"getLeagueEntries",
"(",
"String",
"...",
"teamIds",
")",
"{",
"return",
"new",
"ApiFuture",
"<>",
"(",
"(",
")",
"->",
"handler",
".",
"getLeagueEntries",
"(",... | Get a listing of all league entries in the teams' leagues
@param teamIds The ids of the teams
@return A mapping of teamIds to lists of league entries
@see <a href=https://developer.riotgames.com/api/methods#!/593/1861>Official API documentation</a> | [
"Get",
"a",
"listing",
"of",
"all",
"league",
"entries",
"in",
"the",
"teams",
"leagues"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L295-L297 |
samskivert/samskivert | src/main/java/com/samskivert/util/Queue.java | Queue.append0 | protected void append0 (T item, boolean notify) {
"""
Internal append method. If subclassing queue, be sure to call
this method from inside a synchronized block.
"""
if (_count == _size) {
makeMoreRoom();
}
_items[_end] = item;
_end = (_end + 1) % _size;
_co... | java | protected void append0 (T item, boolean notify)
{
if (_count == _size) {
makeMoreRoom();
}
_items[_end] = item;
_end = (_end + 1) % _size;
_count++;
if (notify) {
notify();
}
} | [
"protected",
"void",
"append0",
"(",
"T",
"item",
",",
"boolean",
"notify",
")",
"{",
"if",
"(",
"_count",
"==",
"_size",
")",
"{",
"makeMoreRoom",
"(",
")",
";",
"}",
"_items",
"[",
"_end",
"]",
"=",
"item",
";",
"_end",
"=",
"(",
"_end",
"+",
"... | Internal append method. If subclassing queue, be sure to call
this method from inside a synchronized block. | [
"Internal",
"append",
"method",
".",
"If",
"subclassing",
"queue",
"be",
"sure",
"to",
"call",
"this",
"method",
"from",
"inside",
"a",
"synchronized",
"block",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Queue.java#L107-L119 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/route/RouteDispatcher.java | RouteDispatcher.onPreDispatch | protected void onPreDispatch(Request request, Response response) {
"""
Executes onPreDispatch of registered route pre-dispatch listeners.
@param request
@param response
"""
application.getRoutePreDispatchListeners().onPreDispatch(request, response);
} | java | protected void onPreDispatch(Request request, Response response) {
application.getRoutePreDispatchListeners().onPreDispatch(request, response);
} | [
"protected",
"void",
"onPreDispatch",
"(",
"Request",
"request",
",",
"Response",
"response",
")",
"{",
"application",
".",
"getRoutePreDispatchListeners",
"(",
")",
".",
"onPreDispatch",
"(",
"request",
",",
"response",
")",
";",
"}"
] | Executes onPreDispatch of registered route pre-dispatch listeners.
@param request
@param response | [
"Executes",
"onPreDispatch",
"of",
"registered",
"route",
"pre",
"-",
"dispatch",
"listeners",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/route/RouteDispatcher.java#L111-L113 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newWasInvalidatedBy | public WasInvalidatedBy newWasInvalidatedBy(QualifiedName id, QualifiedName entity, QualifiedName activity, XMLGregorianCalendar time, Collection<Attribute> attributes) {
"""
/* (non-Javadoc)
@see org.openprovenance.prov.model.ModelConstructor#newWasInvalidatedBy(org.openprovenance.model.QualifiedName, org.openpr... | java | public WasInvalidatedBy newWasInvalidatedBy(QualifiedName id, QualifiedName entity, QualifiedName activity, XMLGregorianCalendar time, Collection<Attribute> attributes) {
WasInvalidatedBy res=newWasInvalidatedBy(id,entity,activity);
res.setTime(time);
setAttributes(res, attributes);
return res;
} | [
"public",
"WasInvalidatedBy",
"newWasInvalidatedBy",
"(",
"QualifiedName",
"id",
",",
"QualifiedName",
"entity",
",",
"QualifiedName",
"activity",
",",
"XMLGregorianCalendar",
"time",
",",
"Collection",
"<",
"Attribute",
">",
"attributes",
")",
"{",
"WasInvalidatedBy",
... | /* (non-Javadoc)
@see org.openprovenance.prov.model.ModelConstructor#newWasInvalidatedBy(org.openprovenance.model.QualifiedName, org.openprovenance.model.QualifiedName, org.openprovenance.model.QualifiedName, javax.xml.datatype.XMLGregorianCalendar, java.util.Collection) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L1470-L1475 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/cache/ObjectCacheJCSPerClassImpl.java | ObjectCacheJCSPerClassImpl.getCachePerClass | private ObjectCache getCachePerClass(Class objectClass, int methodCall) {
"""
Gets the cache for the given class
@param objectClass The class to look up the cache for
@return The cache
"""
ObjectCache cache = (ObjectCache) cachesByClass.get(objectClass.getName());
if (cache =... | java | private ObjectCache getCachePerClass(Class objectClass, int methodCall)
{
ObjectCache cache = (ObjectCache) cachesByClass.get(objectClass.getName());
if (cache == null && methodCall == AbstractMetaCache.METHOD_CACHE)
{
/**
* the cache wasn't found, and the cach... | [
"private",
"ObjectCache",
"getCachePerClass",
"(",
"Class",
"objectClass",
",",
"int",
"methodCall",
")",
"{",
"ObjectCache",
"cache",
"=",
"(",
"ObjectCache",
")",
"cachesByClass",
".",
"get",
"(",
"objectClass",
".",
"getName",
"(",
")",
")",
";",
"if",
"(... | Gets the cache for the given class
@param objectClass The class to look up the cache for
@return The cache | [
"Gets",
"the",
"cache",
"for",
"the",
"given",
"class"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/cache/ObjectCacheJCSPerClassImpl.java#L108-L121 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/message/SQSMessage.java | SQSMessage.getPrimitiveProperty | <T> T getPrimitiveProperty(String property, Class<T> type) throws JMSException {
"""
Get the value for a property that represents a java primitive(e.g. int or
long).
@param property
The name of the property to get.
@param type
The type of the property.
@return the converted value for the property.
@throws... | java | <T> T getPrimitiveProperty(String property, Class<T> type) throws JMSException {
if (property == null) {
throw new NullPointerException("Property name is null");
}
Object value = getObjectProperty(property);
if (value == null) {
return handleNullPropertyValue(prop... | [
"<",
"T",
">",
"T",
"getPrimitiveProperty",
"(",
"String",
"property",
",",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"property",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Property name is nu... | Get the value for a property that represents a java primitive(e.g. int or
long).
@param property
The name of the property to get.
@param type
The type of the property.
@return the converted value for the property.
@throws JMSException
On internal error.
@throws MessageFormatException
If the property cannot be converte... | [
"Get",
"the",
"value",
"for",
"a",
"property",
"that",
"represents",
"a",
"java",
"primitive",
"(",
"e",
".",
"g",
".",
"int",
"or",
"long",
")",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/message/SQSMessage.java#L457-L471 |
bwkimmel/jdcp | jdcp-console/src/main/java/ca/eandb/jdcp/client/ScriptCommand.java | ScriptCommand.getScriptEngine | private ScriptEngine getScriptEngine(ScriptEngineManager factory, Options options) {
"""
Gets the <code>ScriptEngine</code> to use for interpreting the script.
@param factory The <code>ScriptEngineManager</code> to use to create the
<code>ScriptEngine</code>.
@param options The command line options for this
<c... | java | private ScriptEngine getScriptEngine(ScriptEngineManager factory, Options options) {
if (options.language != null) {
return factory.getEngineByName(options.language);
}
if (options.file != null) {
String fileName = options.file.getName();
int separator = fileName.lastIndexOf('.');
if... | [
"private",
"ScriptEngine",
"getScriptEngine",
"(",
"ScriptEngineManager",
"factory",
",",
"Options",
"options",
")",
"{",
"if",
"(",
"options",
".",
"language",
"!=",
"null",
")",
"{",
"return",
"factory",
".",
"getEngineByName",
"(",
"options",
".",
"language",... | Gets the <code>ScriptEngine</code> to use for interpreting the script.
@param factory The <code>ScriptEngineManager</code> to use to create the
<code>ScriptEngine</code>.
@param options The command line options for this
<code>ScriptCommand</code>.
@return The <code>ScriptEngine</code> to use. | [
"Gets",
"the",
"<code",
">",
"ScriptEngine<",
"/",
"code",
">",
"to",
"use",
"for",
"interpreting",
"the",
"script",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-console/src/main/java/ca/eandb/jdcp/client/ScriptCommand.java#L121-L134 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.createUrl | public static URL createUrl(final URL baseUrl, final String path, final String filename) {
"""
Creates an URL based on a directory a relative path and a filename.
@param baseUrl
Directory URL with or without slash ("/") at the end of the string - Cannot be <code>null</code>.
@param path
Relative path inside ... | java | public static URL createUrl(final URL baseUrl, final String path, final String filename) {
checkNotNull("baseUrl", baseUrl);
checkNotNull("filename", filename);
try {
String baseUrlStr = baseUrl.toString();
if (!baseUrlStr.endsWith(SLASH)) {
baseUrlS... | [
"public",
"static",
"URL",
"createUrl",
"(",
"final",
"URL",
"baseUrl",
",",
"final",
"String",
"path",
",",
"final",
"String",
"filename",
")",
"{",
"checkNotNull",
"(",
"\"baseUrl\"",
",",
"baseUrl",
")",
";",
"checkNotNull",
"(",
"\"filename\"",
",",
"fil... | Creates an URL based on a directory a relative path and a filename.
@param baseUrl
Directory URL with or without slash ("/") at the end of the string - Cannot be <code>null</code>.
@param path
Relative path inside the base URL (with or without slash ("/") at the end of the string) - Can be <code>null</code> or an
empt... | [
"Creates",
"an",
"URL",
"based",
"on",
"a",
"directory",
"a",
"relative",
"path",
"and",
"a",
"filename",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L473-L495 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/Conversions.java | Conversions.checkComponentType | private static Object checkComponentType(Object array, Class<?> expectedComponentType) {
"""
Checks the component type of the given array against the expected component type.
@param array
the array to be checked. May not be <code>null</code>.
@param expectedComponentType
the expected component type of the ar... | java | private static Object checkComponentType(Object array, Class<?> expectedComponentType) {
Class<?> actualComponentType = array.getClass().getComponentType();
if (!expectedComponentType.isAssignableFrom(actualComponentType)) {
throw new ArrayStoreException(
String.format("The expected component type %s is not... | [
"private",
"static",
"Object",
"checkComponentType",
"(",
"Object",
"array",
",",
"Class",
"<",
"?",
">",
"expectedComponentType",
")",
"{",
"Class",
"<",
"?",
">",
"actualComponentType",
"=",
"array",
".",
"getClass",
"(",
")",
".",
"getComponentType",
"(",
... | Checks the component type of the given array against the expected component type.
@param array
the array to be checked. May not be <code>null</code>.
@param expectedComponentType
the expected component type of the array. May not be <code>null</code>.
@return the unchanged array.
@throws ArrayStoreException
if the expe... | [
"Checks",
"the",
"component",
"type",
"of",
"the",
"given",
"array",
"against",
"the",
"expected",
"component",
"type",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/Conversions.java#L226-L234 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/ByteArrayUtil.java | ByteArrayUtil.getIntLE | public static int getIntLE(final byte[] array, final int offset) {
"""
Get a <i>int</i> from the given byte array starting at the given offset
in little endian order.
There is no bounds checking.
@param array source byte array
@param offset source offset
@return the <i>int</i>
"""
return ( array[offs... | java | public static int getIntLE(final byte[] array, final int offset) {
return ( array[offset ] & 0XFF )
| ((array[offset + 1] & 0XFF) << 8)
| ((array[offset + 2] & 0XFF) << 16)
| ((array[offset + 3] & 0XFF) << 24);
} | [
"public",
"static",
"int",
"getIntLE",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
")",
"{",
"return",
"(",
"array",
"[",
"offset",
"]",
"&",
"0XFF",
")",
"|",
"(",
"(",
"array",
"[",
"offset",
"+",
"1",
"]",
"&",
"0XF... | Get a <i>int</i> from the given byte array starting at the given offset
in little endian order.
There is no bounds checking.
@param array source byte array
@param offset source offset
@return the <i>int</i> | [
"Get",
"a",
"<i",
">",
"int<",
"/",
"i",
">",
"from",
"the",
"given",
"byte",
"array",
"starting",
"at",
"the",
"given",
"offset",
"in",
"little",
"endian",
"order",
".",
"There",
"is",
"no",
"bounds",
"checking",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/ByteArrayUtil.java#L65-L70 |
sahan/RoboZombie | robozombie/src/main/java/com/lonepulse/robozombie/util/Assert.java | Assert.assertNotNull | public static <T extends Object> T assertNotNull(T arg, String message) {
"""
<p>Asserts that the given argument is <b>{@code not null}</b>. If the argument is {@code null}
a {@link NullPointerException} will be thrown with the provided message.</p>
@param arg
the argument to be asserted as being {@code not n... | java | public static <T extends Object> T assertNotNull(T arg, String message) {
if(arg == null) {
throw new NullPointerException(message);
}
return arg;
} | [
"public",
"static",
"<",
"T",
"extends",
"Object",
">",
"T",
"assertNotNull",
"(",
"T",
"arg",
",",
"String",
"message",
")",
"{",
"if",
"(",
"arg",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"message",
")",
";",
"}",
"return"... | <p>Asserts that the given argument is <b>{@code not null}</b>. If the argument is {@code null}
a {@link NullPointerException} will be thrown with the provided message.</p>
@param arg
the argument to be asserted as being {@code not null}
<br><br>
@param arg
the message to be provided with the {@link NullPointerExceptio... | [
"<p",
">",
"Asserts",
"that",
"the",
"given",
"argument",
"is",
"<b",
">",
"{",
"@code",
"not",
"null",
"}",
"<",
"/",
"b",
">",
".",
"If",
"the",
"argument",
"is",
"{",
"@code",
"null",
"}",
"a",
"{",
"@link",
"NullPointerException",
"}",
"will",
... | train | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/com/lonepulse/robozombie/util/Assert.java#L126-L134 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/Integration.java | Integration.withRequestParameters | public Integration withRequestParameters(java.util.Map<String, String> requestParameters) {
"""
<p>
A key-value map specifying request parameters that are passed from the method request to the backend. The key is
an integration request parameter name and the associated value is a method request parameter value o... | java | public Integration withRequestParameters(java.util.Map<String, String> requestParameters) {
setRequestParameters(requestParameters);
return this;
} | [
"public",
"Integration",
"withRequestParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestParameters",
")",
"{",
"setRequestParameters",
"(",
"requestParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A key-value map specifying request parameters that are passed from the method request to the backend. The key is
an integration request parameter name and the associated value is a method request parameter value or static
value that must be enclosed within single quotes and pre-encoded as required by the backend. T... | [
"<p",
">",
"A",
"key",
"-",
"value",
"map",
"specifying",
"request",
"parameters",
"that",
"are",
"passed",
"from",
"the",
"method",
"request",
"to",
"the",
"backend",
".",
"The",
"key",
"is",
"an",
"integration",
"request",
"parameter",
"name",
"and",
"th... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/Integration.java#L1153-L1156 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceStrategyFactory.java | TaskInstanceStrategyFactory.getRoutingStrategy | public static RoutingStrategy getRoutingStrategy(String attributeValue, Long processInstanceId) throws StrategyException {
"""
Returns a workgroup routing strategy instance based on an attribute value and bundle spec
which can consist of either the routing strategy logical name, or an xml document.
@param attrib... | java | public static RoutingStrategy getRoutingStrategy(String attributeValue, Long processInstanceId) throws StrategyException {
Package packageVO = processInstanceId == null ? null : getPackage(processInstanceId);
TaskInstanceStrategyFactory factory = getInstance();
String className = factory.getStra... | [
"public",
"static",
"RoutingStrategy",
"getRoutingStrategy",
"(",
"String",
"attributeValue",
",",
"Long",
"processInstanceId",
")",
"throws",
"StrategyException",
"{",
"Package",
"packageVO",
"=",
"processInstanceId",
"==",
"null",
"?",
"null",
":",
"getPackage",
"("... | Returns a workgroup routing strategy instance based on an attribute value and bundle spec
which can consist of either the routing strategy logical name, or an xml document.
@param attributeValue
@param processInstanceId
@return
@throws StrategyException | [
"Returns",
"a",
"workgroup",
"routing",
"strategy",
"instance",
"based",
"on",
"an",
"attribute",
"value",
"and",
"bundle",
"spec",
"which",
"can",
"consist",
"of",
"either",
"the",
"routing",
"strategy",
"logical",
"name",
"or",
"an",
"xml",
"document",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceStrategyFactory.java#L71-L77 |
EdwardRaff/JSAT | JSAT/src/jsat/math/optimization/ModifiedOWLQN.java | ModifiedOWLQN.setBeta | public void setBeta(double beta) {
"""
Sets the shrinkage term used for the line search.
@param beta the line search shrinkage term
"""
if(beta <= 0 || beta >= 1 || Double.isNaN(beta))
throw new IllegalArgumentException("shrinkage term must be in (0, 1), not " + beta);
this.beta =... | java | public void setBeta(double beta)
{
if(beta <= 0 || beta >= 1 || Double.isNaN(beta))
throw new IllegalArgumentException("shrinkage term must be in (0, 1), not " + beta);
this.beta = beta;
} | [
"public",
"void",
"setBeta",
"(",
"double",
"beta",
")",
"{",
"if",
"(",
"beta",
"<=",
"0",
"||",
"beta",
">=",
"1",
"||",
"Double",
".",
"isNaN",
"(",
"beta",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"shrinkage term must be in (0, 1), no... | Sets the shrinkage term used for the line search.
@param beta the line search shrinkage term | [
"Sets",
"the",
"shrinkage",
"term",
"used",
"for",
"the",
"line",
"search",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/optimization/ModifiedOWLQN.java#L176-L181 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/exception/ContextedException.java | ContextedException.setContextValue | @Override
public ContextedException setContextValue(final String label, final Object value) {
"""
Sets information helpful to a developer in diagnosing and correcting the problem.
For the information to be meaningful, the value passed should have a reasonable
toString() implementation.
Any existing values w... | java | @Override
public ContextedException setContextValue(final String label, final Object value) {
exceptionContext.setContextValue(label, value);
return this;
} | [
"@",
"Override",
"public",
"ContextedException",
"setContextValue",
"(",
"final",
"String",
"label",
",",
"final",
"Object",
"value",
")",
"{",
"exceptionContext",
".",
"setContextValue",
"(",
"label",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Sets information helpful to a developer in diagnosing and correcting the problem.
For the information to be meaningful, the value passed should have a reasonable
toString() implementation.
Any existing values with the same labels are removed before the new one is added.
<p>
Note: This exception is only serializable if ... | [
"Sets",
"information",
"helpful",
"to",
"a",
"developer",
"in",
"diagnosing",
"and",
"correcting",
"the",
"problem",
".",
"For",
"the",
"information",
"to",
"be",
"meaningful",
"the",
"value",
"passed",
"should",
"have",
"a",
"reasonable",
"toString",
"()",
"i... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ContextedException.java#L191-L195 |
zxing/zxing | core/src/main/java/com/google/zxing/pdf417/decoder/DecodedBitStreamParser.java | DecodedBitStreamParser.decodeBase900toBase10 | private static String decodeBase900toBase10(int[] codewords, int count) throws FormatException {
"""
/*
EXAMPLE
Encode the fifteen digit numeric string 000213298174000
Prefix the numeric string with a 1 and set the initial value of
t = 1 000 213 298 174 000
Calculate codeword 0
d0 = 1 000 213 298 174 000 mod... | java | private static String decodeBase900toBase10(int[] codewords, int count) throws FormatException {
BigInteger result = BigInteger.ZERO;
for (int i = 0; i < count; i++) {
result = result.add(EXP900[count - i - 1].multiply(BigInteger.valueOf(codewords[i])));
}
String resultString = result.toString();
... | [
"private",
"static",
"String",
"decodeBase900toBase10",
"(",
"int",
"[",
"]",
"codewords",
",",
"int",
"count",
")",
"throws",
"FormatException",
"{",
"BigInteger",
"result",
"=",
"BigInteger",
".",
"ZERO",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | /*
EXAMPLE
Encode the fifteen digit numeric string 000213298174000
Prefix the numeric string with a 1 and set the initial value of
t = 1 000 213 298 174 000
Calculate codeword 0
d0 = 1 000 213 298 174 000 mod 900 = 200
t = 1 000 213 298 174 000 div 900 = 1 111 348 109 082
Calculate codeword 1
d1 = 1 111 348 109 082 mo... | [
"/",
"*",
"EXAMPLE",
"Encode",
"the",
"fifteen",
"digit",
"numeric",
"string",
"000213298174000",
"Prefix",
"the",
"numeric",
"string",
"with",
"a",
"1",
"and",
"set",
"the",
"initial",
"value",
"of",
"t",
"=",
"1",
"000",
"213",
"298",
"174",
"000",
"Ca... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/pdf417/decoder/DecodedBitStreamParser.java#L705-L715 |
kiegroup/jbpm | jbpm-services/jbpm-kie-services/src/main/java/org/jbpm/kie/services/impl/CommonUtils.java | CommonUtils.getCallbackUserRoles | public static List<String> getCallbackUserRoles(UserGroupCallback userGroupCallback, String userId) {
"""
to compensate https://hibernate.atlassian.net/browse/HHH-8091 add empty element to the roles in case it's empty
"""
List<String> roles = userGroupCallback != null ? userGroupCallback.getGroupsForUser(use... | java | public static List<String> getCallbackUserRoles(UserGroupCallback userGroupCallback, String userId) {
List<String> roles = userGroupCallback != null ? userGroupCallback.getGroupsForUser(userId) : new ArrayList<>();
if (roles == null || roles.isEmpty()) {
roles = new ArrayList<>();
roles.add("");
}
return... | [
"public",
"static",
"List",
"<",
"String",
">",
"getCallbackUserRoles",
"(",
"UserGroupCallback",
"userGroupCallback",
",",
"String",
"userId",
")",
"{",
"List",
"<",
"String",
">",
"roles",
"=",
"userGroupCallback",
"!=",
"null",
"?",
"userGroupCallback",
".",
... | to compensate https://hibernate.atlassian.net/browse/HHH-8091 add empty element to the roles in case it's empty | [
"to",
"compensate",
"https",
":",
"//",
"hibernate",
".",
"atlassian",
".",
"net",
"/",
"browse",
"/",
"HHH",
"-",
"8091",
"add",
"empty",
"element",
"to",
"the",
"roles",
"in",
"case",
"it",
"s",
"empty"
] | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-services/jbpm-kie-services/src/main/java/org/jbpm/kie/services/impl/CommonUtils.java#L60-L68 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/print/OneSelect.java | OneSelect.addLinkToSelectPart | public void addLinkToSelectPart(final String _linkTo)
throws EFapsException {
"""
Add the name of the attribute the link must go to, evaluated from an
<code>linkTo[ATTRIBUTENAME]</code> part of an select statement.
@param _linkTo name of the attribute the link must go to
@throws EFapsException the e... | java | public void addLinkToSelectPart(final String _linkTo)
throws EFapsException
{
final Type type;
// if a previous select exists it is based on the previous select,
// else it is based on the basic table
if (this.selectParts.size() > 0) {
type = this.selectParts.get(... | [
"public",
"void",
"addLinkToSelectPart",
"(",
"final",
"String",
"_linkTo",
")",
"throws",
"EFapsException",
"{",
"final",
"Type",
"type",
";",
"// if a previous select exists it is based on the previous select,",
"// else it is based on the basic table",
"if",
"(",
"this",
"... | Add the name of the attribute the link must go to, evaluated from an
<code>linkTo[ATTRIBUTENAME]</code> part of an select statement.
@param _linkTo name of the attribute the link must go to
@throws EFapsException the e faps exception | [
"Add",
"the",
"name",
"of",
"the",
"attribute",
"the",
"link",
"must",
"go",
"to",
"evaluated",
"from",
"an",
"<code",
">",
"linkTo",
"[",
"ATTRIBUTENAME",
"]",
"<",
"/",
"code",
">",
"part",
"of",
"an",
"select",
"statement",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/print/OneSelect.java#L284-L297 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.notNullNotEquals | public static <T> T notNullNotEquals (final T aValue, final String sName, @Nonnull final T aUnexpectedValue) {
"""
Check that the passed value is not <code>null</code> and not equal to the
provided value.
@param <T>
Type to be checked and returned
@param aValue
The value to check. May not be <code>null</cod... | java | public static <T> T notNullNotEquals (final T aValue, final String sName, @Nonnull final T aUnexpectedValue)
{
if (isEnabled ())
return notNullNotEquals (aValue, () -> sName, aUnexpectedValue);
return aValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"notNullNotEquals",
"(",
"final",
"T",
"aValue",
",",
"final",
"String",
"sName",
",",
"@",
"Nonnull",
"final",
"T",
"aUnexpectedValue",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"return",
"notNullNotEquals",
... | Check that the passed value is not <code>null</code> and not equal to the
provided value.
@param <T>
Type to be checked and returned
@param aValue
The value to check. May not be <code>null</code>.
@param sName
The name of the value (e.g. the parameter name)
@param aUnexpectedValue
The value that may not be equal to aV... | [
"Check",
"that",
"the",
"passed",
"value",
"is",
"not",
"<code",
">",
"null<",
"/",
"code",
">",
"and",
"not",
"equal",
"to",
"the",
"provided",
"value",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L1316-L1321 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ConcurrentSkipListMap.java | Index.unlink | final boolean unlink(Index<K,V> succ) {
"""
Tries to CAS right field to skip over apparent successor
succ. Fails (forcing a retraversal by caller) if this node
is known to be deleted.
@param succ the expected current successor
@return true if successful
"""
return node.value != null && casRigh... | java | final boolean unlink(Index<K,V> succ) {
return node.value != null && casRight(succ, succ.right);
} | [
"final",
"boolean",
"unlink",
"(",
"Index",
"<",
"K",
",",
"V",
">",
"succ",
")",
"{",
"return",
"node",
".",
"value",
"!=",
"null",
"&&",
"casRight",
"(",
"succ",
",",
"succ",
".",
"right",
")",
";",
"}"
] | Tries to CAS right field to skip over apparent successor
succ. Fails (forcing a retraversal by caller) if this node
is known to be deleted.
@param succ the expected current successor
@return true if successful | [
"Tries",
"to",
"CAS",
"right",
"field",
"to",
"skip",
"over",
"apparent",
"successor",
"succ",
".",
"Fails",
"(",
"forcing",
"a",
"retraversal",
"by",
"caller",
")",
"if",
"this",
"node",
"is",
"known",
"to",
"be",
"deleted",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ConcurrentSkipListMap.java#L617-L619 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernel.java | FactoryKernel.random1D_F32 | public static Kernel1D_F32 random1D_F32(int width , int offset, float min, float max, Random rand) {
"""
Creates a random 1D kernel drawn from a uniform distribution.
@param width Kernel's width.
@param offset Offset for element zero in the kernel
@param min minimum value.
@param max maximum value.
@param r... | java | public static Kernel1D_F32 random1D_F32(int width , int offset, float min, float max, Random rand) {
Kernel1D_F32 ret = new Kernel1D_F32(width,offset);
float range = max - min;
for (int i = 0; i < ret.data.length; i++) {
ret.data[i] = rand.nextFloat() * range + min;
}
return ret;
} | [
"public",
"static",
"Kernel1D_F32",
"random1D_F32",
"(",
"int",
"width",
",",
"int",
"offset",
",",
"float",
"min",
",",
"float",
"max",
",",
"Random",
"rand",
")",
"{",
"Kernel1D_F32",
"ret",
"=",
"new",
"Kernel1D_F32",
"(",
"width",
",",
"offset",
")",
... | Creates a random 1D kernel drawn from a uniform distribution.
@param width Kernel's width.
@param offset Offset for element zero in the kernel
@param min minimum value.
@param max maximum value.
@param rand Random number generator.
@return Randomized kernel. | [
"Creates",
"a",
"random",
"1D",
"kernel",
"drawn",
"from",
"a",
"uniform",
"distribution",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernel.java#L244-L253 |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java | RequestParam.get | public static @Nullable String get(@NotNull Map<String, String[]> requestMap, @NotNull String param) {
"""
Returns a request parameter.<br>
In addition the method fixes problems with incorrect UTF-8 characters returned by the servlet engine.
All character data is converted from ISO-8859-1 to UTF-8.
@param reque... | java | public static @Nullable String get(@NotNull Map<String, String[]> requestMap, @NotNull String param) {
String value = null;
String[] valueArray = requestMap.get(param);
if (valueArray != null && valueArray.length > 0) {
value = valueArray[0];
}
// convert encoding to UTF-8 if not form encoding... | [
"public",
"static",
"@",
"Nullable",
"String",
"get",
"(",
"@",
"NotNull",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"requestMap",
",",
"@",
"NotNull",
"String",
"param",
")",
"{",
"String",
"value",
"=",
"null",
";",
"String",
"[",
"]",
"v... | Returns a request parameter.<br>
In addition the method fixes problems with incorrect UTF-8 characters returned by the servlet engine.
All character data is converted from ISO-8859-1 to UTF-8.
@param requestMap Request Parameter map.
@param param Parameter name.
@return Parameter value or null if it is not set. | [
"Returns",
"a",
"request",
"parameter",
".",
"<br",
">",
"In",
"addition",
"the",
"method",
"fixes",
"problems",
"with",
"incorrect",
"UTF",
"-",
"8",
"characters",
"returned",
"by",
"the",
"servlet",
"engine",
".",
"All",
"character",
"data",
"is",
"convert... | train | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java#L126-L137 |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java | WebDriverTool.openNewWindow | public String openNewWindow(final By openClickBy, final long timeoutSeconds) {
"""
Opens a new window and switches to it. The window to switch to is determined by diffing
the given {@code existingWindowHandles} with the current ones. The difference must be
exactly one window handle which is then used to switch t... | java | public String openNewWindow(final By openClickBy, final long timeoutSeconds) {
checkTopmostElement(openClickBy);
return openNewWindow(() -> sendKeys(openClickBy, Keys.chord(Keys.CONTROL, Keys.RETURN)), timeoutSeconds);
} | [
"public",
"String",
"openNewWindow",
"(",
"final",
"By",
"openClickBy",
",",
"final",
"long",
"timeoutSeconds",
")",
"{",
"checkTopmostElement",
"(",
"openClickBy",
")",
";",
"return",
"openNewWindow",
"(",
"(",
")",
"->",
"sendKeys",
"(",
"openClickBy",
",",
... | Opens a new window and switches to it. The window to switch to is determined by diffing
the given {@code existingWindowHandles} with the current ones. The difference must be
exactly one window handle which is then used to switch to.
@param openClickBy
identifies the element to click on in order to open the new window
... | [
"Opens",
"a",
"new",
"window",
"and",
"switches",
"to",
"it",
".",
"The",
"window",
"to",
"switch",
"to",
"is",
"determined",
"by",
"diffing",
"the",
"given",
"{",
"@code",
"existingWindowHandles",
"}",
"with",
"the",
"current",
"ones",
".",
"The",
"differ... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L765-L768 |
FXMisc/WellBehavedFX | src/main/java/org/fxmisc/wellbehaved/event/Nodes.java | Nodes.pushInputMap | public static void pushInputMap(Node node, InputMap<?> im) {
"""
Removes the currently installed {@link InputMap} (InputMap1) on the given node and installs the {@code im}
(InputMap2) in its place. When finished, InputMap2 can be uninstalled and InputMap1 reinstalled via
{@link #popInputMap(Node)}. Multiple Inpu... | java | public static void pushInputMap(Node node, InputMap<?> im) {
// store currently installed im; getInputMap calls init
InputMap<?> previousInputMap = getInputMap(node);
getStack(node).push(previousInputMap);
// completely override the previous one with the given one
setInputMapUns... | [
"public",
"static",
"void",
"pushInputMap",
"(",
"Node",
"node",
",",
"InputMap",
"<",
"?",
">",
"im",
")",
"{",
"// store currently installed im; getInputMap calls init",
"InputMap",
"<",
"?",
">",
"previousInputMap",
"=",
"getInputMap",
"(",
"node",
")",
";",
... | Removes the currently installed {@link InputMap} (InputMap1) on the given node and installs the {@code im}
(InputMap2) in its place. When finished, InputMap2 can be uninstalled and InputMap1 reinstalled via
{@link #popInputMap(Node)}. Multiple InputMaps can be installed so that InputMap(n) will be installed over
InputM... | [
"Removes",
"the",
"currently",
"installed",
"{"
] | train | https://github.com/FXMisc/WellBehavedFX/blob/ca889734481f5439655ca8deb6f742964b5654b0/src/main/java/org/fxmisc/wellbehaved/event/Nodes.java#L88-L95 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/Criteria.java | Criteria.sloppy | public Criteria sloppy(String phrase, int distance) {
"""
Crates new {@link Predicate} with trailing {@code ~} followed by distance
@param phrase
@param distance
@return
"""
if (distance <= 0) {
throw new InvalidDataAccessApiUsageException("Slop distance has to be greater than 0.");
}
if (!Strin... | java | public Criteria sloppy(String phrase, int distance) {
if (distance <= 0) {
throw new InvalidDataAccessApiUsageException("Slop distance has to be greater than 0.");
}
if (!StringUtils.contains(phrase, CRITERIA_VALUE_SEPERATOR)) {
throw new InvalidDataAccessApiUsageException("Phrase must consist of multiple ... | [
"public",
"Criteria",
"sloppy",
"(",
"String",
"phrase",
",",
"int",
"distance",
")",
"{",
"if",
"(",
"distance",
"<=",
"0",
")",
"{",
"throw",
"new",
"InvalidDataAccessApiUsageException",
"(",
"\"Slop distance has to be greater than 0.\"",
")",
";",
"}",
"if",
... | Crates new {@link Predicate} with trailing {@code ~} followed by distance
@param phrase
@param distance
@return | [
"Crates",
"new",
"{",
"@link",
"Predicate",
"}",
"with",
"trailing",
"{",
"@code",
"~",
"}",
"followed",
"by",
"distance"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/Criteria.java#L356-L367 |
alkacon/opencms-core | src/org/opencms/site/xmlsitemap/CmsXmlSitemapCache.java | CmsXmlSitemapCache.put | public void put(String key, String value) {
"""
Stores an XML sitemap in the cache.<p>
@param key the XML sitemap key (usually the root path of the sitemap.xml)
@param value the XML sitemap content
"""
LOG.info("Caching sitemap for key " + key + ", size = " + value.length());
m_cache.put(k... | java | public void put(String key, String value) {
LOG.info("Caching sitemap for key " + key + ", size = " + value.length());
m_cache.put(key, value);
} | [
"public",
"void",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Caching sitemap for key \"",
"+",
"key",
"+",
"\", size = \"",
"+",
"value",
".",
"length",
"(",
")",
")",
";",
"m_cache",
".",
"put",
"(",
"ke... | Stores an XML sitemap in the cache.<p>
@param key the XML sitemap key (usually the root path of the sitemap.xml)
@param value the XML sitemap content | [
"Stores",
"an",
"XML",
"sitemap",
"in",
"the",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/xmlsitemap/CmsXmlSitemapCache.java#L75-L79 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java | Long.getLong | public static Long getLong(String nm, long val) {
"""
Determines the {@code long} value of the system property
with the specified name.
<p>The first argument is treated as the name of a system
property. System properties are accessible through the {@link
java.lang.System#getProperty(java.lang.String)} metho... | java | public static Long getLong(String nm, long val) {
Long result = Long.getLong(nm, null);
return (result == null) ? Long.valueOf(val) : result;
} | [
"public",
"static",
"Long",
"getLong",
"(",
"String",
"nm",
",",
"long",
"val",
")",
"{",
"Long",
"result",
"=",
"Long",
".",
"getLong",
"(",
"nm",
",",
"null",
")",
";",
"return",
"(",
"result",
"==",
"null",
")",
"?",
"Long",
".",
"valueOf",
"(",... | Determines the {@code long} value of the system property
with the specified name.
<p>The first argument is treated as the name of a system
property. System properties are accessible through the {@link
java.lang.System#getProperty(java.lang.String)} method. The
string value of this property is then interpreted as a {@... | [
"Determines",
"the",
"{",
"@code",
"long",
"}",
"value",
"of",
"the",
"system",
"property",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Long.java#L1004-L1007 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java | BaseRequest.setHeaders | public void setHeaders(Map<String, List<String>> headerMap) {
"""
Sets headers for this resource request. Overrides all headers previously added.
@param headerMap A multimap containing the header names and corresponding values
"""
headers = new Headers.Builder();
for (Map.Entry<String, List... | java | public void setHeaders(Map<String, List<String>> headerMap) {
headers = new Headers.Builder();
for (Map.Entry<String, List<String>> e : headerMap.entrySet()) {
for (String headerValue : e.getValue()) {
addHeader(e.getKey(), headerValue);
}
}
} | [
"public",
"void",
"setHeaders",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headerMap",
")",
"{",
"headers",
"=",
"new",
"Headers",
".",
"Builder",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<... | Sets headers for this resource request. Overrides all headers previously added.
@param headerMap A multimap containing the header names and corresponding values | [
"Sets",
"headers",
"for",
"this",
"resource",
"request",
".",
"Overrides",
"all",
"headers",
"previously",
"added",
"."
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java#L296-L304 |
Red5/red5-server-common | src/main/java/org/red5/server/util/ScopeUtils.java | ScopeUtils.getScopeService | public static Object getScopeService(IScope scope, Class<?> intf, Class<?> defaultClass) {
"""
Returns scope service that implements a given interface.
@param scope
The scope service belongs to
@param intf
The interface the service must implement
@param defaultClass
Class that should be used to create a ne... | java | public static Object getScopeService(IScope scope, Class<?> intf, Class<?> defaultClass) {
return getScopeService(scope, intf, defaultClass, true);
} | [
"public",
"static",
"Object",
"getScopeService",
"(",
"IScope",
"scope",
",",
"Class",
"<",
"?",
">",
"intf",
",",
"Class",
"<",
"?",
">",
"defaultClass",
")",
"{",
"return",
"getScopeService",
"(",
"scope",
",",
"intf",
",",
"defaultClass",
",",
"true",
... | Returns scope service that implements a given interface.
@param scope
The scope service belongs to
@param intf
The interface the service must implement
@param defaultClass
Class that should be used to create a new service if no service was found.
@return Service object | [
"Returns",
"scope",
"service",
"that",
"implements",
"a",
"given",
"interface",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/ScopeUtils.java#L323-L325 |
ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java | OneShotSQLGeneratorEngine.collectVariableReferencesWithLeftJoin | private void collectVariableReferencesWithLeftJoin(Set<Variable> vars, Function atom) {
"""
Collects (recursively) the set of variables that participate in data atoms
(either in this atom directly or in nested ones, excluding those on the
right-hand side of left joins.
@param vars
@param atom
@return
""... | java | private void collectVariableReferencesWithLeftJoin(Set<Variable> vars, Function atom) {
if (atom.isDataFunction()) {
TermUtils.addReferencedVariablesTo(vars, atom);
}
else if (atom.isAlgebraFunction()) {
Predicate functionSymbol = atom.getFunctionSymbol();
if (functionSymbol.equals(datalogFactory.getSpar... | [
"private",
"void",
"collectVariableReferencesWithLeftJoin",
"(",
"Set",
"<",
"Variable",
">",
"vars",
",",
"Function",
"atom",
")",
"{",
"if",
"(",
"atom",
".",
"isDataFunction",
"(",
")",
")",
"{",
"TermUtils",
".",
"addReferencedVariablesTo",
"(",
"vars",
",... | Collects (recursively) the set of variables that participate in data atoms
(either in this atom directly or in nested ones, excluding those on the
right-hand side of left joins.
@param vars
@param atom
@return | [
"Collects",
"(",
"recursively",
")",
"the",
"set",
"of",
"variables",
"that",
"participate",
"in",
"data",
"atoms",
"(",
"either",
"in",
"this",
"atom",
"directly",
"or",
"in",
"nested",
"ones",
"excluding",
"those",
"on",
"the",
"right",
"-",
"hand",
"sid... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java#L815-L832 |
apache/incubator-gobblin | gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java | GobblinEncryptionProvider.buildStreamCryptoProvider | public StreamCodec buildStreamCryptoProvider(String algorithm, Map<String, Object> parameters) {
"""
Return a StreamEncryptor for the given algorithm and with appropriate parameters.
@param algorithm Algorithm to build
@param parameters Parameters for algorithm
@return A StreamEncoder for that algorithm
@throw... | java | public StreamCodec buildStreamCryptoProvider(String algorithm, Map<String, Object> parameters) {
switch (algorithm) {
case EncryptionConfigParser.ENCRYPTION_TYPE_ANY:
case "aes_rotating":
CredentialStore cs = CredentialStoreFactory.buildCredentialStore(parameters);
if (cs == null) {
... | [
"public",
"StreamCodec",
"buildStreamCryptoProvider",
"(",
"String",
"algorithm",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"switch",
"(",
"algorithm",
")",
"{",
"case",
"EncryptionConfigParser",
".",
"ENCRYPTION_TYPE_ANY",
":",
"case"... | Return a StreamEncryptor for the given algorithm and with appropriate parameters.
@param algorithm Algorithm to build
@param parameters Parameters for algorithm
@return A StreamEncoder for that algorithm
@throws IllegalArgumentException If the given algorithm/parameter pair cannot be built | [
"Return",
"a",
"StreamEncryptor",
"for",
"the",
"given",
"algorithm",
"and",
"with",
"appropriate",
"parameters",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java#L76-L106 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java | ConfluenceGreenPepper.getPageContent | public String getPageContent(Page page) {
"""
Retrieves the body of a page in HTML rendering.
@param page a {@link com.atlassian.confluence.pages.Page} object.
@return the body of a page in HTML rendering.
"""
try {
return getPageContent(page, false);
} catch (GreenPepperServerE... | java | public String getPageContent(Page page) {
try {
return getPageContent(page, false);
} catch (GreenPepperServerException e) {
return e.getMessage();
}
} | [
"public",
"String",
"getPageContent",
"(",
"Page",
"page",
")",
"{",
"try",
"{",
"return",
"getPageContent",
"(",
"page",
",",
"false",
")",
";",
"}",
"catch",
"(",
"GreenPepperServerException",
"e",
")",
"{",
"return",
"e",
".",
"getMessage",
"(",
")",
... | Retrieves the body of a page in HTML rendering.
@param page a {@link com.atlassian.confluence.pages.Page} object.
@return the body of a page in HTML rendering. | [
"Retrieves",
"the",
"body",
"of",
"a",
"page",
"in",
"HTML",
"rendering",
"."
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L467-L473 |
feedzai/pdb | src/main/java/com/feedzai/commons/sql/abstraction/engine/AbstractDatabaseEngine.java | AbstractDatabaseEngine.executePSUpdate | @Override
public synchronized Integer executePSUpdate(final String name) throws DatabaseEngineException, ConnectionResetException {
"""
Executes update on the specified prepared statement.
@param name The prepared statement name.
@throws DatabaseEngineException If the prepared statement does not exist or ... | java | @Override
public synchronized Integer executePSUpdate(final String name) throws DatabaseEngineException, ConnectionResetException {
final PreparedStatementCapsule ps = stmts.get(name);
if (ps == null) {
throw new DatabaseEngineRuntimeException(String.format("PreparedStatement named '%s' ... | [
"@",
"Override",
"public",
"synchronized",
"Integer",
"executePSUpdate",
"(",
"final",
"String",
"name",
")",
"throws",
"DatabaseEngineException",
",",
"ConnectionResetException",
"{",
"final",
"PreparedStatementCapsule",
"ps",
"=",
"stmts",
".",
"get",
"(",
"name",
... | Executes update on the specified prepared statement.
@param name The prepared statement name.
@throws DatabaseEngineException If the prepared statement does not exist or something goes wrong while executing.
@throws ConnectionResetException If the connection is down and reestablishment occurs. If this happens, the us... | [
"Executes",
"update",
"on",
"the",
"specified",
"prepared",
"statement",
"."
] | train | https://github.com/feedzai/pdb/blob/fe07ca08417e0ddcd620a36aa1fdbca7f338be98/src/main/java/com/feedzai/commons/sql/abstraction/engine/AbstractDatabaseEngine.java#L1801-L1825 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.sumCols | public static DMatrixRMaj sumCols(DMatrixRMaj input , DMatrixRMaj output ) {
"""
<p>
Computes the sum of each column in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = min(i=1:m ; a<sub>ij</sub>)
</p>
@param input Input matrix
@param output Optional storage for output. Reshap... | java | public static DMatrixRMaj sumCols(DMatrixRMaj input , DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(1,input.numCols);
} else {
output.reshape(1,input.numCols);
}
for( int cols = 0; cols < input.numCols; cols++ ) {
double total... | [
"public",
"static",
"DMatrixRMaj",
"sumCols",
"(",
"DMatrixRMaj",
"input",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"1",
",",
"input",
".",
"numCols",
")",
";",
"}",
... | <p>
Computes the sum of each column in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = min(i=1:m ; a<sub>ij</sub>)
</p>
@param input Input matrix
@param output Optional storage for output. Reshaped into a row vector. Modified.
@return Vector containing the sum of each column | [
"<p",
">",
"Computes",
"the",
"sum",
"of",
"each",
"column",
"in",
"the",
"input",
"matrix",
"and",
"returns",
"the",
"results",
"in",
"a",
"vector",
":",
"<br",
">",
"<br",
">",
"b<sub",
">",
"j<",
"/",
"sub",
">",
"=",
"min",
"(",
"i",
"=",
"1"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1959-L1978 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java | AbstractUserAgentStringParser.examineAsBrowser | private static void examineAsBrowser(final UserAgent.Builder builder, final Data data) {
"""
Examines the user agent string whether it is a browser.
@param userAgent
String of an user agent
@param builder
Builder for an user agent information
"""
Matcher matcher;
VersionNumber version = VersionNumber... | java | private static void examineAsBrowser(final UserAgent.Builder builder, final Data data) {
Matcher matcher;
VersionNumber version = VersionNumber.UNKNOWN;
for (final Entry<BrowserPattern, Browser> entry : data.getPatternToBrowserMap().entrySet()) {
matcher = entry.getKey().getPattern().matcher(builder.getUserAge... | [
"private",
"static",
"void",
"examineAsBrowser",
"(",
"final",
"UserAgent",
".",
"Builder",
"builder",
",",
"final",
"Data",
"data",
")",
"{",
"Matcher",
"matcher",
";",
"VersionNumber",
"version",
"=",
"VersionNumber",
".",
"UNKNOWN",
";",
"for",
"(",
"final"... | Examines the user agent string whether it is a browser.
@param userAgent
String of an user agent
@param builder
Builder for an user agent information | [
"Examines",
"the",
"user",
"agent",
"string",
"whether",
"it",
"is",
"a",
"browser",
"."
] | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/parser/AbstractUserAgentStringParser.java#L54-L72 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java | CPDefinitionLinkPersistenceImpl.removeByCPD_T | @Override
public void removeByCPD_T(long CPDefinitionId, String type) {
"""
Removes all the cp definition links where CPDefinitionId = ? and type = ? from the database.
@param CPDefinitionId the cp definition ID
@param type the type
"""
for (CPDefinitionLink cpDefinitionLink : findByCPD_T(CPDefi... | java | @Override
public void removeByCPD_T(long CPDefinitionId, String type) {
for (CPDefinitionLink cpDefinitionLink : findByCPD_T(CPDefinitionId,
type, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionLink);
}
} | [
"@",
"Override",
"public",
"void",
"removeByCPD_T",
"(",
"long",
"CPDefinitionId",
",",
"String",
"type",
")",
"{",
"for",
"(",
"CPDefinitionLink",
"cpDefinitionLink",
":",
"findByCPD_T",
"(",
"CPDefinitionId",
",",
"type",
",",
"QueryUtil",
".",
"ALL_POS",
",",... | Removes all the cp definition links where CPDefinitionId = ? and type = ? from the database.
@param CPDefinitionId the cp definition ID
@param type the type | [
"Removes",
"all",
"the",
"cp",
"definition",
"links",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L3022-L3028 |
alipay/sofa-rpc | core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AllConnectConnectionHolder.java | AllConnectConnectionHolder.addAlive | protected void addAlive(ProviderInfo providerInfo, ClientTransport transport) {
"""
Add alive.
@param providerInfo the provider
@param transport the transport
"""
if (checkState(providerInfo, transport)) {
aliveConnections.put(providerInfo, transport);
}
} | java | protected void addAlive(ProviderInfo providerInfo, ClientTransport transport) {
if (checkState(providerInfo, transport)) {
aliveConnections.put(providerInfo, transport);
}
} | [
"protected",
"void",
"addAlive",
"(",
"ProviderInfo",
"providerInfo",
",",
"ClientTransport",
"transport",
")",
"{",
"if",
"(",
"checkState",
"(",
"providerInfo",
",",
"transport",
")",
")",
"{",
"aliveConnections",
".",
"put",
"(",
"providerInfo",
",",
"transpo... | Add alive.
@param providerInfo the provider
@param transport the transport | [
"Add",
"alive",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AllConnectConnectionHolder.java#L123-L127 |
apereo/cas | support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/SamlIdPObjectEncrypter.java | SamlIdPObjectEncrypter.getEncrypter | protected Encrypter getEncrypter(final Object samlObject,
final SamlRegisteredService service,
final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
final KeyEncryptionParameters keyEncParams,
... | java | protected Encrypter getEncrypter(final Object samlObject,
final SamlRegisteredService service,
final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
final KeyEncryptionParameters keyEncParams,
... | [
"protected",
"Encrypter",
"getEncrypter",
"(",
"final",
"Object",
"samlObject",
",",
"final",
"SamlRegisteredService",
"service",
",",
"final",
"SamlRegisteredServiceServiceProviderMetadataFacade",
"adaptor",
",",
"final",
"KeyEncryptionParameters",
"keyEncParams",
",",
"fina... | Gets encrypter.
@param samlObject the saml object
@param service the service
@param adaptor the adaptor
@param keyEncParams the key enc params
@param dataEncParams the data enc params
@return the encrypter | [
"Gets",
"encrypter",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/SamlIdPObjectEncrypter.java#L143-L151 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.parseProcess | public ProcessDefinitionEntity parseProcess(Element processElement) {
"""
Parses one process (ie anything inside a <process> element).
@param processElement
The 'process' element.
@return The parsed version of the XML: a {@link ProcessDefinitionImpl}
object.
"""
// reset all mappings that are r... | java | public ProcessDefinitionEntity parseProcess(Element processElement) {
// reset all mappings that are related to one process definition
sequenceFlows = new HashMap<String, TransitionImpl>();
ProcessDefinitionEntity processDefinition = new ProcessDefinitionEntity();
/*
* Mapping object model - bpmn... | [
"public",
"ProcessDefinitionEntity",
"parseProcess",
"(",
"Element",
"processElement",
")",
"{",
"// reset all mappings that are related to one process definition",
"sequenceFlows",
"=",
"new",
"HashMap",
"<",
"String",
",",
"TransitionImpl",
">",
"(",
")",
";",
"ProcessDef... | Parses one process (ie anything inside a <process> element).
@param processElement
The 'process' element.
@return The parsed version of the XML: a {@link ProcessDefinitionImpl}
object. | [
"Parses",
"one",
"process",
"(",
"ie",
"anything",
"inside",
"a",
"<",
";",
"process>",
";",
"element",
")",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L526-L579 |
vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java | SkbShellFactory.newArgument | public static SkbShellArgument newArgument(String argument, boolean isOptional, SkbShellArgumentType type, Object[] valueSet, String description, String addedHelp) {
"""
Returns a new shell argument, use the factory to create one.
@param argument the actual argument, cannot be blank
@param isOptional flag for op... | java | public static SkbShellArgument newArgument(String argument, boolean isOptional, SkbShellArgumentType type, Object[] valueSet, String description, String addedHelp){
return new AbstractShellArgument(argument, isOptional, type, valueSet, description, addedHelp);
} | [
"public",
"static",
"SkbShellArgument",
"newArgument",
"(",
"String",
"argument",
",",
"boolean",
"isOptional",
",",
"SkbShellArgumentType",
"type",
",",
"Object",
"[",
"]",
"valueSet",
",",
"String",
"description",
",",
"String",
"addedHelp",
")",
"{",
"return",
... | Returns a new shell argument, use the factory to create one.
@param argument the actual argument, cannot be blank
@param isOptional flag for optional (true if optional, false if not)
@param type the argument's type, cannot be null
@param valueSet the argument's value set if specified, can be null
@param description the... | [
"Returns",
"a",
"new",
"shell",
"argument",
"use",
"the",
"factory",
"to",
"create",
"one",
"."
] | train | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java#L155-L157 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java | OtpCookedConnection.breakLinks | synchronized void breakLinks() {
"""
/*
When the connection fails - send exit to all local pids with links
through this connection
"""
if (links != null) {
final Link[] l = links.clearLinks();
if (l != null) {
final int len = l.length;
for (in... | java | synchronized void breakLinks() {
if (links != null) {
final Link[] l = links.clearLinks();
if (l != null) {
final int len = l.length;
for (int i = 0; i < len; i++) {
// send exit "from" remote pids to local ones
se... | [
"synchronized",
"void",
"breakLinks",
"(",
")",
"{",
"if",
"(",
"links",
"!=",
"null",
")",
"{",
"final",
"Link",
"[",
"]",
"l",
"=",
"links",
".",
"clearLinks",
"(",
")",
";",
"if",
"(",
"l",
"!=",
"null",
")",
"{",
"final",
"int",
"len",
"=",
... | /*
When the connection fails - send exit to all local pids with links
through this connection | [
"/",
"*",
"When",
"the",
"connection",
"fails",
"-",
"send",
"exit",
"to",
"all",
"local",
"pids",
"with",
"links",
"through",
"this",
"connection"
] | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java#L231-L245 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/util/StringHelper.java | StringHelper.makeFormattedString | public static String makeFormattedString(
String aAttrName,
Object[] anObjArray,
boolean aPrependSeparator) {
"""
Utility method that formats array of <code>Object</code>.
<p>
Example: aAttrName[]="[LENGTH=anObjArray.length(anObjArray{i}, ... ]",
where the "," is controlled using the aPr... | java | public static String makeFormattedString(
String aAttrName,
Object[] anObjArray,
boolean aPrependSeparator) {
StringBuffer mStrBuff =
new StringBuffer(PreFormatString(aAttrName + "[]", aPrependSeparator));
if (anObjArray == null)
mStrBuff.append("null");
... | [
"public",
"static",
"String",
"makeFormattedString",
"(",
"String",
"aAttrName",
",",
"Object",
"[",
"]",
"anObjArray",
",",
"boolean",
"aPrependSeparator",
")",
"{",
"StringBuffer",
"mStrBuff",
"=",
"new",
"StringBuffer",
"(",
"PreFormatString",
"(",
"aAttrName",
... | Utility method that formats array of <code>Object</code>.
<p>
Example: aAttrName[]="[LENGTH=anObjArray.length(anObjArray{i}, ... ]",
where the "," is controlled using the aPrependSeparator set to true.
@param aAttrName A String attribute name value.
@param anObjArray An Object array of values
@param aPrependSeparator ... | [
"Utility",
"method",
"that",
"formats",
"array",
"of",
"<code",
">",
"Object<",
"/",
"code",
">",
".",
"<p",
">",
"Example",
":",
"aAttrName",
"[]",
"=",
"[",
"LENGTH",
"=",
"anObjArray",
".",
"length",
"(",
"anObjArray",
"{",
"i",
"}",
"...",
"]",
"... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/StringHelper.java#L259-L278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.