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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java | DatabasesInner.beginUpgradeDataWarehouseAsync | public Observable<Void> beginUpgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Upgrades a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the porta... | java | public Observable<Void> beginUpgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) {
return beginUpgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public... | [
"public",
"Observable",
"<",
"Void",
">",
"beginUpgradeDataWarehouseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"beginUpgradeDataWarehouseWithServiceResponseAsync",
"(",
"resourceGroupName",
","... | Upgrades a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database to be upgraded.
@throws IllegalArgumentExcep... | [
"Upgrades",
"a",
"data",
"warehouse",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java#L254-L261 |
Samsung/GearVRf | GVRf/Extensions/3DCursor/IODevices/gearwear/GearWearIoDevice/src/main/java/com/gearvrf/io/gearwear/GearWearableDevice.java | GearWearableDevice.getSensitivity | private float getSensitivity(float x, float y) {
"""
Calculate sensitivity based on distance from center
<p/>
The farther from the center, the more sensitive the cursor should be (linearly)
"""
double furthestDistance = MAX_DISTANCE;
double distance = Math.sqrt(Math.pow(x - CENTER_X, 2) + Mat... | java | private float getSensitivity(float x, float y) {
double furthestDistance = MAX_DISTANCE;
double distance = Math.sqrt(Math.pow(x - CENTER_X, 2) + Math.pow(y - CENTER_Y, 2));
double sens = MAX_SENSITIVITY * distance / furthestDistance;
if (sens > MAX_SENSITIVITY) {
sens = MAX_S... | [
"private",
"float",
"getSensitivity",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"double",
"furthestDistance",
"=",
"MAX_DISTANCE",
";",
"double",
"distance",
"=",
"Math",
".",
"sqrt",
"(",
"Math",
".",
"pow",
"(",
"x",
"-",
"CENTER_X",
",",
"2",
... | Calculate sensitivity based on distance from center
<p/>
The farther from the center, the more sensitive the cursor should be (linearly) | [
"Calculate",
"sensitivity",
"based",
"on",
"distance",
"from",
"center",
"<p",
"/",
">",
"The",
"farther",
"from",
"the",
"center",
"the",
"more",
"sensitive",
"the",
"cursor",
"should",
"be",
"(",
"linearly",
")"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/3DCursor/IODevices/gearwear/GearWearIoDevice/src/main/java/com/gearvrf/io/gearwear/GearWearableDevice.java#L594-L602 |
Doctoror/Geocoder | library/src/main/java/com/doctoror/geocoder/Parser.java | Parser.parseJson | @NonNull
static List<Address> parseJson(final byte[] jsonData,
final int maxResults,
final boolean parseAddressComponents)
throws GeocoderException {
"""
Parses response into {@link List}
@param jsonData
@param maxResults
@p... | java | @NonNull
static List<Address> parseJson(final byte[] jsonData,
final int maxResults,
final boolean parseAddressComponents)
throws GeocoderException {
try {
final String jsonString = new String(jsonData, Charset.for... | [
"@",
"NonNull",
"static",
"List",
"<",
"Address",
">",
"parseJson",
"(",
"final",
"byte",
"[",
"]",
"jsonData",
",",
"final",
"int",
"maxResults",
",",
"final",
"boolean",
"parseAddressComponents",
")",
"throws",
"GeocoderException",
"{",
"try",
"{",
"final",
... | Parses response into {@link List}
@param jsonData
@param maxResults
@param parseAddressComponents
@return {@link Address} {@link List}
@throws GeocoderException if error occurs | [
"Parses",
"response",
"into",
"{",
"@link",
"List",
"}"
] | train | https://github.com/Doctoror/Geocoder/blob/c55463266584c7ad79880ffc7869c25e5f9eb006/library/src/main/java/com/doctoror/geocoder/Parser.java#L85-L122 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.inSynchronized | public static final <T extends Tree> Matcher<T> inSynchronized() {
"""
Matches if this Tree is enclosed by either a synchronized block or a synchronized method.
"""
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
SynchronizedTree synchronizedTree... | java | public static final <T extends Tree> Matcher<T> inSynchronized() {
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
SynchronizedTree synchronizedTree =
ASTHelpers.findEnclosingNode(state.getPath(), SynchronizedTree.class);
if (synchroni... | [
"public",
"static",
"final",
"<",
"T",
"extends",
"Tree",
">",
"Matcher",
"<",
"T",
">",
"inSynchronized",
"(",
")",
"{",
"return",
"new",
"Matcher",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"T",
"tree",
","... | Matches if this Tree is enclosed by either a synchronized block or a synchronized method. | [
"Matches",
"if",
"this",
"Tree",
"is",
"enclosed",
"by",
"either",
"a",
"synchronized",
"block",
"or",
"a",
"synchronized",
"method",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L1255-L1270 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java | RedisStorage.removeCalendar | @Override
public boolean removeCalendar(String calendarName, Jedis jedis) throws JobPersistenceException {
"""
Remove (delete) the <code>{@link org.quartz.Calendar}</code> with the given name.
@param calendarName the name of the calendar to be removed
@param jedis a thread-safe Redis connection
@return true... | java | @Override
public boolean removeCalendar(String calendarName, Jedis jedis) throws JobPersistenceException {
final String calendarTriggersSetKey = redisSchema.calendarTriggersSetKey(calendarName);
if(jedis.scard(calendarTriggersSetKey) > 0){
throw new JobPersistenceException(String.format... | [
"@",
"Override",
"public",
"boolean",
"removeCalendar",
"(",
"String",
"calendarName",
",",
"Jedis",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"calendarTriggersSetKey",
"=",
"redisSchema",
".",
"calendarTriggersSetKey",
"(",
"calendarNam... | Remove (delete) the <code>{@link org.quartz.Calendar}</code> with the given name.
@param calendarName the name of the calendar to be removed
@param jedis a thread-safe Redis connection
@return true if a calendar with the given name was found and removed | [
"Remove",
"(",
"delete",
")",
"the",
"<code",
">",
"{"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisStorage.java#L323-L337 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java | PlanNode.findAtOrBelow | public PlanNode findAtOrBelow( Traversal order,
Type firstTypeToFind,
Type... additionalTypesToFind ) {
"""
Find the first node with one of the specified types that are at or below this node.
@param order the order to traverse; may not be nul... | java | public PlanNode findAtOrBelow( Traversal order,
Type firstTypeToFind,
Type... additionalTypesToFind ) {
return findAtOrBelow(order, EnumSet.of(firstTypeToFind, additionalTypesToFind));
} | [
"public",
"PlanNode",
"findAtOrBelow",
"(",
"Traversal",
"order",
",",
"Type",
"firstTypeToFind",
",",
"Type",
"...",
"additionalTypesToFind",
")",
"{",
"return",
"findAtOrBelow",
"(",
"order",
",",
"EnumSet",
".",
"of",
"(",
"firstTypeToFind",
",",
"additionalTyp... | Find the first node with one of the specified types that are at or below this node.
@param order the order to traverse; may not be null
@param firstTypeToFind the first type of node to find; may not be null
@param additionalTypesToFind the additional types of node to find; may not be null
@return the first node that i... | [
"Find",
"the",
"first",
"node",
"with",
"one",
"of",
"the",
"specified",
"types",
"that",
"are",
"at",
"or",
"below",
"this",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1497-L1501 |
jglobus/JGlobus | axis/src/main/java/org/globus/axis/transport/HTTPUtils.java | HTTPUtils.setHTTPVersion | public static void setHTTPVersion(Stub stub, boolean http10) {
"""
Sets on option on the stub to control what HTTP protocol
version should be used.
@param stub The stub to set the property on
@param http10 If true, HTTP 1.0 will be used. Otherwise HTTP 1.1
will be used.
"""
stub._setProperty(Mess... | java | public static void setHTTPVersion(Stub stub, boolean http10) {
stub._setProperty(MessageContext.HTTP_TRANSPORT_VERSION,
(http10)
? HTTPConstants.HEADER_PROTOCOL_V10
: HTTPConstants.HEADER_PROTOCOL_V11);
} | [
"public",
"static",
"void",
"setHTTPVersion",
"(",
"Stub",
"stub",
",",
"boolean",
"http10",
")",
"{",
"stub",
".",
"_setProperty",
"(",
"MessageContext",
".",
"HTTP_TRANSPORT_VERSION",
",",
"(",
"http10",
")",
"?",
"HTTPConstants",
".",
"HEADER_PROTOCOL_V10",
"... | Sets on option on the stub to control what HTTP protocol
version should be used.
@param stub The stub to set the property on
@param http10 If true, HTTP 1.0 will be used. Otherwise HTTP 1.1
will be used. | [
"Sets",
"on",
"option",
"on",
"the",
"stub",
"to",
"control",
"what",
"HTTP",
"protocol",
"version",
"should",
"be",
"used",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/axis/src/main/java/org/globus/axis/transport/HTTPUtils.java#L81-L86 |
Guichaguri/MinimalFTP | src/main/java/com/guichaguri/minimalftp/FTPConnection.java | FTPConnection.sendResponse | public void sendResponse(int code, String response) {
"""
Sends a response to the connection
@param code The response code
@param response The response message
"""
if(con.isClosed()) return;
if(response == null || response.isEmpty()) {
response = "Unknown";
}
try... | java | public void sendResponse(int code, String response) {
if(con.isClosed()) return;
if(response == null || response.isEmpty()) {
response = "Unknown";
}
try {
if(response.charAt(0) == '-') {
writer.write(code + response + "\r\n");
} else... | [
"public",
"void",
"sendResponse",
"(",
"int",
"code",
",",
"String",
"response",
")",
"{",
"if",
"(",
"con",
".",
"isClosed",
"(",
")",
")",
"return",
";",
"if",
"(",
"response",
"==",
"null",
"||",
"response",
".",
"isEmpty",
"(",
")",
")",
"{",
"... | Sends a response to the connection
@param code The response code
@param response The response message | [
"Sends",
"a",
"response",
"to",
"the",
"connection"
] | train | https://github.com/Guichaguri/MinimalFTP/blob/ddd81e26ec88079ee4c37fe53d8efe420996e9b1/src/main/java/com/guichaguri/minimalftp/FTPConnection.java#L211-L229 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.filterLine | public static void filterLine(Reader reader, Writer writer, @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) throws IOException {
"""
Filter the lines from a reader and write them on the writer,
according to a closure which returns true if the line should be included.
Both Read... | java | public static void filterLine(Reader reader, Writer writer, @ClosureParams(value=SimpleType.class, options="java.lang.String") Closure closure) throws IOException {
BufferedReader br = new BufferedReader(reader);
BufferedWriter bw = new BufferedWriter(writer);
String line;
try {
... | [
"public",
"static",
"void",
"filterLine",
"(",
"Reader",
"reader",
",",
"Writer",
"writer",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.lang.String\"",
")",
"Closure",
"closure",
")",
"throws",
"IOExce... | Filter the lines from a reader and write them on the writer,
according to a closure which returns true if the line should be included.
Both Reader and Writer are closed after the operation.
@param reader a reader, closed after the call
@param writer a writer, closed after the call
@param closure the closure which re... | [
"Filter",
"the",
"lines",
"from",
"a",
"reader",
"and",
"write",
"them",
"on",
"the",
"writer",
"according",
"to",
"a",
"closure",
"which",
"returns",
"true",
"if",
"the",
"line",
"should",
"be",
"included",
".",
"Both",
"Reader",
"and",
"Writer",
"are",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1452-L1479 |
Pi4J/pi4j | pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/pca/PCA9685GpioProvider.java | PCA9685GpioProvider.setFrequency | public void setFrequency(BigDecimal targetFrequency, BigDecimal frequencyCorrectionFactor) {
"""
The built-in Oscillator runs at ~25MHz. For better accuracy user can provide a correction
factor to meet desired frequency.<p>
<b>Note:</b> correction is limited to a certain degree because the calculated prescale va... | java | public void setFrequency(BigDecimal targetFrequency, BigDecimal frequencyCorrectionFactor) {
validateFrequency(targetFrequency);
frequency = targetFrequency;
periodDurationMicros = calculatePeriodDuration();
int prescale = calculatePrescale(frequencyCorrectionFactor);
int oldMode... | [
"public",
"void",
"setFrequency",
"(",
"BigDecimal",
"targetFrequency",
",",
"BigDecimal",
"frequencyCorrectionFactor",
")",
"{",
"validateFrequency",
"(",
"targetFrequency",
")",
";",
"frequency",
"=",
"targetFrequency",
";",
"periodDurationMicros",
"=",
"calculatePeriod... | The built-in Oscillator runs at ~25MHz. For better accuracy user can provide a correction
factor to meet desired frequency.<p>
<b>Note:</b> correction is limited to a certain degree because the calculated prescale value has to be
rounded to an integer value!
<p>
<b>Example:</b><br>
target freq: 50Hz<br>
actual freq: 52... | [
"The",
"built",
"-",
"in",
"Oscillator",
"runs",
"at",
"~25MHz",
".",
"For",
"better",
"accuracy",
"user",
"can",
"provide",
"a",
"correction",
"factor",
"to",
"meet",
"desired",
"frequency",
".",
"<p",
">",
"<b",
">",
"Note",
":",
"<",
"/",
"b",
">",
... | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/pca/PCA9685GpioProvider.java#L139-L158 |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngineJNI.java | ExecutionEngineJNI.storeLargeTempTableBlock | public boolean storeLargeTempTableBlock(long siteId, long blockCounter, ByteBuffer block) {
"""
Store a large temp table block to disk.
@param siteId The site id of the block to store to disk
@param blockCounter The serial number of the block to store to disk
@param block A directly-allocated Byt... | java | public boolean storeLargeTempTableBlock(long siteId, long blockCounter, ByteBuffer block) {
LargeBlockTask task = LargeBlockTask.getStoreTask(new BlockId(siteId, blockCounter), block);
return executeLargeBlockTaskSynchronously(task);
} | [
"public",
"boolean",
"storeLargeTempTableBlock",
"(",
"long",
"siteId",
",",
"long",
"blockCounter",
",",
"ByteBuffer",
"block",
")",
"{",
"LargeBlockTask",
"task",
"=",
"LargeBlockTask",
".",
"getStoreTask",
"(",
"new",
"BlockId",
"(",
"siteId",
",",
"blockCounte... | Store a large temp table block to disk.
@param siteId The site id of the block to store to disk
@param blockCounter The serial number of the block to store to disk
@param block A directly-allocated ByteBuffer of the block
@return true if operation succeeded, false otherwise | [
"Store",
"a",
"large",
"temp",
"table",
"block",
"to",
"disk",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngineJNI.java#L878-L881 |
OpenLiberty/open-liberty | dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigValidator.java | ConfigValidator.isSecureAttribute | private boolean isSecureAttribute(RegistryEntry registryEntry, String attributeName) {
"""
Test if an attribute is a secured / password type attribute.
This is tested using the attribute type, as obtained from {@link ExtendedAttributeDefinition#getType()}.
Attribute types {@link MetaTypeFactory#PASSWORD_TYPE... | java | private boolean isSecureAttribute(RegistryEntry registryEntry, String attributeName) {
ExtendedAttributeDefinition attributeDefinition = getAttributeDefinition(registryEntry, attributeName);
if (attributeDefinition == null) {
return false; // No available definition; default to false.
... | [
"private",
"boolean",
"isSecureAttribute",
"(",
"RegistryEntry",
"registryEntry",
",",
"String",
"attributeName",
")",
"{",
"ExtendedAttributeDefinition",
"attributeDefinition",
"=",
"getAttributeDefinition",
"(",
"registryEntry",
",",
"attributeName",
")",
";",
"if",
"("... | Test if an attribute is a secured / password type attribute.
This is tested using the attribute type, as obtained from {@link ExtendedAttributeDefinition#getType()}.
Attribute types {@link MetaTypeFactory#PASSWORD_TYPE} and {@link MetaTypeFactory#HASHED_PASSWORD_TYPE} are secured. All other attribute types are not se... | [
"Test",
"if",
"an",
"attribute",
"is",
"a",
"secured",
"/",
"password",
"type",
"attribute",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigValidator.java#L127-L138 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/view/ViewPropertyAnimatorPreHC.java | ViewPropertyAnimatorPreHC.animateProperty | private void animateProperty(int constantName, float toValue) {
"""
Utility function, called by the various x(), y(), etc. methods. This stores the
constant name for the property along with the from/delta values that will be used to
calculate and set the property during the animation. This structure is added to ... | java | private void animateProperty(int constantName, float toValue) {
float fromValue = getValue(constantName);
float deltaValue = toValue - fromValue;
animatePropertyBy(constantName, fromValue, deltaValue);
} | [
"private",
"void",
"animateProperty",
"(",
"int",
"constantName",
",",
"float",
"toValue",
")",
"{",
"float",
"fromValue",
"=",
"getValue",
"(",
"constantName",
")",
";",
"float",
"deltaValue",
"=",
"toValue",
"-",
"fromValue",
";",
"animatePropertyBy",
"(",
"... | Utility function, called by the various x(), y(), etc. methods. This stores the
constant name for the property along with the from/delta values that will be used to
calculate and set the property during the animation. This structure is added to the
pending animations, awaiting the eventual start() of the underlying ani... | [
"Utility",
"function",
"called",
"by",
"the",
"various",
"x",
"()",
"y",
"()",
"etc",
".",
"methods",
".",
"This",
"stores",
"the",
"constant",
"name",
"for",
"the",
"property",
"along",
"with",
"the",
"from",
"/",
"delta",
"values",
"that",
"will",
"be"... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/view/ViewPropertyAnimatorPreHC.java#L473-L477 |
lessthanoptimal/ejml | examples/src/org/ejml/example/LevenbergMarquardt.java | LevenbergMarquardt.configure | protected void configure(ResidualFunction function , int numParam ) {
"""
Performs sanity checks on the input data and reshapes internal matrices. By reshaping
a matrix it will only declare new memory when needed.
"""
this.function = function;
int numFunctions = function.numFunctions();
... | java | protected void configure(ResidualFunction function , int numParam )
{
this.function = function;
int numFunctions = function.numFunctions();
// reshaping a matrix means that new memory is only declared when needed
candidateParameters.reshape(numParam,1);
g.reshape(numParam,1)... | [
"protected",
"void",
"configure",
"(",
"ResidualFunction",
"function",
",",
"int",
"numParam",
")",
"{",
"this",
".",
"function",
"=",
"function",
";",
"int",
"numFunctions",
"=",
"function",
".",
"numFunctions",
"(",
")",
";",
"// reshaping a matrix means that ne... | Performs sanity checks on the input data and reshapes internal matrices. By reshaping
a matrix it will only declare new memory when needed. | [
"Performs",
"sanity",
"checks",
"on",
"the",
"input",
"data",
"and",
"reshapes",
"internal",
"matrices",
".",
"By",
"reshaping",
"a",
"matrix",
"it",
"will",
"only",
"declare",
"new",
"memory",
"when",
"needed",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/LevenbergMarquardt.java#L193-L209 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/Treebank.java | Treebank.loadPath | public void loadPath(String pathName, String suffix, boolean recursively) {
"""
Load trees from given directory.
@param pathName File or directory name
@param suffix Extension of files to load: If <code>pathName</code>
is a directory, then, if this is
non-<code>null</code>, all and only files ending ... | java | public void loadPath(String pathName, String suffix, boolean recursively) {
loadPath(new File(pathName), new ExtensionFileFilter(suffix, recursively));
} | [
"public",
"void",
"loadPath",
"(",
"String",
"pathName",
",",
"String",
"suffix",
",",
"boolean",
"recursively",
")",
"{",
"loadPath",
"(",
"new",
"File",
"(",
"pathName",
")",
",",
"new",
"ExtensionFileFilter",
"(",
"suffix",
",",
"recursively",
")",
")",
... | Load trees from given directory.
@param pathName File or directory name
@param suffix Extension of files to load: If <code>pathName</code>
is a directory, then, if this is
non-<code>null</code>, all and only files ending in "." followed
by this extension will be loaded; if it is <code>null</code>,
all files in... | [
"Load",
"trees",
"from",
"given",
"directory",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/Treebank.java#L166-L168 |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.addAsyncProperty | public static void addAsyncProperty(String key, String value, TransactionLogger transactionLogger) {
"""
Add property to 'properties' map on transaction
@param key - of property
@param value - of property
@param transactionLogger
"""
FlowContextFactory.deserializeNativeFlowContext(transactionLogger.get... | java | public static void addAsyncProperty(String key, String value, TransactionLogger transactionLogger) {
FlowContextFactory.deserializeNativeFlowContext(transactionLogger.getFlowContextAsync(transactionLogger));
transactionLogger.properties.put(key, value);
} | [
"public",
"static",
"void",
"addAsyncProperty",
"(",
"String",
"key",
",",
"String",
"value",
",",
"TransactionLogger",
"transactionLogger",
")",
"{",
"FlowContextFactory",
".",
"deserializeNativeFlowContext",
"(",
"transactionLogger",
".",
"getFlowContextAsync",
"(",
"... | Add property to 'properties' map on transaction
@param key - of property
@param value - of property
@param transactionLogger | [
"Add",
"property",
"to",
"properties",
"map",
"on",
"transaction"
] | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L219-L224 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsVfsSitemapService.java | CmsVfsSitemapService.getRootEntry | private CmsClientSitemapEntry getRootEntry(String rootPath, String targetPath)
throws CmsSecurityException, CmsException {
"""
Reeds the site root entry.<p>
@param rootPath the root path of the sitemap root
@param targetPath the target path to open
@return the site root entry
@throws CmsSecurityExcep... | java | private CmsClientSitemapEntry getRootEntry(String rootPath, String targetPath)
throws CmsSecurityException, CmsException {
String sitePath = "/";
if ((rootPath != null)) {
sitePath = getCmsObject().getRequestContext().removeSiteRoot(rootPath);
}
CmsJspNavElement navEleme... | [
"private",
"CmsClientSitemapEntry",
"getRootEntry",
"(",
"String",
"rootPath",
",",
"String",
"targetPath",
")",
"throws",
"CmsSecurityException",
",",
"CmsException",
"{",
"String",
"sitePath",
"=",
"\"/\"",
";",
"if",
"(",
"(",
"rootPath",
"!=",
"null",
")",
"... | Reeds the site root entry.<p>
@param rootPath the root path of the sitemap root
@param targetPath the target path to open
@return the site root entry
@throws CmsSecurityException in case of insufficient permissions
@throws CmsException if something goes wrong | [
"Reeds",
"the",
"site",
"root",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsVfsSitemapService.java#L2592-L2609 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/hlist/SingletonHList.java | SingletonHList.into | public <R> R into(Function<? super _1, ? extends R> fn) {
"""
Apply {@link SingletonHList#head()} to <code>fn</code> and return the result.
@param fn the function to apply
@param <R> the return type of the function
@return the result of applying the head to the function
"""
return fn.apply(head()... | java | public <R> R into(Function<? super _1, ? extends R> fn) {
return fn.apply(head());
} | [
"public",
"<",
"R",
">",
"R",
"into",
"(",
"Function",
"<",
"?",
"super",
"_1",
",",
"?",
"extends",
"R",
">",
"fn",
")",
"{",
"return",
"fn",
".",
"apply",
"(",
"head",
"(",
")",
")",
";",
"}"
] | Apply {@link SingletonHList#head()} to <code>fn</code> and return the result.
@param fn the function to apply
@param <R> the return type of the function
@return the result of applying the head to the function | [
"Apply",
"{",
"@link",
"SingletonHList#head",
"()",
"}",
"to",
"<code",
">",
"fn<",
"/",
"code",
">",
"and",
"return",
"the",
"result",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/hlist/SingletonHList.java#L89-L91 |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/FileUtil.java | FileUtil.getPathToRoot | static public String getPathToRoot(JBakeConfiguration config, File rootPath, File sourceFile) {
"""
Given a file inside content it return
the relative path to get to the root.
<p>
Example: /content and /content/tags/blog will return '../..'
@param sourceFile the file to calculate relative path for
@return
... | java | static public String getPathToRoot(JBakeConfiguration config, File rootPath, File sourceFile) {
Path r = Paths.get(rootPath.toURI());
Path s = Paths.get(sourceFile.getParentFile().toURI());
Path relativePath = s.relativize(r);
StringBuilder sb = new StringBuilder();
sb.append(... | [
"static",
"public",
"String",
"getPathToRoot",
"(",
"JBakeConfiguration",
"config",
",",
"File",
"rootPath",
",",
"File",
"sourceFile",
")",
"{",
"Path",
"r",
"=",
"Paths",
".",
"get",
"(",
"rootPath",
".",
"toURI",
"(",
")",
")",
";",
"Path",
"s",
"=",
... | Given a file inside content it return
the relative path to get to the root.
<p>
Example: /content and /content/tags/blog will return '../..'
@param sourceFile the file to calculate relative path for
@return | [
"Given",
"a",
"file",
"inside",
"content",
"it",
"return",
"the",
"relative",
"path",
"to",
"get",
"to",
"the",
"root",
".",
"<p",
">",
"Example",
":",
"/",
"content",
"and",
"/",
"content",
"/",
"tags",
"/",
"blog",
"will",
"return",
"..",
"/",
".."... | train | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/FileUtil.java#L206-L223 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java | ParsedScheduleExpression.getTimeout | private long getTimeout(long lastTimeout, boolean reschedule) {
"""
Determines the next timeout for the schedule expression.
@param lastTimeout the last timeout in milliseconds, or the current time
if reschedule is false
@param reschedule <tt>true</tt> if lastTimeout is an exclusive lower
bound for the next ... | java | private long getTimeout(long lastTimeout, boolean reschedule)
{
Calendar cal = createCalendar(lastTimeout);
// If this expression is being rescheduled, then add a second to make
// progress towards the next timeout.
if (reschedule)
{
cal.add(Calendar.SECOND, 1);
... | [
"private",
"long",
"getTimeout",
"(",
"long",
"lastTimeout",
",",
"boolean",
"reschedule",
")",
"{",
"Calendar",
"cal",
"=",
"createCalendar",
"(",
"lastTimeout",
")",
";",
"// If this expression is being rescheduled, then add a second to make",
"// progress towards the next ... | Determines the next timeout for the schedule expression.
@param lastTimeout the last timeout in milliseconds, or the current time
if reschedule is false
@param reschedule <tt>true</tt> if lastTimeout is an exclusive lower
bound for the next timeout
@return the next timeout in milliseconds, or -1 if there are no more
f... | [
"Determines",
"the",
"next",
"timeout",
"for",
"the",
"schedule",
"expression",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java#L517-L544 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/csv/CsvUtil.java | CsvUtil.getWriter | public static CsvWriter getWriter(File file, Charset charset, boolean isAppend) {
"""
获取CSV生成器(写出器),使用默认配置
@param file File CSV文件
@param charset 编码
@param isAppend 是否追加
"""
return new CsvWriter(file, charset, isAppend);
} | java | public static CsvWriter getWriter(File file, Charset charset, boolean isAppend) {
return new CsvWriter(file, charset, isAppend);
} | [
"public",
"static",
"CsvWriter",
"getWriter",
"(",
"File",
"file",
",",
"Charset",
"charset",
",",
"boolean",
"isAppend",
")",
"{",
"return",
"new",
"CsvWriter",
"(",
"file",
",",
"charset",
",",
"isAppend",
")",
";",
"}"
] | 获取CSV生成器(写出器),使用默认配置
@param file File CSV文件
@param charset 编码
@param isAppend 是否追加 | [
"获取CSV生成器(写出器),使用默认配置"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvUtil.java#L74-L76 |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol/RequestHttpBase.java | RequestHttpBase.addHeaderOutImpl | public void addHeaderOutImpl(String key, String value) {
"""
Adds a new header. If an old header with that name exists,
both headers are output.
@param key the header key.
@param value the header value.
"""
if (headerOutSpecial(key, value)) {
return;
}
ArrayList<String> keys = _hea... | java | public void addHeaderOutImpl(String key, String value)
{
if (headerOutSpecial(key, value)) {
return;
}
ArrayList<String> keys = _headerKeysOut;
ArrayList<String> values = _headerValuesOut;
int size = keys.size();
// webapp/1k32
for (int i = 0; i < size; i++) {
if... | [
"public",
"void",
"addHeaderOutImpl",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"headerOutSpecial",
"(",
"key",
",",
"value",
")",
")",
"{",
"return",
";",
"}",
"ArrayList",
"<",
"String",
">",
"keys",
"=",
"_headerKeysOut",
";",... | Adds a new header. If an old header with that name exists,
both headers are output.
@param key the header key.
@param value the header value. | [
"Adds",
"a",
"new",
"header",
".",
"If",
"an",
"old",
"header",
"with",
"that",
"name",
"exists",
"both",
"headers",
"are",
"output",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttpBase.java#L1928-L1948 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/DatabaseManager.java | DatabaseManager.getSession | public static Session getSession(int dbId, long sessionId) {
"""
Returns an existing session. Used with repeat HTTP connections
belonging to the same JDBC Conenction / HSQL Session pair.
"""
Database db = (Database) databaseIDMap.get(dbId);
return db == null ? null
... | java | public static Session getSession(int dbId, long sessionId) {
Database db = (Database) databaseIDMap.get(dbId);
return db == null ? null
: db.sessionManager.getSession(sessionId);
} | [
"public",
"static",
"Session",
"getSession",
"(",
"int",
"dbId",
",",
"long",
"sessionId",
")",
"{",
"Database",
"db",
"=",
"(",
"Database",
")",
"databaseIDMap",
".",
"get",
"(",
"dbId",
")",
";",
"return",
"db",
"==",
"null",
"?",
"null",
":",
"db",
... | Returns an existing session. Used with repeat HTTP connections
belonging to the same JDBC Conenction / HSQL Session pair. | [
"Returns",
"an",
"existing",
"session",
".",
"Used",
"with",
"repeat",
"HTTP",
"connections",
"belonging",
"to",
"the",
"same",
"JDBC",
"Conenction",
"/",
"HSQL",
"Session",
"pair",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/DatabaseManager.java#L183-L189 |
motown-io/motown | ocpp/view-model/src/main/java/io/motown/ocpp/viewmodel/domain/DomainService.java | DomainService.startTransactionNoAuthorize | public void startTransactionNoAuthorize(ChargingStationId chargingStationId, TransactionId transactionId,
StartTransactionInfo startTransactionInfo, AddOnIdentity addOnIdentity) {
"""
Initiates a StartTransactionCommand without authorizing the identification. Normally th... | java | public void startTransactionNoAuthorize(ChargingStationId chargingStationId, TransactionId transactionId,
StartTransactionInfo startTransactionInfo, AddOnIdentity addOnIdentity) {
IdentityContext identityContext = new IdentityContext(addOnIdentity, new NullUserIdentit... | [
"public",
"void",
"startTransactionNoAuthorize",
"(",
"ChargingStationId",
"chargingStationId",
",",
"TransactionId",
"transactionId",
",",
"StartTransactionInfo",
"startTransactionInfo",
",",
"AddOnIdentity",
"addOnIdentity",
")",
"{",
"IdentityContext",
"identityContext",
"="... | Initiates a StartTransactionCommand without authorizing the identification. Normally this method is called by the
futureEventCallback of {@link #startTransaction}.
@param chargingStationId charging station identifier.
@param transactionId transaction identifier.
@param startTransactionInfo information about the st... | [
"Initiates",
"a",
"StartTransactionCommand",
"without",
"authorizing",
"the",
"identification",
".",
"Normally",
"this",
"method",
"is",
"called",
"by",
"the",
"futureEventCallback",
"of",
"{",
"@link",
"#startTransaction",
"}",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/ocpp/view-model/src/main/java/io/motown/ocpp/viewmodel/domain/DomainService.java#L199-L205 |
banq/jdonframework | JdonAccessory/jdon-hibernate3x/src/main/java/com/jdon/model/query/block/BlockStrategy.java | BlockStrategy.getBlock | public Block getBlock(String sqlquery, Collection queryParams, int startIndex, int count) {
"""
get a data block by the sql sentence.
@param sqlqueryAllCount
@param sqlquery
@return if not found, return null;
"""
Debug.logVerbose("[JdonFramework]enter getBlock .. ", module);
if ((count > this.blockL... | java | public Block getBlock(String sqlquery, Collection queryParams, int startIndex, int count) {
Debug.logVerbose("[JdonFramework]enter getBlock .. ", module);
if ((count > this.blockLength) || (count <= 0)) { // every query max
// length must be
// little than
// blockLength
count = this.blockLength;
... | [
"public",
"Block",
"getBlock",
"(",
"String",
"sqlquery",
",",
"Collection",
"queryParams",
",",
"int",
"startIndex",
",",
"int",
"count",
")",
"{",
"Debug",
".",
"logVerbose",
"(",
"\"[JdonFramework]enter getBlock .. \"",
",",
"module",
")",
";",
"if",
"(",
"... | get a data block by the sql sentence.
@param sqlqueryAllCount
@param sqlquery
@return if not found, return null; | [
"get",
"a",
"data",
"block",
"by",
"the",
"sql",
"sentence",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-hibernate3x/src/main/java/com/jdon/model/query/block/BlockStrategy.java#L142-L159 |
ops4j/org.ops4j.base | ops4j-base-net/src/main/java/org/ops4j/net/URLUtils.java | URLUtils.prepareInputStream | public static InputStream prepareInputStream( final URL url, final boolean acceptAnyCertificate )
throws IOException {
"""
Prepare url for authentication and ssl if necessary and returns the input stream from the url.
@param url url to prepare
@param acceptAnyCertificate true if the ce... | java | public static InputStream prepareInputStream( final URL url, final boolean acceptAnyCertificate )
throws IOException
{
final URLConnection conn = url.openConnection();
prepareForAuthentication( conn );
prepareHttpHeaders( conn );
if( acceptAnyCertificate )
{
... | [
"public",
"static",
"InputStream",
"prepareInputStream",
"(",
"final",
"URL",
"url",
",",
"final",
"boolean",
"acceptAnyCertificate",
")",
"throws",
"IOException",
"{",
"final",
"URLConnection",
"conn",
"=",
"url",
".",
"openConnection",
"(",
")",
";",
"prepareFor... | Prepare url for authentication and ssl if necessary and returns the input stream from the url.
@param url url to prepare
@param acceptAnyCertificate true if the certicate check should be skipped
@return input stream from url
@throws IOException re-thrown | [
"Prepare",
"url",
"for",
"authentication",
"and",
"ssl",
"if",
"necessary",
"and",
"returns",
"the",
"input",
"stream",
"from",
"the",
"url",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-net/src/main/java/org/ops4j/net/URLUtils.java#L170-L181 |
voldemort/voldemort | contrib/restclient/src/java/voldemort/restclient/admin/CoordinatorAdminCommand.java | CoordinatorAdminCommand.executeHelp | public static void executeHelp(String[] args, PrintStream stream) throws Exception {
"""
Parses command-line input and prints help menu.
@throws Exception
"""
String subCmd = (args.length > 0) ? args[0] : "";
args = CoordinatorAdminUtils.copyArrayCutFirst(args);
if(subCmd.equals("get... | java | public static void executeHelp(String[] args, PrintStream stream) throws Exception {
String subCmd = (args.length > 0) ? args[0] : "";
args = CoordinatorAdminUtils.copyArrayCutFirst(args);
if(subCmd.equals("get")) {
SubCommandGet.printHelp(stream);
} else if(subCmd.equals("pu... | [
"public",
"static",
"void",
"executeHelp",
"(",
"String",
"[",
"]",
"args",
",",
"PrintStream",
"stream",
")",
"throws",
"Exception",
"{",
"String",
"subCmd",
"=",
"(",
"args",
".",
"length",
">",
"0",
")",
"?",
"args",
"[",
"0",
"]",
":",
"\"\"",
";... | Parses command-line input and prints help menu.
@throws Exception | [
"Parses",
"command",
"-",
"line",
"input",
"and",
"prints",
"help",
"menu",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/restclient/src/java/voldemort/restclient/admin/CoordinatorAdminCommand.java#L71-L84 |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/database/SqlDocument.java | SqlDocument.indexOf | private int indexOf( String content, String needle, int offset ) {
"""
/*
Assume the needle will the found at the start/end of the line
"""
int index;
while( (index = content.indexOf(needle, offset)) != -1 ) {
String text = getLine(content, index).trim();
if (text.start... | java | private int indexOf( String content, String needle, int offset ) {
int index;
while( (index = content.indexOf(needle, offset)) != -1 ) {
String text = getLine(content, index).trim();
if (text.startsWith(needle) || text.endsWith(needle))
break;
else
... | [
"private",
"int",
"indexOf",
"(",
"String",
"content",
",",
"String",
"needle",
",",
"int",
"offset",
")",
"{",
"int",
"index",
";",
"while",
"(",
"(",
"index",
"=",
"content",
".",
"indexOf",
"(",
"needle",
",",
"offset",
")",
")",
"!=",
"-",
"1",
... | /*
Assume the needle will the found at the start/end of the line | [
"/",
"*",
"Assume",
"the",
"needle",
"will",
"the",
"found",
"at",
"the",
"start",
"/",
"end",
"of",
"the",
"line"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/database/SqlDocument.java#L342-L352 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/hmap/HMap.java | HMap.demand | public <V> V demand(TypeSafeKey<?, V> key) throws NoSuchElementException {
"""
Retrieve the value at this key, throwing a {@link NoSuchElementException} if this key is unmapped.
@param key the key
@param <V> the value type
@return the value at this key
@throws NoSuchElementException if the key is unmapped
... | java | public <V> V demand(TypeSafeKey<?, V> key) throws NoSuchElementException {
return get(key).orElseThrow(() -> new NoSuchElementException("Demanded value for key " + key + ", but couldn't find one."));
} | [
"public",
"<",
"V",
">",
"V",
"demand",
"(",
"TypeSafeKey",
"<",
"?",
",",
"V",
">",
"key",
")",
"throws",
"NoSuchElementException",
"{",
"return",
"get",
"(",
"key",
")",
".",
"orElseThrow",
"(",
"(",
")",
"->",
"new",
"NoSuchElementException",
"(",
"... | Retrieve the value at this key, throwing a {@link NoSuchElementException} if this key is unmapped.
@param key the key
@param <V> the value type
@return the value at this key
@throws NoSuchElementException if the key is unmapped | [
"Retrieve",
"the",
"value",
"at",
"this",
"key",
"throwing",
"a",
"{",
"@link",
"NoSuchElementException",
"}",
"if",
"this",
"key",
"is",
"unmapped",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/hmap/HMap.java#L61-L63 |
fnklabs/draenei | src/main/java/com/fnklabs/draenei/analytics/search/Facet.java | Facet.same | @Deprecated
public static boolean same(@NotNull Facet left, @NotNull Facet right) {
"""
Check whether specified facets are equals
@param left Facet
@param right Facet
@return
"""
if (left.getFacetType().getName().equals(FacetType.UNKNOWN) || right.getFacetType().getName().equals(FacetType.U... | java | @Deprecated
public static boolean same(@NotNull Facet left, @NotNull Facet right) {
if (left.getFacetType().getName().equals(FacetType.UNKNOWN) || right.getFacetType().getName().equals(FacetType.UNKNOWN)) {
return left.getValue().equals(right.getValue());
}
return left.equals(ri... | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"same",
"(",
"@",
"NotNull",
"Facet",
"left",
",",
"@",
"NotNull",
"Facet",
"right",
")",
"{",
"if",
"(",
"left",
".",
"getFacetType",
"(",
")",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"FacetType"... | Check whether specified facets are equals
@param left Facet
@param right Facet
@return | [
"Check",
"whether",
"specified",
"facets",
"are",
"equals"
] | train | https://github.com/fnklabs/draenei/blob/0a8cac54f1f635be3e2950375a23291d38453ae8/src/main/java/com/fnklabs/draenei/analytics/search/Facet.java#L34-L41 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/TriangularSolver_DDRM.java | TriangularSolver_DDRM.solveL | public static void solveL( double L[] , double []b , int n ) {
"""
<p>
Solves for non-singular lower triangular matrices using forward substitution.
<br>
b = L<sup>-1</sup>b<br>
<br>
where b is a vector, L is an n by n matrix.<br>
</p>
@param L An n by n non-singular lower triangular matrix. Not modified.... | java | public static void solveL( double L[] , double []b , int n )
{
// for( int i = 0; i < n; i++ ) {
// double sum = b[i];
// for( int k=0; k<i; k++ ) {
// sum -= L[i*n+k]* b[k];
// }
// b[i] = sum / L[i*n+i];
// }
for( int i = 0; i < n; i... | [
"public",
"static",
"void",
"solveL",
"(",
"double",
"L",
"[",
"]",
",",
"double",
"[",
"]",
"b",
",",
"int",
"n",
")",
"{",
"// for( int i = 0; i < n; i++ ) {",
"// double sum = b[i];",
"// for( int k=0; k<i; k++ ) {",
"// sum ... | <p>
Solves for non-singular lower triangular matrices using forward substitution.
<br>
b = L<sup>-1</sup>b<br>
<br>
where b is a vector, L is an n by n matrix.<br>
</p>
@param L An n by n non-singular lower triangular matrix. Not modified.
@param b A vector of length n. Modified.
@param n The size of the matrices. | [
"<p",
">",
"Solves",
"for",
"non",
"-",
"singular",
"lower",
"triangular",
"matrices",
"using",
"forward",
"substitution",
".",
"<br",
">",
"b",
"=",
"L<sup",
">",
"-",
"1<",
"/",
"sup",
">",
"b<br",
">",
"<br",
">",
"where",
"b",
"is",
"a",
"vector"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/TriangularSolver_DDRM.java#L89-L106 |
redisson/redisson | redisson/src/main/java/org/redisson/liveobject/misc/ClassUtils.java | ClassUtils.searchForMethod | public static Method searchForMethod(Class<?> type, String name, Class<?>[] parms) {
"""
Searches through all methods looking for one with the specified name that
will take the specified paramaters even if the parameter types are more
generic in the actual method implementation. This is similar to the
findConst... | java | public static Method searchForMethod(Class<?> type, String name, Class<?>[] parms) {
try {
return type.getMethod(name, parms);
} catch (NoSuchMethodException e) {}
Method[] methods = type.getMethods();
for (int i = 0; i < methods.length; i++) {
// Has to be named ... | [
"public",
"static",
"Method",
"searchForMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parms",
")",
"{",
"try",
"{",
"return",
"type",
".",
"getMethod",
"(",
"name",
",",
"parms",
")",
"... | Searches through all methods looking for one with the specified name that
will take the specified paramaters even if the parameter types are more
generic in the actual method implementation. This is similar to the
findConstructor() method and has the similar limitations that it doesn't
do a real widening scope search a... | [
"Searches",
"through",
"all",
"methods",
"looking",
"for",
"one",
"with",
"the",
"specified",
"name",
"that",
"will",
"take",
"the",
"specified",
"paramaters",
"even",
"if",
"the",
"parameter",
"types",
"are",
"more",
"generic",
"in",
"the",
"actual",
"method"... | train | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/liveobject/misc/ClassUtils.java#L169-L192 |
alkacon/opencms-core | src/org/opencms/importexport/A_CmsImport.java | A_CmsImport.checkImmutable | protected boolean checkImmutable(String translatedName, List<String> immutableResources) {
"""
Checks if the resources is in the list of immutalbe resources. <p>
@param translatedName the name of the resource
@param immutableResources the list of the immutable resources
@return true or false
"""
... | java | protected boolean checkImmutable(String translatedName, List<String> immutableResources) {
boolean resourceNotImmutable = true;
if (immutableResources.contains(translatedName)) {
if (LOG.isDebugEnabled()) {
LOG.debug(
Messages.get().getBundle().key(Messag... | [
"protected",
"boolean",
"checkImmutable",
"(",
"String",
"translatedName",
",",
"List",
"<",
"String",
">",
"immutableResources",
")",
"{",
"boolean",
"resourceNotImmutable",
"=",
"true",
";",
"if",
"(",
"immutableResources",
".",
"contains",
"(",
"translatedName",
... | Checks if the resources is in the list of immutalbe resources. <p>
@param translatedName the name of the resource
@param immutableResources the list of the immutable resources
@return true or false | [
"Checks",
"if",
"the",
"resources",
"is",
"in",
"the",
"list",
"of",
"immutalbe",
"resources",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/A_CmsImport.java#L380-L412 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.associateValue | public synchronized final Object associateValue(Object key, Object value) {
"""
Associate arbitrary application-specific value with this object.
Value can only be associated with the given object and key only once.
The method ignores any subsequent attempts to change the already
associated value.
<p> The assoc... | java | public synchronized final Object associateValue(Object key, Object value)
{
if (value == null) throw new IllegalArgumentException();
Map<Object,Object> h = associatedValues;
if (h == null) {
h = new HashMap<Object,Object>();
associatedValues = h;
}
ret... | [
"public",
"synchronized",
"final",
"Object",
"associateValue",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"Map",
"<",
"Object",
",",
"Object",
">... | Associate arbitrary application-specific value with this object.
Value can only be associated with the given object and key only once.
The method ignores any subsequent attempts to change the already
associated value.
<p> The associated values are not serialized.
@param key key object to select particular value.
@param... | [
"Associate",
"arbitrary",
"application",
"-",
"specific",
"value",
"with",
"this",
"object",
".",
"Value",
"can",
"only",
"be",
"associated",
"with",
"the",
"given",
"object",
"and",
"key",
"only",
"once",
".",
"The",
"method",
"ignores",
"any",
"subsequent",
... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2782-L2791 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/strutsutil/ModelListAction.java | ModelListAction.setModellistByModel | private void setModellistByModel(ModelListForm listForm, PageIterator pageIterator, HttpServletRequest request) {
"""
/*
the elements in pageIterator is Model type we directly add them in result
"""
Collection c = null;
try {
listForm.setAllCount(pageIterator.getAllCount());
if (pageIterator.get... | java | private void setModellistByModel(ModelListForm listForm, PageIterator pageIterator, HttpServletRequest request) {
Collection c = null;
try {
listForm.setAllCount(pageIterator.getAllCount());
if (pageIterator.getCount() != 0)
listForm.setCount(pageIterator.getCount());
c = new ArrayList(pageIterat... | [
"private",
"void",
"setModellistByModel",
"(",
"ModelListForm",
"listForm",
",",
"PageIterator",
"pageIterator",
",",
"HttpServletRequest",
"request",
")",
"{",
"Collection",
"c",
"=",
"null",
";",
"try",
"{",
"listForm",
".",
"setAllCount",
"(",
"pageIterator",
"... | /*
the elements in pageIterator is Model type we directly add them in result | [
"/",
"*",
"the",
"elements",
"in",
"pageIterator",
"is",
"Model",
"type",
"we",
"directly",
"add",
"them",
"in",
"result"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/strutsutil/ModelListAction.java#L100-L119 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BitSieve.java | BitSieve.retrieve | BigInteger retrieve(BigInteger initValue, int certainty, java.util.Random random) {
"""
Test probable primes in the sieve and return successful candidates.
"""
// Examine the sieve one long at a time to find possible primes
int offset = 1;
for (int i=0; i<bits.length; i++) {
... | java | BigInteger retrieve(BigInteger initValue, int certainty, java.util.Random random) {
// Examine the sieve one long at a time to find possible primes
int offset = 1;
for (int i=0; i<bits.length; i++) {
long nextLong = ~bits[i];
for (int j=0; j<64; j++) {
if ... | [
"BigInteger",
"retrieve",
"(",
"BigInteger",
"initValue",
",",
"int",
"certainty",
",",
"java",
".",
"util",
".",
"Random",
"random",
")",
"{",
"// Examine the sieve one long at a time to find possible primes",
"int",
"offset",
"=",
"1",
";",
"for",
"(",
"int",
"i... | Test probable primes in the sieve and return successful candidates. | [
"Test",
"probable",
"primes",
"in",
"the",
"sieve",
"and",
"return",
"successful",
"candidates",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BitSieve.java#L194-L211 |
jenetics/jenetics | jenetics.ext/src/main/java/io/jenetics/ext/util/TreeNode.java | TreeNode.ofTree | public static <T> TreeNode<T> ofTree(final Tree<? extends T, ?> tree) {
"""
Return a new {@code TreeNode} from the given source {@code tree}. The
whole tree is copied.
@param tree the source tree the new tree-node is created from
@param <T> the current tree value type
@return a new {@code TreeNode} from the ... | java | public static <T> TreeNode<T> ofTree(final Tree<? extends T, ?> tree) {
return ofTree(tree, Function.identity());
} | [
"public",
"static",
"<",
"T",
">",
"TreeNode",
"<",
"T",
">",
"ofTree",
"(",
"final",
"Tree",
"<",
"?",
"extends",
"T",
",",
"?",
">",
"tree",
")",
"{",
"return",
"ofTree",
"(",
"tree",
",",
"Function",
".",
"identity",
"(",
")",
")",
";",
"}"
] | Return a new {@code TreeNode} from the given source {@code tree}. The
whole tree is copied.
@param tree the source tree the new tree-node is created from
@param <T> the current tree value type
@return a new {@code TreeNode} from the given source {@code tree}
@throws NullPointerException if the source {@code tree} is {... | [
"Return",
"a",
"new",
"{",
"@code",
"TreeNode",
"}",
"from",
"the",
"given",
"source",
"{",
"@code",
"tree",
"}",
".",
"The",
"whole",
"tree",
"is",
"copied",
"."
] | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics.ext/src/main/java/io/jenetics/ext/util/TreeNode.java#L512-L514 |
strator-dev/greenpepper-open | extensions-external/fit/src/main/java/com/greenpepper/extensions/fit/Fit.java | Fit.isAnActionFitInterpreter | public static boolean isAnActionFitInterpreter(SystemUnderDevelopment sud, String name) {
"""
<p>isAnActionFitInterpreter.</p>
@param sud a {@link com.greenpepper.systemunderdevelopment.SystemUnderDevelopment} object.
@param name a {@link java.lang.String} object.
@return a boolean.
"""
try
... | java | public static boolean isAnActionFitInterpreter(SystemUnderDevelopment sud, String name)
{
try
{
Object target = sud.getFixture(name).getTarget();
if (target.getClass().equals(ActionFixture.class))
return false;
if (target instanceof ActionFixture... | [
"public",
"static",
"boolean",
"isAnActionFitInterpreter",
"(",
"SystemUnderDevelopment",
"sud",
",",
"String",
"name",
")",
"{",
"try",
"{",
"Object",
"target",
"=",
"sud",
".",
"getFixture",
"(",
"name",
")",
".",
"getTarget",
"(",
")",
";",
"if",
"(",
"... | <p>isAnActionFitInterpreter.</p>
@param sud a {@link com.greenpepper.systemunderdevelopment.SystemUnderDevelopment} object.
@param name a {@link java.lang.String} object.
@return a boolean. | [
"<p",
">",
"isAnActionFitInterpreter",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper-open/blob/71fd244b4989e9cd2d07ae62dd954a1f2a269a92/extensions-external/fit/src/main/java/com/greenpepper/extensions/fit/Fit.java#L51-L66 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/ApplicationMetadata.java | ApplicationMetadata.addQueryToCollection | public void addQueryToCollection(String queryName, String query, boolean isNativeQuery, Class clazz) {
"""
Adds parameterised query with given name into collection. Throws
exception if duplicate name is provided.
@param queryName
query name.
@param query
named/native query.
@param isNativeQuery
true, if i... | java | public void addQueryToCollection(String queryName, String query, boolean isNativeQuery, Class clazz)
{
if (namedNativeQueries == null)
{
namedNativeQueries = new ConcurrentHashMap<String, QueryWrapper>();
}
if (!namedNativeQueries.containsKey(queryName))
{
... | [
"public",
"void",
"addQueryToCollection",
"(",
"String",
"queryName",
",",
"String",
"query",
",",
"boolean",
"isNativeQuery",
",",
"Class",
"clazz",
")",
"{",
"if",
"(",
"namedNativeQueries",
"==",
"null",
")",
"{",
"namedNativeQueries",
"=",
"new",
"Concurrent... | Adds parameterised query with given name into collection. Throws
exception if duplicate name is provided.
@param queryName
query name.
@param query
named/native query.
@param isNativeQuery
true, if it is a namednativequery. | [
"Adds",
"parameterised",
"query",
"with",
"given",
"name",
"into",
"collection",
".",
"Throws",
"exception",
"if",
"duplicate",
"name",
"is",
"provided",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/ApplicationMetadata.java#L241-L259 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/message/external/XmlTrxMessageIn.java | XmlTrxMessageIn.getMessageBody | public org.w3c.dom.Node getMessageBody(Object rawData, boolean bReturnCopy) {
"""
Get the SOAP message body as a DOM node.
@param message the SOAP message.
@param bReturnCopy Return a copy of the message node, instead of the actual node.
@return The DOM node containing the message body.
"""
if (this... | java | public org.w3c.dom.Node getMessageBody(Object rawData, boolean bReturnCopy)
{
if (this.getRawData() instanceof String)
{ // Always
String strXML = this.getXML();
return Utility.convertXMLToDOM(strXML);
}
return super.getMessageBody(rawData, bReturnCopy);
... | [
"public",
"org",
".",
"w3c",
".",
"dom",
".",
"Node",
"getMessageBody",
"(",
"Object",
"rawData",
",",
"boolean",
"bReturnCopy",
")",
"{",
"if",
"(",
"this",
".",
"getRawData",
"(",
")",
"instanceof",
"String",
")",
"{",
"// Always",
"String",
"strXML",
... | Get the SOAP message body as a DOM node.
@param message the SOAP message.
@param bReturnCopy Return a copy of the message node, instead of the actual node.
@return The DOM node containing the message body. | [
"Get",
"the",
"SOAP",
"message",
"body",
"as",
"a",
"DOM",
"node",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/message/external/XmlTrxMessageIn.java#L70-L78 |
jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java | SecondsDescriptor.describe | protected String describe(final FieldExpression fieldExpression, final boolean and) {
"""
Given a CronFieldExpression, provide a String with a human readable description.
Will identify CronFieldExpression subclasses and delegate.
@param fieldExpression - CronFieldExpression instance - not null
@param and ... | java | protected String describe(final FieldExpression fieldExpression, final boolean and) {
Preconditions.checkNotNull(fieldExpression, "CronFieldExpression should not be null!");
if (fieldExpression instanceof Always) {
return describe(fieldExpression, and);
}
if (fieldExpression ... | [
"protected",
"String",
"describe",
"(",
"final",
"FieldExpression",
"fieldExpression",
",",
"final",
"boolean",
"and",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"fieldExpression",
",",
"\"CronFieldExpression should not be null!\"",
")",
";",
"if",
"(",
"fie... | Given a CronFieldExpression, provide a String with a human readable description.
Will identify CronFieldExpression subclasses and delegate.
@param fieldExpression - CronFieldExpression instance - not null
@param and - boolean expression that indicates if description should fit an "and" context
@return huma... | [
"Given",
"a",
"CronFieldExpression",
"provide",
"a",
"String",
"with",
"a",
"human",
"readable",
"description",
".",
"Will",
"identify",
"CronFieldExpression",
"subclasses",
"and",
"delegate",
"."
] | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java#L50-L68 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XDSAuditor.java | XDSAuditor.auditQueryEvent | protected void auditQueryEvent(
boolean systemIsSource, // System Type
IHETransactionEventTypeCodes transaction, RFC3881EventOutcomeCodes eventOutcome, // Event
String auditSourceId, String auditSourceEnterpriseSiteId, // Audit Source
String sourceUserId, String sourceAltUserId, String sourceUserName, Strin... | java | protected void auditQueryEvent(
boolean systemIsSource, // System Type
IHETransactionEventTypeCodes transaction, RFC3881EventOutcomeCodes eventOutcome, // Event
String auditSourceId, String auditSourceEnterpriseSiteId, // Audit Source
String sourceUserId, String sourceAltUserId, String sourceUserName, Strin... | [
"protected",
"void",
"auditQueryEvent",
"(",
"boolean",
"systemIsSource",
",",
"// System Type",
"IHETransactionEventTypeCodes",
"transaction",
",",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"// Event",
"String",
"auditSourceId",
",",
"String",
"auditSourceEnterpriseSite... | Audits a QUERY event for IHE XDS transactions, notably
XDS Registry Query and XDS Registry Stored Query transactions.
@param systemIsSource Whether the system sending the message is the source active participant
@param transaction IHE Transaction sending the message
@param eventOutcome The event outcome indicator
@par... | [
"Audits",
"a",
"QUERY",
"event",
"for",
"IHE",
"XDS",
"transactions",
"notably",
"XDS",
"Registry",
"Query",
"and",
"XDS",
"Registry",
"Stored",
"Query",
"transactions",
"."
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XDSAuditor.java#L55-L95 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java | ComponentsInner.getPurgeStatus | public ComponentPurgeStatusResponseInner getPurgeStatus(String resourceGroupName, String resourceName, String purgeId) {
"""
Get status for an ongoing purge operation.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param p... | java | public ComponentPurgeStatusResponseInner getPurgeStatus(String resourceGroupName, String resourceName, String purgeId) {
return getPurgeStatusWithServiceResponseAsync(resourceGroupName, resourceName, purgeId).toBlocking().single().body();
} | [
"public",
"ComponentPurgeStatusResponseInner",
"getPurgeStatus",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"purgeId",
")",
"{",
"return",
"getPurgeStatusWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
"p... | Get status for an ongoing purge operation.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param purgeId In a purge status request, this is the Id of the operation the status of which is returned.
@throws IllegalArgumentException th... | [
"Get",
"status",
"for",
"an",
"ongoing",
"purge",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java#L882-L884 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java | CommercePriceListPersistenceImpl.removeByLtD_S | @Override
public void removeByLtD_S(Date displayDate, int status) {
"""
Removes all the commerce price lists where displayDate < ? and status = ? from the database.
@param displayDate the display date
@param status the status
"""
for (CommercePriceList commercePriceList : findByLtD_S(displayD... | java | @Override
public void removeByLtD_S(Date displayDate, int status) {
for (CommercePriceList commercePriceList : findByLtD_S(displayDate,
status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commercePriceList);
}
} | [
"@",
"Override",
"public",
"void",
"removeByLtD_S",
"(",
"Date",
"displayDate",
",",
"int",
"status",
")",
"{",
"for",
"(",
"CommercePriceList",
"commercePriceList",
":",
"findByLtD_S",
"(",
"displayDate",
",",
"status",
",",
"QueryUtil",
".",
"ALL_POS",
",",
... | Removes all the commerce price lists where displayDate < ? and status = ? from the database.
@param displayDate the display date
@param status the status | [
"Removes",
"all",
"the",
"commerce",
"price",
"lists",
"where",
"displayDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListPersistenceImpl.java#L4821-L4827 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.setex | @Override
public String setex(final byte[] key, final int seconds, final byte[] value) {
"""
The command is exactly equivalent to the following group of commands:
{@link #set(byte[], byte[]) SET} + {@link #expire(byte[], int) EXPIRE}. The operation is
atomic.
<p>
Time complexity: O(1)
@param key
@param sec... | java | @Override
public String setex(final byte[] key, final int seconds, final byte[] value) {
checkIsInMultiOrPipeline();
client.setex(key, seconds, value);
return client.getStatusCodeReply();
} | [
"@",
"Override",
"public",
"String",
"setex",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"int",
"seconds",
",",
"final",
"byte",
"[",
"]",
"value",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"setex",
"(",
"key",
",",
... | The command is exactly equivalent to the following group of commands:
{@link #set(byte[], byte[]) SET} + {@link #expire(byte[], int) EXPIRE}. The operation is
atomic.
<p>
Time complexity: O(1)
@param key
@param seconds
@param value
@return Status code reply | [
"The",
"command",
"is",
"exactly",
"equivalent",
"to",
"the",
"following",
"group",
"of",
"commands",
":",
"{"
] | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L660-L665 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.create_POINTER_Image | protected BufferedImage create_POINTER_Image(final int WIDTH, final PointerType POINTER_TYPE) {
"""
Returns the image of the pointer. This pointer is centered in the gauge.
@param WIDTH
@param POINTER_TYPE
@return the pointer image that is used in all gauges that have a centered pointer
"""
if (getP... | java | protected BufferedImage create_POINTER_Image(final int WIDTH, final PointerType POINTER_TYPE) {
if (getPointerColor() != ColorDef.CUSTOM) {
return POINTER_FACTORY.createStandardPointer(WIDTH, POINTER_TYPE, getPointerColor(), getBackgroundColor());
} else {
return POINTER_FACTORY.... | [
"protected",
"BufferedImage",
"create_POINTER_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"PointerType",
"POINTER_TYPE",
")",
"{",
"if",
"(",
"getPointerColor",
"(",
")",
"!=",
"ColorDef",
".",
"CUSTOM",
")",
"{",
"return",
"POINTER_FACTORY",
".",
"creat... | Returns the image of the pointer. This pointer is centered in the gauge.
@param WIDTH
@param POINTER_TYPE
@return the pointer image that is used in all gauges that have a centered pointer | [
"Returns",
"the",
"image",
"of",
"the",
"pointer",
".",
"This",
"pointer",
"is",
"centered",
"in",
"the",
"gauge",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L2968-L2974 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.asDate | public static <T extends Comparable<?>> DateExpression<T> asDate(Expression<T> expr) {
"""
Create a new DateExpression
@param expr the date Expression
@return new DateExpression
"""
Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
if (underlyingMixin instanceof PathImpl) {
... | java | public static <T extends Comparable<?>> DateExpression<T> asDate(Expression<T> expr) {
Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
if (underlyingMixin instanceof PathImpl) {
return new DatePath<T>((PathImpl<T>) underlyingMixin);
} else if (underlyingMixin instanceo... | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
">",
">",
"DateExpression",
"<",
"T",
">",
"asDate",
"(",
"Expression",
"<",
"T",
">",
"expr",
")",
"{",
"Expression",
"<",
"T",
">",
"underlyingMixin",
"=",
"ExpressionUtils",
".",
"extrac... | Create a new DateExpression
@param expr the date Expression
@return new DateExpression | [
"Create",
"a",
"new",
"DateExpression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L1938-L1959 |
yavijava/yavijava | src/main/java/com/vmware/vim25/ws/XmlGen.java | XmlGen.createMOR | @Deprecated
public static ManagedObjectReference createMOR(String type, String value) {
"""
Switch usage of this to the MorUtil
@param type Type of ManagedObject to create a reference for.
@param value Value of said ManagedObjectReference
@return ManagedObjectReverence
@deprecated Switch usage to {@link... | java | @Deprecated
public static ManagedObjectReference createMOR(String type, String value) {
return MorUtil.createMOR(type, value);
} | [
"@",
"Deprecated",
"public",
"static",
"ManagedObjectReference",
"createMOR",
"(",
"String",
"type",
",",
"String",
"value",
")",
"{",
"return",
"MorUtil",
".",
"createMOR",
"(",
"type",
",",
"value",
")",
";",
"}"
] | Switch usage of this to the MorUtil
@param type Type of ManagedObject to create a reference for.
@param value Value of said ManagedObjectReference
@return ManagedObjectReverence
@deprecated Switch usage to {@link com.vmware.vim25.mo.util.MorUtil#createMOR(String, String)} | [
"Switch",
"usage",
"of",
"this",
"to",
"the",
"MorUtil"
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/ws/XmlGen.java#L197-L200 |
duracloud/duracloud | storageprovider/src/main/java/org/duracloud/storage/xml/StorageAccountsDocumentBinding.java | StorageAccountsDocumentBinding.createStorageAccountsFrom | public List<StorageAccount> createStorageAccountsFrom(Element accounts) {
"""
This method deserializes the provided xml into a durastore acct config object.
@param accounts
@return
"""
List<StorageAccount> accts = new ArrayList<StorageAccount>();
try {
Iterator<?> accountList = ... | java | public List<StorageAccount> createStorageAccountsFrom(Element accounts) {
List<StorageAccount> accts = new ArrayList<StorageAccount>();
try {
Iterator<?> accountList = accounts.getChildren().iterator();
while (accountList.hasNext()) {
Element accountXml = (Element... | [
"public",
"List",
"<",
"StorageAccount",
">",
"createStorageAccountsFrom",
"(",
"Element",
"accounts",
")",
"{",
"List",
"<",
"StorageAccount",
">",
"accts",
"=",
"new",
"ArrayList",
"<",
"StorageAccount",
">",
"(",
")",
";",
"try",
"{",
"Iterator",
"<",
"?"... | This method deserializes the provided xml into a durastore acct config object.
@param accounts
@return | [
"This",
"method",
"deserializes",
"the",
"provided",
"xml",
"into",
"a",
"durastore",
"acct",
"config",
"object",
"."
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storageprovider/src/main/java/org/duracloud/storage/xml/StorageAccountsDocumentBinding.java#L60-L95 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java | AbstractManagedChannelImplBuilder.makeTargetStringForDirectAddress | @VisibleForTesting
static String makeTargetStringForDirectAddress(SocketAddress address) {
"""
Returns a target string for the SocketAddress. It is only used as a placeholder, because
DirectAddressNameResolverFactory will not actually try to use it. However, it must be a valid
URI.
"""
try {
retu... | java | @VisibleForTesting
static String makeTargetStringForDirectAddress(SocketAddress address) {
try {
return new URI(DIRECT_ADDRESS_SCHEME, "", "/" + address, null).toString();
} catch (URISyntaxException e) {
// It should not happen.
throw new RuntimeException(e);
}
} | [
"@",
"VisibleForTesting",
"static",
"String",
"makeTargetStringForDirectAddress",
"(",
"SocketAddress",
"address",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"DIRECT_ADDRESS_SCHEME",
",",
"\"\"",
",",
"\"/\"",
"+",
"address",
",",
"null",
")",
".",
"toSt... | Returns a target string for the SocketAddress. It is only used as a placeholder, because
DirectAddressNameResolverFactory will not actually try to use it. However, it must be a valid
URI. | [
"Returns",
"a",
"target",
"string",
"for",
"the",
"SocketAddress",
".",
"It",
"is",
"only",
"used",
"as",
"a",
"placeholder",
"because",
"DirectAddressNameResolverFactory",
"will",
"not",
"actually",
"try",
"to",
"use",
"it",
".",
"However",
"it",
"must",
"be"... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java#L191-L199 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/MalisisCore.java | MalisisCore.openConfigurationGui | @SideOnly(Side.CLIENT)
public static boolean openConfigurationGui(IMalisisMod mod) {
"""
Open the configuration GUI for the {@link IMalisisMod}.
@param mod the mod to open the GUI for
@return true, if a the mod had {@link Settings} and the GUI was opened, false otherwise
"""
Settings settings = mod.getS... | java | @SideOnly(Side.CLIENT)
public static boolean openConfigurationGui(IMalisisMod mod)
{
Settings settings = mod.getSettings();
if (settings == null)
return false;
new ConfigurationGui(mod, settings).display(true);
return true;
} | [
"@",
"SideOnly",
"(",
"Side",
".",
"CLIENT",
")",
"public",
"static",
"boolean",
"openConfigurationGui",
"(",
"IMalisisMod",
"mod",
")",
"{",
"Settings",
"settings",
"=",
"mod",
".",
"getSettings",
"(",
")",
";",
"if",
"(",
"settings",
"==",
"null",
")",
... | Open the configuration GUI for the {@link IMalisisMod}.
@param mod the mod to open the GUI for
@return true, if a the mod had {@link Settings} and the GUI was opened, false otherwise | [
"Open",
"the",
"configuration",
"GUI",
"for",
"the",
"{",
"@link",
"IMalisisMod",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/MalisisCore.java#L299-L309 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java | TriangularSolver_DSCC.solveTranL | public static void solveTranL(DMatrixSparseCSC L , double []x ) {
"""
Solves for the transpose of a lower triangular matrix against a dense matrix. L<sup>T</sup>*x = b
@param L Lower triangular matrix. Diagonal elements are assumed to be non-zero
@param x (Input) Solution matrix 'b'. (Output) matrix 'x'
... | java | public static void solveTranL(DMatrixSparseCSC L , double []x )
{
final int N = L.numCols;
for (int j = N-1; j >= 0; j--) {
int idx0 = L.col_idx[j];
int idx1 = L.col_idx[j+1];
for (int p = idx0+1; p < idx1; p++) {
x[j] -= L.nz_values[p]*x[L.nz_ro... | [
"public",
"static",
"void",
"solveTranL",
"(",
"DMatrixSparseCSC",
"L",
",",
"double",
"[",
"]",
"x",
")",
"{",
"final",
"int",
"N",
"=",
"L",
".",
"numCols",
";",
"for",
"(",
"int",
"j",
"=",
"N",
"-",
"1",
";",
"j",
">=",
"0",
";",
"j",
"--",... | Solves for the transpose of a lower triangular matrix against a dense matrix. L<sup>T</sup>*x = b
@param L Lower triangular matrix. Diagonal elements are assumed to be non-zero
@param x (Input) Solution matrix 'b'. (Output) matrix 'x' | [
"Solves",
"for",
"the",
"transpose",
"of",
"a",
"lower",
"triangular",
"matrix",
"against",
"a",
"dense",
"matrix",
".",
"L<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"x",
"=",
"b"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/misc/TriangularSolver_DSCC.java#L65-L78 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/ClassLoaders.java | ClassLoaders.getResource | public static URL getResource(String resourceName, Class<?> callingClass) {
"""
Load a given resource(Cannot start with slash /).
<p/>
This method will try to load the resource using the following methods (in order):
<ul>
<li>From {@link Thread#getContextClassLoader() Thread.currentThread().getContextClassLoad... | java | public static URL getResource(String resourceName, Class<?> callingClass) {
URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName);
if (url != null) return url;
url = ClassLoaders.class.getClassLoader().getResource(resourceName);
if (url != null) return url;
ClassLoader... | [
"public",
"static",
"URL",
"getResource",
"(",
"String",
"resourceName",
",",
"Class",
"<",
"?",
">",
"callingClass",
")",
"{",
"URL",
"url",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
".",
"getResource",
"(",
"r... | Load a given resource(Cannot start with slash /).
<p/>
This method will try to load the resource using the following methods (in order):
<ul>
<li>From {@link Thread#getContextClassLoader() Thread.currentThread().getContextClassLoader()}
<li>From {@link Class#getClassLoader() ClassLoaders.class.getClassLoader()}
<li>Fro... | [
"Load",
"a",
"given",
"resource",
"(",
"Cannot",
"start",
"with",
"slash",
"/",
")",
".",
"<p",
"/",
">",
"This",
"method",
"will",
"try",
"to",
"load",
"the",
"resource",
"using",
"the",
"following",
"methods",
"(",
"in",
"order",
")",
":",
"<ul",
"... | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/ClassLoaders.java#L75-L85 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.containsAny | public static boolean containsAny(String str, String searchChars) {
"""
<p>
Checks if the String contains any character in the given set of characters.
</p>
<p>
A <code>null</code> String will return <code>false</code>. A <code>null</code> search string will return
<code>false</code>.
</p>
<pre>
GosuSt... | java | public static boolean containsAny(String str, String searchChars) {
if (searchChars == null) {
return false;
}
return containsAny(str, searchChars.toCharArray());
} | [
"public",
"static",
"boolean",
"containsAny",
"(",
"String",
"str",
",",
"String",
"searchChars",
")",
"{",
"if",
"(",
"searchChars",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"containsAny",
"(",
"str",
",",
"searchChars",
".",
"toChar... | <p>
Checks if the String contains any character in the given set of characters.
</p>
<p>
A <code>null</code> String will return <code>false</code>. A <code>null</code> search string will return
<code>false</code>.
</p>
<pre>
GosuStringUtil.containsAny(null, *) = false
GosuStringUtil.containsAny("", *) ... | [
"<p",
">",
"Checks",
"if",
"the",
"String",
"contains",
"any",
"character",
"in",
"the",
"given",
"set",
"of",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L1178-L1183 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getChildren | public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException {
"""
Get the children
@param filter to filter the children
@return the children
@throws IOException for any problem accessing the virtual file system
@throws IllegalStateException if the file is closed or it is a lea... | java | public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException {
// isDirectory does the read security check
if (!isDirectory()) { return Collections.emptyList(); }
if (filter == null) { filter = MatchAllVirtualFileFilter.INSTANCE; }
FilterVirtualFileVisitor visitor = ... | [
"public",
"List",
"<",
"VirtualFile",
">",
"getChildren",
"(",
"VirtualFileFilter",
"filter",
")",
"throws",
"IOException",
"{",
"// isDirectory does the read security check",
"if",
"(",
"!",
"isDirectory",
"(",
")",
")",
"{",
"return",
"Collections",
".",
"emptyLis... | Get the children
@param filter to filter the children
@return the children
@throws IOException for any problem accessing the virtual file system
@throws IllegalStateException if the file is closed or it is a leaf node | [
"Get",
"the",
"children"
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L422-L429 |
katharsis-project/katharsis-framework | katharsis-core/src/main/java/io/katharsis/core/internal/utils/ClassUtils.java | ClassUtils.findMethodWith | public static Method findMethodWith(Class<?> searchClass, Class<? extends Annotation> annotationClass) {
"""
Return a first occurrence of a method annotated with specified annotation
@param searchClass class to be searched
@param annotationClass annotation class
@return annotated method or null
"""
... | java | public static Method findMethodWith(Class<?> searchClass, Class<? extends Annotation> annotationClass) {
Method foundMethod = null;
methodFinder: while (searchClass != null && searchClass != Object.class) {
for (Method method : searchClass.getDeclaredMethods()) {
if (method.isAnnotationPresent(annotationClas... | [
"public",
"static",
"Method",
"findMethodWith",
"(",
"Class",
"<",
"?",
">",
"searchClass",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"Method",
"foundMethod",
"=",
"null",
";",
"methodFinder",
":",
"while",
"(",
"sear... | Return a first occurrence of a method annotated with specified annotation
@param searchClass class to be searched
@param annotationClass annotation class
@return annotated method or null | [
"Return",
"a",
"first",
"occurrence",
"of",
"a",
"method",
"annotated",
"with",
"specified",
"annotation"
] | train | https://github.com/katharsis-project/katharsis-framework/blob/73d1a8763c49c5cf4643d43e2dbfedb647630c46/katharsis-core/src/main/java/io/katharsis/core/internal/utils/ClassUtils.java#L194-L207 |
phax/ph-commons | ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java | AbstractMapBasedWALDAO.internalDeleteItem | @MustBeLocked (ELockType.WRITE)
@Nullable
protected final IMPLTYPE internalDeleteItem (@Nullable final String sID, final boolean bInvokeCallbacks) {
"""
Delete the item by removing it from the map. If something was remove the
onDeleteItem callback is invoked. Must only be invoked inside a write-lock.
@para... | java | @MustBeLocked (ELockType.WRITE)
@Nullable
protected final IMPLTYPE internalDeleteItem (@Nullable final String sID, final boolean bInvokeCallbacks)
{
if (StringHelper.hasNoText (sID))
return null;
final IMPLTYPE aDeletedItem = m_aMap.remove (sID);
if (aDeletedItem == null)
return null;
... | [
"@",
"MustBeLocked",
"(",
"ELockType",
".",
"WRITE",
")",
"@",
"Nullable",
"protected",
"final",
"IMPLTYPE",
"internalDeleteItem",
"(",
"@",
"Nullable",
"final",
"String",
"sID",
",",
"final",
"boolean",
"bInvokeCallbacks",
")",
"{",
"if",
"(",
"StringHelper",
... | Delete the item by removing it from the map. If something was remove the
onDeleteItem callback is invoked. Must only be invoked inside a write-lock.
@param sID
The ID to be removed. May be <code>null</code>.
@param bInvokeCallbacks
<code>true</code> to invoke callbacks, <code>false</code> to not do
so.
@return The del... | [
"Delete",
"the",
"item",
"by",
"removing",
"it",
"from",
"the",
"map",
".",
"If",
"something",
"was",
"remove",
"the",
"onDeleteItem",
"callback",
"is",
"invoked",
".",
"Must",
"only",
"be",
"invoked",
"inside",
"a",
"write",
"-",
"lock",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java#L406-L426 |
bThink-BGU/BPjs | src/main/java/il/ac/bgu/cs/bp/bpjs/execution/jsproxy/BProgramJsProxy.java | BProgramJsProxy.registerBThread | public void registerBThread(String name, Function func) {
"""
Called from JS to add BThreads running func as their runnable code.
@param name Name of the registered BThread (useful for debugging).
@param func Script entry point of the BThread.
@see #registerBThread(org.mozilla.javascript.Function)
"""
... | java | public void registerBThread(String name, Function func) {
program.registerBThread(new BThreadSyncSnapshot(name, func));
} | [
"public",
"void",
"registerBThread",
"(",
"String",
"name",
",",
"Function",
"func",
")",
"{",
"program",
".",
"registerBThread",
"(",
"new",
"BThreadSyncSnapshot",
"(",
"name",
",",
"func",
")",
")",
";",
"}"
] | Called from JS to add BThreads running func as their runnable code.
@param name Name of the registered BThread (useful for debugging).
@param func Script entry point of the BThread.
@see #registerBThread(org.mozilla.javascript.Function) | [
"Called",
"from",
"JS",
"to",
"add",
"BThreads",
"running",
"func",
"as",
"their",
"runnable",
"code",
"."
] | train | https://github.com/bThink-BGU/BPjs/blob/2d388365a27ad79ded108eaf98a35a7ef292ae1f/src/main/java/il/ac/bgu/cs/bp/bpjs/execution/jsproxy/BProgramJsProxy.java#L122-L124 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java | WorkspacePersistentDataManager.doRename | protected void doRename(final ItemData item, final WorkspaceStorageConnection con, final Set<QPath> addedNodes)
throws RepositoryException, InvalidItemStateException {
"""
Perform node rename.
@param item
@param con
@param addedNodes
@throws RepositoryException
@throws InvalidItemStateException
""... | java | protected void doRename(final ItemData item, final WorkspaceStorageConnection con, final Set<QPath> addedNodes)
throws RepositoryException, InvalidItemStateException
{
final NodeData node = (NodeData)item;
checkSameNameSibling(node, con, addedNodes);
addedNodes.add(node.getQPath());
c... | [
"protected",
"void",
"doRename",
"(",
"final",
"ItemData",
"item",
",",
"final",
"WorkspaceStorageConnection",
"con",
",",
"final",
"Set",
"<",
"QPath",
">",
"addedNodes",
")",
"throws",
"RepositoryException",
",",
"InvalidItemStateException",
"{",
"final",
"NodeDat... | Perform node rename.
@param item
@param con
@param addedNodes
@throws RepositoryException
@throws InvalidItemStateException | [
"Perform",
"node",
"rename",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java#L1217-L1226 |
jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java | GenericRepository.byMandatoryPredicate | protected <R> Predicate byMandatoryPredicate(CriteriaQuery<?> criteriaQuery, Root<E> root, CriteriaBuilder builder, E entity, SearchParameters sp) {
"""
/*
You may override this method to add a Predicate to the default find method.
"""
return null;
} | java | protected <R> Predicate byMandatoryPredicate(CriteriaQuery<?> criteriaQuery, Root<E> root, CriteriaBuilder builder, E entity, SearchParameters sp) {
return null;
} | [
"protected",
"<",
"R",
">",
"Predicate",
"byMandatoryPredicate",
"(",
"CriteriaQuery",
"<",
"?",
">",
"criteriaQuery",
",",
"Root",
"<",
"E",
">",
"root",
",",
"CriteriaBuilder",
"builder",
",",
"E",
"entity",
",",
"SearchParameters",
"sp",
")",
"{",
"return... | /*
You may override this method to add a Predicate to the default find method. | [
"/",
"*",
"You",
"may",
"override",
"this",
"method",
"to",
"add",
"a",
"Predicate",
"to",
"the",
"default",
"find",
"method",
"."
] | train | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/GenericRepository.java#L544-L546 |
RestComm/jain-slee.sip | resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/Utils.java | Utils.getRequestUri | public static URI getRequestUri(Response response, AddressFactory addressFactory) throws ParseException {
"""
Forges Request-URI using contact and To name par to address URI, this is
required on dialog fork, this is how target is determined
@param response
@return
@throws ParseException
"""
final Conta... | java | public static URI getRequestUri(Response response, AddressFactory addressFactory) throws ParseException {
final ContactHeader contact = ((ContactHeader) response.getHeader(ContactHeader.NAME));
return (contact != null) ? (URI) contact.getAddress().getURI().clone() : null;
} | [
"public",
"static",
"URI",
"getRequestUri",
"(",
"Response",
"response",
",",
"AddressFactory",
"addressFactory",
")",
"throws",
"ParseException",
"{",
"final",
"ContactHeader",
"contact",
"=",
"(",
"(",
"ContactHeader",
")",
"response",
".",
"getHeader",
"(",
"Co... | Forges Request-URI using contact and To name par to address URI, this is
required on dialog fork, this is how target is determined
@param response
@return
@throws ParseException | [
"Forges",
"Request",
"-",
"URI",
"using",
"contact",
"and",
"To",
"name",
"par",
"to",
"address",
"URI",
"this",
"is",
"required",
"on",
"dialog",
"fork",
"this",
"is",
"how",
"target",
"is",
"determined"
] | train | https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/Utils.java#L144-L147 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count,
final PreparedStatement stmt) throws UncheckedSQLException {
"""
Imports the data from <code>DataSet</code> to database.
@param dataset
@param selectColumnNames
@para... | java | public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count,
final PreparedStatement stmt) throws UncheckedSQLException {
return importData(dataset, selectColumnNames, offset, count, stmt, 200, 0);
} | [
"public",
"static",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"Collection",
"<",
"String",
">",
"selectColumnNames",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"count",
",",
"final",
"PreparedStatement",
"stmt",
")",
"thro... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param selectColumnNames
@param offset
@param count
@param stmt the column order in the sql must be consistent with the column order in the DataSet.
@return
@throws UncheckedSQLException | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2204-L2207 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/operations/Shell.java | Shell.executeProcess | private ProcessInfo executeProcess(boolean background,ProcessBuilder pb) {
"""
Executes a process
@param background if starting as background process
@param pb the process builder
@return the process information
@throws IOException
"""
try
{
pb.directory(workingDirectory);
pb.redirectErro... | java | private ProcessInfo executeProcess(boolean background,ProcessBuilder pb)
{
try
{
pb.directory(workingDirectory);
pb.redirectErrorStream(false);
if(log != null)
pb.redirectOutput(Redirect.appendTo(log));
pb.environment().putAll(envMap);
Process p = pb.start();
String out = null... | [
"private",
"ProcessInfo",
"executeProcess",
"(",
"boolean",
"background",
",",
"ProcessBuilder",
"pb",
")",
"{",
"try",
"{",
"pb",
".",
"directory",
"(",
"workingDirectory",
")",
";",
"pb",
".",
"redirectErrorStream",
"(",
"false",
")",
";",
"if",
"(",
"log"... | Executes a process
@param background if starting as background process
@param pb the process builder
@return the process information
@throws IOException | [
"Executes",
"a",
"process"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/operations/Shell.java#L116-L157 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/EmailIntents.java | EmailIntents.newEmailIntent | public static Intent newEmailIntent(String[] addresses, String subject, String body, Uri attachment) {
"""
Create an intent to send an email with an attachment
@param addresses The recipients addresses (or null if not specified)
@param subject The subject of the email (or null if not specified)
@param bod... | java | public static Intent newEmailIntent(String[] addresses, String subject, String body, Uri attachment) {
Intent intent = new Intent(Intent.ACTION_SEND);
if (addresses != null) intent.putExtra(Intent.EXTRA_EMAIL, addresses);
if (body != null) intent.putExtra(Intent.EXTRA_TEXT, body);
if (su... | [
"public",
"static",
"Intent",
"newEmailIntent",
"(",
"String",
"[",
"]",
"addresses",
",",
"String",
"subject",
",",
"String",
"body",
",",
"Uri",
"attachment",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_SEND",
")",
";"... | Create an intent to send an email with an attachment
@param addresses The recipients addresses (or null if not specified)
@param subject The subject of the email (or null if not specified)
@param body The body of the email (or null if not specified)
@param attachment The URI of a file to attach to the email.... | [
"Create",
"an",
"intent",
"to",
"send",
"an",
"email",
"with",
"an",
"attachment"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/EmailIntents.java#L65-L74 |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java | AbstractRouter.getReverseRouteFor | @Override
public String getReverseRouteFor(Controller controller, String method, String var1, Object val1) {
"""
Gets the url of the route handled by the specified action method.
@param controller the controller object
@param method the controller method
@param var1 the first parameter name
@pa... | java | @Override
public String getReverseRouteFor(Controller controller, String method, String var1, Object val1) {
return getReverseRouteFor(controller, method, ImmutableMap.of(var1, val1));
} | [
"@",
"Override",
"public",
"String",
"getReverseRouteFor",
"(",
"Controller",
"controller",
",",
"String",
"method",
",",
"String",
"var1",
",",
"Object",
"val1",
")",
"{",
"return",
"getReverseRouteFor",
"(",
"controller",
",",
"method",
",",
"ImmutableMap",
".... | Gets the url of the route handled by the specified action method.
@param controller the controller object
@param method the controller method
@param var1 the first parameter name
@param val1 the first parameter value
@return the url, {@literal null} if the action method is not found. | [
"Gets",
"the",
"url",
"of",
"the",
"route",
"handled",
"by",
"the",
"specified",
"action",
"method",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java#L154-L157 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_ipLoadbalancing_id_GET | public OvhIPLoadbalancing project_serviceName_ipLoadbalancing_id_GET(String serviceName, String id) throws IOException {
"""
Get this object properties
REST: GET /cloud/project/{serviceName}/ipLoadbalancing/{id}
@param serviceName [required] The project id
@param id [required] ID of your load balancing ip imp... | java | public OvhIPLoadbalancing project_serviceName_ipLoadbalancing_id_GET(String serviceName, String id) throws IOException {
String qPath = "/cloud/project/{serviceName}/ipLoadbalancing/{id}";
StringBuilder sb = path(qPath, serviceName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(re... | [
"public",
"OvhIPLoadbalancing",
"project_serviceName_ipLoadbalancing_id_GET",
"(",
"String",
"serviceName",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/ipLoadbalancing/{id}\"",
";",
"StringBuilder",
"sb",
"="... | Get this object properties
REST: GET /cloud/project/{serviceName}/ipLoadbalancing/{id}
@param serviceName [required] The project id
@param id [required] ID of your load balancing ip import
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1626-L1631 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.executeModifyOperation | public static boolean executeModifyOperation(final String currentDn, final ConnectionFactory connectionFactory, final LdapEntry entry) {
"""
Execute modify operation boolean.
@param currentDn the current dn
@param connectionFactory the connection factory
@param entry the entry
@return tru... | java | public static boolean executeModifyOperation(final String currentDn, final ConnectionFactory connectionFactory, final LdapEntry entry) {
final Map<String, Set<String>> attributes = entry.getAttributes().stream()
.collect(Collectors.toMap(LdapAttribute::getName, ldapAttribute -> new HashSet<>(ldapAtt... | [
"public",
"static",
"boolean",
"executeModifyOperation",
"(",
"final",
"String",
"currentDn",
",",
"final",
"ConnectionFactory",
"connectionFactory",
",",
"final",
"LdapEntry",
"entry",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">"... | Execute modify operation boolean.
@param currentDn the current dn
@param connectionFactory the connection factory
@param entry the entry
@return true/false | [
"Execute",
"modify",
"operation",
"boolean",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L385-L390 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cache/impl/MXBeanUtil.java | MXBeanUtil.registerCacheObject | public static void registerCacheObject(Object mxbean, String cacheManagerName, String name, boolean stats) {
"""
Registers the provided {@link javax.cache.management.CacheMXBean} or
{@link javax.cache.management.CacheStatisticsMXBean} implementations if not registered yet.
@param mxbean {@link javax.... | java | public static void registerCacheObject(Object mxbean, String cacheManagerName, String name, boolean stats) {
synchronized (mBeanServer) {
//these can change during runtime, so always look it up
ObjectName registeredObjectName = calculateObjectName(cacheManagerName, name, stats);
... | [
"public",
"static",
"void",
"registerCacheObject",
"(",
"Object",
"mxbean",
",",
"String",
"cacheManagerName",
",",
"String",
"name",
",",
"boolean",
"stats",
")",
"{",
"synchronized",
"(",
"mBeanServer",
")",
"{",
"//these can change during runtime, so always look it u... | Registers the provided {@link javax.cache.management.CacheMXBean} or
{@link javax.cache.management.CacheStatisticsMXBean} implementations if not registered yet.
@param mxbean {@link javax.cache.management.CacheMXBean} or {@link javax.cache.management.CacheStatisticsMXBean}.
@param cacheManagerName name gener... | [
"Registers",
"the",
"provided",
"{",
"@link",
"javax",
".",
"cache",
".",
"management",
".",
"CacheMXBean",
"}",
"or",
"{",
"@link",
"javax",
".",
"cache",
".",
"management",
".",
"CacheStatisticsMXBean",
"}",
"implementations",
"if",
"not",
"registered",
"yet... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/MXBeanUtil.java#L50-L64 |
Pi4J/pi4j | pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/base/DacGpioProviderBase.java | DacGpioProviderBase.setShutdownValue | public void setShutdownValue(Number value, GpioPinAnalogOutput ... pin) {
"""
Set the shutdown/terminate value that the DAC should apply to the given GPIO pin
when the class is destroyed/terminated.
@param value the shutdown value to apply to the given pin(s)
@param pin analog output pin (vararg: one or more ... | java | public void setShutdownValue(Number value, GpioPinAnalogOutput ... pin){
for(GpioPinAnalogOutput p : pin) {
setShutdownValue(value, p.getPin());
}
} | [
"public",
"void",
"setShutdownValue",
"(",
"Number",
"value",
",",
"GpioPinAnalogOutput",
"...",
"pin",
")",
"{",
"for",
"(",
"GpioPinAnalogOutput",
"p",
":",
"pin",
")",
"{",
"setShutdownValue",
"(",
"value",
",",
"p",
".",
"getPin",
"(",
")",
")",
";",
... | Set the shutdown/terminate value that the DAC should apply to the given GPIO pin
when the class is destroyed/terminated.
@param value the shutdown value to apply to the given pin(s)
@param pin analog output pin (vararg: one or more pins) | [
"Set",
"the",
"shutdown",
"/",
"terminate",
"value",
"that",
"the",
"DAC",
"should",
"apply",
"to",
"the",
"given",
"GPIO",
"pin",
"when",
"the",
"class",
"is",
"destroyed",
"/",
"terminated",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/base/DacGpioProviderBase.java#L175-L179 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/ClassificationTree.java | ClassificationTree.categorizationTree | public Function<String, Map<String, Double>> categorizationTree(Map<String, List<String>> categories, int depth) {
"""
Categorization tree function.
@param categories the categories
@param depth the depth
@return the function
"""
return categorizationTree(categories, depth, "");
} | java | public Function<String, Map<String, Double>> categorizationTree(Map<String, List<String>> categories, int depth) {
return categorizationTree(categories, depth, "");
} | [
"public",
"Function",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Double",
">",
">",
"categorizationTree",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"categories",
",",
"int",
"depth",
")",
"{",
"return",
"categorizationTree",
"... | Categorization tree function.
@param categories the categories
@param depth the depth
@return the function | [
"Categorization",
"tree",
"function",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/ClassificationTree.java#L47-L49 |
signit-wesign/java-sdk | src/main/java/cn/signit/sdk/SignitClient.java | SignitClient.verify | public static boolean verify(String appId, String appSecretKey, byte[] body, HttpServletRequest request)
throws IOException {
"""
客户端验证服务器的webhook响应数据
@param appId
APP ID
@param appSecretKey
APP Secret
@param body
webhook响应具体数据。考虑到request中只能获取到body一次,故而需要在方法外获取并传递给此方法
@param request
服务端向客户端... | java | public static boolean verify(String appId, String appSecretKey, byte[] body, HttpServletRequest request)
throws IOException {
HmacSignatureBuilder builder = new HmacSignatureBuilder();
String signitSignature = request.getHeader("X-Signit-Signature");
builder.scheme(request.getHeader... | [
"public",
"static",
"boolean",
"verify",
"(",
"String",
"appId",
",",
"String",
"appSecretKey",
",",
"byte",
"[",
"]",
"body",
",",
"HttpServletRequest",
"request",
")",
"throws",
"IOException",
"{",
"HmacSignatureBuilder",
"builder",
"=",
"new",
"HmacSignatureBui... | 客户端验证服务器的webhook响应数据
@param appId
APP ID
@param appSecretKey
APP Secret
@param body
webhook响应具体数据。考虑到request中只能获取到body一次,故而需要在方法外获取并传递给此方法
@param request
服务端向客户端发起的请求
@throws IOException
数据流异常
@return 验证结果: true-是服务器发送给客户端的数据;false-验证失败
@since 2.0.0 | [
"客户端验证服务器的webhook响应数据"
] | train | https://github.com/signit-wesign/java-sdk/blob/6f3196c9d444818a953396fdaa8ffed9794d9530/src/main/java/cn/signit/sdk/SignitClient.java#L369-L389 |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.textImpl | protected void textImpl(String value, boolean replaceText) {
"""
Add or replace the text value of an element for this builder node.
@param value
the text value to set or add to the element.
@param replaceText
if True any existing text content of the node is replaced with the
given text value, if the given v... | java | protected void textImpl(String value, boolean replaceText) {
// Issue 10: null text values cause exceptions on subsequent call to
// Transformer to render document, so we fail-fast here on bad data.
if (value == null) {
throw new IllegalArgumentException("Illegal null text value");
... | [
"protected",
"void",
"textImpl",
"(",
"String",
"value",
",",
"boolean",
"replaceText",
")",
"{",
"// Issue 10: null text values cause exceptions on subsequent call to",
"// Transformer to render document, so we fail-fast here on bad data.",
"if",
"(",
"value",
"==",
"null",
")",... | Add or replace the text value of an element for this builder node.
@param value
the text value to set or add to the element.
@param replaceText
if True any existing text content of the node is replaced with the
given text value, if the given value is appended to any existing text. | [
"Add",
"or",
"replace",
"the",
"text",
"value",
"of",
"an",
"element",
"for",
"this",
"builder",
"node",
"."
] | train | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L824-L836 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/transform/BoxImageTransform.java | BoxImageTransform.doTransform | @Override
protected ImageWritable doTransform(ImageWritable image, Random random) {
"""
Takes an image and returns a boxed version of the image.
@param image to transform, null == end of stream
@param random object to use (or null for deterministic)
@return transformed image
"""
if (image == ... | java | @Override
protected ImageWritable doTransform(ImageWritable image, Random random) {
if (image == null) {
return null;
}
Mat mat = converter.convert(image.getFrame());
Mat box = new Mat(height, width, mat.type());
box.put(borderValue);
x = (mat.cols() - wi... | [
"@",
"Override",
"protected",
"ImageWritable",
"doTransform",
"(",
"ImageWritable",
"image",
",",
"Random",
"random",
")",
"{",
"if",
"(",
"image",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Mat",
"mat",
"=",
"converter",
".",
"convert",
"(",
"... | Takes an image and returns a boxed version of the image.
@param image to transform, null == end of stream
@param random object to use (or null for deterministic)
@return transformed image | [
"Takes",
"an",
"image",
"and",
"returns",
"a",
"boxed",
"version",
"of",
"the",
"image",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/transform/BoxImageTransform.java#L84-L117 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.beanMap | public static Collection beanMap(String property, Collection c, boolean includeNull) {
"""
Map dynamically using a bean property name.
@param property the name of a bean property
@param c an Collection of objects
@param includeNull true to include null results in the response
@return collectio... | java | public static Collection beanMap(String property, Collection c, boolean includeNull) {
return beanMap(property, c.iterator(), includeNull);
} | [
"public",
"static",
"Collection",
"beanMap",
"(",
"String",
"property",
",",
"Collection",
"c",
",",
"boolean",
"includeNull",
")",
"{",
"return",
"beanMap",
"(",
"property",
",",
"c",
".",
"iterator",
"(",
")",
",",
"includeNull",
")",
";",
"}"
] | Map dynamically using a bean property name.
@param property the name of a bean property
@param c an Collection of objects
@param includeNull true to include null results in the response
@return collection
@throws ClassCastException if there is an error invoking the method on any object. | [
"Map",
"dynamically",
"using",
"a",
"bean",
"property",
"name",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L687-L689 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/FileSteps.java | FileSteps.uploadFile | @Conditioned
@Lorsque("J'utilise l'élément '(.*)-(.*)' pour uploader le fichier '(.*)'[\\.|\\?]")
@Then("I use '(.*)-(.*)' element to upload '(.*)' file[\\.|\\?]")
public void uploadFile(String page, String element, String filename, List<GherkinStepCondition> conditions) throws FailureException, TechnicalEx... | java | @Conditioned
@Lorsque("J'utilise l'élément '(.*)-(.*)' pour uploader le fichier '(.*)'[\\.|\\?]")
@Then("I use '(.*)-(.*)' element to upload '(.*)' file[\\.|\\?]")
public void uploadFile(String page, String element, String filename, List<GherkinStepCondition> conditions) throws FailureException, TechnicalEx... | [
"@",
"Conditioned",
"@",
"Lorsque",
"(",
"\"J'utilise l'élément '(.*)-(.*)' pour uploader le fichier '(.*)'[\\\\.|\\\\?]\")",
"",
"@",
"Then",
"(",
"\"I use '(.*)-(.*)' element to upload '(.*)' file[\\\\.|\\\\?]\"",
")",
"public",
"void",
"uploadFile",
"(",
"String",
"page",
",",... | Waits the full download of a file with a maximum timeout in seconds.
@param page
The page to upload the file from
@param element
The file input field
@param filename
The name of the file to upload (from the default downloaded files directory)
@param conditions
List of 'expected' values condition and 'actual' values ({... | [
"Waits",
"the",
"full",
"download",
"of",
"a",
"file",
"with",
"a",
"maximum",
"timeout",
"in",
"seconds",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/FileSteps.java#L155-L160 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/table/RtfBorderGroup.java | RtfBorderGroup.addBorder | public void addBorder(int bordersToAdd, int borderStyle, float borderWidth, Color borderColor) {
"""
Adds borders to the RtfBorderGroup
@param bordersToAdd The borders to add (Rectangle.LEFT, Rectangle.RIGHT, Rectangle.TOP, Rectangle.BOTTOM, Rectangle.BOX)
@param borderStyle The style of border to add (from Rt... | java | public void addBorder(int bordersToAdd, int borderStyle, float borderWidth, Color borderColor) {
if((bordersToAdd & Rectangle.LEFT) == Rectangle.LEFT) {
setBorder(RtfBorder.LEFT_BORDER, borderStyle, borderWidth, borderColor);
}
if((bordersToAdd & Rectangle.TOP) == Rectangle.TOP) {
... | [
"public",
"void",
"addBorder",
"(",
"int",
"bordersToAdd",
",",
"int",
"borderStyle",
",",
"float",
"borderWidth",
",",
"Color",
"borderColor",
")",
"{",
"if",
"(",
"(",
"bordersToAdd",
"&",
"Rectangle",
".",
"LEFT",
")",
"==",
"Rectangle",
".",
"LEFT",
")... | Adds borders to the RtfBorderGroup
@param bordersToAdd The borders to add (Rectangle.LEFT, Rectangle.RIGHT, Rectangle.TOP, Rectangle.BOTTOM, Rectangle.BOX)
@param borderStyle The style of border to add (from RtfBorder)
@param borderWidth The border width to use
@param borderColor The border color to use | [
"Adds",
"borders",
"to",
"the",
"RtfBorderGroup"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/table/RtfBorderGroup.java#L162-L179 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/config/ConfigManager.java | ConfigManager.getPropertiesByContext | public Properties getPropertiesByContext(ServletContext context, String path) {
"""
Read in properties based on a ServletContext and a path to a config file
"""
return reader.getProperties(context, path, log);
} | java | public Properties getPropertiesByContext(ServletContext context, String path) {
return reader.getProperties(context, path, log);
} | [
"public",
"Properties",
"getPropertiesByContext",
"(",
"ServletContext",
"context",
",",
"String",
"path",
")",
"{",
"return",
"reader",
".",
"getProperties",
"(",
"context",
",",
"path",
",",
"log",
")",
";",
"}"
] | Read in properties based on a ServletContext and a path to a config file | [
"Read",
"in",
"properties",
"based",
"on",
"a",
"ServletContext",
"and",
"a",
"path",
"to",
"a",
"config",
"file"
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/config/ConfigManager.java#L136-L139 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/DcpMessageHandler.java | DcpMessageHandler.channelRead | @Override
public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
"""
Reads server responses and uses them to fulfill promises returned by
{@link #sendRequest}.
<p>
Dispatches other incoming messages to either the data or the control feeds.
"""
final ByteBuf messa... | java | @Override
public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
final ByteBuf message = (ByteBuf) msg;
final byte magic = message.getByte(0);
// The majority of messages are likely to be stream requests, not responses.
if (magic != MessageUtil.MAGIC_RES) {
... | [
"@",
"Override",
"public",
"void",
"channelRead",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"final",
"Object",
"msg",
")",
"throws",
"Exception",
"{",
"final",
"ByteBuf",
"message",
"=",
"(",
"ByteBuf",
")",
"msg",
";",
"final",
"byte",
"magic",
"="... | Reads server responses and uses them to fulfill promises returned by
{@link #sendRequest}.
<p>
Dispatches other incoming messages to either the data or the control feeds. | [
"Reads",
"server",
"responses",
"and",
"uses",
"them",
"to",
"fulfill",
"promises",
"returned",
"by",
"{"
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/DcpMessageHandler.java#L284-L318 |
datacleaner/AnalyzerBeans | core/src/main/java/org/eobjects/analyzer/util/SystemProperties.java | SystemProperties.getLong | public static long getLong(String key, long valueIfNullOrNotParseable) {
"""
Gets a system property long, or a replacement value if the property is
null or blank or not parseable
@param key
@param valueIfNullOrNotParseable
@return
"""
String value = System.getProperty(key);
if (Strings.is... | java | public static long getLong(String key, long valueIfNullOrNotParseable) {
String value = System.getProperty(key);
if (Strings.isNullOrEmpty(value)) {
return valueIfNullOrNotParseable;
}
try {
return Long.parseLong(value);
} catch (NumberFormatException e) {... | [
"public",
"static",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"valueIfNullOrNotParseable",
")",
"{",
"String",
"value",
"=",
"System",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"value",
")",
")",... | Gets a system property long, or a replacement value if the property is
null or blank or not parseable
@param key
@param valueIfNullOrNotParseable
@return | [
"Gets",
"a",
"system",
"property",
"long",
"or",
"a",
"replacement",
"value",
"if",
"the",
"property",
"is",
"null",
"or",
"blank",
"or",
"not",
"parseable"
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/core/src/main/java/org/eobjects/analyzer/util/SystemProperties.java#L63-L73 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java | NamespaceSupport.declarePrefix | public boolean declarePrefix (String prefix, String uri) {
"""
Declare a Namespace prefix. All prefixes must be declared
before they are referenced. For example, a SAX driver (parser)
would scan an element's attributes
in two passes: first for namespace declarations,
then a second pass using {@link #process... | java | public boolean declarePrefix (String prefix, String uri)
{
if (prefix.equals("xml") || prefix.equals("xmlns")) {
return false;
} else {
currentContext.declarePrefix(prefix, uri);
return true;
}
} | [
"public",
"boolean",
"declarePrefix",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"if",
"(",
"prefix",
".",
"equals",
"(",
"\"xml\"",
")",
"||",
"prefix",
".",
"equals",
"(",
"\"xmlns\"",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",... | Declare a Namespace prefix. All prefixes must be declared
before they are referenced. For example, a SAX driver (parser)
would scan an element's attributes
in two passes: first for namespace declarations,
then a second pass using {@link #processName processName()} to
interpret prefixes against (potentially redefined... | [
"Declare",
"a",
"Namespace",
"prefix",
".",
"All",
"prefixes",
"must",
"be",
"declared",
"before",
"they",
"are",
"referenced",
".",
"For",
"example",
"a",
"SAX",
"driver",
"(",
"parser",
")",
"would",
"scan",
"an",
"element",
"s",
"attributes",
"in",
"two... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java#L293-L301 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsStaticExportManager.java | CmsStaticExportManager.getRfsName | public String getRfsName(CmsObject cms, String vfsName) {
"""
Returns the static export rfs name for a given vfs resource.<p>
@param cms an initialized cms context
@param vfsName the name of the vfs resource
@return the static export rfs name for a give vfs resource
@see #getVfsName(CmsObject, String)
@... | java | public String getRfsName(CmsObject cms, String vfsName) {
return getRfsName(cms, vfsName, null, null);
} | [
"public",
"String",
"getRfsName",
"(",
"CmsObject",
"cms",
",",
"String",
"vfsName",
")",
"{",
"return",
"getRfsName",
"(",
"cms",
",",
"vfsName",
",",
"null",
",",
"null",
")",
";",
"}"
] | Returns the static export rfs name for a given vfs resource.<p>
@param cms an initialized cms context
@param vfsName the name of the vfs resource
@return the static export rfs name for a give vfs resource
@see #getVfsName(CmsObject, String)
@see #getRfsName(CmsObject, String, String, String) | [
"Returns",
"the",
"static",
"export",
"rfs",
"name",
"for",
"a",
"given",
"vfs",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsStaticExportManager.java#L1311-L1314 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Compound.java | Compound.in2in | public void in2in(String in, Object... to) {
"""
Maps a compound input to an internal simple input field. Both
fields have the same name.
@param in the name of the field
@param to the commands to map to
"""
for (Object cmd : to) {
in2in(in, cmd, in);
}
} | java | public void in2in(String in, Object... to) {
for (Object cmd : to) {
in2in(in, cmd, in);
}
} | [
"public",
"void",
"in2in",
"(",
"String",
"in",
",",
"Object",
"...",
"to",
")",
"{",
"for",
"(",
"Object",
"cmd",
":",
"to",
")",
"{",
"in2in",
"(",
"in",
",",
"cmd",
",",
"in",
")",
";",
"}",
"}"
] | Maps a compound input to an internal simple input field. Both
fields have the same name.
@param in the name of the field
@param to the commands to map to | [
"Maps",
"a",
"compound",
"input",
"to",
"an",
"internal",
"simple",
"input",
"field",
".",
"Both",
"fields",
"have",
"the",
"same",
"name",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Compound.java#L154-L158 |
aoindustries/aoweb-framework | src/main/java/com/aoindustries/website/framework/WebSiteRequest.java | WebSiteRequest.getURL | public String getURL(String classname, String params) throws IOException, SQLException {
"""
Gets a relative URL given its classname and optional parameters.
Parameters should already be URL encoded but not XML encoded.
"""
try {
Class<? extends WebPage> clazz=Class.forName(classname).asSubclass(WebPage.... | java | public String getURL(String classname, String params) throws IOException, SQLException {
try {
Class<? extends WebPage> clazz=Class.forName(classname).asSubclass(WebPage.class);
return getURL(clazz, params);
} catch(ClassNotFoundException err) {
throw new IOException("Unable to load class: "+classname, err... | [
"public",
"String",
"getURL",
"(",
"String",
"classname",
",",
"String",
"params",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"try",
"{",
"Class",
"<",
"?",
"extends",
"WebPage",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"classname",
")... | Gets a relative URL given its classname and optional parameters.
Parameters should already be URL encoded but not XML encoded. | [
"Gets",
"a",
"relative",
"URL",
"given",
"its",
"classname",
"and",
"optional",
"parameters",
".",
"Parameters",
"should",
"already",
"be",
"URL",
"encoded",
"but",
"not",
"XML",
"encoded",
"."
] | train | https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebSiteRequest.java#L368-L375 |
jclawson/hazeltask | hazeltask-core/src/main/java/com/hazeltask/hazelcast/MemberTasks.java | MemberTasks.executeOptimistic | public static <T> Collection<MemberResponse<T>> executeOptimistic(IExecutorService execSvc, Set<Member> members, Callable<T> callable) {
"""
Will wait a maximum of 1 minute for each node to response with their result. If an error occurs on any
member, we will always attempt to continue execution and collect as m... | java | public static <T> Collection<MemberResponse<T>> executeOptimistic(IExecutorService execSvc, Set<Member> members, Callable<T> callable) {
return executeOptimistic(execSvc, members, callable, 60, TimeUnit.SECONDS);
} | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"MemberResponse",
"<",
"T",
">",
">",
"executeOptimistic",
"(",
"IExecutorService",
"execSvc",
",",
"Set",
"<",
"Member",
">",
"members",
",",
"Callable",
"<",
"T",
">",
"callable",
")",
"{",
"return",
... | Will wait a maximum of 1 minute for each node to response with their result. If an error occurs on any
member, we will always attempt to continue execution and collect as many results as possible.
@param execSvc
@param members
@param callable
@return | [
"Will",
"wait",
"a",
"maximum",
"of",
"1",
"minute",
"for",
"each",
"node",
"to",
"response",
"with",
"their",
"result",
".",
"If",
"an",
"error",
"occurs",
"on",
"any",
"member",
"we",
"will",
"always",
"attempt",
"to",
"continue",
"execution",
"and",
"... | train | https://github.com/jclawson/hazeltask/blob/801162bc54c5f1d5744a28a2844b24289d9495d7/hazeltask-core/src/main/java/com/hazeltask/hazelcast/MemberTasks.java#L53-L55 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.executeVariableDeclaration | private Status executeVariableDeclaration(Decl.Variable stmt, CallStack frame) {
"""
Execute a variable declaration statement at a given point in the function or method
body
@param stmt
--- The statement to execute
@param frame
--- The current stack frame
@return
"""
// We only need to do something i... | java | private Status executeVariableDeclaration(Decl.Variable stmt, CallStack frame) {
// We only need to do something if this has an initialiser
if(stmt.hasInitialiser()) {
RValue value = executeExpression(ANY_T, stmt.getInitialiser(), frame);
frame.putLocal(stmt.getName(),value);
}
return Status.NEXT;
} | [
"private",
"Status",
"executeVariableDeclaration",
"(",
"Decl",
".",
"Variable",
"stmt",
",",
"CallStack",
"frame",
")",
"{",
"// We only need to do something if this has an initialiser",
"if",
"(",
"stmt",
".",
"hasInitialiser",
"(",
")",
")",
"{",
"RValue",
"value",... | Execute a variable declaration statement at a given point in the function or method
body
@param stmt
--- The statement to execute
@param frame
--- The current stack frame
@return | [
"Execute",
"a",
"variable",
"declaration",
"statement",
"at",
"a",
"given",
"point",
"in",
"the",
"function",
"or",
"method",
"body"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L517-L524 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageReceiver.java | BaseMessageReceiver.createDefaultFilter | public BaseMessageFilter createDefaultFilter(JMessageListener listener) {
"""
Create a message filter that will send all messages to this listener.
@param listener The listener to create a filter for.
@return The new filter for this listener.
"""
BaseMessageFilter messageFilter = null;
String... | java | public BaseMessageFilter createDefaultFilter(JMessageListener listener)
{
BaseMessageFilter messageFilter = null;
String strQueueName = MessageConstants.RECORD_QUEUE_NAME; // Default queue name=
String strQueueType = MessageConstants.INTRANET_QUEUE; // Default queue type
if (m_bas... | [
"public",
"BaseMessageFilter",
"createDefaultFilter",
"(",
"JMessageListener",
"listener",
")",
"{",
"BaseMessageFilter",
"messageFilter",
"=",
"null",
";",
"String",
"strQueueName",
"=",
"MessageConstants",
".",
"RECORD_QUEUE_NAME",
";",
"// Default queue name=",
"String",... | Create a message filter that will send all messages to this listener.
@param listener The listener to create a filter for.
@return The new filter for this listener. | [
"Create",
"a",
"message",
"filter",
"that",
"will",
"send",
"all",
"messages",
"to",
"this",
"listener",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageReceiver.java#L201-L216 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.makeCall | public void makeCall(
String destination,
KeyValueCollection userData,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
"""
Make a new call to the specified destination.
@param destination The number to call.
@para... | java | public void makeCall(
String destination,
KeyValueCollection userData,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
try {
VoicemakecallData data = new VoicemakecallData();
data.desti... | [
"public",
"void",
"makeCall",
"(",
"String",
"destination",
",",
"KeyValueCollection",
"userData",
",",
"KeyValueCollection",
"reasons",
",",
"KeyValueCollection",
"extensions",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"VoicemakecallData",
"data",
"=",
... | Make a new call to the specified destination.
@param destination The number to call.
@param userData A key/value pairs list of the user data that should be attached to the call.
@param reasons Information on causes for, and results of, actions taken by the user of the current DN. For details about reasons, refer to the... | [
"Make",
"a",
"new",
"call",
"to",
"the",
"specified",
"destination",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L497-L517 |
opoo/opoopress | core/src/main/java/org/opoo/util/PathUtils.java | PathUtils.getRelativePath | public static String getRelativePath(File baseDir, File file) {
"""
Use {@link java.nio.file.Path#relativize(java.nio.file.Path)} in JDK1.7.
@param baseDir
@param file
@return
"""
if(!baseDir.isDirectory()){
throw new IllegalArgumentException("Base directory must be a directory.");
}
String dirPat... | java | public static String getRelativePath(File baseDir, File file){
if(!baseDir.isDirectory()){
throw new IllegalArgumentException("Base directory must be a directory.");
}
String dirPath = FilenameUtils.normalize(baseDir.getAbsolutePath(), true);
String filePath = FilenameUtils.normalize(file.getAbsolutePath(),... | [
"public",
"static",
"String",
"getRelativePath",
"(",
"File",
"baseDir",
",",
"File",
"file",
")",
"{",
"if",
"(",
"!",
"baseDir",
".",
"isDirectory",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Base directory must be a directory.\"",
... | Use {@link java.nio.file.Path#relativize(java.nio.file.Path)} in JDK1.7.
@param baseDir
@param file
@return | [
"Use",
"{"
] | train | https://github.com/opoo/opoopress/blob/4ed0265d294c8b748be48cf097949aa905ff1df2/core/src/main/java/org/opoo/util/PathUtils.java#L170-L186 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/PaymentRequired.java | PaymentRequired.of | public static PaymentRequired of(Throwable cause) {
"""
Returns a static PaymentRequired instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the c... | java | public static PaymentRequired of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(PAYMENT_REQUIRED));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"PaymentRequired",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"PAYMENT_REQUIRED",
")",
")",
";",
"}",
"else",
"{",
"touchPayl... | Returns a static PaymentRequired instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static PaymentRequired instance as described above | [
"Returns",
"a",
"static",
"PaymentRequired",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/PaymentRequired.java#L121-L128 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_service_serviceName_directory_PUT | public void billingAccount_service_serviceName_directory_PUT(String billingAccount, String serviceName, OvhDirectoryInfo body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/service/{serviceName}/directory
@param body [required] New object properties
@param billing... | java | public void billingAccount_service_serviceName_directory_PUT(String billingAccount, String serviceName, OvhDirectoryInfo body) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/directory";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toStr... | [
"public",
"void",
"billingAccount_service_serviceName_directory_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhDirectoryInfo",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/service/{serviceName}/... | Alter this object properties
REST: PUT /telephony/{billingAccount}/service/{serviceName}/directory
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4009-L4013 |
biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java | Utils.roundToDecimals | public final static double roundToDecimals(double d, int c) {
"""
Returns a value with the desired number of decimal places.
@param d
value to round
@param c
number of decimal places desired.
Must be greater or equal to zero, otherwise, the given value d would be returned without any modification.
@return
... | java | public final static double roundToDecimals(double d, int c) {
if(c < 0) return d;
double p = Math.pow(10,c);
d = d * p;
double tmp = Math.round(d);
return tmp/p;
} | [
"public",
"final",
"static",
"double",
"roundToDecimals",
"(",
"double",
"d",
",",
"int",
"c",
")",
"{",
"if",
"(",
"c",
"<",
"0",
")",
"return",
"d",
";",
"double",
"p",
"=",
"Math",
".",
"pow",
"(",
"10",
",",
"c",
")",
";",
"d",
"=",
"d",
... | Returns a value with the desired number of decimal places.
@param d
value to round
@param c
number of decimal places desired.
Must be greater or equal to zero, otherwise, the given value d would be returned without any modification.
@return
a value with the given number of decimal places. | [
"Returns",
"a",
"value",
"with",
"the",
"desired",
"number",
"of",
"decimal",
"places",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L51-L57 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java | PGPoolingDataSource.getReference | public Reference getReference() throws NamingException {
"""
Adds custom properties for this DataSource to the properties defined in the superclass.
"""
Reference ref = super.getReference();
ref.add(new StringRefAddr("dataSourceName", dataSourceName));
if (initialConnections > 0) {
ref.add(ne... | java | public Reference getReference() throws NamingException {
Reference ref = super.getReference();
ref.add(new StringRefAddr("dataSourceName", dataSourceName));
if (initialConnections > 0) {
ref.add(new StringRefAddr("initialConnections", Integer.toString(initialConnections)));
}
if (maxConnection... | [
"public",
"Reference",
"getReference",
"(",
")",
"throws",
"NamingException",
"{",
"Reference",
"ref",
"=",
"super",
".",
"getReference",
"(",
")",
";",
"ref",
".",
"add",
"(",
"new",
"StringRefAddr",
"(",
"\"dataSourceName\"",
",",
"dataSourceName",
")",
")",... | Adds custom properties for this DataSource to the properties defined in the superclass. | [
"Adds",
"custom",
"properties",
"for",
"this",
"DataSource",
"to",
"the",
"properties",
"defined",
"in",
"the",
"superclass",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/PGPoolingDataSource.java#L439-L449 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeParserBucket.java | DateTimeParserBucket.saveField | public void saveField(DateTimeFieldType fieldType, int value) {
"""
Saves a datetime field value.
@param fieldType the field type
@param value the value
"""
obtainSaveField().init(fieldType.getField(iChrono), value);
} | java | public void saveField(DateTimeFieldType fieldType, int value) {
obtainSaveField().init(fieldType.getField(iChrono), value);
} | [
"public",
"void",
"saveField",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"value",
")",
"{",
"obtainSaveField",
"(",
")",
".",
"init",
"(",
"fieldType",
".",
"getField",
"(",
"iChrono",
")",
",",
"value",
")",
";",
"}"
] | Saves a datetime field value.
@param fieldType the field type
@param value the value | [
"Saves",
"a",
"datetime",
"field",
"value",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeParserBucket.java#L308-L310 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.markInvoiceFailed | public InvoiceCollection markInvoiceFailed(final String invoiceId) {
"""
Mark an invoice as failed collection
@param invoiceId String Recurly Invoice ID
"""
return doPUT(Invoices.INVOICES_RESOURCE + "/" + invoiceId + "/mark_failed", null, InvoiceCollection.class);
} | java | public InvoiceCollection markInvoiceFailed(final String invoiceId) {
return doPUT(Invoices.INVOICES_RESOURCE + "/" + invoiceId + "/mark_failed", null, InvoiceCollection.class);
} | [
"public",
"InvoiceCollection",
"markInvoiceFailed",
"(",
"final",
"String",
"invoiceId",
")",
"{",
"return",
"doPUT",
"(",
"Invoices",
".",
"INVOICES_RESOURCE",
"+",
"\"/\"",
"+",
"invoiceId",
"+",
"\"/mark_failed\"",
",",
"null",
",",
"InvoiceCollection",
".",
"c... | Mark an invoice as failed collection
@param invoiceId String Recurly Invoice ID | [
"Mark",
"an",
"invoice",
"as",
"failed",
"collection"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1301-L1303 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java | InstanceGroupManagerClient.resizeInstanceGroupManager | @BetaApi
public final Operation resizeInstanceGroupManager(Integer size, String instanceGroupManager) {
"""
Resizes the managed instance group. If you increase the size, the group creates new instances
using the current instance template. If you decrease the size, the group deletes instances. The
resize operat... | java | @BetaApi
public final Operation resizeInstanceGroupManager(Integer size, String instanceGroupManager) {
ResizeInstanceGroupManagerHttpRequest request =
ResizeInstanceGroupManagerHttpRequest.newBuilder()
.setSize(size)
.setInstanceGroupManager(instanceGroupManager)
.bui... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"resizeInstanceGroupManager",
"(",
"Integer",
"size",
",",
"String",
"instanceGroupManager",
")",
"{",
"ResizeInstanceGroupManagerHttpRequest",
"request",
"=",
"ResizeInstanceGroupManagerHttpRequest",
".",
"newBuilder",
"(",
"... | Resizes the managed instance group. If you increase the size, the group creates new instances
using the current instance template. If you decrease the size, the group deletes instances. The
resize operation is marked DONE when the resize actions are scheduled even if the group has not
yet added or deleted any instances... | [
"Resizes",
"the",
"managed",
"instance",
"group",
".",
"If",
"you",
"increase",
"the",
"size",
"the",
"group",
"creates",
"new",
"instances",
"using",
"the",
"current",
"instance",
"template",
".",
"If",
"you",
"decrease",
"the",
"size",
"the",
"group",
"del... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/InstanceGroupManagerClient.java#L1663-L1672 |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/evaluator/VortexWorker.java | VortexWorker.call | @Override
public byte[] call(final byte[] memento) throws Exception {
"""
Starts the scheduler and executor and waits until termination.
"""
final ExecutorService schedulerThread = Executors.newSingleThreadExecutor();
final ExecutorService commandExecutor = Executors.newFixedThreadPool(numOfThreads);... | java | @Override
public byte[] call(final byte[] memento) throws Exception {
final ExecutorService schedulerThread = Executors.newSingleThreadExecutor();
final ExecutorService commandExecutor = Executors.newFixedThreadPool(numOfThreads);
final ConcurrentMap<Integer, Future> futures = new ConcurrentHashMap<>();
... | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"call",
"(",
"final",
"byte",
"[",
"]",
"memento",
")",
"throws",
"Exception",
"{",
"final",
"ExecutorService",
"schedulerThread",
"=",
"Executors",
".",
"newSingleThreadExecutor",
"(",
")",
";",
"final",
"ExecutorS... | Starts the scheduler and executor and waits until termination. | [
"Starts",
"the",
"scheduler",
"and",
"executor",
"and",
"waits",
"until",
"termination",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/evaluator/VortexWorker.java#L77-L131 |
RobAustin/low-latency-primitive-concurrent-queues | src/main/java/uk/co/boundedbuffer/ConcurrentBlockingIntQueue.java | ConcurrentBlockingIntQueue.peek | public int peek(long timeout, TimeUnit unit)
throws InterruptedException, TimeoutException {
"""
Retrieves, but does not remove, the head of this queue.
@param timeout how long to wait before giving up, in units of <tt>unit</tt>
@param unit a <tt>TimeUnit</tt> determining how to interpret the <t... | java | public int peek(long timeout, TimeUnit unit)
throws InterruptedException, TimeoutException {
// non volatile read ( which is quicker )
final int readLocation = this.consumerReadLocation;
blockForReadSpace(timeout, unit, readLocation);
// purposely not volatile as the read... | [
"public",
"int",
"peek",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"TimeoutException",
"{",
"// non volatile read ( which is quicker )",
"final",
"int",
"readLocation",
"=",
"this",
".",
"consumerReadLocation",
";",
... | Retrieves, but does not remove, the head of this queue.
@param timeout how long to wait before giving up, in units of <tt>unit</tt>
@param unit a <tt>TimeUnit</tt> determining how to interpret the <tt>timeout</tt> parameter
@return the head of this queue
@throws java.util.concurrent.TimeoutException if timeout time... | [
"Retrieves",
"but",
"does",
"not",
"remove",
"the",
"head",
"of",
"this",
"queue",
"."
] | train | https://github.com/RobAustin/low-latency-primitive-concurrent-queues/blob/ffcf95a8135750c0b23cd486346a1f68a4724b1c/src/main/java/uk/co/boundedbuffer/ConcurrentBlockingIntQueue.java#L161-L172 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/render/AbstractRenderer.java | AbstractRenderer.createLabel | public Label createLabel(BaseComponent parent, Object value, String prefix, String style) {
"""
Creates a label for a string value.
@param parent BaseComponent that will be the parent of the label.
@param value Value to be used as label text.
@param prefix Value to be used as a prefix for the label text.
@pa... | java | public Label createLabel(BaseComponent parent, Object value, String prefix, String style) {
return createLabel(parent, value, prefix, style, false);
} | [
"public",
"Label",
"createLabel",
"(",
"BaseComponent",
"parent",
",",
"Object",
"value",
",",
"String",
"prefix",
",",
"String",
"style",
")",
"{",
"return",
"createLabel",
"(",
"parent",
",",
"value",
",",
"prefix",
",",
"style",
",",
"false",
")",
";",
... | Creates a label for a string value.
@param parent BaseComponent that will be the parent of the label.
@param value Value to be used as label text.
@param prefix Value to be used as a prefix for the label text.
@param style Style to be applied to the label.
@return The newly created label. | [
"Creates",
"a",
"label",
"for",
"a",
"string",
"value",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/render/AbstractRenderer.java#L100-L102 |
josueeduardo/snappy | plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/util/SystemPropertyUtils.java | SystemPropertyUtils.resolvePlaceholders | public static String resolvePlaceholders(String text) {
"""
Resolve ${...} placeholders in the given text, replacing them with corresponding
system property values.
@param text the String to resolve
@return the resolved String
@throws IllegalArgumentException if there is an unresolvable placeholder
@see #PL... | java | public static String resolvePlaceholders(String text) {
if (text == null) {
return text;
}
return parseStringValue(null, text, text, new HashSet<String>());
} | [
"public",
"static",
"String",
"resolvePlaceholders",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"text",
";",
"}",
"return",
"parseStringValue",
"(",
"null",
",",
"text",
",",
"text",
",",
"new",
"HashSet",
"<",
... | Resolve ${...} placeholders in the given text, replacing them with corresponding
system property values.
@param text the String to resolve
@return the resolved String
@throws IllegalArgumentException if there is an unresolvable placeholder
@see #PLACEHOLDER_PREFIX
@see #PLACEHOLDER_SUFFIX | [
"Resolve",
"$",
"{",
"...",
"}",
"placeholders",
"in",
"the",
"given",
"text",
"replacing",
"them",
"with",
"corresponding",
"system",
"property",
"values",
"."
] | train | https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/util/SystemPropertyUtils.java#L66-L71 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLSerializer.java | XMLSerializer.writeAttribute | public void writeAttribute(final String uri, final String qName, final String value) {
"""
Write attribute
@param uri namespace URI
@param qName attribute name
@param value attribute value
@throws IllegalStateException if start element is not open
"""
if (!openStartElement) {
throw ne... | java | public void writeAttribute(final String uri, final String qName, final String value) {
if (!openStartElement) {
throw new IllegalStateException("Current state does not allow Attribute writing");
}
if (openAttributes == null) {
openAttributes = new AttributesImpl();
... | [
"public",
"void",
"writeAttribute",
"(",
"final",
"String",
"uri",
",",
"final",
"String",
"qName",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"!",
"openStartElement",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Current state does not a... | Write attribute
@param uri namespace URI
@param qName attribute name
@param value attribute value
@throws IllegalStateException if start element is not open | [
"Write",
"attribute"
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLSerializer.java#L219-L229 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.