repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.isSortedFromTo | public boolean isSortedFromTo(int from, int to) {
if (size==0) return true;
checkRangeFromTo(from, to, size);
Object[] theElements = elements;
for (int i=from+1; i<=to; i++ ) {
if (((Comparable)theElements[i]).compareTo((Comparable) theElements[i-1]) < 0) return false;
}
return true;
} | java | public boolean isSortedFromTo(int from, int to) {
if (size==0) return true;
checkRangeFromTo(from, to, size);
Object[] theElements = elements;
for (int i=from+1; i<=to; i++ ) {
if (((Comparable)theElements[i]).compareTo((Comparable) theElements[i-1]) < 0) return false;
}
return true;
} | [
"public",
"boolean",
"isSortedFromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"return",
"true",
";",
"checkRangeFromTo",
"(",
"from",
",",
"to",
",",
"size",
")",
";",
"Object",
"[",
"]",
"theElements",
"="... | Determines whether the receiver is sorted ascending, according to the <i>natural ordering</i> of its
elements. All elements in this range must implement the
<tt>Comparable</tt> interface. Furthermore, all elements in this range
must be <i>mutually comparable</i> (that is, <tt>e1.compareTo(e2)</tt>
must not throw a <t... | [
"Determines",
"whether",
"the",
"receiver",
"is",
"sorted",
"ascending",
"according",
"to",
"the",
"<i",
">",
"natural",
"ordering<",
"/",
"i",
">",
"of",
"its",
"elements",
".",
"All",
"elements",
"in",
"this",
"range",
"must",
"implement",
"the",
"<tt",
... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L472-L481 |
rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertNotNull | public static void assertNotNull(String message, Object o) {
if (o != null) {
pass(message);
} else {
fail(message, null);
}
} | java | public static void assertNotNull(String message, Object o) {
if (o != null) {
pass(message);
} else {
fail(message, null);
}
} | [
"public",
"static",
"void",
"assertNotNull",
"(",
"String",
"message",
",",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"pass",
"(",
"message",
")",
";",
"}",
"else",
"{",
"fail",
"(",
"message",
",",
"null",
")",
";",
"}",
"... | Assert that a value is not null.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion outcome
@param o value to test | [
"Assert",
"that",
"a",
"value",
"is",
"not",
"null",
".",
"<p",
">",
"If",
"the",
"assertion",
"passes",
"a",
"green",
"tick",
"will",
"be",
"shown",
".",
"If",
"the",
"assertion",
"fails",
"a",
"red",
"cross",
"will",
"be",
"shown",
"."
] | train | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L295-L301 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/beans/AbstractBean.java | AbstractBean.processChange | protected void processChange(String propertyName, Object oldValue, Object newValue) {
processChange(propertyName, oldValue, newValue, null);
} | java | protected void processChange(String propertyName, Object oldValue, Object newValue) {
processChange(propertyName, oldValue, newValue, null);
} | [
"protected",
"void",
"processChange",
"(",
"String",
"propertyName",
",",
"Object",
"oldValue",
",",
"Object",
"newValue",
")",
"{",
"processChange",
"(",
"propertyName",
",",
"oldValue",
",",
"newValue",
",",
"null",
")",
";",
"}"
] | Processes the change in state to the particular property of this Bean. A PropertyChangeEvent is created
to notify all listeners of the state change. First, VetoableChangeListeners are notified of the pending change
in order to validate the change and veto any undesired change to the specified property. Next, the sta... | [
"Processes",
"the",
"change",
"in",
"state",
"to",
"the",
"particular",
"property",
"of",
"this",
"Bean",
".",
"A",
"PropertyChangeEvent",
"is",
"created",
"to",
"notify",
"all",
"listeners",
"of",
"the",
"state",
"change",
".",
"First",
"VetoableChangeListeners... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/beans/AbstractBean.java#L642-L644 |
cloudendpoints/endpoints-management-java | endpoints-control/src/main/java/com/google/api/control/model/PathTemplate.java | PathTemplate.matchFromFullName | @Nullable
public ImmutableMap<String, String> matchFromFullName(String path) {
return match(path, true);
} | java | @Nullable
public ImmutableMap<String, String> matchFromFullName(String path) {
return match(path, true);
} | [
"@",
"Nullable",
"public",
"ImmutableMap",
"<",
"String",
",",
"String",
">",
"matchFromFullName",
"(",
"String",
"path",
")",
"{",
"return",
"match",
"(",
"path",
",",
"true",
")",
";",
"}"
] | Matches the path, where the first segment is interpreted as the host name regardless of whether
it starts with '//' or not. Example: <pre>
assert template("{name=shelves/*}").matchFromFullName("somewhere.io/shelves/s1")
.equals(ImmutableMap.of(HOSTNAME_VAR, "somewhere.io", "name", "shelves/s1"));
</pre> | [
"Matches",
"the",
"path",
"where",
"the",
"first",
"segment",
"is",
"interpreted",
"as",
"the",
"host",
"name",
"regardless",
"of",
"whether",
"it",
"starts",
"with",
"//",
"or",
"not",
".",
"Example",
":",
"<pre",
">",
"assert",
"template",
"(",
"{",
"n... | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-control/src/main/java/com/google/api/control/model/PathTemplate.java#L459-L462 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.deletePath | public static void deletePath(FileSystem fs, Path f, boolean recursive) throws IOException {
if (fs.exists(f) && !fs.delete(f, recursive)) {
throw new IOException("Failed to delete: " + f);
}
} | java | public static void deletePath(FileSystem fs, Path f, boolean recursive) throws IOException {
if (fs.exists(f) && !fs.delete(f, recursive)) {
throw new IOException("Failed to delete: " + f);
}
} | [
"public",
"static",
"void",
"deletePath",
"(",
"FileSystem",
"fs",
",",
"Path",
"f",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fs",
".",
"exists",
"(",
"f",
")",
"&&",
"!",
"fs",
".",
"delete",
"(",
"f",
",",
"recurs... | A wrapper around {@link FileSystem#delete(Path, boolean)} which throws {@link IOException} if the given
{@link Path} exists, and {@link FileSystem#delete(Path, boolean)} returns False. | [
"A",
"wrapper",
"around",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L147-L151 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsInner.java | ExpressRouteConnectionsInner.beginDelete | public void beginDelete(String resourceGroupName, String expressRouteGatewayName, String connectionName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().single().body();
} | java | public void beginDelete(String resourceGroupName, String expressRouteGatewayName, String connectionName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRouteGatewayName",
",",
"String",
"connectionName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"expressRouteGatewayName",
",",
"connectionName",
... | Deletes a connection to a ExpressRoute circuit.
@param resourceGroupName The name of the resource group.
@param expressRouteGatewayName The name of the ExpressRoute gateway.
@param connectionName The name of the connection subresource.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws C... | [
"Deletes",
"a",
"connection",
"to",
"a",
"ExpressRoute",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsInner.java#L440-L442 |
derari/cthul | xml/src/main/java/org/cthul/resolve/RRequest.java | RRequest.expandSystemId | protected String expandSystemId(String baseId, String systemId) {
if (baseId == null || baseId.isEmpty()) return systemId;
if (systemId == null || systemId.isEmpty()) return baseId;
try {
return new URI(baseId).resolve(new URI(systemId)).toASCIIString();
//
// ... | java | protected String expandSystemId(String baseId, String systemId) {
if (baseId == null || baseId.isEmpty()) return systemId;
if (systemId == null || systemId.isEmpty()) return baseId;
try {
return new URI(baseId).resolve(new URI(systemId)).toASCIIString();
//
// ... | [
"protected",
"String",
"expandSystemId",
"(",
"String",
"baseId",
",",
"String",
"systemId",
")",
"{",
"if",
"(",
"baseId",
"==",
"null",
"||",
"baseId",
".",
"isEmpty",
"(",
")",
")",
"return",
"systemId",
";",
"if",
"(",
"systemId",
"==",
"null",
"||",... | Calculates the schema file location.
@param baseId
@param systemId
@return schema file path | [
"Calculates",
"the",
"schema",
"file",
"location",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/RRequest.java#L117-L129 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.updateDirection | public QueryParameters updateDirection(String key, Direction direction) {
this.direction.put(processKey(key), direction);
return this;
} | java | public QueryParameters updateDirection(String key, Direction direction) {
this.direction.put(processKey(key), direction);
return this;
} | [
"public",
"QueryParameters",
"updateDirection",
"(",
"String",
"key",
",",
"Direction",
"direction",
")",
"{",
"this",
".",
"direction",
".",
"put",
"(",
"processKey",
"(",
"key",
")",
",",
"direction",
")",
";",
"return",
"this",
";",
"}"
] | Updates direction of specified key
@param key Key
@param direction Direction
@return this instance of QueryParameters | [
"Updates",
"direction",
"of",
"specified",
"key"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L301-L305 |
jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Decoder.java | Decoder.decodeFrame | public Obuffer decodeFrame(Header header, Bitstream stream)
throws DecoderException
{
try
{
if (!initialized)
{
initialize(header);
}
int layer = header.layer();
output.clear_buffer();
FrameDecoder decoder = retrieveDecoder(header, stream, layer);
decoder.decodeFrame();
... | java | public Obuffer decodeFrame(Header header, Bitstream stream)
throws DecoderException
{
try
{
if (!initialized)
{
initialize(header);
}
int layer = header.layer();
output.clear_buffer();
FrameDecoder decoder = retrieveDecoder(header, stream, layer);
decoder.decodeFrame();
... | [
"public",
"Obuffer",
"decodeFrame",
"(",
"Header",
"header",
",",
"Bitstream",
"stream",
")",
"throws",
"DecoderException",
"{",
"try",
"{",
"if",
"(",
"!",
"initialized",
")",
"{",
"initialize",
"(",
"header",
")",
";",
"}",
"int",
"layer",
"=",
"header",... | Decodes one frame from an MPEG audio bitstream.
@param header The header describing the frame to decode.
@param bitstream The bistream that provides the bits for the body of the frame.
@return A SampleBuffer containing the decoded samples. | [
"Decodes",
"one",
"frame",
"from",
"an",
"MPEG",
"audio",
"bitstream",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Decoder.java#L133-L159 |
op4j/op4j | src/main/java/org/op4j/functions/Call.java | Call.listOf | public static <R> Function<Object,List<R>> listOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) {
return methodForListOf(resultType, methodName, optionalParameters);
} | java | public static <R> Function<Object,List<R>> listOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) {
return methodForListOf(resultType, methodName, optionalParameters);
} | [
"public",
"static",
"<",
"R",
">",
"Function",
"<",
"Object",
",",
"List",
"<",
"R",
">",
">",
"listOf",
"(",
"final",
"Type",
"<",
"R",
">",
"resultType",
",",
"final",
"String",
"methodName",
",",
"final",
"Object",
"...",
"optionalParameters",
")",
... | <p>
Abbreviation for {{@link #methodForListOf(Type, String, Object...)}.
</p>
@since 1.1
@param methodName the name of the method
@param optionalParameters the (optional) parameters of the method.
@return the result of the method execution | [
"<p",
">",
"Abbreviation",
"for",
"{{",
"@link",
"#methodForListOf",
"(",
"Type",
"String",
"Object",
"...",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/Call.java#L644-L646 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.getAbsoluteParent | public static String getAbsoluteParent(String path, int level)
{
int idx = 0;
int len = path.length();
while (level >= 0 && idx < len)
{
idx = path.indexOf('/', idx + 1);
if (idx < 0)
{
idx = len;
}
level--;
}
return level >... | java | public static String getAbsoluteParent(String path, int level)
{
int idx = 0;
int len = path.length();
while (level >= 0 && idx < len)
{
idx = path.indexOf('/', idx + 1);
if (idx < 0)
{
idx = len;
}
level--;
}
return level >... | [
"public",
"static",
"String",
"getAbsoluteParent",
"(",
"String",
"path",
",",
"int",
"level",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"int",
"len",
"=",
"path",
".",
"length",
"(",
")",
";",
"while",
"(",
"level",
">=",
"0",
"&&",
"idx",
"<",
"len"... | Returns the n<sup>th</sup> absolute parent of the path, where n=level.
<p>
Example:<br>
<code>
Text.getAbsoluteParent("/foo/bar/test", 1) == "/foo/bar"
</code>
@param path
the path of the page
@param level
the level of the parent
@return String absolute parent | [
"Returns",
"the",
"n<sup",
">",
"th<",
"/",
"sup",
">",
"absolute",
"parent",
"of",
"the",
"path",
"where",
"n",
"=",
"level",
".",
"<p",
">",
"Example",
":",
"<br",
">",
"<code",
">",
"Text",
".",
"getAbsoluteParent",
"(",
"/",
"foo",
"/",
"bar",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L811-L825 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlExecutor.java | SqlExecutor.executeUpdateSql | public int executeUpdateSql(String sql, PropertyDesc[] propDescs, Object entity){
PreparedStatement stmt = null;
ResultSet rs = null;
try {
Connection conn = connectionProvider.getConnection();
if (logger.isDebugEnabled()) {
printSql(sql);
... | java | public int executeUpdateSql(String sql, PropertyDesc[] propDescs, Object entity){
PreparedStatement stmt = null;
ResultSet rs = null;
try {
Connection conn = connectionProvider.getConnection();
if (logger.isDebugEnabled()) {
printSql(sql);
... | [
"public",
"int",
"executeUpdateSql",
"(",
"String",
"sql",
",",
"PropertyDesc",
"[",
"]",
"propDescs",
",",
"Object",
"entity",
")",
"{",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"try",
"{",
"Connection",
"conn",
... | Executes an update SQL.
@param sql the update SQL to execute
@param propDescs the array of parameters
@param entity the entity object in insertion, otherwise null
@return the number of updated rows
@throws SQLRuntimeException if a database access error occurs | [
"Executes",
"an",
"update",
"SQL",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlExecutor.java#L274-L309 |
TakahikoKawasaki/nv-bluetooth | src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java | ADPayloadParser.registerManufacturerSpecificBuilder | public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder)
{
if (companyId < 0 || 0xFFFF < companyId)
{
String message = String.format("'companyId' is out of the valid range: %d", companyId);
throw new IllegalArgumentException(messag... | java | public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder)
{
if (companyId < 0 || 0xFFFF < companyId)
{
String message = String.format("'companyId' is out of the valid range: %d", companyId);
throw new IllegalArgumentException(messag... | [
"public",
"void",
"registerManufacturerSpecificBuilder",
"(",
"int",
"companyId",
",",
"ADManufacturerSpecificBuilder",
"builder",
")",
"{",
"if",
"(",
"companyId",
"<",
"0",
"||",
"0xFFFF",
"<",
"companyId",
")",
"{",
"String",
"message",
"=",
"String",
".",
"f... | Register a builder for the company ID. The given builder is added
at the beginning of the list of the builders for the company ID.
@param companyId
Company ID. The value must be in the range from 0 to 0xFFFF.
@param builder
A builder. | [
"Register",
"a",
"builder",
"for",
"the",
"company",
"ID",
".",
"The",
"given",
"builder",
"is",
"added",
"at",
"the",
"beginning",
"of",
"the",
"list",
"of",
"the",
"builders",
"for",
"the",
"company",
"ID",
"."
] | train | https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java#L193-L221 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.getInternalState | @SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, String fieldName, Class<?> where) {
if (object == null || fieldName == null || fieldName.equals("") || fieldName.startsWith(" ")) {
throw new IllegalArgumentException("object, field name, and \"where\" must not be... | java | @SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, String fieldName, Class<?> where) {
if (object == null || fieldName == null || fieldName.equals("") || fieldName.startsWith(" ")) {
throw new IllegalArgumentException("object, field name, and \"where\" must not be... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getInternalState",
"(",
"Object",
"object",
",",
"String",
"fieldName",
",",
"Class",
"<",
"?",
">",
"where",
")",
"{",
"if",
"(",
"object",
"==",
"null",
"||",
... | Get the value of a field using reflection. Use this method when you need
to specify in which class the field is declared. This might be useful
when you have mocked the instance you are trying to access. Use this
method to avoid casting.
@param <T> the expected type of the field
@param object the object to mod... | [
"Get",
"the",
"value",
"of",
"a",
"field",
"using",
"reflection",
".",
"Use",
"this",
"method",
"when",
"you",
"need",
"to",
"specify",
"in",
"which",
"class",
"the",
"field",
"is",
"declared",
".",
"This",
"might",
"be",
"useful",
"when",
"you",
"have",... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L612-L629 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java | Postconditions.checkPostconditionsL | public static long checkPostconditionsL(
final long value,
final ContractLongConditionType... conditions)
throws PostconditionViolationException
{
final Violations violations = innerCheckAllLong(value, conditions);
if (violations != null) {
throw failed(null, Long.valueOf(value), violations)... | java | public static long checkPostconditionsL(
final long value,
final ContractLongConditionType... conditions)
throws PostconditionViolationException
{
final Violations violations = innerCheckAllLong(value, conditions);
if (violations != null) {
throw failed(null, Long.valueOf(value), violations)... | [
"public",
"static",
"long",
"checkPostconditionsL",
"(",
"final",
"long",
"value",
",",
"final",
"ContractLongConditionType",
"...",
"conditions",
")",
"throws",
"PostconditionViolationException",
"{",
"final",
"Violations",
"violations",
"=",
"innerCheckAllLong",
"(",
... | A {@code long} specialized version of {@link #checkPostconditions(Object,
ContractConditionType[])}
@param value The value
@param conditions The conditions the value must obey
@return value
@throws PostconditionViolationException If any of the conditions are false | [
"A",
"{",
"@code",
"long",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkPostconditions",
"(",
"Object",
"ContractConditionType",
"[]",
")",
"}"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java#L122-L132 |
mlhartme/sushi | src/main/java/net/oneandone/sushi/fs/file/FileNode.java | FileNode.deleteTree | @Override
public FileNode deleteTree() throws DeleteException, NodeNotFoundException {
if (!exists()) {
throw new NodeNotFoundException(this);
}
try {
doDeleteTree(path);
} catch (IOException e) {
throw new DeleteException(this, e);
}
... | java | @Override
public FileNode deleteTree() throws DeleteException, NodeNotFoundException {
if (!exists()) {
throw new NodeNotFoundException(this);
}
try {
doDeleteTree(path);
} catch (IOException e) {
throw new DeleteException(this, e);
}
... | [
"@",
"Override",
"public",
"FileNode",
"deleteTree",
"(",
")",
"throws",
"DeleteException",
",",
"NodeNotFoundException",
"{",
"if",
"(",
"!",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"NodeNotFoundException",
"(",
"this",
")",
";",
"}",
"try",
"{",
"d... | Deletes a file or directory. Directories are deleted recursively. Handles Links. | [
"Deletes",
"a",
"file",
"or",
"directory",
".",
"Directories",
"are",
"deleted",
"recursively",
".",
"Handles",
"Links",
"."
] | train | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/fs/file/FileNode.java#L411-L422 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java | MultiLineString.fromLineStrings | public static MultiLineString fromLineStrings(@NonNull List<LineString> lineStrings,
@Nullable BoundingBox bbox) {
List<List<Point>> coordinates = new ArrayList<>(lineStrings.size());
for (LineString lineString : lineStrings) {
coordinates.add(lineString.coo... | java | public static MultiLineString fromLineStrings(@NonNull List<LineString> lineStrings,
@Nullable BoundingBox bbox) {
List<List<Point>> coordinates = new ArrayList<>(lineStrings.size());
for (LineString lineString : lineStrings) {
coordinates.add(lineString.coo... | [
"public",
"static",
"MultiLineString",
"fromLineStrings",
"(",
"@",
"NonNull",
"List",
"<",
"LineString",
">",
"lineStrings",
",",
"@",
"Nullable",
"BoundingBox",
"bbox",
")",
"{",
"List",
"<",
"List",
"<",
"Point",
">>",
"coordinates",
"=",
"new",
"ArrayList"... | Create a new instance of this class by defining a list of {@link LineString} objects and
passing that list in as a parameter in this method. The LineStrings should comply with the
GeoJson specifications described in the documentation. Optionally, pass in an instance of a
{@link BoundingBox} which better describes this ... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"list",
"of",
"{",
"@link",
"LineString",
"}",
"objects",
"and",
"passing",
"that",
"list",
"in",
"as",
"a",
"parameter",
"in",
"this",
"method",
".",
"The",
"LineStrings",
"... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java#L111-L118 |
wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.stringify | public String stringify(JsonNode json) {
try {
return mapper().writerWithDefaultPrettyPrinter().writeValueAsString(json);
} catch (JsonProcessingException e) {
throw new RuntimeException("Cannot stringify the input json node", e);
}
} | java | public String stringify(JsonNode json) {
try {
return mapper().writerWithDefaultPrettyPrinter().writeValueAsString(json);
} catch (JsonProcessingException e) {
throw new RuntimeException("Cannot stringify the input json node", e);
}
} | [
"public",
"String",
"stringify",
"(",
"JsonNode",
"json",
")",
"{",
"try",
"{",
"return",
"mapper",
"(",
")",
".",
"writerWithDefaultPrettyPrinter",
"(",
")",
".",
"writeValueAsString",
"(",
"json",
")",
";",
"}",
"catch",
"(",
"JsonProcessingException",
"e",
... | Converts a JsonNode to its string representation.
This implementation use a `pretty printer`.
@param json the json node
@return the String representation of the given Json Object
@throws java.lang.RuntimeException if the String form cannot be created | [
"Converts",
"a",
"JsonNode",
"to",
"its",
"string",
"representation",
".",
"This",
"implementation",
"use",
"a",
"pretty",
"printer",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L209-L215 |
ZuInnoTe/hadoopcryptoledger | inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java | BitcoinBlockReader.parseTransactionOutputs | public List<BitcoinTransactionOutput> parseTransactionOutputs(ByteBuffer rawByteBuffer, long noOfTransactionOutputs) {
ArrayList<BitcoinTransactionOutput> currentTransactionOutput = new ArrayList<>((int)(noOfTransactionOutputs));
for (int i=0;i<noOfTransactionOutputs;i++) {
// read value
byte[] currentTransacti... | java | public List<BitcoinTransactionOutput> parseTransactionOutputs(ByteBuffer rawByteBuffer, long noOfTransactionOutputs) {
ArrayList<BitcoinTransactionOutput> currentTransactionOutput = new ArrayList<>((int)(noOfTransactionOutputs));
for (int i=0;i<noOfTransactionOutputs;i++) {
// read value
byte[] currentTransacti... | [
"public",
"List",
"<",
"BitcoinTransactionOutput",
">",
"parseTransactionOutputs",
"(",
"ByteBuffer",
"rawByteBuffer",
",",
"long",
"noOfTransactionOutputs",
")",
"{",
"ArrayList",
"<",
"BitcoinTransactionOutput",
">",
"currentTransactionOutput",
"=",
"new",
"ArrayList",
... | /*
Parses the Bitcoin transaction outputs in a byte buffer.
@param rawByteBuffer ByteBuffer from which the transaction outputs have to be parsed
@param noOfTransactionInputs Number of expected transaction outputs
@return Array of transactions | [
"/",
"*",
"Parses",
"the",
"Bitcoin",
"transaction",
"outputs",
"in",
"a",
"byte",
"buffer",
"."
] | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java#L406-L424 |
galenframework/galen | galen-core/src/main/java/com/galenframework/specs/page/PageSpec.java | PageSpec.setObjects | public void setObjects(Map<String, Locator> objects) {
this.objects.clear();
if (objects != null) {
this.objects.putAll(objects);
}
} | java | public void setObjects(Map<String, Locator> objects) {
this.objects.clear();
if (objects != null) {
this.objects.putAll(objects);
}
} | [
"public",
"void",
"setObjects",
"(",
"Map",
"<",
"String",
",",
"Locator",
">",
"objects",
")",
"{",
"this",
".",
"objects",
".",
"clear",
"(",
")",
";",
"if",
"(",
"objects",
"!=",
"null",
")",
"{",
"this",
".",
"objects",
".",
"putAll",
"(",
"obj... | Clears current objects list and sets new object list
@param objects | [
"Clears",
"current",
"objects",
"list",
"and",
"sets",
"new",
"object",
"list"
] | train | https://github.com/galenframework/galen/blob/6c7dc1f11d097e6aa49c45d6a77ee688741657a4/galen-core/src/main/java/com/galenframework/specs/page/PageSpec.java#L52-L57 |
pushtorefresh/storio | storio-content-resolver/src/main/java/com/pushtorefresh/storio3/contentresolver/operations/put/PutResult.java | PutResult.newUpdateResult | @NonNull
public static PutResult newUpdateResult(int numberOfRowsUpdated, @NonNull Uri affectedUri) {
return new PutResult(null, numberOfRowsUpdated, affectedUri);
} | java | @NonNull
public static PutResult newUpdateResult(int numberOfRowsUpdated, @NonNull Uri affectedUri) {
return new PutResult(null, numberOfRowsUpdated, affectedUri);
} | [
"@",
"NonNull",
"public",
"static",
"PutResult",
"newUpdateResult",
"(",
"int",
"numberOfRowsUpdated",
",",
"@",
"NonNull",
"Uri",
"affectedUri",
")",
"{",
"return",
"new",
"PutResult",
"(",
"null",
",",
"numberOfRowsUpdated",
",",
"affectedUri",
")",
";",
"}"
] | Creates {@link PutResult} for update.
@param numberOfRowsUpdated number of rows that were updated, must be {@code >= 0}.
@param affectedUri Uri that was affected by update.
@return new {@link PutResult} instance. | [
"Creates",
"{",
"@link",
"PutResult",
"}",
"for",
"update",
"."
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-content-resolver/src/main/java/com/pushtorefresh/storio3/contentresolver/operations/put/PutResult.java#L55-L58 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java | EventServiceSegment.addRegistration | public boolean addRegistration(String topic, Registration registration) {
Collection<Registration> registrations = getRegistrations(topic, true);
if (registrations.add(registration)) {
registrationIdMap.put(registration.getId(), registration);
pingNotifiableEventListener(topic, r... | java | public boolean addRegistration(String topic, Registration registration) {
Collection<Registration> registrations = getRegistrations(topic, true);
if (registrations.add(registration)) {
registrationIdMap.put(registration.getId(), registration);
pingNotifiableEventListener(topic, r... | [
"public",
"boolean",
"addRegistration",
"(",
"String",
"topic",
",",
"Registration",
"registration",
")",
"{",
"Collection",
"<",
"Registration",
">",
"registrations",
"=",
"getRegistrations",
"(",
"topic",
",",
"true",
")",
";",
"if",
"(",
"registrations",
".",... | Adds a registration for the {@code topic} and notifies the listener and service of the listener
registration. Returns if the registration was added. The registration might not be added
if an equal instance is already registered.
@param topic the event topic
@param registration the listener registration
@return ... | [
"Adds",
"a",
"registration",
"for",
"the",
"{",
"@code",
"topic",
"}",
"and",
"notifies",
"the",
"listener",
"and",
"service",
"of",
"the",
"listener",
"registration",
".",
"Returns",
"if",
"the",
"registration",
"was",
"added",
".",
"The",
"registration",
"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java#L153-L161 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Stream.java | Stream.parallelConcat | public static <T> Stream<T> parallelConcat(final Collection<? extends Stream<? extends T>> c, final int readThreadNum) {
return parallelConcat(c, readThreadNum, calculateQueueSize(c.size()));
} | java | public static <T> Stream<T> parallelConcat(final Collection<? extends Stream<? extends T>> c, final int readThreadNum) {
return parallelConcat(c, readThreadNum, calculateQueueSize(c.size()));
} | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"parallelConcat",
"(",
"final",
"Collection",
"<",
"?",
"extends",
"Stream",
"<",
"?",
"extends",
"T",
">",
">",
"c",
",",
"final",
"int",
"readThreadNum",
")",
"{",
"return",
"parallelConcat",
... | Put the stream in try-catch to stop the back-end reading thread if error happens
<br />
<code>
try (Stream<Integer> stream = Stream.parallelConcat(a,b, ...)) {
stream.forEach(N::println);
}
</code>
@param c
@param readThreadNum
@return | [
"Put",
"the",
"stream",
"in",
"try",
"-",
"catch",
"to",
"stop",
"the",
"back",
"-",
"end",
"reading",
"thread",
"if",
"error",
"happens",
"<br",
"/",
">",
"<code",
">",
"try",
"(",
"Stream<Integer",
">",
"stream",
"=",
"Stream",
".",
"parallelConcat",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Stream.java#L4255-L4257 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/Schema.java | Schema.performTypeValidation | protected void performTypeValidation(String path, Object type, Object value, List<ValidationResult> results) {
// If type it not defined then skip
if (type == null)
return;
// Perform validation against schema
if (type instanceof Schema) {
Schema schema = (Schema) type;
schema.performValidation(path, ... | java | protected void performTypeValidation(String path, Object type, Object value, List<ValidationResult> results) {
// If type it not defined then skip
if (type == null)
return;
// Perform validation against schema
if (type instanceof Schema) {
Schema schema = (Schema) type;
schema.performValidation(path, ... | [
"protected",
"void",
"performTypeValidation",
"(",
"String",
"path",
",",
"Object",
"type",
",",
"Object",
"value",
",",
"List",
"<",
"ValidationResult",
">",
"results",
")",
"{",
"// If type it not defined then skip",
"if",
"(",
"type",
"==",
"null",
")",
"retu... | Validates a given value to match specified type. The type can be defined as a
Schema, type, a type name or TypeCode When type is a Schema, it executes
validation recursively against that Schema.
@param path a dot notation path to the value.
@param type a type to match the value type
@param value a value to be ... | [
"Validates",
"a",
"given",
"value",
"to",
"match",
"specified",
"type",
".",
"The",
"type",
"can",
"be",
"defined",
"as",
"a",
"Schema",
"type",
"a",
"type",
"name",
"or",
"TypeCode",
"When",
"type",
"is",
"a",
"Schema",
"it",
"executes",
"validation",
"... | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/Schema.java#L162-L189 |
orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java | GraphCreator.setEdgeWeight | private void setEdgeWeight(E edge, final double weight) throws SQLException {
if (edge != null && weightColumnIndex != -1) {
edge.setWeight(weight);
}
} | java | private void setEdgeWeight(E edge, final double weight) throws SQLException {
if (edge != null && weightColumnIndex != -1) {
edge.setWeight(weight);
}
} | [
"private",
"void",
"setEdgeWeight",
"(",
"E",
"edge",
",",
"final",
"double",
"weight",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"edge",
"!=",
"null",
"&&",
"weightColumnIndex",
"!=",
"-",
"1",
")",
"{",
"edge",
".",
"setWeight",
"(",
"weight",
")"... | Set this edge's weight to the weight contained in the current row.
@param edge Edge
@throws SQLException If the weight cannot be retrieved | [
"Set",
"this",
"edge",
"s",
"weight",
"to",
"the",
"weight",
"contained",
"in",
"the",
"current",
"row",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java#L278-L282 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/transform/recurrence/AbstractDateExpansionRule.java | AbstractDateExpansionRule.getCalendarInstance | protected Calendar getCalendarInstance(final Date date, final boolean lenient) {
Calendar cal = Dates.getCalendarInstance(date);
// A week should have at least 4 days to be considered as such per RFC5545
cal.setMinimalDaysInFirstWeek(4);
cal.setFirstDayOfWeek(calendarWeekStartDay);
... | java | protected Calendar getCalendarInstance(final Date date, final boolean lenient) {
Calendar cal = Dates.getCalendarInstance(date);
// A week should have at least 4 days to be considered as such per RFC5545
cal.setMinimalDaysInFirstWeek(4);
cal.setFirstDayOfWeek(calendarWeekStartDay);
... | [
"protected",
"Calendar",
"getCalendarInstance",
"(",
"final",
"Date",
"date",
",",
"final",
"boolean",
"lenient",
")",
"{",
"Calendar",
"cal",
"=",
"Dates",
".",
"getCalendarInstance",
"(",
"date",
")",
";",
"// A week should have at least 4 days to be considered as suc... | Construct a Calendar object and sets the time.
@param date
@param lenient
@return | [
"Construct",
"a",
"Calendar",
"object",
"and",
"sets",
"the",
"time",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/transform/recurrence/AbstractDateExpansionRule.java#L110-L119 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/traverson/Traverson.java | Traverson.followLink | public Traverson followLink(final String rel,
final Predicate<Link> predicate) {
return followLink(rel, predicate, emptyMap());
} | java | public Traverson followLink(final String rel,
final Predicate<Link> predicate) {
return followLink(rel, predicate, emptyMap());
} | [
"public",
"Traverson",
"followLink",
"(",
"final",
"String",
"rel",
",",
"final",
"Predicate",
"<",
"Link",
">",
"predicate",
")",
"{",
"return",
"followLink",
"(",
"rel",
",",
"predicate",
",",
"emptyMap",
"(",
")",
")",
";",
"}"
] | Follow the first {@link Link} of the current resource that is matching the link-relation type and
the {@link LinkPredicates predicate}.
<p>
Other than {@link #follow(String, Predicate)}, this method will ignore possibly embedded resources
with the same link-relation type. Only if the link is missing, the embedded resou... | [
"Follow",
"the",
"first",
"{",
"@link",
"Link",
"}",
"of",
"the",
"current",
"resource",
"that",
"is",
"matching",
"the",
"link",
"-",
"relation",
"type",
"and",
"the",
"{",
"@link",
"LinkPredicates",
"predicate",
"}",
".",
"<p",
">",
"Other",
"than",
"{... | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/traverson/Traverson.java#L408-L411 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.variableDeclarator | JCVariableDecl variableDeclarator(JCModifiers mods, JCExpression type, boolean reqInit, Comment dc) {
return variableDeclaratorRest(token.pos, mods, type, ident(), reqInit, dc);
} | java | JCVariableDecl variableDeclarator(JCModifiers mods, JCExpression type, boolean reqInit, Comment dc) {
return variableDeclaratorRest(token.pos, mods, type, ident(), reqInit, dc);
} | [
"JCVariableDecl",
"variableDeclarator",
"(",
"JCModifiers",
"mods",
",",
"JCExpression",
"type",
",",
"boolean",
"reqInit",
",",
"Comment",
"dc",
")",
"{",
"return",
"variableDeclaratorRest",
"(",
"token",
".",
"pos",
",",
"mods",
",",
"type",
",",
"ident",
"(... | VariableDeclarator = Ident VariableDeclaratorRest
ConstantDeclarator = Ident ConstantDeclaratorRest | [
"VariableDeclarator",
"=",
"Ident",
"VariableDeclaratorRest",
"ConstantDeclarator",
"=",
"Ident",
"ConstantDeclaratorRest"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3007-L3009 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/localization/MessageInterpolator.java | MessageInterpolator.interpolate | public String interpolate(final String message, final Map<String, ?> vars, boolean recursive,
final MessageResolver messageResolver) {
return parse(message, vars, recursive, messageResolver);
} | java | public String interpolate(final String message, final Map<String, ?> vars, boolean recursive,
final MessageResolver messageResolver) {
return parse(message, vars, recursive, messageResolver);
} | [
"public",
"String",
"interpolate",
"(",
"final",
"String",
"message",
",",
"final",
"Map",
"<",
"String",
",",
"?",
">",
"vars",
",",
"boolean",
"recursive",
",",
"final",
"MessageResolver",
"messageResolver",
")",
"{",
"return",
"parse",
"(",
"message",
","... | メッセージを引数varsで指定した変数で補完する。
<p>{@link MessageResolver}を指定した場合、メッセージ中の変数をメッセージコードとして解決します。
@param message 対象のメッセージ。
@param vars メッセージ中の変数に対する値のマップ。
@param recursive 変換したメッセージに対しても再帰的に処理するかどうか
@param messageResolver メッセージを解決するクラス。nullの場合、指定しないと同じ意味になります。
@return 補完したメッセージ。 | [
"メッセージを引数varsで指定した変数で補完する。",
"<p",
">",
"{",
"@link",
"MessageResolver",
"}",
"を指定した場合、メッセージ中の変数をメッセージコードとして解決します。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/localization/MessageInterpolator.java#L100-L103 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.pack | public static void pack(File sourceDir, OutputStream os) {
pack(sourceDir, os, IdentityNameMapper.INSTANCE, DEFAULT_COMPRESSION_LEVEL);
} | java | public static void pack(File sourceDir, OutputStream os) {
pack(sourceDir, os, IdentityNameMapper.INSTANCE, DEFAULT_COMPRESSION_LEVEL);
} | [
"public",
"static",
"void",
"pack",
"(",
"File",
"sourceDir",
",",
"OutputStream",
"os",
")",
"{",
"pack",
"(",
"sourceDir",
",",
"os",
",",
"IdentityNameMapper",
".",
"INSTANCE",
",",
"DEFAULT_COMPRESSION_LEVEL",
")",
";",
"}"
] | Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@param os
output stream (will be buffered in this method).
@since 1.10 | [
"Compresses",
"the",
"given",
"directory",
"and",
"all",
"of",
"its",
"sub",
"-",
"directories",
"into",
"the",
"passed",
"in",
"stream",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"caller",
"to",
"close",
"the",
"passed",
"in",
"stream",
"prop... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1634-L1636 |
find-sec-bugs/find-sec-bugs | findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/common/InterfaceUtils.java | InterfaceUtils.isSubtype | public static boolean isSubtype(String className, String... superClasses) {
for(String potentialSuperClass : superClasses) {
try {
if(Hierarchy.isSubtype(className, potentialSuperClass)) {
return true;
}
} catch (ClassNotFoundException ... | java | public static boolean isSubtype(String className, String... superClasses) {
for(String potentialSuperClass : superClasses) {
try {
if(Hierarchy.isSubtype(className, potentialSuperClass)) {
return true;
}
} catch (ClassNotFoundException ... | [
"public",
"static",
"boolean",
"isSubtype",
"(",
"String",
"className",
",",
"String",
"...",
"superClasses",
")",
"{",
"for",
"(",
"String",
"potentialSuperClass",
":",
"superClasses",
")",
"{",
"try",
"{",
"if",
"(",
"Hierarchy",
".",
"isSubtype",
"(",
"cl... | Test if the given class is a subtype of ONE of the super classes given.
<br/>
The following test that the class is a subclass of Hashtable.
<pre>
boolean isHashtable = InterfaceUtils.isSubtype( classThatCouldBeAHashTable, "java.util.Hashtable");
</pre>
@param className Class to test
@param superClasses If classes exte... | [
"Test",
"if",
"the",
"given",
"class",
"is",
"a",
"subtype",
"of",
"ONE",
"of",
"the",
"super",
"classes",
"given",
".",
"<br",
"/",
">",
"The",
"following",
"test",
"that",
"the",
"class",
"is",
"a",
"subclass",
"of",
"Hashtable",
".",
"<pre",
">",
... | train | https://github.com/find-sec-bugs/find-sec-bugs/blob/362da013cef4925e6a1506dd3511fe5bdcc5fba3/findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/common/InterfaceUtils.java#L54-L65 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java | ExceptionUtils.getStackFrameList | @GwtIncompatible("incompatible method")
static List<String> getStackFrameList(final Throwable t) {
final String stackTrace = getStackTrace(t);
final String linebreak = System.lineSeparator();
final StringTokenizer frames = new StringTokenizer(stackTrace, linebreak);
final List<String... | java | @GwtIncompatible("incompatible method")
static List<String> getStackFrameList(final Throwable t) {
final String stackTrace = getStackTrace(t);
final String linebreak = System.lineSeparator();
final StringTokenizer frames = new StringTokenizer(stackTrace, linebreak);
final List<String... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"static",
"List",
"<",
"String",
">",
"getStackFrameList",
"(",
"final",
"Throwable",
"t",
")",
"{",
"final",
"String",
"stackTrace",
"=",
"getStackTrace",
"(",
"t",
")",
";",
"final",
"String",
"lin... | <p>Produces a <code>List</code> of stack frames - the message
is not included. Only the trace of the specified exception is
returned, any caused by trace is stripped.</p>
<p>This works in most cases - it will only fail if the exception
message contains a line that starts with:
<code>" at".</... | [
"<p",
">",
"Produces",
"a",
"<code",
">",
"List<",
"/",
"code",
">",
"of",
"stack",
"frames",
"-",
"the",
"message",
"is",
"not",
"included",
".",
"Only",
"the",
"trace",
"of",
"the",
"specified",
"exception",
"is",
"returned",
"any",
"caused",
"by",
"... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java#L656-L675 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.loadBitmapOptimized | public static Bitmap loadBitmapOptimized(Uri uri, Context context) throws ImageLoadException {
return loadBitmapOptimized(uri, context, MAX_PIXELS);
} | java | public static Bitmap loadBitmapOptimized(Uri uri, Context context) throws ImageLoadException {
return loadBitmapOptimized(uri, context, MAX_PIXELS);
} | [
"public",
"static",
"Bitmap",
"loadBitmapOptimized",
"(",
"Uri",
"uri",
",",
"Context",
"context",
")",
"throws",
"ImageLoadException",
"{",
"return",
"loadBitmapOptimized",
"(",
"uri",
",",
"context",
",",
"MAX_PIXELS",
")",
";",
"}"
] | Loading bitmap with optimized loaded size less than 1.4 MPX
@param uri content uri for bitmap
@param context Application Context
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to load file | [
"Loading",
"bitmap",
"with",
"optimized",
"loaded",
"size",
"less",
"than",
"1",
".",
"4",
"MPX"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L97-L99 |
geomajas/geomajas-project-client-gwt2 | common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java | StyleUtil.createFill | public static FillInfo createFill(String color, float opacity) {
FillInfo fillInfo = new FillInfo();
if (color != null) {
fillInfo.getCssParameterList().add(createCssParameter("fill", color));
}
fillInfo.getCssParameterList().add(createCssParameter("fill-opacity", opacity));
return fillInfo;
} | java | public static FillInfo createFill(String color, float opacity) {
FillInfo fillInfo = new FillInfo();
if (color != null) {
fillInfo.getCssParameterList().add(createCssParameter("fill", color));
}
fillInfo.getCssParameterList().add(createCssParameter("fill-opacity", opacity));
return fillInfo;
} | [
"public",
"static",
"FillInfo",
"createFill",
"(",
"String",
"color",
",",
"float",
"opacity",
")",
"{",
"FillInfo",
"fillInfo",
"=",
"new",
"FillInfo",
"(",
")",
";",
"if",
"(",
"color",
"!=",
"null",
")",
"{",
"fillInfo",
".",
"getCssParameterList",
"(",... | Creates a fill with the specified CSS parameters.
@param color the color
@param opacity the opacity
@return the fill | [
"Creates",
"a",
"fill",
"with",
"the",
"specified",
"CSS",
"parameters",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L227-L234 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.setByte | public void setByte(int index, int value)
{
checkPositionIndexes(index, index + SIZE_OF_BYTE, this.length);
index += offset;
data[index] = (byte) value;
} | java | public void setByte(int index, int value)
{
checkPositionIndexes(index, index + SIZE_OF_BYTE, this.length);
index += offset;
data[index] = (byte) value;
} | [
"public",
"void",
"setByte",
"(",
"int",
"index",
",",
"int",
"value",
")",
"{",
"checkPositionIndexes",
"(",
"index",
",",
"index",
"+",
"SIZE_OF_BYTE",
",",
"this",
".",
"length",
")",
";",
"index",
"+=",
"offset",
";",
"data",
"[",
"index",
"]",
"="... | Sets the specified byte at the specified absolute {@code index} in this
buffer. The 24 high-order bits of the specified value are ignored.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
{@code index + 1} is greater than {@code this.capacity} | [
"Sets",
"the",
"specified",
"byte",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"in",
"this",
"buffer",
".",
"The",
"24",
"high",
"-",
"order",
"bits",
"of",
"the",
"specified",
"value",
"are",
"ignored",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L347-L352 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.deleteFileFromTask | public void deleteFileFromTask(String jobId, String taskId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
FileDeleteFromTaskOptions options = new FileDeleteFromTaskOptions();
BehaviorManager bhMgr = new BehaviorManager(th... | java | public void deleteFileFromTask(String jobId, String taskId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
FileDeleteFromTaskOptions options = new FileDeleteFromTaskOptions();
BehaviorManager bhMgr = new BehaviorManager(th... | [
"public",
"void",
"deleteFileFromTask",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"String",
"fileName",
",",
"Boolean",
"recursive",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOEx... | Deletes the specified file from the specified task's directory on its compute node.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task.
@param fileName The name of the file to delete.
@param recursive If the file-path parameter represents a directory instead of a file, you can set the... | [
"Deletes",
"the",
"specified",
"file",
"from",
"the",
"specified",
"task",
"s",
"directory",
"on",
"its",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L200-L206 |
groupon/odo | client/src/main/java/com/groupon/odo/client/PathValueClient.java | PathValueClient.removeCustomResponse | public boolean removeCustomResponse(String pathValue, String requestType) {
try {
JSONObject path = getPathFromEndpoint(pathValue, requestType);
if (path == null) {
return false;
}
String pathId = path.getString("pathId");
return resetR... | java | public boolean removeCustomResponse(String pathValue, String requestType) {
try {
JSONObject path = getPathFromEndpoint(pathValue, requestType);
if (path == null) {
return false;
}
String pathId = path.getString("pathId");
return resetR... | [
"public",
"boolean",
"removeCustomResponse",
"(",
"String",
"pathValue",
",",
"String",
"requestType",
")",
"{",
"try",
"{",
"JSONObject",
"path",
"=",
"getPathFromEndpoint",
"(",
"pathValue",
",",
"requestType",
")",
";",
"if",
"(",
"path",
"==",
"null",
")",... | Remove any overrides for an endpoint
@param pathValue path (endpoint) value
@param requestType path request type. "GET", "POST", etc
@return true if success, false otherwise | [
"Remove",
"any",
"overrides",
"for",
"an",
"endpoint"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L103-L115 |
grails/grails-core | grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java | PluginAwareResourceBundleMessageSource.resolveCodeWithoutArgumentsFromPlugins | protected String resolveCodeWithoutArgumentsFromPlugins(String code, Locale locale) {
if (pluginCacheMillis < 0) {
PropertiesHolder propHolder = getMergedPluginProperties(locale);
String result = propHolder.getProperty(code);
if (result != null) {
return resul... | java | protected String resolveCodeWithoutArgumentsFromPlugins(String code, Locale locale) {
if (pluginCacheMillis < 0) {
PropertiesHolder propHolder = getMergedPluginProperties(locale);
String result = propHolder.getProperty(code);
if (result != null) {
return resul... | [
"protected",
"String",
"resolveCodeWithoutArgumentsFromPlugins",
"(",
"String",
"code",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"pluginCacheMillis",
"<",
"0",
")",
"{",
"PropertiesHolder",
"propHolder",
"=",
"getMergedPluginProperties",
"(",
"locale",
")",
";"... | Attempts to resolve a String for the code from the list of plugin base names
@param code The code
@param locale The locale
@return a MessageFormat | [
"Attempts",
"to",
"resolve",
"a",
"String",
"for",
"the",
"code",
"from",
"the",
"list",
"of",
"plugin",
"base",
"names"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java#L195-L209 |
PuyallupFoursquare/ccb-api-client-java | src/main/java/com/p4square/ccbapi/serializer/FormBuilder.java | FormBuilder.appendField | public void appendField(final String key, final String value) {
if (builder.length() > 0) {
builder.append("&");
}
try {
builder.append(key).append("=").append(URLEncoder.encode(value, "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new As... | java | public void appendField(final String key, final String value) {
if (builder.length() > 0) {
builder.append("&");
}
try {
builder.append(key).append("=").append(URLEncoder.encode(value, "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new As... | [
"public",
"void",
"appendField",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"builder",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"builder",
".",
"append",
"(",
"\"&\"",
")",
";",
"}",
"try",
"{",
"builde... | Append a field to the form.
@param key The form key, which must be URLEncoded before calling this method.
@param value The value associated with the key. The value will be URLEncoded by this method. | [
"Append",
"a",
"field",
"to",
"the",
"form",
"."
] | train | https://github.com/PuyallupFoursquare/ccb-api-client-java/blob/54a7a3184dc565fe513aa520e1344b2303ea6834/src/main/java/com/p4square/ccbapi/serializer/FormBuilder.java#L61-L71 |
javalite/activejdbc | javalite-common/src/main/java/org/javalite/common/Convert.java | Convert.toInteger | public static Integer toInteger(Object value) {
if (value == null) {
return null;
} else if (value instanceof Integer) {
return (Integer) value;
} else if (value instanceof Number) {
return ((Number) value).intValue();
} else {
try {
... | java | public static Integer toInteger(Object value) {
if (value == null) {
return null;
} else if (value instanceof Integer) {
return (Integer) value;
} else if (value instanceof Number) {
return ((Number) value).intValue();
} else {
try {
... | [
"public",
"static",
"Integer",
"toInteger",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"value",
"instanceof",
"Integer",
")",
"{",
"return",
"(",
"Integer",
")",
"value",... | Converts value to Integer if it can. If value is a Integer, it is returned, if it is a Number, it is
promoted to Integer and then returned, in all other cases, it converts the value to String,
then tries to parse Integer from it.
@param value value to be converted to Integer.
@return value converted to Integer. | [
"Converts",
"value",
"to",
"Integer",
"if",
"it",
"can",
".",
"If",
"value",
"is",
"a",
"Integer",
"it",
"is",
"returned",
"if",
"it",
"is",
"a",
"Number",
"it",
"is",
"promoted",
"to",
"Integer",
"and",
"then",
"returned",
"in",
"all",
"other",
"cases... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Convert.java#L373-L387 |
jglobus/JGlobus | axis/src/main/java/org/globus/axis/transport/HTTPUtils.java | HTTPUtils.setCloseConnection | public static void setCloseConnection(Stub stub, boolean close) {
Hashtable headers = getRequestHeaders(stub);
if (close) {
headers.put(HTTPConstants.HEADER_CONNECTION,
HTTPConstants.HEADER_CONNECTION_CLOSE);
} else {
headers.remove(HTTPConstants.H... | java | public static void setCloseConnection(Stub stub, boolean close) {
Hashtable headers = getRequestHeaders(stub);
if (close) {
headers.put(HTTPConstants.HEADER_CONNECTION,
HTTPConstants.HEADER_CONNECTION_CLOSE);
} else {
headers.remove(HTTPConstants.H... | [
"public",
"static",
"void",
"setCloseConnection",
"(",
"Stub",
"stub",
",",
"boolean",
"close",
")",
"{",
"Hashtable",
"headers",
"=",
"getRequestHeaders",
"(",
"stub",
")",
";",
"if",
"(",
"close",
")",
"{",
"headers",
".",
"put",
"(",
"HTTPConstants",
".... | Sets on option on the stub to close the connection
after receiving the reply (connection will not
be reused).
@param stub The stub to set the property on
@param close If true, connection close will be requested. Otherwise
connection close will not be requested. | [
"Sets",
"on",
"option",
"on",
"the",
"stub",
"to",
"close",
"the",
"connection",
"after",
"receiving",
"the",
"reply",
"(",
"connection",
"will",
"not",
"be",
"reused",
")",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/axis/src/main/java/org/globus/axis/transport/HTTPUtils.java#L51-L59 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.fundamentalToEssential | public static DMatrixRMaj fundamentalToEssential( DMatrixRMaj F , DMatrixRMaj K , @Nullable DMatrixRMaj outputE ) {
if( outputE == null )
outputE = new DMatrixRMaj(3,3);
PerspectiveOps.multTranA(K,F,K,outputE);
// this is unlikely to be a perfect essential matrix. reduce the error by enforcing essential cons... | java | public static DMatrixRMaj fundamentalToEssential( DMatrixRMaj F , DMatrixRMaj K , @Nullable DMatrixRMaj outputE ) {
if( outputE == null )
outputE = new DMatrixRMaj(3,3);
PerspectiveOps.multTranA(K,F,K,outputE);
// this is unlikely to be a perfect essential matrix. reduce the error by enforcing essential cons... | [
"public",
"static",
"DMatrixRMaj",
"fundamentalToEssential",
"(",
"DMatrixRMaj",
"F",
",",
"DMatrixRMaj",
"K",
",",
"@",
"Nullable",
"DMatrixRMaj",
"outputE",
")",
"{",
"if",
"(",
"outputE",
"==",
"null",
")",
"outputE",
"=",
"new",
"DMatrixRMaj",
"(",
"3",
... | Given the calibration matrix, convert the fundamental matrix into an essential matrix. E = K'*F*k. The
singular values of the resulting E matrix are forced to be [1,1,0]
@param F (Input) Fundamental matrix. 3x3
@param K (Input) Calibration matrix (3x3)
@param outputE (Output) Found essential matrix
@return Essential m... | [
"Given",
"the",
"calibration",
"matrix",
"convert",
"the",
"fundamental",
"matrix",
"into",
"an",
"essential",
"matrix",
".",
"E",
"=",
"K",
"*",
"F",
"*",
"k",
".",
"The",
"singular",
"values",
"of",
"the",
"resulting",
"E",
"matrix",
"are",
"forced",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L946-L970 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/ConnectionManagerFactory.java | ConnectionManagerFactory.createConnectionManager | public static ConnectionManager createConnectionManager(TransactionSupportEnum tse,
ManagedConnectionFactory mcf,
CachedConnectionManager ccm,
... | java | public static ConnectionManager createConnectionManager(TransactionSupportEnum tse,
ManagedConnectionFactory mcf,
CachedConnectionManager ccm,
... | [
"public",
"static",
"ConnectionManager",
"createConnectionManager",
"(",
"TransactionSupportEnum",
"tse",
",",
"ManagedConnectionFactory",
"mcf",
",",
"CachedConnectionManager",
"ccm",
",",
"ConnectionManagerConfiguration",
"cmc",
",",
"TransactionIntegration",
"ti",
")",
"{"... | Create a connection manager
@param tse The transaction support level
@param mcf The managed connection factory
@param ccm The cached connection manager
@param cmc The connection manager configuration
@param ti The transaction integration
@return The connection manager | [
"Create",
"a",
"connection",
"manager"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/ConnectionManagerFactory.java#L53-L71 |
jblas-project/jblas | src/main/java/org/jblas/util/SanityChecks.java | SanityChecks.checkEigenvalues | public static void checkEigenvalues() {
DoubleMatrix A = new DoubleMatrix(new double[][]{
{3.0, 2.0, 0.0},
{2.0, 3.0, 2.0},
{0.0, 2.0, 3.0}
});
DoubleMatrix E = new DoubleMatrix(3, 1);
NativeBlas.dsyev('N', 'U', 3, A.d... | java | public static void checkEigenvalues() {
DoubleMatrix A = new DoubleMatrix(new double[][]{
{3.0, 2.0, 0.0},
{2.0, 3.0, 2.0},
{0.0, 2.0, 3.0}
});
DoubleMatrix E = new DoubleMatrix(3, 1);
NativeBlas.dsyev('N', 'U', 3, A.d... | [
"public",
"static",
"void",
"checkEigenvalues",
"(",
")",
"{",
"DoubleMatrix",
"A",
"=",
"new",
"DoubleMatrix",
"(",
"new",
"double",
"[",
"]",
"[",
"]",
"{",
"{",
"3.0",
",",
"2.0",
",",
"0.0",
"}",
",",
"{",
"2.0",
",",
"3.0",
",",
"2.0",
"}",
... | Compute eigenvalues. This is a routine not in ATLAS, but in the original
LAPACK. | [
"Compute",
"eigenvalues",
".",
"This",
"is",
"a",
"routine",
"not",
"in",
"ATLAS",
"but",
"in",
"the",
"original",
"LAPACK",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/SanityChecks.java#L115-L126 |
Jasig/uPortal | uPortal-web/src/main/java/org/apereo/portal/url/PortalUrlProviderImpl.java | PortalUrlProviderImpl.verifyPortletWindowId | protected String verifyPortletWindowId(
HttpServletRequest request, IPortletWindowId portletWindowId) {
final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
final... | java | protected String verifyPortletWindowId(
HttpServletRequest request, IPortletWindowId portletWindowId) {
final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
final... | [
"protected",
"String",
"verifyPortletWindowId",
"(",
"HttpServletRequest",
"request",
",",
"IPortletWindowId",
"portletWindowId",
")",
"{",
"final",
"IUserInstance",
"userInstance",
"=",
"this",
".",
"userInstanceManager",
".",
"getUserInstance",
"(",
"request",
")",
";... | Verify the requested portlet window corresponds to a node in the user's layout and return the
corresponding layout node id | [
"Verify",
"the",
"requested",
"portlet",
"window",
"corresponds",
"to",
"a",
"node",
"in",
"the",
"user",
"s",
"layout",
"and",
"return",
"the",
"corresponding",
"layout",
"node",
"id"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-web/src/main/java/org/apereo/portal/url/PortalUrlProviderImpl.java#L216-L241 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java | SlotManager.removeSlotRequestFromSlot | private void removeSlotRequestFromSlot(SlotID slotId, AllocationID allocationId) {
TaskManagerSlot taskManagerSlot = slots.get(slotId);
if (null != taskManagerSlot) {
if (taskManagerSlot.getState() == TaskManagerSlot.State.PENDING && Objects.equals(allocationId, taskManagerSlot.getAssignedSlotRequest().getAlloc... | java | private void removeSlotRequestFromSlot(SlotID slotId, AllocationID allocationId) {
TaskManagerSlot taskManagerSlot = slots.get(slotId);
if (null != taskManagerSlot) {
if (taskManagerSlot.getState() == TaskManagerSlot.State.PENDING && Objects.equals(allocationId, taskManagerSlot.getAssignedSlotRequest().getAlloc... | [
"private",
"void",
"removeSlotRequestFromSlot",
"(",
"SlotID",
"slotId",
",",
"AllocationID",
"allocationId",
")",
"{",
"TaskManagerSlot",
"taskManagerSlot",
"=",
"slots",
".",
"get",
"(",
"slotId",
")",
";",
"if",
"(",
"null",
"!=",
"taskManagerSlot",
")",
"{",... | Removes a pending slot request identified by the given allocation id from a slot identified
by the given slot id.
@param slotId identifying the slot
@param allocationId identifying the presumable assigned pending slot request | [
"Removes",
"a",
"pending",
"slot",
"request",
"identified",
"by",
"the",
"given",
"allocation",
"id",
"from",
"a",
"slot",
"identified",
"by",
"the",
"given",
"slot",
"id",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java#L917-L939 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/storage/StorageFacade.java | StorageFacade.registerProvider | public static void registerProvider( String providerName, Class<? extends StorageProvider> providerClass )
{
if ( PROVIDERS.containsKey( providerName ) ) {
throw new IllegalArgumentException( "A provider already exists with the name " + providerName );
}
PROVIDERS.put( providerNa... | java | public static void registerProvider( String providerName, Class<? extends StorageProvider> providerClass )
{
if ( PROVIDERS.containsKey( providerName ) ) {
throw new IllegalArgumentException( "A provider already exists with the name " + providerName );
}
PROVIDERS.put( providerNa... | [
"public",
"static",
"void",
"registerProvider",
"(",
"String",
"providerName",
",",
"Class",
"<",
"?",
"extends",
"StorageProvider",
">",
"providerClass",
")",
"{",
"if",
"(",
"PROVIDERS",
".",
"containsKey",
"(",
"providerName",
")",
")",
"{",
"throw",
"new",... | Register a new {@link StorageProvider}
@param providerName The name to use with the provider
@param providerClass The provider class | [
"Register",
"a",
"new",
"{",
"@link",
"StorageProvider",
"}"
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/storage/StorageFacade.java#L63-L70 |
google/closure-templates | java/src/com/google/template/soy/pysrc/restricted/PyExprUtils.java | PyExprUtils.convertMapToOrderedDict | public static PyExpr convertMapToOrderedDict(Map<PyExpr, PyExpr> dict) {
List<String> values = new ArrayList<>();
for (Map.Entry<PyExpr, PyExpr> entry : dict.entrySet()) {
values.add("(" + entry.getKey().getText() + ", " + entry.getValue().getText() + ")");
}
Joiner joiner = Joiner.on(", ");
... | java | public static PyExpr convertMapToOrderedDict(Map<PyExpr, PyExpr> dict) {
List<String> values = new ArrayList<>();
for (Map.Entry<PyExpr, PyExpr> entry : dict.entrySet()) {
values.add("(" + entry.getKey().getText() + ", " + entry.getValue().getText() + ")");
}
Joiner joiner = Joiner.on(", ");
... | [
"public",
"static",
"PyExpr",
"convertMapToOrderedDict",
"(",
"Map",
"<",
"PyExpr",
",",
"PyExpr",
">",
"dict",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"PyExpr"... | Convert a java Map to valid PyExpr as dict.
@param dict A Map to be converted to PyExpr as a dictionary, both key and value should be
PyExpr. | [
"Convert",
"a",
"java",
"Map",
"to",
"valid",
"PyExpr",
"as",
"dict",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/restricted/PyExprUtils.java#L222-L231 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/AABBUtils.java | AABBUtils.getCollisionBoundingBoxes | public static AxisAlignedBB[] getCollisionBoundingBoxes(World world, Block block, BlockPos pos)
{
return getCollisionBoundingBoxes(world, new MBlockState(pos, block), false);
} | java | public static AxisAlignedBB[] getCollisionBoundingBoxes(World world, Block block, BlockPos pos)
{
return getCollisionBoundingBoxes(world, new MBlockState(pos, block), false);
} | [
"public",
"static",
"AxisAlignedBB",
"[",
"]",
"getCollisionBoundingBoxes",
"(",
"World",
"world",
",",
"Block",
"block",
",",
"BlockPos",
"pos",
")",
"{",
"return",
"getCollisionBoundingBoxes",
"(",
"world",
",",
"new",
"MBlockState",
"(",
"pos",
",",
"block",
... | Gets the collision {@link AxisAlignedBB} for the {@link Block} as the {@link BlockPos} coordinates.
@param world the world
@param block the block
@param pos the pos
@return the collision bounding boxes | [
"Gets",
"the",
"collision",
"{",
"@link",
"AxisAlignedBB",
"}",
"for",
"the",
"{",
"@link",
"Block",
"}",
"as",
"the",
"{",
"@link",
"BlockPos",
"}",
"coordinates",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/AABBUtils.java#L405-L408 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java | JBBPOut.Short | public JBBPOut Short(final String str, final JBBPBitOrder bitOrder) throws IOException {
assertNotEnded();
if (this.processCommands) {
final boolean msb0 = bitOrder == JBBPBitOrder.MSB0;
for (int i = 0; i < str.length(); i++) {
short value = (short) str.charAt(i);
if (msb0) {
... | java | public JBBPOut Short(final String str, final JBBPBitOrder bitOrder) throws IOException {
assertNotEnded();
if (this.processCommands) {
final boolean msb0 = bitOrder == JBBPBitOrder.MSB0;
for (int i = 0; i < str.length(); i++) {
short value = (short) str.charAt(i);
if (msb0) {
... | [
"public",
"JBBPOut",
"Short",
"(",
"final",
"String",
"str",
",",
"final",
"JBBPBitOrder",
"bitOrder",
")",
"throws",
"IOException",
"{",
"assertNotEnded",
"(",
")",
";",
"if",
"(",
"this",
".",
"processCommands",
")",
"{",
"final",
"boolean",
"msb0",
"=",
... | Write codes of chars as 16 bit values into the stream.
@param str the string which chars will be written, must not be null
@param bitOrder the bit outOrder
@return the DSL session
@throws IOException it will be thrown for transport errors
@since 1.1 | [
"Write",
"codes",
"of",
"chars",
"as",
"16",
"bit",
"values",
"into",
"the",
"stream",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java#L686-L699 |
Impetus/Kundera | src/kundera-ethereum/src/main/java/com/impetus/kundera/blockchain/ethereum/KunderaWeb3jClient.java | KunderaWeb3jClient.getBlock | public EthBlock getBlock(BigInteger number, boolean includeTransactions)
{
try
{
return web3j.ethGetBlockByNumber(DefaultBlockParameter.valueOf(number), includeTransactions).send();
}
catch (IOException ex)
{
LOGGER.error("Not able to find block" + num... | java | public EthBlock getBlock(BigInteger number, boolean includeTransactions)
{
try
{
return web3j.ethGetBlockByNumber(DefaultBlockParameter.valueOf(number), includeTransactions).send();
}
catch (IOException ex)
{
LOGGER.error("Not able to find block" + num... | [
"public",
"EthBlock",
"getBlock",
"(",
"BigInteger",
"number",
",",
"boolean",
"includeTransactions",
")",
"{",
"try",
"{",
"return",
"web3j",
".",
"ethGetBlockByNumber",
"(",
"DefaultBlockParameter",
".",
"valueOf",
"(",
"number",
")",
",",
"includeTransactions",
... | Gets the block.
@param number
the number
@param includeTransactions
the include transactions
@return the block | [
"Gets",
"the",
"block",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-ethereum/src/main/java/com/impetus/kundera/blockchain/ethereum/KunderaWeb3jClient.java#L167-L178 |
santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/xsl/TransformerUtil.java | TransformerUtil.newTransformer | public static Transformer newTransformer(Source source, boolean omitXMLDeclaration, int indentAmount, String encoding) throws TransformerConfigurationException{
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = source!=null ? factory.newTransformer(source) : factor... | java | public static Transformer newTransformer(Source source, boolean omitXMLDeclaration, int indentAmount, String encoding) throws TransformerConfigurationException{
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = source!=null ? factory.newTransformer(source) : factor... | [
"public",
"static",
"Transformer",
"newTransformer",
"(",
"Source",
"source",
",",
"boolean",
"omitXMLDeclaration",
",",
"int",
"indentAmount",
",",
"String",
"encoding",
")",
"throws",
"TransformerConfigurationException",
"{",
"TransformerFactory",
"factory",
"=",
"Tra... | Creates Transformer
@param source source of xsl document, use null for identity transformer
@param omitXMLDeclaration omit xml declaration or not
@param indentAmount the number fo spaces used for indentation.
use <=0, in case you dont want indentation
@param encoding required en... | [
"Creates",
"Transformer"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/xsl/TransformerUtil.java#L70-L74 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/slave/ModbusSlaveFactory.java | ModbusSlaveFactory.createTCPSlave | public static synchronized ModbusSlave createTCPSlave(int port, int poolSize, boolean useRtuOverTcp) throws ModbusException {
return ModbusSlaveFactory.createTCPSlave(null, port, poolSize, useRtuOverTcp);
} | java | public static synchronized ModbusSlave createTCPSlave(int port, int poolSize, boolean useRtuOverTcp) throws ModbusException {
return ModbusSlaveFactory.createTCPSlave(null, port, poolSize, useRtuOverTcp);
} | [
"public",
"static",
"synchronized",
"ModbusSlave",
"createTCPSlave",
"(",
"int",
"port",
",",
"int",
"poolSize",
",",
"boolean",
"useRtuOverTcp",
")",
"throws",
"ModbusException",
"{",
"return",
"ModbusSlaveFactory",
".",
"createTCPSlave",
"(",
"null",
",",
"port",
... | Creates a TCP modbus slave or returns the one already allocated to this port
@param port Port to listen on
@param poolSize Pool size of listener threads
@param useRtuOverTcp True if the RTU protocol should be used over TCP
@return new or existing TCP modbus slave associated with the port
@throws ModbusE... | [
"Creates",
"a",
"TCP",
"modbus",
"slave",
"or",
"returns",
"the",
"one",
"already",
"allocated",
"to",
"this",
"port"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/slave/ModbusSlaveFactory.java#L66-L68 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/templates/config/SiteConfigurationReader.java | SiteConfigurationReader.decorateLocalResourceLinks | private final void decorateLocalResourceLinks(final SiteConfiguration.Tag[] links, final String prefix, final Path root) {
if (links == null) return;
for(SiteConfiguration.Tag link : links) {
if (isLocal(link.url)) {
link.url = deploymentInfo.translateIntoContextPath... | java | private final void decorateLocalResourceLinks(final SiteConfiguration.Tag[] links, final String prefix, final Path root) {
if (links == null) return;
for(SiteConfiguration.Tag link : links) {
if (isLocal(link.url)) {
link.url = deploymentInfo.translateIntoContextPath... | [
"private",
"final",
"void",
"decorateLocalResourceLinks",
"(",
"final",
"SiteConfiguration",
".",
"Tag",
"[",
"]",
"links",
",",
"final",
"String",
"prefix",
",",
"final",
"Path",
"root",
")",
"{",
"if",
"(",
"links",
"==",
"null",
")",
"return",
";",
"for... | Prefixes local resources with css/ or js/.
"Local" is defined by not starting with 'http.*' or 'ftp.*'
Adds a version query param to local resources.
The <code>version</code> is currently just an epoch | [
"Prefixes",
"local",
"resources",
"with",
"css",
"/",
"or",
"js",
"/",
".",
"Local",
"is",
"defined",
"by",
"not",
"starting",
"with",
"http",
".",
"*",
"or",
"ftp",
".",
"*"
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/templates/config/SiteConfigurationReader.java#L239-L247 |
logic-ng/LogicNG | src/main/java/org/logicng/datastructures/ubtrees/UBTree.java | UBTree.firstSubset | public SortedSet<T> firstSubset(SortedSet<T> set) {
if (this.rootNodes.isEmpty() || set == null || set.isEmpty()) {
return null;
}
return firstSubset(set, this.rootNodes);
} | java | public SortedSet<T> firstSubset(SortedSet<T> set) {
if (this.rootNodes.isEmpty() || set == null || set.isEmpty()) {
return null;
}
return firstSubset(set, this.rootNodes);
} | [
"public",
"SortedSet",
"<",
"T",
">",
"firstSubset",
"(",
"SortedSet",
"<",
"T",
">",
"set",
")",
"{",
"if",
"(",
"this",
".",
"rootNodes",
".",
"isEmpty",
"(",
")",
"||",
"set",
"==",
"null",
"||",
"set",
".",
"isEmpty",
"(",
")",
")",
"{",
"ret... | Returns the first subset of a given set in this UBTree.
@param set the set to search for
@return the first subset which is found for the given set or {@code null} if there is none | [
"Returns",
"the",
"first",
"subset",
"of",
"a",
"given",
"set",
"in",
"this",
"UBTree",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/datastructures/ubtrees/UBTree.java#L54-L59 |
grails/grails-core | grails-core/src/main/groovy/org/grails/spring/context/support/ReloadableResourceBundleMessageSource.java | ReloadableResourceBundleMessageSource.getProperties | @SuppressWarnings("rawtypes")
protected PropertiesHolder getProperties(final String filename, final Resource resource) {
return CacheEntry.getValue(cachedProperties, filename, fileCacheMillis, new Callable<PropertiesHolder>() {
@Override
public PropertiesHolder call() throws Exception {... | java | @SuppressWarnings("rawtypes")
protected PropertiesHolder getProperties(final String filename, final Resource resource) {
return CacheEntry.getValue(cachedProperties, filename, fileCacheMillis, new Callable<PropertiesHolder>() {
@Override
public PropertiesHolder call() throws Exception {... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"protected",
"PropertiesHolder",
"getProperties",
"(",
"final",
"String",
"filename",
",",
"final",
"Resource",
"resource",
")",
"{",
"return",
"CacheEntry",
".",
"getValue",
"(",
"cachedProperties",
",",
"filename"... | Get a PropertiesHolder for the given filename, either from the
cache or freshly loaded.
@param filename the bundle filename (basename + Locale)
@return the current PropertiesHolder for the bundle | [
"Get",
"a",
"PropertiesHolder",
"for",
"the",
"given",
"filename",
"either",
"from",
"the",
"cache",
"or",
"freshly",
"loaded",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/context/support/ReloadableResourceBundleMessageSource.java#L488-L501 |
molgenis/molgenis | molgenis-api-data/src/main/java/org/molgenis/api/data/RestService.java | RestService.toEntity | public Entity toEntity(final EntityType meta, final Map<String, Object> request) {
final Entity entity = entityManager.create(meta, POPULATE);
for (Attribute attr : meta.getAtomicAttributes()) {
if (attr.getExpression() == null) {
String paramName = attr.getName();
if (request.containsKey... | java | public Entity toEntity(final EntityType meta, final Map<String, Object> request) {
final Entity entity = entityManager.create(meta, POPULATE);
for (Attribute attr : meta.getAtomicAttributes()) {
if (attr.getExpression() == null) {
String paramName = attr.getName();
if (request.containsKey... | [
"public",
"Entity",
"toEntity",
"(",
"final",
"EntityType",
"meta",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"request",
")",
"{",
"final",
"Entity",
"entity",
"=",
"entityManager",
".",
"create",
"(",
"meta",
",",
"POPULATE",
")",
";",
"fo... | Creates a new entity based from a HttpServletRequest. For file attributes persists the file in
the file store and persist a file meta data entity.
@param meta entity meta data
@param request HTTP request parameters
@return entity created from HTTP request parameters | [
"Creates",
"a",
"new",
"entity",
"based",
"from",
"a",
"HttpServletRequest",
".",
"For",
"file",
"attributes",
"persists",
"the",
"file",
"in",
"the",
"file",
"store",
"and",
"persist",
"a",
"file",
"meta",
"data",
"entity",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-api-data/src/main/java/org/molgenis/api/data/RestService.java#L85-L102 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPUtility.java | MPPUtility.getGUID | public static final UUID getGUID(byte[] data, int offset)
{
UUID result = null;
if (data != null && data.length > 15)
{
long long1 = 0;
long1 |= ((long) (data[offset + 3] & 0xFF)) << 56;
long1 |= ((long) (data[offset + 2] & 0xFF)) << 48;
long1 |= ((long) (data[of... | java | public static final UUID getGUID(byte[] data, int offset)
{
UUID result = null;
if (data != null && data.length > 15)
{
long long1 = 0;
long1 |= ((long) (data[offset + 3] & 0xFF)) << 56;
long1 |= ((long) (data[offset + 2] & 0xFF)) << 48;
long1 |= ((long) (data[of... | [
"public",
"static",
"final",
"UUID",
"getGUID",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"UUID",
"result",
"=",
"null",
";",
"if",
"(",
"data",
"!=",
"null",
"&&",
"data",
".",
"length",
">",
"15",
")",
"{",
"long",
"long1",
... | Reads a UUID/GUID from a data block.
@param data data block
@param offset offset into the data block
@return UUID instance | [
"Reads",
"a",
"UUID",
"/",
"GUID",
"from",
"a",
"data",
"block",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L273-L301 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.convertValueByFunction | private ByteBuffer convertValueByFunction(Tree functionCall, CfDef columnFamily, ByteBuffer columnName)
{
return convertValueByFunction(functionCall, columnFamily, columnName, false);
} | java | private ByteBuffer convertValueByFunction(Tree functionCall, CfDef columnFamily, ByteBuffer columnName)
{
return convertValueByFunction(functionCall, columnFamily, columnName, false);
} | [
"private",
"ByteBuffer",
"convertValueByFunction",
"(",
"Tree",
"functionCall",
",",
"CfDef",
"columnFamily",
",",
"ByteBuffer",
"columnName",
")",
"{",
"return",
"convertValueByFunction",
"(",
"functionCall",
",",
"columnFamily",
",",
"columnName",
",",
"false",
")",... | Used to convert value (function argument, string) into byte[]
calls convertValueByFunction method with "withUpdate" set to false
@param functionCall - tree representing function call ^(FUNCTION_CALL function_name value)
@param columnFamily - column family definition (CfDef)
@param columnName - also updates column fam... | [
"Used",
"to",
"convert",
"value",
"(",
"function",
"argument",
"string",
")",
"into",
"byte",
"[]",
"calls",
"convertValueByFunction",
"method",
"with",
"withUpdate",
"set",
"to",
"false"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2759-L2762 |
konmik/solid | collections/src/main/java/solid/collectors/ToSparseArray.java | ToSparseArray.toSparseArray | public static <T> Func1<Iterable<T>, SparseArray<T>> toSparseArray(Func1<T, Integer> itemToKey) {
return toSparseArray(itemToKey, 10);
} | java | public static <T> Func1<Iterable<T>, SparseArray<T>> toSparseArray(Func1<T, Integer> itemToKey) {
return toSparseArray(itemToKey, 10);
} | [
"public",
"static",
"<",
"T",
">",
"Func1",
"<",
"Iterable",
"<",
"T",
">",
",",
"SparseArray",
"<",
"T",
">",
">",
"toSparseArray",
"(",
"Func1",
"<",
"T",
",",
"Integer",
">",
"itemToKey",
")",
"{",
"return",
"toSparseArray",
"(",
"itemToKey",
",",
... | Returns a method that can be used with {@link solid.stream.Stream#collect(Func1)}
to convert a stream into a {@link SparseArray}.
@param <T> a type of stream items.
@param itemToKey a method that should return a key for an item.
@return a method that converts an iterable into a {@link SparseArray}. | [
"Returns",
"a",
"method",
"that",
"can",
"be",
"used",
"with",
"{",
"@link",
"solid",
".",
"stream",
".",
"Stream#collect",
"(",
"Func1",
")",
"}",
"to",
"convert",
"a",
"stream",
"into",
"a",
"{",
"@link",
"SparseArray",
"}",
"."
] | train | https://github.com/konmik/solid/blob/3d6c452ef3219fd843547f3590b3d2e1ad3f1d17/collections/src/main/java/solid/collectors/ToSparseArray.java#L17-L19 |
alkacon/opencms-core | src/org/opencms/relations/CmsCategoryService.java | CmsCategoryService.localizeCategory | public CmsCategory localizeCategory(CmsObject cms, CmsCategory category, Locale locale) {
try {
CmsUUID id = category.getId();
CmsResource categoryRes = cms.readResource(id, CmsResourceFilter.IGNORE_EXPIRATION);
String title = cms.readPropertyObject(
category... | java | public CmsCategory localizeCategory(CmsObject cms, CmsCategory category, Locale locale) {
try {
CmsUUID id = category.getId();
CmsResource categoryRes = cms.readResource(id, CmsResourceFilter.IGNORE_EXPIRATION);
String title = cms.readPropertyObject(
category... | [
"public",
"CmsCategory",
"localizeCategory",
"(",
"CmsObject",
"cms",
",",
"CmsCategory",
"category",
",",
"Locale",
"locale",
")",
"{",
"try",
"{",
"CmsUUID",
"id",
"=",
"category",
".",
"getId",
"(",
")",
";",
"CmsResource",
"categoryRes",
"=",
"cms",
".",... | Localizes a single category by reading its locale-specific properties for title and description, if possible.<p>
@param cms the CMS context to use for reading resources
@param category the category to localize
@param locale the locale to use
@return the localized category | [
"Localizes",
"a",
"single",
"category",
"by",
"reading",
"its",
"locale",
"-",
"specific",
"properties",
"for",
"title",
"and",
"description",
"if",
"possible",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L399-L419 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java | ExpressRoutePortsInner.beginCreateOrUpdate | public ExpressRoutePortInner beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).toBlocking().single().body();
} | java | public ExpressRoutePortInner beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).toBlocking().single().body();
} | [
"public",
"ExpressRoutePortInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
",",
"ExpressRoutePortInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"ex... | Creates or updates the specified ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@param parameters Parameters supplied to the create ExpressRoutePort operation.
@throws IllegalArgumentException thrown if paramete... | [
"Creates",
"or",
"updates",
"the",
"specified",
"ExpressRoutePort",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java#L437-L439 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/Directory.java | Directory.setString | @java.lang.SuppressWarnings({ "ConstantConditions" })
public void setString(int tagType, @NotNull String value)
{
if (value == null)
throw new NullPointerException("cannot set a null String");
setObject(tagType, value);
} | java | @java.lang.SuppressWarnings({ "ConstantConditions" })
public void setString(int tagType, @NotNull String value)
{
if (value == null)
throw new NullPointerException("cannot set a null String");
setObject(tagType, value);
} | [
"@",
"java",
".",
"lang",
".",
"SuppressWarnings",
"(",
"{",
"\"ConstantConditions\"",
"}",
")",
"public",
"void",
"setString",
"(",
"int",
"tagType",
",",
"@",
"NotNull",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new"... | Sets a <code>String</code> value for the specified tag.
@param tagType the tag's value as an int
@param value the value for the specified tag as a String | [
"Sets",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"value",
"for",
"the",
"specified",
"tag",
"."
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/Directory.java#L283-L289 |
infinispan/infinispan | core/src/main/java/org/infinispan/container/offheap/OffHeapEntryFactoryImpl.java | OffHeapEntryFactoryImpl.equalsKey | @Override
public boolean equalsKey(long address, WrappedBytes wrappedBytes) {
// 16 bytes for eviction if needed (optional)
// 8 bytes for linked pointer
int headerOffset = evictionEnabled ? 24 : 8;
byte type = MEMORY.getByte(address, headerOffset);
headerOffset++;
// First if has... | java | @Override
public boolean equalsKey(long address, WrappedBytes wrappedBytes) {
// 16 bytes for eviction if needed (optional)
// 8 bytes for linked pointer
int headerOffset = evictionEnabled ? 24 : 8;
byte type = MEMORY.getByte(address, headerOffset);
headerOffset++;
// First if has... | [
"@",
"Override",
"public",
"boolean",
"equalsKey",
"(",
"long",
"address",
",",
"WrappedBytes",
"wrappedBytes",
")",
"{",
"// 16 bytes for eviction if needed (optional)",
"// 8 bytes for linked pointer",
"int",
"headerOffset",
"=",
"evictionEnabled",
"?",
"24",
":",
"8",
... | Assumes the address points to the entry excluding the pointer reference at the beginning
@param address the address of an entry to read
@param wrappedBytes the key to check if it equals
@return whether the key and address are equal | [
"Assumes",
"the",
"address",
"points",
"to",
"the",
"entry",
"excluding",
"the",
"pointer",
"reference",
"at",
"the",
"beginning"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/container/offheap/OffHeapEntryFactoryImpl.java#L367-L399 |
VoltDB/voltdb | src/frontend/org/voltdb/largequery/LargeBlockTask.java | LargeBlockTask.getLoadTask | public static LargeBlockTask getLoadTask(BlockId blockId, ByteBuffer block) {
return new LargeBlockTask() {
@Override
public LargeBlockResponse call() throws Exception {
Exception theException = null;
try {
LargeBlockManager.getInstance... | java | public static LargeBlockTask getLoadTask(BlockId blockId, ByteBuffer block) {
return new LargeBlockTask() {
@Override
public LargeBlockResponse call() throws Exception {
Exception theException = null;
try {
LargeBlockManager.getInstance... | [
"public",
"static",
"LargeBlockTask",
"getLoadTask",
"(",
"BlockId",
"blockId",
",",
"ByteBuffer",
"block",
")",
"{",
"return",
"new",
"LargeBlockTask",
"(",
")",
"{",
"@",
"Override",
"public",
"LargeBlockResponse",
"call",
"(",
")",
"throws",
"Exception",
"{",... | Get a new "load" task
@param blockId The block id of the block to load
@param block A ByteBuffer to write data intox
@return An instance of LargeBlockTask that will load a block | [
"Get",
"a",
"new",
"load",
"task"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/largequery/LargeBlockTask.java#L83-L98 |
mailin-api/sendinblue-java-mvn | src/main/java/com/sendinblue/Sendinblue.java | Sendinblue.update_child_account | public String update_child_account(Object data) {
Gson gson = new Gson();
String json = gson.toJson(data);
return put("account", json);
} | java | public String update_child_account(Object data) {
Gson gson = new Gson();
String json = gson.toJson(data);
return put("account", json);
} | [
"public",
"String",
"update_child_account",
"(",
"Object",
"data",
")",
"{",
"Gson",
"gson",
"=",
"new",
"Gson",
"(",
")",
";",
"String",
"json",
"=",
"gson",
".",
"toJson",
"(",
"data",
")",
";",
"return",
"put",
"(",
"\"account\"",
",",
"json",
")",
... | /*
Update Child Account.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {String} auth_key: 16 character authorization key of Reseller child to be modified [Mandatory]
@options data {String} company_org: Name of Reseller child’s company [Optional]
@options data {String} first_... | [
"/",
"*",
"Update",
"Child",
"Account",
"."
] | train | https://github.com/mailin-api/sendinblue-java-mvn/blob/3a186b004003450f18d619aa084adc8d75086183/src/main/java/com/sendinblue/Sendinblue.java#L212-L216 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/layout/LayoutExtensions.java | LayoutExtensions.addComponent | public static void addComponent(final GridBagLayout gbl, final GridBagConstraints gbc,
final int gridx, final int gridy, final Component component, final Container panelToAdd)
{
gbc.anchor = GridBagConstraints.CENTER;
gbc.fill = GridBagConstraints.BOTH;
gbc.insets = new Insets(5, 5, 5, 5);
gbc.gridx = ... | java | public static void addComponent(final GridBagLayout gbl, final GridBagConstraints gbc,
final int gridx, final int gridy, final Component component, final Container panelToAdd)
{
gbc.anchor = GridBagConstraints.CENTER;
gbc.fill = GridBagConstraints.BOTH;
gbc.insets = new Insets(5, 5, 5, 5);
gbc.gridx = ... | [
"public",
"static",
"void",
"addComponent",
"(",
"final",
"GridBagLayout",
"gbl",
",",
"final",
"GridBagConstraints",
"gbc",
",",
"final",
"int",
"gridx",
",",
"final",
"int",
"gridy",
",",
"final",
"Component",
"component",
",",
"final",
"Container",
"panelToAd... | Adds the component.
@param gbl
the gbl
@param gbc
the gbc
@param gridx
the gridx
@param gridy
the gridy
@param component
the component
@param panelToAdd
the panel to add | [
"Adds",
"the",
"component",
"."
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/layout/LayoutExtensions.java#L91-L101 |
JoeKerouac/utils | src/main/java/com/joe/utils/serialize/json/JsonParser.java | JsonParser.readAsObject | @SuppressWarnings("unchecked")
public <T> T readAsObject(String content, Class<T> type) {
Assert.notNull(type);
try {
if (StringUtils.isEmpty(content)) {
log.debug("content为空,返回null", content, type);
return null;
} else if (type.equals(String.c... | java | @SuppressWarnings("unchecked")
public <T> T readAsObject(String content, Class<T> type) {
Assert.notNull(type);
try {
if (StringUtils.isEmpty(content)) {
log.debug("content为空,返回null", content, type);
return null;
} else if (type.equals(String.c... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"readAsObject",
"(",
"String",
"content",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Assert",
".",
"notNull",
"(",
"type",
")",
";",
"try",
"{",
"if",
"(",
"String... | 解析json
@param content json字符串
@param type json解析后对应的实体类型
@param <T> 实体类型的实际类型
@return 解析失败将返回null | [
"解析json"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/serialize/json/JsonParser.java#L114-L129 |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/ValidationFilter.java | ValidationFilter.validateReference | private AttributesImpl validateReference(final String attrName, final Attributes atts, final AttributesImpl modified) {
AttributesImpl res = modified;
final String href = atts.getValue(attrName);
if (href != null) {
try {
new URI(href);
} catch (final URIS... | java | private AttributesImpl validateReference(final String attrName, final Attributes atts, final AttributesImpl modified) {
AttributesImpl res = modified;
final String href = atts.getValue(attrName);
if (href != null) {
try {
new URI(href);
} catch (final URIS... | [
"private",
"AttributesImpl",
"validateReference",
"(",
"final",
"String",
"attrName",
",",
"final",
"Attributes",
"atts",
",",
"final",
"AttributesImpl",
"modified",
")",
"{",
"AttributesImpl",
"res",
"=",
"modified",
";",
"final",
"String",
"href",
"=",
"atts",
... | Validate and fix {@code href} or {@code conref} attribute for URI validity.
@return modified attributes, {@code null} if there have been no changes | [
"Validate",
"and",
"fix",
"{",
"@code",
"href",
"}",
"or",
"{",
"@code",
"conref",
"}",
"attribute",
"for",
"URI",
"validity",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/ValidationFilter.java#L183-L212 |
haifengl/smile | core/src/main/java/smile/clustering/PartitionClustering.java | PartitionClustering.squaredDistance | static double squaredDistance(double[] x, double[] y) {
int n = x.length;
int m = 0;
double dist = 0.0;
for (int i = 0; i < n; i++) {
if (!Double.isNaN(x[i]) && !Double.isNaN(y[i])) {
m++;
double d = x[i] - y[i];
dist += d * d;... | java | static double squaredDistance(double[] x, double[] y) {
int n = x.length;
int m = 0;
double dist = 0.0;
for (int i = 0; i < n; i++) {
if (!Double.isNaN(x[i]) && !Double.isNaN(y[i])) {
m++;
double d = x[i] - y[i];
dist += d * d;... | [
"static",
"double",
"squaredDistance",
"(",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"int",
"n",
"=",
"x",
".",
"length",
";",
"int",
"m",
"=",
"0",
";",
"double",
"dist",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
... | Squared Euclidean distance with handling missing values (represented as NaN). | [
"Squared",
"Euclidean",
"distance",
"with",
"handling",
"missing",
"values",
"(",
"represented",
"as",
"NaN",
")",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/clustering/PartitionClustering.java#L67-L87 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java | GVRCameraRig.setFloat | public void setFloat(String key, float value) {
checkStringNotNullOrEmpty("key", key);
checkFloatNotNaNOrInfinity("value", value);
NativeCameraRig.setFloat(getNative(), key, value);
} | java | public void setFloat(String key, float value) {
checkStringNotNullOrEmpty("key", key);
checkFloatNotNaNOrInfinity("value", value);
NativeCameraRig.setFloat(getNative(), key, value);
} | [
"public",
"void",
"setFloat",
"(",
"String",
"key",
",",
"float",
"value",
")",
"{",
"checkStringNotNullOrEmpty",
"(",
"\"key\"",
",",
"key",
")",
";",
"checkFloatNotNaNOrInfinity",
"(",
"\"value\"",
",",
"value",
")",
";",
"NativeCameraRig",
".",
"setFloat",
... | Map {@code value} to {@code key}.
@param key
Key to map {@code value} to.
@param value
The {@code float} value to map. | [
"Map",
"{",
"@code",
"value",
"}",
"to",
"{",
"@code",
"key",
"}",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java#L223-L227 |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java | CepOperator.processEvent | private void processEvent(NFAState nfaState, IN event, long timestamp) throws Exception {
try (SharedBufferAccessor<IN> sharedBufferAccessor = partialMatches.getAccessor()) {
Collection<Map<String, List<IN>>> patterns =
nfa.process(sharedBufferAccessor, nfaState, event, timestamp, afterMatchSkipStrategy, cepTi... | java | private void processEvent(NFAState nfaState, IN event, long timestamp) throws Exception {
try (SharedBufferAccessor<IN> sharedBufferAccessor = partialMatches.getAccessor()) {
Collection<Map<String, List<IN>>> patterns =
nfa.process(sharedBufferAccessor, nfaState, event, timestamp, afterMatchSkipStrategy, cepTi... | [
"private",
"void",
"processEvent",
"(",
"NFAState",
"nfaState",
",",
"IN",
"event",
",",
"long",
"timestamp",
")",
"throws",
"Exception",
"{",
"try",
"(",
"SharedBufferAccessor",
"<",
"IN",
">",
"sharedBufferAccessor",
"=",
"partialMatches",
".",
"getAccessor",
... | Process the given event by giving it to the NFA and outputting the produced set of matched
event sequences.
@param nfaState Our NFAState object
@param event The current event to be processed
@param timestamp The timestamp of the event | [
"Process",
"the",
"given",
"event",
"by",
"giving",
"it",
"to",
"the",
"NFA",
"and",
"outputting",
"the",
"produced",
"set",
"of",
"matched",
"event",
"sequences",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/operator/CepOperator.java#L422-L428 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/annotation/AnnotationUtils.java | AnnotationUtils.getAnnotation | public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationType) {
Method resolvedMethod = BridgeMethodResolver.findBridgedMethod(method);
return getAnnotation((AnnotatedElement) resolvedMethod, annotationType);
} | java | public static <A extends Annotation> A getAnnotation(Method method, Class<A> annotationType) {
Method resolvedMethod = BridgeMethodResolver.findBridgedMethod(method);
return getAnnotation((AnnotatedElement) resolvedMethod, annotationType);
} | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"Method",
"method",
",",
"Class",
"<",
"A",
">",
"annotationType",
")",
"{",
"Method",
"resolvedMethod",
"=",
"BridgeMethodResolver",
".",
"findBridgedMethod",
"(",
"method",
... | Get a single {@link Annotation} of {@code annotationType} from the supplied {@link Method}.
<p>Correctly handles bridge {@link Method Methods} generated by the compiler.
@param method the method to look for annotations on
@param annotationType the annotation type to look for
@return the annotations found | [
"Get",
"a",
"single",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/annotation/AnnotationUtils.java#L169-L172 |
google/closure-compiler | src/com/google/javascript/jscomp/AstFactory.java | AstFactory.createObjectDotAssignCall | Node createObjectDotAssignCall(Scope scope, JSType returnType, Node... args) {
Node objAssign = createQName(scope, "Object.assign");
Node result = createCall(objAssign, args);
if (isAddingTypes()) {
// Make a unique function type that returns the exact type we've inferred it to be.
// Object.as... | java | Node createObjectDotAssignCall(Scope scope, JSType returnType, Node... args) {
Node objAssign = createQName(scope, "Object.assign");
Node result = createCall(objAssign, args);
if (isAddingTypes()) {
// Make a unique function type that returns the exact type we've inferred it to be.
// Object.as... | [
"Node",
"createObjectDotAssignCall",
"(",
"Scope",
"scope",
",",
"JSType",
"returnType",
",",
"Node",
"...",
"args",
")",
"{",
"Node",
"objAssign",
"=",
"createQName",
"(",
"scope",
",",
"\"Object.assign\"",
")",
";",
"Node",
"result",
"=",
"createCall",
"(",
... | Creates a call to Object.assign that returns the specified type.
<p>Object.assign returns !Object in the externs, which can lose type information if the actual
type is known. | [
"Creates",
"a",
"call",
"to",
"Object",
".",
"assign",
"that",
"returns",
"the",
"specified",
"type",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AstFactory.java#L572-L589 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.createImageTagsWithServiceResponseAsync | public Observable<ServiceResponse<ImageTagCreateSummary>> createImageTagsWithServiceResponseAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
... | java | public Observable<ServiceResponse<ImageTagCreateSummary>> createImageTagsWithServiceResponseAsync(UUID projectId, CreateImageTagsOptionalParameter createImageTagsOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"ImageTagCreateSummary",
">",
">",
"createImageTagsWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"CreateImageTagsOptionalParameter",
"createImageTagsOptionalParameter",
")",
"{",
"if",
"(",
"projectId",
"==",
... | Associate a set of images with a set of tags.
@param projectId The project id
@param createImageTagsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ImageTagCreateS... | [
"Associate",
"a",
"set",
"of",
"images",
"with",
"a",
"set",
"of",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3641-L3651 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/impl/util/ReflectionUtil.java | ReflectionUtil.forEachField | public static void forEachField( final Object object, Class<?> clazz, final FieldPredicate predicate, final FieldAction action ) {
forEachSuperClass( clazz, new ClassAction() {
@Override
public void act( Class<?> clazz ) throws Exception {
for( Field field : clazz.getDecl... | java | public static void forEachField( final Object object, Class<?> clazz, final FieldPredicate predicate, final FieldAction action ) {
forEachSuperClass( clazz, new ClassAction() {
@Override
public void act( Class<?> clazz ) throws Exception {
for( Field field : clazz.getDecl... | [
"public",
"static",
"void",
"forEachField",
"(",
"final",
"Object",
"object",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"FieldPredicate",
"predicate",
",",
"final",
"FieldAction",
"action",
")",
"{",
"forEachSuperClass",
"(",
"clazz",
",",
"new",
"... | Iterates over all fields of the given class and all its super classes
and calls action.act() for the fields that are annotated with the given annotation. | [
"Iterates",
"over",
"all",
"fields",
"of",
"the",
"given",
"class",
"and",
"all",
"its",
"super",
"classes",
"and",
"calls",
"action",
".",
"act",
"()",
"for",
"the",
"fields",
"that",
"are",
"annotated",
"with",
"the",
"given",
"annotation",
"."
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/impl/util/ReflectionUtil.java#L30-L41 |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java | LiveReloadServer.createConnection | protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
return new Connection(socket, inputStream, outputStream);
} | java | protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
return new Connection(socket, inputStream, outputStream);
} | [
"protected",
"Connection",
"createConnection",
"(",
"Socket",
"socket",
",",
"InputStream",
"inputStream",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"return",
"new",
"Connection",
"(",
"socket",
",",
"inputStream",
",",
"outputStream",
... | Factory method used to create the {@link Connection}.
@param socket the source socket
@param inputStream the socket input stream
@param outputStream the socket output stream
@return a connection
@throws IOException in case of I/O errors | [
"Factory",
"method",
"used",
"to",
"create",
"the",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java#L236-L239 |
aspnet/SignalR | clients/java/signalr/src/main/java/com/microsoft/signalr/HttpHubConnectionBuilder.java | HttpHubConnectionBuilder.withHeader | public HttpHubConnectionBuilder withHeader(String name, String value) {
if (headers == null) {
this.headers = new HashMap<>();
}
this.headers.put(name, value);
return this;
} | java | public HttpHubConnectionBuilder withHeader(String name, String value) {
if (headers == null) {
this.headers = new HashMap<>();
}
this.headers.put(name, value);
return this;
} | [
"public",
"HttpHubConnectionBuilder",
"withHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"headers",
"==",
"null",
")",
"{",
"this",
".",
"headers",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"this",
".",
"headers",
... | Sets a single header for the {@link HubConnection} to send.
@param name The name of the header to set.
@param value The value of the header to be set.
@return This instance of the HttpHubConnectionBuilder. | [
"Sets",
"a",
"single",
"header",
"for",
"the",
"{",
"@link",
"HubConnection",
"}",
"to",
"send",
"."
] | train | https://github.com/aspnet/SignalR/blob/8c6ed160d84f58ce8edf06a1c74221ddc8983ee9/clients/java/signalr/src/main/java/com/microsoft/signalr/HttpHubConnectionBuilder.java#L101-L107 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/refer/DependencyResolver.java | DependencyResolver.getOneRequired | public Object getOneRequired(String name) throws ReferenceException {
Object locator = find(name);
if (locator == null)
throw new ReferenceException(null, name);
return _references.getOneRequired(locator);
} | java | public Object getOneRequired(String name) throws ReferenceException {
Object locator = find(name);
if (locator == null)
throw new ReferenceException(null, name);
return _references.getOneRequired(locator);
} | [
"public",
"Object",
"getOneRequired",
"(",
"String",
"name",
")",
"throws",
"ReferenceException",
"{",
"Object",
"locator",
"=",
"find",
"(",
"name",
")",
";",
"if",
"(",
"locator",
"==",
"null",
")",
"throw",
"new",
"ReferenceException",
"(",
"null",
",",
... | Gets one required dependency by its name. At least one dependency must
present. If the dependency was found it throws a ReferenceException
@param name the dependency name to locate.
@return a dependency reference
@throws ReferenceException if dependency was not found. | [
"Gets",
"one",
"required",
"dependency",
"by",
"its",
"name",
".",
"At",
"least",
"one",
"dependency",
"must",
"present",
".",
"If",
"the",
"dependency",
"was",
"found",
"it",
"throws",
"a",
"ReferenceException"
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/refer/DependencyResolver.java#L253-L259 |
asciidoctor/asciidoctorj | asciidoctorj-core/src/main/java/org/asciidoctor/jruby/extension/internal/JRubyProcessor.java | JRubyProcessor.parseContent | @Override
public void parseContent(StructuralNode parent, List<String> lines) {
Ruby runtime = JRubyRuntimeContext.get(parent);
Parser parser = new Parser(runtime, parent, ReaderImpl.createReader(runtime, lines));
StructuralNode nextBlock = parser.nextBlock();
while (nextBlock != nu... | java | @Override
public void parseContent(StructuralNode parent, List<String> lines) {
Ruby runtime = JRubyRuntimeContext.get(parent);
Parser parser = new Parser(runtime, parent, ReaderImpl.createReader(runtime, lines));
StructuralNode nextBlock = parser.nextBlock();
while (nextBlock != nu... | [
"@",
"Override",
"public",
"void",
"parseContent",
"(",
"StructuralNode",
"parent",
",",
"List",
"<",
"String",
">",
"lines",
")",
"{",
"Ruby",
"runtime",
"=",
"JRubyRuntimeContext",
".",
"get",
"(",
"parent",
")",
";",
"Parser",
"parser",
"=",
"new",
"Par... | Parses the given raw asciidoctor content, parses it and appends it as children to the given parent block.
<p>The following example will add two paragraphs with the role {@code newcontent} to all top
level sections of a document:
<pre>
<verbatim>
Asciidoctor asciidoctor = ...
asciidoctor.javaExtensionRegistry().treeproc... | [
"Parses",
"the",
"given",
"raw",
"asciidoctor",
"content",
"parses",
"it",
"and",
"appends",
"it",
"as",
"children",
"to",
"the",
"given",
"parent",
"block",
".",
"<p",
">",
"The",
"following",
"example",
"will",
"add",
"two",
"paragraphs",
"with",
"the",
... | train | https://github.com/asciidoctor/asciidoctorj/blob/e348c9a12b54c33fea7b05d70224c007e2ee75a9/asciidoctorj-core/src/main/java/org/asciidoctor/jruby/extension/internal/JRubyProcessor.java#L335-L345 |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java | SQLiteUpdateTaskHelper.executeSQL | public static void executeSQL(final SQLiteDatabase database, Context context, int rawResourceId) {
String[] c = IOUtils.readTextFile(context, rawResourceId).split(";");
List<String> commands = Arrays.asList(c);
executeSQL(database, commands);
} | java | public static void executeSQL(final SQLiteDatabase database, Context context, int rawResourceId) {
String[] c = IOUtils.readTextFile(context, rawResourceId).split(";");
List<String> commands = Arrays.asList(c);
executeSQL(database, commands);
} | [
"public",
"static",
"void",
"executeSQL",
"(",
"final",
"SQLiteDatabase",
"database",
",",
"Context",
"context",
",",
"int",
"rawResourceId",
")",
"{",
"String",
"[",
"]",
"c",
"=",
"IOUtils",
".",
"readTextFile",
"(",
"context",
",",
"rawResourceId",
")",
"... | Execute SQL.
@param database
the database
@param context
the context
@param rawResourceId
the raw resource id | [
"Execute",
"SQL",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java#L232-L236 |
vkostyukov/la4j | src/main/java/org/la4j/Vectors.java | Vectors.mkManhattanNormAccumulator | public static VectorAccumulator mkManhattanNormAccumulator() {
return new VectorAccumulator() {
private double result = 0.0;
@Override
public void update(int i, double value) {
result += Math.abs(value);
}
@Override
public... | java | public static VectorAccumulator mkManhattanNormAccumulator() {
return new VectorAccumulator() {
private double result = 0.0;
@Override
public void update(int i, double value) {
result += Math.abs(value);
}
@Override
public... | [
"public",
"static",
"VectorAccumulator",
"mkManhattanNormAccumulator",
"(",
")",
"{",
"return",
"new",
"VectorAccumulator",
"(",
")",
"{",
"private",
"double",
"result",
"=",
"0.0",
";",
"@",
"Override",
"public",
"void",
"update",
"(",
"int",
"i",
",",
"doubl... | Makes a Manhattan norm accumulator that allows to use
{@link org.la4j.Vector#fold(org.la4j.vector.functor.VectorAccumulator)} method for norm calculation.
@return a Manhattan norm accumulator | [
"Makes",
"a",
"Manhattan",
"norm",
"accumulator",
"that",
"allows",
"to",
"use",
"{",
"@link",
"org",
".",
"la4j",
".",
"Vector#fold",
"(",
"org",
".",
"la4j",
".",
"vector",
".",
"functor",
".",
"VectorAccumulator",
")",
"}",
"method",
"for",
"norm",
"c... | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Vectors.java#L353-L369 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/constraint/ForbidSubStr.java | ForbidSubStr.execute | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
final String stringValue = value.toString();
for( String forbidden : forbiddenSubStrings ) {
if( stringValue.contains(forbidden) ) {
throw new SuperCsvConstraintViolationException(String.format... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
final String stringValue = value.toString();
for( String forbidden : forbiddenSubStrings ) {
if( stringValue.contains(forbidden) ) {
throw new SuperCsvConstraintViolationException(String.format... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"final",
"String",
"stringValue",
"=",
"value",
".",
"toString",
"(",
")",
";",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null
@throws SuperCsvConstraintViolationException
if value is in the forbidden list | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/constraint/ForbidSubStr.java#L201-L214 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Triangle.java | Triangle.setPoints | public Triangle setPoints(final Point2D a, final Point2D b, final Point2D c)
{
return setPoint2DArray(new Point2DArray(a, b, c));
} | java | public Triangle setPoints(final Point2D a, final Point2D b, final Point2D c)
{
return setPoint2DArray(new Point2DArray(a, b, c));
} | [
"public",
"Triangle",
"setPoints",
"(",
"final",
"Point2D",
"a",
",",
"final",
"Point2D",
"b",
",",
"final",
"Point2D",
"c",
")",
"{",
"return",
"setPoint2DArray",
"(",
"new",
"Point2DArray",
"(",
"a",
",",
"b",
",",
"c",
")",
")",
";",
"}"
] | Sets this triangles points.
@param 3 points {@link Point2D}
@return this Triangle | [
"Sets",
"this",
"triangles",
"points",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Triangle.java#L150-L153 |
alkacon/opencms-core | src/org/opencms/notification/CmsPublishNotification.java | CmsPublishNotification.appendList | private void appendList(StringBuffer buffer, List<Object> list) {
Iterator<Object> iter = list.iterator();
while (iter.hasNext()) {
Object entry = iter.next();
buffer.append(entry).append("<br/>\n");
}
} | java | private void appendList(StringBuffer buffer, List<Object> list) {
Iterator<Object> iter = list.iterator();
while (iter.hasNext()) {
Object entry = iter.next();
buffer.append(entry).append("<br/>\n");
}
} | [
"private",
"void",
"appendList",
"(",
"StringBuffer",
"buffer",
",",
"List",
"<",
"Object",
">",
"list",
")",
"{",
"Iterator",
"<",
"Object",
">",
"iter",
"=",
"list",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")... | Appends the contents of a list to the buffer with every entry in a new line.<p>
@param buffer The buffer were the entries of the list will be appended.
@param list The list with the entries to append to the buffer. | [
"Appends",
"the",
"contents",
"of",
"a",
"list",
"to",
"the",
"buffer",
"with",
"every",
"entry",
"in",
"a",
"new",
"line",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/notification/CmsPublishNotification.java#L112-L119 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/DefaultImageDecoder.java | DefaultImageDecoder.decodeGif | public CloseableImage decodeGif(
final EncodedImage encodedImage,
final int length,
final QualityInfo qualityInfo,
final ImageDecodeOptions options) {
if (!options.forceStaticImage && mAnimatedGifDecoder != null) {
return mAnimatedGifDecoder.decode(encodedImage, length, qualityInfo, op... | java | public CloseableImage decodeGif(
final EncodedImage encodedImage,
final int length,
final QualityInfo qualityInfo,
final ImageDecodeOptions options) {
if (!options.forceStaticImage && mAnimatedGifDecoder != null) {
return mAnimatedGifDecoder.decode(encodedImage, length, qualityInfo, op... | [
"public",
"CloseableImage",
"decodeGif",
"(",
"final",
"EncodedImage",
"encodedImage",
",",
"final",
"int",
"length",
",",
"final",
"QualityInfo",
"qualityInfo",
",",
"final",
"ImageDecodeOptions",
"options",
")",
"{",
"if",
"(",
"!",
"options",
".",
"forceStaticI... | Decodes gif into CloseableImage.
@param encodedImage input image (encoded bytes plus meta data)
@return a CloseableImage | [
"Decodes",
"gif",
"into",
"CloseableImage",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/DefaultImageDecoder.java#L130-L139 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_migrate_destinationServiceName_GET | public OvhMigrationService domain_account_accountName_migrate_destinationServiceName_GET(String domain, String accountName, String destinationServiceName) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}";
StringBuilder sb = path(qPath, domain, accou... | java | public OvhMigrationService domain_account_accountName_migrate_destinationServiceName_GET(String domain, String accountName, String destinationServiceName) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}";
StringBuilder sb = path(qPath, domain, accou... | [
"public",
"OvhMigrationService",
"domain_account_accountName_migrate_destinationServiceName_GET",
"(",
"String",
"domain",
",",
"String",
"accountName",
",",
"String",
"destinationServiceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}... | Get this object properties
REST: GET /email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}
@param domain [required] Name of your domain name
@param accountName [required] Name of account
@param destinationServiceName [required] Service name allowed as migration destination
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L449-L454 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java | CopyOnWriteArrayList.removeOrRetain | private int removeOrRetain(Collection<?> collection, boolean retain, int from, int to) {
for (int i = from; i < to; i++) {
if (collection.contains(elements[i]) == retain) {
continue;
}
/*
* We've encountered an element that must be removed! Creat... | java | private int removeOrRetain(Collection<?> collection, boolean retain, int from, int to) {
for (int i = from; i < to; i++) {
if (collection.contains(elements[i]) == retain) {
continue;
}
/*
* We've encountered an element that must be removed! Creat... | [
"private",
"int",
"removeOrRetain",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"boolean",
"retain",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"from",
";",
"i",
"<",
"to",
";",
"i",
"++",
")",
"{",
"if"... | Removes or retains the elements in {@code collection}. Returns the number
of elements removed. | [
"Removes",
"or",
"retains",
"the",
"elements",
"in",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java#L435-L471 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCConnection.java | JDBCConnection.onStartEscapeSequence | private int onStartEscapeSequence(String sql, StringBuffer sb,
int i) throws SQLException {
sb.setCharAt(i++, ' ');
i = StringUtil.skipSpaces(sql, i);
if (sql.regionMatches(true, i, "fn ", 0, 3)
|| sql.regionMatches(true, i, "oj ", 0, 3)
... | java | private int onStartEscapeSequence(String sql, StringBuffer sb,
int i) throws SQLException {
sb.setCharAt(i++, ' ');
i = StringUtil.skipSpaces(sql, i);
if (sql.regionMatches(true, i, "fn ", 0, 3)
|| sql.regionMatches(true, i, "oj ", 0, 3)
... | [
"private",
"int",
"onStartEscapeSequence",
"(",
"String",
"sql",
",",
"StringBuffer",
"sb",
",",
"int",
"i",
")",
"throws",
"SQLException",
"{",
"sb",
".",
"setCharAt",
"(",
"i",
"++",
",",
"'",
"'",
")",
";",
"i",
"=",
"StringUtil",
".",
"skipSpaces",
... | is called from within nativeSQL when the start of an JDBC escape sequence is encountered | [
"is",
"called",
"from",
"within",
"nativeSQL",
"when",
"the",
"start",
"of",
"an",
"JDBC",
"escape",
"sequence",
"is",
"encountered"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCConnection.java#L3470-L3503 |
beanshell/beanshell | src/main/java/bsh/Types.java | Types.isJavaAssignable | static boolean isJavaAssignable( Class lhsType, Class rhsType ) {
return isJavaBaseAssignable( lhsType, rhsType )
|| isJavaBoxTypesAssignable( lhsType, rhsType );
} | java | static boolean isJavaAssignable( Class lhsType, Class rhsType ) {
return isJavaBaseAssignable( lhsType, rhsType )
|| isJavaBoxTypesAssignable( lhsType, rhsType );
} | [
"static",
"boolean",
"isJavaAssignable",
"(",
"Class",
"lhsType",
",",
"Class",
"rhsType",
")",
"{",
"return",
"isJavaBaseAssignable",
"(",
"lhsType",
",",
"rhsType",
")",
"||",
"isJavaBoxTypesAssignable",
"(",
"lhsType",
",",
"rhsType",
")",
";",
"}"
] | Test if a conversion of the rhsType type to the lhsType type is legal via
standard Java assignment conversion rules (i.e. without a cast).
The rules include Java 5 autoboxing/unboxing.
<p/>
For Java primitive TYPE classes this method takes primitive promotion
into account. The ordinary Class.isAssignableFrom() does n... | [
"Test",
"if",
"a",
"conversion",
"of",
"the",
"rhsType",
"type",
"to",
"the",
"lhsType",
"type",
"is",
"legal",
"via",
"standard",
"Java",
"assignment",
"conversion",
"rules",
"(",
"i",
".",
"e",
".",
"without",
"a",
"cast",
")",
".",
"The",
"rules",
"... | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L288-L291 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | @SuppressWarnings("static-method")
protected XExpression _generate(XNullLiteral literal, IAppendable it, IExtraLanguageGeneratorContext context) {
appendReturnIfExpectedReturnedExpression(it, context);
it.append("None"); //$NON-NLS-1$
return literal;
} | java | @SuppressWarnings("static-method")
protected XExpression _generate(XNullLiteral literal, IAppendable it, IExtraLanguageGeneratorContext context) {
appendReturnIfExpectedReturnedExpression(it, context);
it.append("None"); //$NON-NLS-1$
return literal;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"XExpression",
"_generate",
"(",
"XNullLiteral",
"literal",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"appendReturnIfExpectedReturnedExpression",
"(",
"it",
",... | Generate the given object.
@param literal the null literal.
@param it the target for the generated content.
@param context the context.
@return the literal. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L798-L803 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/spi/MoneyUtils.java | MoneyUtils.getBigDecimal | public static BigDecimal getBigDecimal(Number num, MonetaryContext moneyContext) {
BigDecimal bd = getBigDecimal(num);
if (moneyContext!=null) {
MathContext mc = getMathContext(moneyContext, RoundingMode.HALF_EVEN);
bd = new BigDecimal(bd.toString(), mc);
if (moneyContex... | java | public static BigDecimal getBigDecimal(Number num, MonetaryContext moneyContext) {
BigDecimal bd = getBigDecimal(num);
if (moneyContext!=null) {
MathContext mc = getMathContext(moneyContext, RoundingMode.HALF_EVEN);
bd = new BigDecimal(bd.toString(), mc);
if (moneyContex... | [
"public",
"static",
"BigDecimal",
"getBigDecimal",
"(",
"Number",
"num",
",",
"MonetaryContext",
"moneyContext",
")",
"{",
"BigDecimal",
"bd",
"=",
"getBigDecimal",
"(",
"num",
")",
";",
"if",
"(",
"moneyContext",
"!=",
"null",
")",
"{",
"MathContext",
"mc",
... | Creates a {@link BigDecimal} from the given {@link Number} doing the
valid conversion depending the type given, if a {@link MonetaryContext}
is given, it is applied to the number returned.
@param num the number type
@return the corresponding {@link BigDecimal} | [
"Creates",
"a",
"{",
"@link",
"BigDecimal",
"}",
"from",
"the",
"given",
"{",
"@link",
"Number",
"}",
"doing",
"the",
"valid",
"conversion",
"depending",
"the",
"type",
"given",
"if",
"a",
"{",
"@link",
"MonetaryContext",
"}",
"is",
"given",
"it",
"is",
... | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/MoneyUtils.java#L96-L107 |
Alexey1Gavrilov/ExpectIt | expectit-core/src/main/java/net/sf/expectit/matcher/Matchers.java | Matchers.eof | public static Matcher<Result> eof() {
return new Matcher<Result>() {
@Override
public Result matches(String input, boolean isEof) {
return isEof ? success(input, input, "") : failure(input, false);
}
@Override
public String toString() ... | java | public static Matcher<Result> eof() {
return new Matcher<Result>() {
@Override
public Result matches(String input, boolean isEof) {
return isEof ? success(input, input, "") : failure(input, false);
}
@Override
public String toString() ... | [
"public",
"static",
"Matcher",
"<",
"Result",
">",
"eof",
"(",
")",
"{",
"return",
"new",
"Matcher",
"<",
"Result",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Result",
"matches",
"(",
"String",
"input",
",",
"boolean",
"isEof",
")",
"{",
"return",... | Creates a matcher that matches if input reaches the end of stream.
<p/>
If succeeded, the {@link net.sf.expectit.Result#getBefore()} will return the entire input
buffer, and
the {@link net.sf.expectit.Result#group()} returns an empty string.
@return the matcher | [
"Creates",
"a",
"matcher",
"that",
"matches",
"if",
"input",
"reaches",
"the",
"end",
"of",
"stream",
".",
"<p",
"/",
">",
"If",
"succeeded",
"the",
"{",
"@link",
"net",
".",
"sf",
".",
"expectit",
".",
"Result#getBefore",
"()",
"}",
"will",
"return",
... | train | https://github.com/Alexey1Gavrilov/ExpectIt/blob/5acbe1f8f895fe1dbd63e29bf3ab8e5bbf0873c3/expectit-core/src/main/java/net/sf/expectit/matcher/Matchers.java#L206-L218 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java | Camera.setView | public void setView(int x, int y, int width, int height, int screenHeight)
{
this.x = x;
this.y = y;
this.width = UtilMath.clamp(width, 0, Integer.MAX_VALUE);
this.height = UtilMath.clamp(height, 0, Integer.MAX_VALUE);
this.screenHeight = screenHeight;
} | java | public void setView(int x, int y, int width, int height, int screenHeight)
{
this.x = x;
this.y = y;
this.width = UtilMath.clamp(width, 0, Integer.MAX_VALUE);
this.height = UtilMath.clamp(height, 0, Integer.MAX_VALUE);
this.screenHeight = screenHeight;
} | [
"public",
"void",
"setView",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"screenHeight",
")",
"{",
"this",
".",
"x",
"=",
"x",
";",
"this",
".",
"y",
"=",
"y",
";",
"this",
".",
"width",
"=",
"UtilMa... | Define the rendering area. Useful to apply an offset during rendering, in order to avoid hiding part.
<p>
For example:
</p>
<ul>
<li>If the view set is <code>(0, 0, 320, 240)</code>, and the tile size is <code>16</code>, then
<code>20</code> horizontal tiles and <code>15</code> vertical tiles will be rendered from <cod... | [
"Define",
"the",
"rendering",
"area",
".",
"Useful",
"to",
"apply",
"an",
"offset",
"during",
"rendering",
"in",
"order",
"to",
"avoid",
"hiding",
"part",
".",
"<p",
">",
"For",
"example",
":",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"If",
"the",... | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java#L216-L223 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java | GVRAssetLoader.loadTexture | public GVRTexture loadTexture(GVRAndroidResource resource,
GVRTextureParameters textureParameters)
{
GVRTexture texture = new GVRTexture(mContext, textureParameters);
TextureRequest request = new TextureRequest(resource, texture);
GVRAsynchronousResourceLoad... | java | public GVRTexture loadTexture(GVRAndroidResource resource,
GVRTextureParameters textureParameters)
{
GVRTexture texture = new GVRTexture(mContext, textureParameters);
TextureRequest request = new TextureRequest(resource, texture);
GVRAsynchronousResourceLoad... | [
"public",
"GVRTexture",
"loadTexture",
"(",
"GVRAndroidResource",
"resource",
",",
"GVRTextureParameters",
"textureParameters",
")",
"{",
"GVRTexture",
"texture",
"=",
"new",
"GVRTexture",
"(",
"mContext",
",",
"textureParameters",
")",
";",
"TextureRequest",
"request",... | Loads file placed in the assets folder, as a {@link GVRBitmapImage}
with the user provided texture parameters.
The bitmap is loaded asynchronously.
<p>
This method automatically scales large images to fit the GPU's
restrictions and to avoid {@linkplain OutOfMemoryError out of memory
errors.}
@param resource
A stream c... | [
"Loads",
"file",
"placed",
"in",
"the",
"assets",
"folder",
"as",
"a",
"{",
"@link",
"GVRBitmapImage",
"}",
"with",
"the",
"user",
"provided",
"texture",
"parameters",
".",
"The",
"bitmap",
"is",
"loaded",
"asynchronously",
".",
"<p",
">",
"This",
"method",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java#L658-L666 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.beginUpdate | public DataMigrationServiceInner beginUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) {
return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body();
} | java | public DataMigrationServiceInner beginUpdate(String groupName, String serviceName, DataMigrationServiceInner parameters) {
return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).toBlocking().single().body();
} | [
"public",
"DataMigrationServiceInner",
"beginUpdate",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"DataMigrationServiceInner",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
",",
"parameters"... | Create or update DMS Service Instance.
The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail... | [
"Create",
"or",
"update",
"DMS",
"Service",
"Instance",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"The",
"PATCH",
"method",
"updates",
"an",
"existing",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L842-L844 |
belaban/JGroups | src/org/jgroups/util/Bits.java | Bits.writeString | public static void writeString(String s, ByteBuffer buf) {
buf.put((byte)(s != null? 1 : 0));
if(s != null) {
byte[] bytes=s.getBytes();
writeInt(bytes.length, buf);
buf.put(bytes);
}
} | java | public static void writeString(String s, ByteBuffer buf) {
buf.put((byte)(s != null? 1 : 0));
if(s != null) {
byte[] bytes=s.getBytes();
writeInt(bytes.length, buf);
buf.put(bytes);
}
} | [
"public",
"static",
"void",
"writeString",
"(",
"String",
"s",
",",
"ByteBuffer",
"buf",
")",
"{",
"buf",
".",
"put",
"(",
"(",
"byte",
")",
"(",
"s",
"!=",
"null",
"?",
"1",
":",
"0",
")",
")",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"b... | Writes a string to buf. The length of the string is written first, followed by the chars (as single-byte values).
Multi-byte values are truncated: only the lower byte of each multi-byte char is written, similar to
{@link DataOutput#writeChars(String)}.
@param s the string
@param buf the buffer | [
"Writes",
"a",
"string",
"to",
"buf",
".",
"The",
"length",
"of",
"the",
"string",
"is",
"written",
"first",
"followed",
"by",
"the",
"chars",
"(",
"as",
"single",
"-",
"byte",
"values",
")",
".",
"Multi",
"-",
"byte",
"values",
"are",
"truncated",
":"... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L600-L607 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/excel/PoiWorkSheet.java | PoiWorkSheet.createTitleCells | public void createTitleCells(double width, String... strs) {
for (String s : strs) {
this.createTitleCell(s, width);
}
} | java | public void createTitleCells(double width, String... strs) {
for (String s : strs) {
this.createTitleCell(s, width);
}
} | [
"public",
"void",
"createTitleCells",
"(",
"double",
"width",
",",
"String",
"...",
"strs",
")",
"{",
"for",
"(",
"String",
"s",
":",
"strs",
")",
"{",
"this",
".",
"createTitleCell",
"(",
"s",
",",
"width",
")",
";",
"}",
"}"
] | Create title cells.
@param width the width
@param strs the strs | [
"Create",
"title",
"cells",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/excel/PoiWorkSheet.java#L121-L125 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserRte.java | AbstractGpxParserRte.initialise | public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
setReader(reader);
setParent(parent);
setContentBuffer(parent.getContentBuffer());
setRtePreparedStmt(parent.getRtePreparedStmt());
setRteptPreparedStmt(parent.getRteptPreparedStmt());
setElementN... | java | public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
setReader(reader);
setParent(parent);
setContentBuffer(parent.getContentBuffer());
setRtePreparedStmt(parent.getRtePreparedStmt());
setRteptPreparedStmt(parent.getRteptPreparedStmt());
setElementN... | [
"public",
"void",
"initialise",
"(",
"XMLReader",
"reader",
",",
"AbstractGpxParserDefault",
"parent",
")",
"{",
"setReader",
"(",
"reader",
")",
";",
"setParent",
"(",
"parent",
")",
";",
"setContentBuffer",
"(",
"parent",
".",
"getContentBuffer",
"(",
")",
"... | Create a new specific parser. It has in memory the default parser, the
contentBuffer, the elementNames, the currentLine and the rteID.
@param reader The XMLReader used in the default class
@param parent The parser used in the default class | [
"Create",
"a",
"new",
"specific",
"parser",
".",
"It",
"has",
"in",
"memory",
"the",
"default",
"parser",
"the",
"contentBuffer",
"the",
"elementNames",
"the",
"currentLine",
"and",
"the",
"rteID",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserRte.java#L58-L67 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/BatchOperation.java | BatchOperation.addQuery | public void addQuery(String query, String bId) {
BatchItemRequest batchItemRequest = new BatchItemRequest();
batchItemRequest.setBId(bId);
batchItemRequest.setQuery(query);
batchItemRequests.add(batchItemRequest);
bIds.add(bId);
} | java | public void addQuery(String query, String bId) {
BatchItemRequest batchItemRequest = new BatchItemRequest();
batchItemRequest.setBId(bId);
batchItemRequest.setQuery(query);
batchItemRequests.add(batchItemRequest);
bIds.add(bId);
} | [
"public",
"void",
"addQuery",
"(",
"String",
"query",
",",
"String",
"bId",
")",
"{",
"BatchItemRequest",
"batchItemRequest",
"=",
"new",
"BatchItemRequest",
"(",
")",
";",
"batchItemRequest",
".",
"setBId",
"(",
"bId",
")",
";",
"batchItemRequest",
".",
"setQ... | Method to add the query batch operation to batchItemRequest
@param query the query
@param bId the batch Id | [
"Method",
"to",
"add",
"the",
"query",
"batch",
"operation",
"to",
"batchItemRequest"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/BatchOperation.java#L112-L120 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.