repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java | JsonUtils.unserializeLicense | public static License unserializeLicense(final String license) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(license, License.class);
} | java | public static License unserializeLicense(final String license) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(license, License.class);
} | [
"public",
"static",
"License",
"unserializeLicense",
"(",
"final",
"String",
"license",
")",
"throws",
"IOException",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"disable",
"(",
"MapperFeature",
".",
"USE_GET... | Un-serialize a report with Json
@param license String
@return License
@throws IOException | [
"Un",
"-",
"serialize",
"a",
"report",
"with",
"Json"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java#L98-L102 | train | Unserialize a license string. | Of course, here is the Java code you requested:
```java
public static License unserializeLicense(final String license) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(license, License.class);
}
```
Hope thi... |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/endpoint/AbstractGenericHandler.java | AbstractGenericHandler.scheduleWorker | private void scheduleWorker(Scheduler scheduler, final CouchbaseResponse response,
final Subject<CouchbaseResponse, CouchbaseResponse> observable) {
final Scheduler.Worker worker = scheduler.createWorker();
worker.schedule(new Action0() {
@Override
public void call() {
... | java | private void scheduleWorker(Scheduler scheduler, final CouchbaseResponse response,
final Subject<CouchbaseResponse, CouchbaseResponse> observable) {
final Scheduler.Worker worker = scheduler.createWorker();
worker.schedule(new Action0() {
@Override
public void call() {
... | [
"private",
"void",
"scheduleWorker",
"(",
"Scheduler",
"scheduler",
",",
"final",
"CouchbaseResponse",
"response",
",",
"final",
"Subject",
"<",
"CouchbaseResponse",
",",
"CouchbaseResponse",
">",
"observable",
")",
"{",
"final",
"Scheduler",
".",
"Worker",
"worker"... | Dispatches the response on a generic scheduler through creating a worker. | [
"Dispatches",
"the",
"response",
"on",
"a",
"generic",
"scheduler",
"through",
"creating",
"a",
"worker",
"."
] | 97f0427112c2168fee1d6499904f5fa0e24c6797 | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/AbstractGenericHandler.java#L534-L544 | train | Schedules a worker to complete the response. | Of course, here is the Java code you requested:
```java
private void scheduleWorker(Scheduler scheduler, final CouchbaseResponse response,
final Subject<CouchbaseResponse, CouchbaseResponse> observable) {
final Scheduler.Worker worker = scheduler.createWorker();
worker.schedule(new Action0() {
... |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/EventImpl.java | EventImpl.cancel | public boolean cancel(boolean mayInterruptIfRunning) {
if (futures == null) {
return false;
}
for (Future<?> future : futures) {
if (!future.cancel(mayInterruptIfRunning)) {
return false;
}
}
return true;
} | java | public boolean cancel(boolean mayInterruptIfRunning) {
if (futures == null) {
return false;
}
for (Future<?> future : futures) {
if (!future.cancel(mayInterruptIfRunning)) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"cancel",
"(",
"boolean",
"mayInterruptIfRunning",
")",
"{",
"if",
"(",
"futures",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"Future",
"<",
"?",
">",
"future",
":",
"futures",
")",
"{",
"if",
"(",
"!",
"fut... | {@inheritDoc} | [
"{"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/EventImpl.java#L223-L233 | train | Cancel all the futures. | Of course, here is the Java code you requested:
```java
public boolean cancel(boolean mayInterruptIfRunning) {
if (futures == null) {
return false;
}
for (Future<?> future : futures) {
if (!future.cancel(mayInterruptIfRunning)) {
return false;
... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsHdrsImpl.java | JsHdrsImpl.getReliability | public final Reliability getReliability() {
// If the transient is not set, get the int value from the message then
// obtain the corresponding Reliability instance and cache it.
if (cachedReliability == null) {
Byte rType = (Byte) getHdr2().getField(JsHdr2Access.RELIABILITY);
... | java | public final Reliability getReliability() {
// If the transient is not set, get the int value from the message then
// obtain the corresponding Reliability instance and cache it.
if (cachedReliability == null) {
Byte rType = (Byte) getHdr2().getField(JsHdr2Access.RELIABILITY);
... | [
"public",
"final",
"Reliability",
"getReliability",
"(",
")",
"{",
"// If the transient is not set, get the int value from the message then",
"// obtain the corresponding Reliability instance and cache it.",
"if",
"(",
"cachedReliability",
"==",
"null",
")",
"{",
"Byte",
"rType",
... | /*
Get the value of the Reliability field from the message header.
Javadoc description supplied by SIBusMessage interface. | [
"/",
"*",
"Get",
"the",
"value",
"of",
"the",
"Reliability",
"field",
"from",
"the",
"message",
"header",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsHdrsImpl.java#L469-L478 | train | Gets the value of theReliability field from the message. | Of course, here is the Java code you requested:
```java
public final Reliability getReliability() {
// If the transient is not set, get the int value from the message then
// obtain the corresponding Reliability instance and cache it.
if (cachedReliability == null) {
Byte rType = (B... |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/NameUtil.java | NameUtil.translateEjbName | private static String translateEjbName(String ejbName)
{
// trim leading and trailing blanks
ejbName = ejbName.trim();
// limits to the first Max_EjbName_Size characters
int len = ejbName.length();
if (len > Max_EjbName_Size)
{
len = Max_EjbName_Size;
... | java | private static String translateEjbName(String ejbName)
{
// trim leading and trailing blanks
ejbName = ejbName.trim();
// limits to the first Max_EjbName_Size characters
int len = ejbName.length();
if (len > Max_EjbName_Size)
{
len = Max_EjbName_Size;
... | [
"private",
"static",
"String",
"translateEjbName",
"(",
"String",
"ejbName",
")",
"{",
"// trim leading and trailing blanks",
"ejbName",
"=",
"ejbName",
".",
"trim",
"(",
")",
";",
"// limits to the first Max_EjbName_Size characters",
"int",
"len",
"=",
"ejbName",
".",
... | Translate the input ejbname to be used by ejbdeploy generated file name
according to the following rules.
1. Leading and trailing white spaces are trimmed.
2. All non-alphanumeric characters are replaced by "_" to avoid invalid
file name character since <ejb-name> can be in any form.
3. Limit the return string to a pre... | [
"Translate",
"the",
"input",
"ejbname",
"to",
"be",
"used",
"by",
"ejbdeploy",
"generated",
"file",
"name",
"according",
"to",
"the",
"following",
"rules",
".",
"1",
".",
"Leading",
"and",
"trailing",
"white",
"spaces",
"are",
"trimmed",
".",
"2",
".",
"Al... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/NameUtil.java#L783-L801 | train | Translate the ejbName to a Crazilianianianianianianianianianianianianianianianianianianianianianianianianianianianz. | Of course, here is the Java code you requested:
```java
private static String translateEjbName(String ejbName)
{
// trim leading and trailing blanks
ejbName = ejbName.trim();
// limits to the first Max_EjbName_Size characters
int len = ejbName.length();
if (len > Max_EjbName... |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTileTransitionModel.java | MapTileTransitionModel.getTransition | private static TransitionType getTransition(TransitionType a, TransitionType b, int ox, int oy)
{
final TransitionType type = getTransitionHorizontalVertical(a, b, ox, oy);
if (type != null)
{
return type;
}
return getTransitionDiagonals(a, b, ox, oy);
... | java | private static TransitionType getTransition(TransitionType a, TransitionType b, int ox, int oy)
{
final TransitionType type = getTransitionHorizontalVertical(a, b, ox, oy);
if (type != null)
{
return type;
}
return getTransitionDiagonals(a, b, ox, oy);
... | [
"private",
"static",
"TransitionType",
"getTransition",
"(",
"TransitionType",
"a",
",",
"TransitionType",
"b",
",",
"int",
"ox",
",",
"int",
"oy",
")",
"{",
"final",
"TransitionType",
"type",
"=",
"getTransitionHorizontalVertical",
"(",
"a",
",",
"b",
",",
"o... | Get the new transition type from two transitions.
@param a The inner transition.
@param b The outer transition.
@param ox The horizontal offset to update.
@param oy The vertical offset to update.
@return The new transition type, <code>null</code> if none. | [
"Get",
"the",
"new",
"transition",
"type",
"from",
"two",
"transitions",
"."
] | cac3d5578532cf11724a737b9f09e71bf9995ab2 | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTileTransitionModel.java#L51-L59 | train | Gets the related data type of a and b. | Of course, here is the Java code you requested:
```java
private static TransitionType getTransition(TransitionType a, TransitionType b, int ox, int oy)
{
final TransitionType type = getTransitionHorizontalVertical(a, b, ox, oy);
if (type != null)
{
return type;
}
... |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/JarResource.java | JarResource.getInputStream | public InputStream getInputStream()
throws java.io.IOException
{
if (!_urlString.endsWith("!/"))
return super.getInputStream();
URL url = new URL(_urlString.substring(4,_urlString.length()-2));
return url.openStream();
} | java | public InputStream getInputStream()
throws java.io.IOException
{
if (!_urlString.endsWith("!/"))
return super.getInputStream();
URL url = new URL(_urlString.substring(4,_urlString.length()-2));
return url.openStream();
} | [
"public",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"if",
"(",
"!",
"_urlString",
".",
"endsWith",
"(",
"\"!/\"",
")",
")",
"return",
"super",
".",
"getInputStream",
"(",
")",
";",
"URL",
"url",
"=",... | /* ------------------------------------------------------------ | [
"/",
"*",
"------------------------------------------------------------"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/JarResource.java#L95-L103 | train | Returns an InputStream for the CIDCTYPE. | Of course, here is the Java code you requested:
```java
public InputStream getInputStream()
throws java.io.IOException
{
if (!_urlString.endsWith("!/"))
return super.getInputStream();
URL url = new URL(_urlString.substring(4,_urlString.length()-2));
return url.o... |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java | PgResultSet.getFastLong | private long getFastLong(int columnIndex) throws SQLException, NumberFormatException {
byte[] bytes = thisRow[columnIndex - 1];
if (bytes.length == 0) {
throw FAST_NUMBER_FAILED;
}
long val = 0;
int start;
boolean neg;
if (bytes[0] == '-') {
neg = true;
start = 1;
... | java | private long getFastLong(int columnIndex) throws SQLException, NumberFormatException {
byte[] bytes = thisRow[columnIndex - 1];
if (bytes.length == 0) {
throw FAST_NUMBER_FAILED;
}
long val = 0;
int start;
boolean neg;
if (bytes[0] == '-') {
neg = true;
start = 1;
... | [
"private",
"long",
"getFastLong",
"(",
"int",
"columnIndex",
")",
"throws",
"SQLException",
",",
"NumberFormatException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"thisRow",
"[",
"columnIndex",
"-",
"1",
"]",
";",
"if",
"(",
"bytes",
".",
"length",
"==",
"0",
... | Optimised byte[] to number parser. This code does not handle null values, so the caller must do
checkResultSet and handle null values prior to calling this function.
@param columnIndex The column to parse.
@return The parsed number.
@throws SQLException If an error occurs while fetching column.
@throws NumberFormatExc... | [
"Optimised",
"byte",
"[]",
"to",
"number",
"parser",
".",
"This",
"code",
"does",
"not",
"handle",
"null",
"values",
"so",
"the",
"caller",
"must",
"do",
"checkResultSet",
"and",
"handle",
"null",
"values",
"prior",
"to",
"calling",
"this",
"function",
"."
] | 95ba7b261e39754674c5817695ae5ebf9a341fae | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java#L2073-L2113 | train | Gets the value of the designated column as a long. | Of course, here is the Java code you requested:
```java
private long getFastLong(int columnIndex) throws SQLException, NumberFormatException {
byte[] bytes = thisRow[columnIndex - 1];
if (bytes.length == 0) {
throw FAST_NUMBER_FAILED;
}
long val = 0;
int start;
boolean neg;
if (byt... |
rackerlabs/blueflood | blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DSimpleNumberIO.java | DSimpleNumberIO.insertRawAsync | public ResultSetFuture insertRawAsync( IMetric metric ) {
BoundStatement bound = getBoundStatementForMetric(metric);
return session.executeAsync(bound);
} | java | public ResultSetFuture insertRawAsync( IMetric metric ) {
BoundStatement bound = getBoundStatementForMetric(metric);
return session.executeAsync(bound);
} | [
"public",
"ResultSetFuture",
"insertRawAsync",
"(",
"IMetric",
"metric",
")",
"{",
"BoundStatement",
"bound",
"=",
"getBoundStatementForMetric",
"(",
"metric",
")",
";",
"return",
"session",
".",
"executeAsync",
"(",
"bound",
")",
";",
"}"
] | Inserts a raw metric (not its rolled up value) to the proper
column family
@param metric
@return | [
"Inserts",
"a",
"raw",
"metric",
"(",
"not",
"its",
"rolled",
"up",
"value",
")",
"to",
"the",
"proper",
"column",
"family"
] | 4722a3449b1a7f8e88889ea8c340c6f24396b5b0 | https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DSimpleNumberIO.java#L39-L44 | test | Insert raw result set for the given metric. | Of course, here is the Java code you requested:
```java
public ResultSetFuture insertRawAsync( IMetric metric ) {
BoundStatement bound = getBoundStatementForMetric(metric);
return session.executeAsync(bound);
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorModel.java | CmsMessageBundleEditorModel.getBundleResources | List<CmsResource> getBundleResources() {
List<CmsResource> resources = new ArrayList<>(m_bundleFiles.values());
if (m_desc != null) {
resources.add(m_desc);
}
return resources;
} | java | List<CmsResource> getBundleResources() {
List<CmsResource> resources = new ArrayList<>(m_bundleFiles.values());
if (m_desc != null) {
resources.add(m_desc);
}
return resources;
} | [
"List",
"<",
"CmsResource",
">",
"getBundleResources",
"(",
")",
"{",
"List",
"<",
"CmsResource",
">",
"resources",
"=",
"new",
"ArrayList",
"<>",
"(",
"m_bundleFiles",
".",
"values",
"(",
")",
")",
";",
"if",
"(",
"m_desc",
"!=",
"null",
")",
"{",
"re... | Returns all resources that belong to the bundle
This includes the descriptor if one exists.
@return List of the bundle resources, including the descriptor. | [
"Returns",
"all",
"resources",
"that",
"belong",
"to",
"the",
"bundle",
"This",
"includes",
"the",
"descriptor",
"if",
"one",
"exists",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorModel.java#L1042-L1050 | train | Returns the list of resources for the bundle. | Of course, here is the Java code you requested:
```java
List<CmsResource> getBundleResources() {
List<CmsResource> resources = new ArrayList<>(m_bundleFiles.values());
if (m_desc != null) {
resources.add(m_desc);
}
return resources;
}
```
Hope this helps! |
gsi-upm/BeastTool | beast-tool/src/main/java/es/upm/dit/gsi/beast/reader/Reader.java | Reader.createDotStoryFile | public static void createDotStoryFile(String scenarioName,
String srcTestRootFolder, String packagePath,
String givenDescription, String whenDescription,
String thenDescription) throws BeastException {
String[] folders = packagePath.split(".");
for (String folder : fo... | java | public static void createDotStoryFile(String scenarioName,
String srcTestRootFolder, String packagePath,
String givenDescription, String whenDescription,
String thenDescription) throws BeastException {
String[] folders = packagePath.split(".");
for (String folder : fo... | [
"public",
"static",
"void",
"createDotStoryFile",
"(",
"String",
"scenarioName",
",",
"String",
"srcTestRootFolder",
",",
"String",
"packagePath",
",",
"String",
"givenDescription",
",",
"String",
"whenDescription",
",",
"String",
"thenDescription",
")",
"throws",
"Be... | Creates the .story file necessary for every Beast Test Case.
@param scenarioName
- The name of the scenario, with spaces
@param srcTestRootFolder
- The test root folder
@param packagePath
- The package of the BeastTestCase
@param scenarioDescription
- the scenario name
@param givenDescription
- The given description
@... | [
"Creates",
"the",
".",
"story",
"file",
"necessary",
"for",
"every",
"Beast",
"Test",
"Case",
"."
] | cc7fdc75cb818c5d60802aaf32c27829e0ca144c | https://github.com/gsi-upm/BeastTool/blob/cc7fdc75cb818c5d60802aaf32c27829e0ca144c/beast-tool/src/main/java/es/upm/dit/gsi/beast/reader/Reader.java#L307-L331 | train | Create a. story file for the specified scenario. | Of course, here is the Java code you requested:
```java
public static void createDotStoryFile(String scenarioName,
String srcTestRootFolder, String packagePath,
String givenDescription, String whenDescription,
String thenDescription) throws BeastException {
String[] folders ... |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/query/parsing/impl/AggregationRenderer.java | AggregationRenderer.getDistinctCountGroup | private List<Document> getDistinctCountGroup() {
// propertyPath is null when the query is a select on an entity
// In this case we can make the distinct on the id of the document
Object groupColumn = propertyPath == null ? "$_id" : propertyPath;
Document group = new Document();
group.append( "$group", new Do... | java | private List<Document> getDistinctCountGroup() {
// propertyPath is null when the query is a select on an entity
// In this case we can make the distinct on the id of the document
Object groupColumn = propertyPath == null ? "$_id" : propertyPath;
Document group = new Document();
group.append( "$group", new Do... | [
"private",
"List",
"<",
"Document",
">",
"getDistinctCountGroup",
"(",
")",
"{",
"// propertyPath is null when the query is a select on an entity",
"// In this case we can make the distinct on the id of the document",
"Object",
"groupColumn",
"=",
"propertyPath",
"==",
"null",
"?",... | /*
A distinct query on the id looks something like:
db.Author.aggregate([{ $group : { _id: "$_id" }}, {$group : {_id:null, n: {$sum: 1}}}, {$project: {n: 1, _id:0}}])
This method returns the "groups" part. | [
"/",
"*",
"A",
"distinct",
"query",
"on",
"the",
"id",
"looks",
"something",
"like",
":"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/query/parsing/impl/AggregationRenderer.java#L83-L95 | train | Get the distinct count group. | Of course, here is the Java code you requested:
```java
private List<Document> getDistinctCountGroup() {
// propertyPath is null when the query is a select on an entity
// In this case we can make the distinct on the id of the document
Object groupColumn = propertyPath == null ? "$_id" : propertyPath;
Document... |
tupilabs/tap4j | tap4j/src/main/java/org/tap4j/consumer/TapConsumerImpl.java | TapConsumerImpl.load | @Override
public TestSet load(File file) {
try {
this.testSet = this.parser.parseFile(file);
} catch (ParserException e) {
throw new TapConsumerException("Failed to parse file " + file
+ ": " + e.getMessage(), e);
}
... | java | @Override
public TestSet load(File file) {
try {
this.testSet = this.parser.parseFile(file);
} catch (ParserException e) {
throw new TapConsumerException("Failed to parse file " + file
+ ": " + e.getMessage(), e);
}
... | [
"@",
"Override",
"public",
"TestSet",
"load",
"(",
"File",
"file",
")",
"{",
"try",
"{",
"this",
".",
"testSet",
"=",
"this",
".",
"parser",
".",
"parseFile",
"(",
"file",
")",
";",
"}",
"catch",
"(",
"ParserException",
"e",
")",
"{",
"throw",
"new",... | {@inheritDoc} | [
"{"
] | 1793b653ce7f3a06a7b5c9557cdf601e28dd1f55 | https://github.com/tupilabs/tap4j/blob/1793b653ce7f3a06a7b5c9557cdf601e28dd1f55/tap4j/src/main/java/org/tap4j/consumer/TapConsumerImpl.java#L79-L88 | train | Loads a
banner test set from the specified file. | Of course, here is the Java code you requested:
```java
@Override
public TestSet load(File file) {
try {
this.testSet = this.parser.parseFile(file);
} catch (ParserException e) {
throw new TapConsumerException("Failed to parse file " + file
... |
Jasig/uPortal | uPortal-io/uPortal-io-core/src/main/java/org/apereo/portal/io/xml/JaxbPortalDataHandlerService.java | JaxbPortalDataHandlerService.setDataDeleters | @Autowired(required = false)
public void setDataDeleters(Collection<IDataDeleter<? extends Object>> dataDeleters) {
this.dataDeleters = dataDeleters;
} | java | @Autowired(required = false)
public void setDataDeleters(Collection<IDataDeleter<? extends Object>> dataDeleters) {
this.dataDeleters = dataDeleters;
} | [
"@",
"Autowired",
"(",
"required",
"=",
"false",
")",
"public",
"void",
"setDataDeleters",
"(",
"Collection",
"<",
"IDataDeleter",
"<",
"?",
"extends",
"Object",
">",
">",
"dataDeleters",
")",
"{",
"this",
".",
"dataDeleters",
"=",
"dataDeleters",
";",
"}"
] | {@link IDataDeleter} implementations to delegate delete operations to. | [
"{"
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-io/uPortal-io-core/src/main/java/org/apereo/portal/io/xml/JaxbPortalDataHandlerService.java#L247-L250 | train | Sets the data deleters. | Of course, here is the Java code you requested:
```java
@Autowired(required = false)
public void setDataDeleters(Collection<IDataDeleter<? extends Object>> dataDeleters) {
this.dataDeleters = dataDeleters;
}
```
Hope this helps! |
apache/fluo-recipes | modules/kryo/src/main/java/org/apache/fluo/recipes/kryo/KryoSimplerSerializer.java | KryoSimplerSerializer.setKryoFactory | public static void setKryoFactory(FluoConfiguration config,
Class<? extends KryoFactory> factoryType) {
config.getAppConfiguration().setProperty(KRYO_FACTORY_PROP, factoryType.getName());
} | java | public static void setKryoFactory(FluoConfiguration config,
Class<? extends KryoFactory> factoryType) {
config.getAppConfiguration().setProperty(KRYO_FACTORY_PROP, factoryType.getName());
} | [
"public",
"static",
"void",
"setKryoFactory",
"(",
"FluoConfiguration",
"config",
",",
"Class",
"<",
"?",
"extends",
"KryoFactory",
">",
"factoryType",
")",
"{",
"config",
".",
"getAppConfiguration",
"(",
")",
".",
"setProperty",
"(",
"KRYO_FACTORY_PROP",
",",
"... | Call this to configure a KryoFactory type before initializing Fluo. | [
"Call",
"this",
"to",
"configure",
"a",
"KryoFactory",
"type",
"before",
"initializing",
"Fluo",
"."
] | 24c11234c9654b16d999437ff49ddc3db86665f8 | https://github.com/apache/fluo-recipes/blob/24c11234c9654b16d999437ff49ddc3db86665f8/modules/kryo/src/main/java/org/apache/fluo/recipes/kryo/KryoSimplerSerializer.java#L124-L127 | train | Sets the KryoFactory property. | Of course, here is the Java code you requested:
```java
public static void setKryoFactory(FluoConfiguration config,
Class<? extends KryoFactory> factoryType) {
config.getAppConfiguration().setProperty(KRYO_FACTORY_PROP, factoryType.getName());
}
```
Hope this helps! |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/visualizers/VisualizerInput.java | VisualizerInput.getMarkedAndCovered | public Map<SNode, Long> getMarkedAndCovered()
{
if(cachedMarkedAndCoveredNodes == null)
{
if (document != null)
{
cachedMarkedAndCoveredNodes = CommonHelper.createSNodeMapFromIDs(
markedAndCovered, document.getDocumentGraph());
}
}
return cachedMarkedAndC... | java | public Map<SNode, Long> getMarkedAndCovered()
{
if(cachedMarkedAndCoveredNodes == null)
{
if (document != null)
{
cachedMarkedAndCoveredNodes = CommonHelper.createSNodeMapFromIDs(
markedAndCovered, document.getDocumentGraph());
}
}
return cachedMarkedAndC... | [
"public",
"Map",
"<",
"SNode",
",",
"Long",
">",
"getMarkedAndCovered",
"(",
")",
"{",
"if",
"(",
"cachedMarkedAndCoveredNodes",
"==",
"null",
")",
"{",
"if",
"(",
"document",
"!=",
"null",
")",
"{",
"cachedMarkedAndCoveredNodes",
"=",
"CommonHelper",
".",
"... | This map is used for calculating the colors of a matching node.
All Nodes, which are not included, should not be colorized. For getting
HEX-values according to html or css standards, it is possible to use
{@link MatchedNodeColors}.
@return | [
"This",
"map",
"is",
"used",
"for",
"calculating",
"the",
"colors",
"of",
"a",
"matching",
"node",
"."
] | 152a2e34832e015f73ac8ce8a7d4c32641641324 | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/visualizers/VisualizerInput.java#L257-L269 | train | Get the SNode ids and their IDs in the document graph. | Of course, here is the Java code you requested:
```java
public Map<SNode, Long> getMarkedAndCovered()
{
if(cachedMarkedAndCoveredNodes == null)
{
if (document != null)
{
cachedMarkedAndCoveredNodes = CommonHelper.createSNodeMapFromIDs(
markedAndCovered, document.getDocumen... |
alkacon/opencms-core | src/org/opencms/ade/galleries/CmsGalleryService.java | CmsGalleryService.search | private CmsGallerySearchBean search(CmsGallerySearchBean searchObj) throws CmsException {
CmsGallerySearchBean searchObjBean = new CmsGallerySearchBean(searchObj);
if (searchObj == null) {
return searchObjBean;
}
// store folder filter
storeFolderFilter(searchObj.get... | java | private CmsGallerySearchBean search(CmsGallerySearchBean searchObj) throws CmsException {
CmsGallerySearchBean searchObjBean = new CmsGallerySearchBean(searchObj);
if (searchObj == null) {
return searchObjBean;
}
// store folder filter
storeFolderFilter(searchObj.get... | [
"private",
"CmsGallerySearchBean",
"search",
"(",
"CmsGallerySearchBean",
"searchObj",
")",
"throws",
"CmsException",
"{",
"CmsGallerySearchBean",
"searchObjBean",
"=",
"new",
"CmsGallerySearchBean",
"(",
"searchObj",
")",
";",
"if",
"(",
"searchObj",
"==",
"null",
")... | Returns the gallery search object containing the results for the current parameter.<p>
@param searchObj the current search object
@return the search result
@throws CmsException if the search fails | [
"Returns",
"the",
"gallery",
"search",
"object",
"containing",
"the",
"results",
"for",
"the",
"current",
"parameter",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsGalleryService.java#L2971-L3006 | train | Search for gallery files. | Of course, here is the Java code you requested:
```java
private CmsGallerySearchBean search(CmsGallerySearchBean searchObj) throws CmsException {
CmsGallerySearchBean searchObjBean = new CmsGallerySearchBean(searchObj);
if (searchObj == null) {
return searchObjBean;
}
// st... |
Talend/tesb-rt-se | locator/src/main/java/org/talend/esb/servicelocator/client/internal/ServiceLocatorImpl.java | ServiceLocatorImpl.getEndpoints | @Override
synchronized public List<SLEndpoint> getEndpoints(final QName serviceName)
throws ServiceLocatorException, InterruptedException {
RootNode rootNode = getBackend().connect();
ServiceNode serviceNode = rootNode.getServiceNode(serviceName);
if (serviceNode.exists()) {
... | java | @Override
synchronized public List<SLEndpoint> getEndpoints(final QName serviceName)
throws ServiceLocatorException, InterruptedException {
RootNode rootNode = getBackend().connect();
ServiceNode serviceNode = rootNode.getServiceNode(serviceName);
if (serviceNode.exists()) {
... | [
"@",
"Override",
"synchronized",
"public",
"List",
"<",
"SLEndpoint",
">",
"getEndpoints",
"(",
"final",
"QName",
"serviceName",
")",
"throws",
"ServiceLocatorException",
",",
"InterruptedException",
"{",
"RootNode",
"rootNode",
"=",
"getBackend",
"(",
")",
".",
"... | {@inheritDoc} | [
"{"
] | 0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886 | https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/locator/src/main/java/org/talend/esb/servicelocator/client/internal/ServiceLocatorImpl.java#L283-L304 | train | Get the list of SLEndpoints for a service. | Of course, here is the Java code you requested:
```java
@Override
synchronized public List<SLEndpoint> getEndpoints(final QName serviceName)
throws ServiceLocatorException, InterruptedException {
RootNode rootNode = getBackend().connect();
ServiceNode serviceNode = rootNode.getServiceN... |
validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.dataBufferFlush | private void dataBufferFlush() throws SAXException {
int saveLine = line;
int saveColumn = column;
line = linePrev;
column = columnPrev;
if ((currentElementContent == CONTENT_ELEMENTS) && (dataBufferPos > 0)
&& !inCDATA) {
// We can't just trust the bu... | java | private void dataBufferFlush() throws SAXException {
int saveLine = line;
int saveColumn = column;
line = linePrev;
column = columnPrev;
if ((currentElementContent == CONTENT_ELEMENTS) && (dataBufferPos > 0)
&& !inCDATA) {
// We can't just trust the bu... | [
"private",
"void",
"dataBufferFlush",
"(",
")",
"throws",
"SAXException",
"{",
"int",
"saveLine",
"=",
"line",
";",
"int",
"saveColumn",
"=",
"column",
";",
"line",
"=",
"linePrev",
";",
"column",
"=",
"columnPrev",
";",
"if",
"(",
"(",
"currentElementConten... | Flush the contents of the data buffer to the handler, as appropriate, and
reset the buffer for new input. | [
"Flush",
"the",
"contents",
"of",
"the",
"data",
"buffer",
"to",
"the",
"handler",
"as",
"appropriate",
"and",
"reset",
"the",
"buffer",
"for",
"new",
"input",
"."
] | c7b7f85b3a364df7d9944753fb5b2cd0ce642889 | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L2995-L3020 | train | Flush the data buffer. | Of course, here is the Java code you requested:
```java
private void dataBufferFlush() throws SAXException {
int saveLine = line;
int saveColumn = column;
line = linePrev;
column = columnPrev;
if ((currentElementContent == CONTENT_ELEMENTS) && (dataBufferPos > 0)
... |
renepickhardt/metalcon | graphityServer/src/main/java/de/metalcon/server/tomcat/NSSP/create/follow/CreateFollowResponse.java | CreateFollowResponse.followedIdentifierInvalid | public void followedIdentifierInvalid(final String followedId) {
this.addStatusMessage(
ProtocolConstants.StatusCodes.Create.Follow.FOLLOWED_NOT_EXISTING,
"there is no user with the identifier \"" + followedId
+ "\". Please provide a valid user identifier.");
} | java | public void followedIdentifierInvalid(final String followedId) {
this.addStatusMessage(
ProtocolConstants.StatusCodes.Create.Follow.FOLLOWED_NOT_EXISTING,
"there is no user with the identifier \"" + followedId
+ "\". Please provide a valid user identifier.");
} | [
"public",
"void",
"followedIdentifierInvalid",
"(",
"final",
"String",
"followedId",
")",
"{",
"this",
".",
"addStatusMessage",
"(",
"ProtocolConstants",
".",
"StatusCodes",
".",
"Create",
".",
"Follow",
".",
"FOLLOWED_NOT_EXISTING",
",",
"\"there is no user with the id... | add status message: followed identifier invalid
@param followedId
followed identifier passed | [
"add",
"status",
"message",
":",
"followed",
"identifier",
"invalid"
] | 26a7bd89d2225fe2172dc958d10f64a1bd9cf52f | https://github.com/renepickhardt/metalcon/blob/26a7bd89d2225fe2172dc958d10f64a1bd9cf52f/graphityServer/src/main/java/de/metalcon/server/tomcat/NSSP/create/follow/CreateFollowResponse.java#L51-L56 | train | This method is called to inform the protocol that a user with the specified identifier is invalid. | Of course, here is the Java code you requested:
```java
public void followedIdentifierInvalid(final String followedId) {
this.addStatusMessage(
ProtocolConstants.StatusCodes.Create.Follow.FOLLOWED_NOT_EXISTING,
"there is no user with the identifier \"" + followedId
+ "\". Please provide a valid user id... |
schaloner/deadbolt-2-java | code/app/be/objectify/deadbolt/java/filters/FilterConstraints.java | FilterConstraints.pattern | public FilterFunction pattern(final String value,
final PatternType patternType,
final Optional<String> meta)
{
return pattern(value,
patternType,
meta,
false,
... | java | public FilterFunction pattern(final String value,
final PatternType patternType,
final Optional<String> meta)
{
return pattern(value,
patternType,
meta,
false,
... | [
"public",
"FilterFunction",
"pattern",
"(",
"final",
"String",
"value",
",",
"final",
"PatternType",
"patternType",
",",
"final",
"Optional",
"<",
"String",
">",
"meta",
")",
"{",
"return",
"pattern",
"(",
"value",
",",
"patternType",
",",
"meta",
",",
"fals... | A constraint that checks the permissions of a subject (if using {@link PatternType#EQUALITY} or {@link PatternType#REGEX}) or
{@link be.objectify.deadbolt.java.DynamicResourceHandler#checkPermission(String, Optional, DeadboltHandler, Http.RequestHeader)} (if
using {@link PatternType#CUSTOM}).
@param value the co... | [
"A",
"constraint",
"that",
"checks",
"the",
"permissions",
"of",
"a",
"subject",
"(",
"if",
"using",
"{",
"@link",
"PatternType#EQUALITY",
"}",
"or",
"{",
"@link",
"PatternType#REGEX",
"}",
")",
"or",
"{",
"@link",
"be",
".",
"objectify",
".",
"deadbolt",
... | 84890eb4565fb6172b7d8e824f64d547ddacfcc7 | https://github.com/schaloner/deadbolt-2-java/blob/84890eb4565fb6172b7d8e824f64d547ddacfcc7/code/app/be/objectify/deadbolt/java/filters/FilterConstraints.java#L195-L204 | valid | Pattern filter function. | Of course, here is the Java code you requested:
```java
public FilterFunction pattern(final String value,
final PatternType patternType,
final Optional<String> meta)
{
return pattern(value,
patternType,
... |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java | XmlStreamReaderUtils.requiredBooleanAttribute | public static boolean requiredBooleanAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
return requiredBooleanAttribute(reader, null, localName);
} | java | public static boolean requiredBooleanAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
return requiredBooleanAttribute(reader, null, localName);
} | [
"public",
"static",
"boolean",
"requiredBooleanAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"localName",
")",
"throws",
"XMLStreamException",
"{",
"return",
"requiredBooleanAttribute",
"(",
"reader",
",",
"null",
",",
"localName",
")"... | Returns the value of an attribute as a boolean. If the attribute is empty, this method throws
an exception.
@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param localName
local name of attribute (the namespace is ignored).
@return value of attribute as boolean
@throws XMLStreamException
if... | [
"Returns",
"the",
"value",
"of",
"an",
"attribute",
"as",
"a",
"boolean",
".",
"If",
"the",
"attribute",
"is",
"empty",
"this",
"method",
"throws",
"an",
"exception",
"."
] | 83c607044f64a7f6c005a67866c0ef7cb68d6e29 | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L995-L998 | train | Method requiredBooleanAttribute. | Of course, here is the Java code you requested:
```java
public static boolean requiredBooleanAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
return requiredBooleanAttribute(reader, null, localName);
}
```
Hope this helps! |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/profile/BasicUserProfile.java | BasicUserProfile.build | public void build(final Object id, final Map<String, Object> attributes, final Map<String, Object> authenticationAttributes ) {
build(id, attributes);
addAuthenticationAttributes(authenticationAttributes);
} | java | public void build(final Object id, final Map<String, Object> attributes, final Map<String, Object> authenticationAttributes ) {
build(id, attributes);
addAuthenticationAttributes(authenticationAttributes);
} | [
"public",
"void",
"build",
"(",
"final",
"Object",
"id",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"authenticationAttributes",
")",
"{",
"build",
"(",
"id",
",",
"attribu... | Build a profile from user identifier, attributes, and authentication attributes.
@param id user identifier
@param attributes user attributes
@param authenticationAttributes authentication attributes | [
"Build",
"a",
"profile",
"from",
"user",
"identifier",
"attributes",
"and",
"authentication",
"attributes",
"."
] | d9cd029f8783792b31dd48bf1e32f80628f2c4a3 | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/profile/BasicUserProfile.java#L78-L81 | train | Build a new resource. | Of course, here is the Java code you requested:
```java
public void build(final Object id, final Map<String, Object> attributes, final Map<String, Object> authenticationAttributes ) {
build(id, attributes);
addAuthenticationAttributes(authenticationAttributes);
}
```
Hope this helps! |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java | FileIOChannel.write | public void write(String propertyId, ValueData value, ChangedSizeHandler sizeHandler) throws IOException
{
WriteValue o =
new WriteValue(getFile(propertyId, value.getOrderNumber()), value, resources, cleaner, tempDir, sizeHandler);
o.execute();
changes.add(o);
} | java | public void write(String propertyId, ValueData value, ChangedSizeHandler sizeHandler) throws IOException
{
WriteValue o =
new WriteValue(getFile(propertyId, value.getOrderNumber()), value, resources, cleaner, tempDir, sizeHandler);
o.execute();
changes.add(o);
} | [
"public",
"void",
"write",
"(",
"String",
"propertyId",
",",
"ValueData",
"value",
",",
"ChangedSizeHandler",
"sizeHandler",
")",
"throws",
"IOException",
"{",
"WriteValue",
"o",
"=",
"new",
"WriteValue",
"(",
"getFile",
"(",
"propertyId",
",",
"value",
".",
"... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java#L103-L109 | train | Write a value to the file. | Of course, here is the Java code you requested:
```java
public void write(String propertyId, ValueData value, ChangedSizeHandler sizeHandler) throws IOException
{
WriteValue o =
new WriteValue(getFile(propertyId, value.getOrderNumber()), value, resources, cleaner, tempDir, sizeHandler);
o.execu... |
janus-project/guava.janusproject.io | guava/src/com/google/common/collect/Iterators.java | Iterators.cycle | public static <T> Iterator<T> cycle(T... elements) {
return cycle(Lists.newArrayList(elements));
} | java | public static <T> Iterator<T> cycle(T... elements) {
return cycle(Lists.newArrayList(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"cycle",
"(",
"T",
"...",
"elements",
")",
"{",
"return",
"cycle",
"(",
"Lists",
".",
"newArrayList",
"(",
"elements",
")",
")",
";",
"}"
] | Returns an iterator that cycles indefinitely over the provided elements.
<p>The returned iterator supports {@code remove()}. After {@code remove()}
is called, subsequent cycles omit the removed
element, but {@code elements} does not change. The iterator's
{@code hasNext()} method returns {@code true} until all of the ... | [
"Returns",
"an",
"iterator",
"that",
"cycles",
"indefinitely",
"over",
"the",
"provided",
"elements",
"."
] | 1c48fb672c9fdfddf276970570f703fa1115f588 | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/Iterators.java#L435-L437 | train | Returns an iterator that iterates over the elements in the array. | Of course, here is the Java code you requested:
```java
public static <T> Iterator<T> cycle(T... elements) {
return cycle(Lists.newArrayList(elements));
}
```
Hope this helps! |
aol/cyclops | cyclops/src/main/java/cyclops/companion/CompletableFutures.java | CompletableFutures.sequence | public static <T> CompletableFuture<ReactiveSeq<T>> sequence(final Stream<? extends CompletableFuture<T>> fts) {
return sequence(ReactiveSeq.fromStream((fts)));
} | java | public static <T> CompletableFuture<ReactiveSeq<T>> sequence(final Stream<? extends CompletableFuture<T>> fts) {
return sequence(ReactiveSeq.fromStream((fts)));
} | [
"public",
"static",
"<",
"T",
">",
"CompletableFuture",
"<",
"ReactiveSeq",
"<",
"T",
">",
">",
"sequence",
"(",
"final",
"Stream",
"<",
"?",
"extends",
"CompletableFuture",
"<",
"T",
">",
">",
"fts",
")",
"{",
"return",
"sequence",
"(",
"ReactiveSeq",
"... | Asynchronous sequence operation that convert a Stream of Futures to a Future with a Stream
<pre>
{@code
CompletableFuture<Seq<Integer>> futures =CompletableFuture.sequence(Seq.of(
CompletableFuture.completedFuture(10),
CompletableFuture.completedFuture(1)));
Seq.of(10,1)
}
</pre>
@param fts Stream of Futures to Seq... | [
"Asynchronous",
"sequence",
"operation",
"that",
"convert",
"a",
"Stream",
"of",
"Futures",
"to",
"a",
"Future",
"with",
"a",
"Stream"
] | 59a9fde30190a4d1faeb9f6d9851d209d82b81dd | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/CompletableFutures.java#L222-L225 | train | Create a new sequence from a stream of futures. | Of course, here is the Java code you requested:
```java
public static <T> CompletableFuture<ReactiveSeq<T>> sequence(final Stream<? extends CompletableFuture<T>> fts) {
return sequence(ReactiveSeq.fromStream((fts)));
}
```
Hope this helps! |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitManager.java | InputSplitManager.unregisterJob | public void unregisterJob(final ExecutionGraph executionGraph) {
final Iterator<ExecutionGroupVertex> it = new ExecutionGroupVertexIterator(executionGraph, true, -1);
while (it.hasNext()) {
final ExecutionGroupVertex groupVertex = it.next();
final InputSplit[] inputSplits = groupVertex.getInputSplits();
... | java | public void unregisterJob(final ExecutionGraph executionGraph) {
final Iterator<ExecutionGroupVertex> it = new ExecutionGroupVertexIterator(executionGraph, true, -1);
while (it.hasNext()) {
final ExecutionGroupVertex groupVertex = it.next();
final InputSplit[] inputSplits = groupVertex.getInputSplits();
... | [
"public",
"void",
"unregisterJob",
"(",
"final",
"ExecutionGraph",
"executionGraph",
")",
"{",
"final",
"Iterator",
"<",
"ExecutionGroupVertex",
">",
"it",
"=",
"new",
"ExecutionGroupVertexIterator",
"(",
"executionGraph",
",",
"true",
",",
"-",
"1",
")",
";",
"... | Unregisters the given job represented by its {@link ExecutionGraph} with the input split manager.
@param executionGraph
the job to be unregistered | [
"Unregisters",
"the",
"given",
"job",
"represented",
"by",
"its",
"{",
"@link",
"ExecutionGraph",
"}",
"with",
"the",
"input",
"split",
"manager",
"."
] | c543a08f9676c5b2b0a7088123bd6e795a8ae0c8 | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/splitassigner/InputSplitManager.java#L133-L161 | train | Unregisters a job from the input split tracker. | Of course, here is the Java code you requested:
```java
public void unregisterJob(final ExecutionGraph executionGraph) {
final Iterator<ExecutionGroupVertex> it = new ExecutionGroupVertexIterator(executionGraph, true, -1);
while (it.hasNext()) {
final ExecutionGroupVertex groupVertex = it.next();
final Inp... |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseStatement | private Stmt parseStatement(EnclosingScope scope) {
checkNotEof();
Token lookahead = tokens.get(index);
// First, attempt to parse the easy statement forms.
switch (lookahead.kind) {
case Assert:
return parseAssertStatement(scope);
case Assume:
return parseAssumeStatement(scope);
case Break:
re... | java | private Stmt parseStatement(EnclosingScope scope) {
checkNotEof();
Token lookahead = tokens.get(index);
// First, attempt to parse the easy statement forms.
switch (lookahead.kind) {
case Assert:
return parseAssertStatement(scope);
case Assume:
return parseAssumeStatement(scope);
case Break:
re... | [
"private",
"Stmt",
"parseStatement",
"(",
"EnclosingScope",
"scope",
")",
"{",
"checkNotEof",
"(",
")",
";",
"Token",
"lookahead",
"=",
"tokens",
".",
"get",
"(",
"index",
")",
";",
"// First, attempt to parse the easy statement forms.",
"switch",
"(",
"lookahead",
... | Parse a given statement. There are essentially two forms of statement:
<code>simple</code> and <code>compound</code>. Simple statements (e.g.
assignment, <code>debug</code>, etc) are terminated by a
<code>NewLine</code> token, although they may span multiple lines if an
expression does. Compound statements (e.g. <code>... | [
"Parse",
"a",
"given",
"statement",
".",
"There",
"are",
"essentially",
"two",
"forms",
"of",
"statement",
":",
"<code",
">",
"simple<",
"/",
"code",
">",
"and",
"<code",
">",
"compound<",
"/",
"code",
">",
".",
"Simple",
"statements",
"(",
"e",
".",
"... | 680f8a657d3fc286f8cc422755988b6d74ab3f4c | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L698-L743 | train | Parse a statement. | Of course, here is the Java code you requested:
```java
private Stmt parseStatement(EnclosingScope scope) {
checkNotEof();
Token lookahead = tokens.get(index);
// First, attempt to parse the easy statement forms.
switch (lookahead.kind) {
case Assert:
return parseAssertStatement(scope);
case Assume:
... |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/dialect/oracle/OracleDdlParser.java | OracleDdlParser.handleUnknownToken | @Override
public AstNode handleUnknownToken( DdlTokenStream tokens,
String tokenValue ) throws ParsingException {
if (tokenValue.equals("/")) {
return nodeFactory().node("backslashTerminator", getRootNode(), TYPE_BACKSLASH_TERMINATOR);
}
re... | java | @Override
public AstNode handleUnknownToken( DdlTokenStream tokens,
String tokenValue ) throws ParsingException {
if (tokenValue.equals("/")) {
return nodeFactory().node("backslashTerminator", getRootNode(), TYPE_BACKSLASH_TERMINATOR);
}
re... | [
"@",
"Override",
"public",
"AstNode",
"handleUnknownToken",
"(",
"DdlTokenStream",
"tokens",
",",
"String",
"tokenValue",
")",
"throws",
"ParsingException",
"{",
"if",
"(",
"tokenValue",
".",
"equals",
"(",
"\"/\"",
")",
")",
"{",
"return",
"nodeFactory",
"(",
... | {@inheritDoc}
@see org.modeshape.sequencer.ddl.StandardDdlParser#handleUnknownToken(org.modeshape.sequencer.ddl.DdlTokenStream,
java.lang.String) | [
"{",
"@inheritDoc",
"}"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/dialect/oracle/OracleDdlParser.java#L378-L386 | train | Handle unknown tokens. | Of course, here is the Java code you requested:
```java
@Override
public AstNode handleUnknownToken( DdlTokenStream tokens,
String tokenValue ) throws ParsingException {
if (tokenValue.equals("/")) {
return nodeFactory().node("backslashTerminator", getRoot... |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/CmsMultiSelectBox.java | CmsMultiSelectBox.getTitle | protected String getTitle(String option, String defaultValue) {
if ((option != null) && m_titles.containsKey(option)) {
return m_titles.get(option);
}
return defaultValue;
} | java | protected String getTitle(String option, String defaultValue) {
if ((option != null) && m_titles.containsKey(option)) {
return m_titles.get(option);
}
return defaultValue;
} | [
"protected",
"String",
"getTitle",
"(",
"String",
"option",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"(",
"option",
"!=",
"null",
")",
"&&",
"m_titles",
".",
"containsKey",
"(",
"option",
")",
")",
"{",
"return",
"m_titles",
".",
"get",
"(",
... | Helper method to get the title for a given select option.<p>
@param option the select option value
@param defaultValue the value to return when no title for the value was found
@return the title for the select option | [
"Helper",
"method",
"to",
"get",
"the",
"title",
"for",
"a",
"given",
"select",
"option",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/CmsMultiSelectBox.java#L364-L370 | train | Get the title for the specified option. | Of course, here is the Java code you requested:
```java
protected String getTitle(String option, String defaultValue) {
if ((option != null) && m_titles.containsKey(option)) {
return m_titles.get(option);
}
return defaultValue;
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/TargetStreamSetControl.java | TargetStreamSetControl.dereferenceControllable | public void dereferenceControllable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "dereferenceControllable", tsm);
streamSet = null;
tsm = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "dereferenceCont... | java | public void dereferenceControllable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "dereferenceControllable", tsm);
streamSet = null;
tsm = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "dereferenceCont... | [
"public",
"void",
"dereferenceControllable",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"dereferenceControllable\"",
",",
"tsm",
... | /* (non-Javadoc)
@see com.ibm.ws.sib.processor.runtime.ControlAdapter#dereferenceControllable() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/TargetStreamSetControl.java#L322-L332 | train | Dereference the containing sequence from the target sequence. | Of course, here is the Java code you requested:
```java
public void dereferenceControllable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "dereferenceControllable", tsm);
streamSet = null;
tsm = null;
if (TraceComponent.isAnyTracingEnabled() && t... |
joniles/mpxj | src/main/java/net/sf/mpxj/sample/MpxjQuery.java | MpxjQuery.listCalendars | private static void listCalendars(ProjectFile file)
{
for (ProjectCalendar cal : file.getCalendars())
{
System.out.println(cal.toString());
}
} | java | private static void listCalendars(ProjectFile file)
{
for (ProjectCalendar cal : file.getCalendars())
{
System.out.println(cal.toString());
}
} | [
"private",
"static",
"void",
"listCalendars",
"(",
"ProjectFile",
"file",
")",
"{",
"for",
"(",
"ProjectCalendar",
"cal",
":",
"file",
".",
"getCalendars",
"(",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"cal",
".",
"toString",
"(",
")",
... | List details of all calendars in the file.
@param file ProjectFile instance | [
"List",
"details",
"of",
"all",
"calendars",
"in",
"the",
"file",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/sample/MpxjQuery.java#L480-L486 | train | List calendars from a project file. | Of course, here is the Java code you requested:
```java
private static void listCalendars(ProjectFile file)
{
for (ProjectCalendar cal : file.getCalendars())
{
System.out.println(cal.toString());
}
}
```
Hope this helps! |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java | JobExistingWorkspaceRestore.restoreWorkspace | @Override
protected void restoreWorkspace() throws WorkspaceRestoreException
{
try
{
// get current workspace configuration
WorkspaceEntry wEntry = null;;
for (WorkspaceEntry entry : repositoryService.getRepository(repositoryName).getConfiguration()
.getWorkspace... | java | @Override
protected void restoreWorkspace() throws WorkspaceRestoreException
{
try
{
// get current workspace configuration
WorkspaceEntry wEntry = null;;
for (WorkspaceEntry entry : repositoryService.getRepository(repositoryName).getConfiguration()
.getWorkspace... | [
"@",
"Override",
"protected",
"void",
"restoreWorkspace",
"(",
")",
"throws",
"WorkspaceRestoreException",
"{",
"try",
"{",
"// get current workspace configuration",
"WorkspaceEntry",
"wEntry",
"=",
"null",
";",
";",
"for",
"(",
"WorkspaceEntry",
"entry",
":",
"reposi... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceRestore.java#L63-L108 | train | Override method for workspace restore. | Of course, here is the Java code you requested:
```java
@Override
protected void restoreWorkspace() throws WorkspaceRestoreException
{
try
{
// get current workspace configuration
WorkspaceEntry wEntry = null;;
for (WorkspaceEntry entry : repositoryService.getRepository(rep... |
aws/aws-sdk-java | aws-java-sdk-codecommit/src/main/java/com/amazonaws/services/codecommit/model/BatchGetRepositoriesResult.java | BatchGetRepositoriesResult.setRepositoriesNotFound | public void setRepositoriesNotFound(java.util.Collection<String> repositoriesNotFound) {
if (repositoriesNotFound == null) {
this.repositoriesNotFound = null;
return;
}
this.repositoriesNotFound = new java.util.ArrayList<String>(repositoriesNotFound);
} | java | public void setRepositoriesNotFound(java.util.Collection<String> repositoriesNotFound) {
if (repositoriesNotFound == null) {
this.repositoriesNotFound = null;
return;
}
this.repositoriesNotFound = new java.util.ArrayList<String>(repositoriesNotFound);
} | [
"public",
"void",
"setRepositoriesNotFound",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"repositoriesNotFound",
")",
"{",
"if",
"(",
"repositoriesNotFound",
"==",
"null",
")",
"{",
"this",
".",
"repositoriesNotFound",
"=",
"null",
";",
"r... | <p>
Returns a list of repository names for which information could not be found.
</p>
@param repositoriesNotFound
Returns a list of repository names for which information could not be found. | [
"<p",
">",
"Returns",
"a",
"list",
"of",
"repository",
"names",
"for",
"which",
"information",
"could",
"not",
"be",
"found",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codecommit/src/main/java/com/amazonaws/services/codecommit/model/BatchGetRepositoriesResult.java#L133-L140 | train | Sets the value of the repositoriesNotFound property. | Of course, here is the Java code you requested:
```java
public void setRepositoriesNotFound(java.util.Collection<String> repositoriesNotFound) {
if (repositoriesNotFound == null) {
this.repositoriesNotFound = null;
return;
}
this.repositoriesNotFound = new java.util.Arr... |
Netflix/ribbon | ribbon-httpclient/src/main/java/com/netflix/http4/ssl/AcceptAllSocketFactory.java | AcceptAllSocketFactory.initWithNiwsConfig | @Override
public void initWithNiwsConfig(IClientConfig clientConfig) {
if (clientConfig == null) {
return;
}
if (clientConfig.getOrDefault(CommonClientConfigKey.TrustStore) != null) {
throw new IllegalArgumentException("Client configured with an AcceptAllSocketFactor... | java | @Override
public void initWithNiwsConfig(IClientConfig clientConfig) {
if (clientConfig == null) {
return;
}
if (clientConfig.getOrDefault(CommonClientConfigKey.TrustStore) != null) {
throw new IllegalArgumentException("Client configured with an AcceptAllSocketFactor... | [
"@",
"Override",
"public",
"void",
"initWithNiwsConfig",
"(",
"IClientConfig",
"clientConfig",
")",
"{",
"if",
"(",
"clientConfig",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"clientConfig",
".",
"getOrDefault",
"(",
"CommonClientConfigKey",
".",
"... | In the case of this factory the intent is to ensure that a truststore is not set,
as this does not make sense in the context of an accept-all policy | [
"In",
"the",
"case",
"of",
"this",
"factory",
"the",
"intent",
"is",
"to",
"ensure",
"that",
"a",
"truststore",
"is",
"not",
"set",
"as",
"this",
"does",
"not",
"make",
"sense",
"in",
"the",
"context",
"of",
"an",
"accept",
"-",
"all",
"policy"
] | d15cd7715b0bf2f64ae6ca98c5e4d184f178e261 | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-httpclient/src/main/java/com/netflix/http4/ssl/AcceptAllSocketFactory.java#L61-L70 | train | Override this method to initialize the AcceptAllSocketFactory with a client configuration. | Of course, here is the Java code you requested:
```java
@Override
public void initWithNiwsConfig(IClientConfig clientConfig) {
if (clientConfig == null) {
return;
}
if (clientConfig.getOrDefault(CommonClientConfigKey.TrustStore) != null) {
throw new IllegalArgumentE... |
Netflix/Nicobar | nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java | JBossModuleUtils.addPropertiesToSpec | public static void addPropertiesToSpec(ModuleSpec.Builder moduleSpecBuilder, Map<String, String> properties) {
for (Entry<String, String> entry : properties.entrySet()) {
moduleSpecBuilder.addProperty(entry.getKey(), entry.getValue());
}
} | java | public static void addPropertiesToSpec(ModuleSpec.Builder moduleSpecBuilder, Map<String, String> properties) {
for (Entry<String, String> entry : properties.entrySet()) {
moduleSpecBuilder.addProperty(entry.getKey(), entry.getValue());
}
} | [
"public",
"static",
"void",
"addPropertiesToSpec",
"(",
"ModuleSpec",
".",
"Builder",
"moduleSpecBuilder",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"propertie... | Add properties to the {@link ModuleSpec}
@param moduleSpecBuilder builder to populate
@param properties properties to add | [
"Add",
"properties",
"to",
"the",
"{",
"@link",
"ModuleSpec",
"}"
] | 507173dcae4a86a955afc3df222a855862fab8d7 | https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java#L261-L265 | train | Add properties to module spec. | Of course, here is the Java code you requested:
```java
public static void addPropertiesToSpec(ModuleSpec.Builder moduleSpecBuilder, Map<String, String> properties) {
for (Entry<String, String> entry : properties.entrySet()) {
moduleSpecBuilder.addProperty(entry.getKey(), entry.getValue());
... |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/PropertyImpl.java | PropertyImpl.dump | public String dump()
{
StringBuilder vals = new StringBuilder("Property ");
try
{
vals = new StringBuilder(getPath()).append(" values: ");
for (int i = 0; i < getValueArray().length; i++)
{
vals.append(ValueDataUtil.getString(((BaseValue)getValueArray()[i]).ge... | java | public String dump()
{
StringBuilder vals = new StringBuilder("Property ");
try
{
vals = new StringBuilder(getPath()).append(" values: ");
for (int i = 0; i < getValueArray().length; i++)
{
vals.append(ValueDataUtil.getString(((BaseValue)getValueArray()[i]).ge... | [
"public",
"String",
"dump",
"(",
")",
"{",
"StringBuilder",
"vals",
"=",
"new",
"StringBuilder",
"(",
"\"Property \"",
")",
";",
"try",
"{",
"vals",
"=",
"new",
"StringBuilder",
"(",
"getPath",
"(",
")",
")",
".",
"append",
"(",
"\" values: \"",
")",
";"... | Get info about property values.
@return string with property values | [
"Get",
"info",
"about",
"property",
"values",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/PropertyImpl.java#L571-L587 | train | Dump the value array of the property. | Of course, here is the Java code you requested:
```java
public String dump()
{
StringBuilder vals = new StringBuilder("Property ");
try
{
vals = new StringBuilder(getPath()).append(" values: ");
for (int i = 0; i < getValueArray().length; i++)
{
vals.append(V... |
glyptodon/guacamole-client | guacamole-common/src/main/java/org/apache/guacamole/protocol/FailoverGuacamoleSocket.java | FailoverGuacamoleSocket.handleUpstreamErrors | private static void handleUpstreamErrors(GuacamoleInstruction instruction)
throws GuacamoleUpstreamException {
// Ignore error instructions which are missing the status code
List<String> args = instruction.getArgs();
if (args.size() < 2) {
logger.debug("Received \"error\... | java | private static void handleUpstreamErrors(GuacamoleInstruction instruction)
throws GuacamoleUpstreamException {
// Ignore error instructions which are missing the status code
List<String> args = instruction.getArgs();
if (args.size() < 2) {
logger.debug("Received \"error\... | [
"private",
"static",
"void",
"handleUpstreamErrors",
"(",
"GuacamoleInstruction",
"instruction",
")",
"throws",
"GuacamoleUpstreamException",
"{",
"// Ignore error instructions which are missing the status code",
"List",
"<",
"String",
">",
"args",
"=",
"instruction",
".",
"g... | Parses the given "error" instruction, throwing an exception if the
instruction represents an error from the upstream remote desktop.
@param instruction
The "error" instruction to parse.
@throws GuacamoleUpstreamException
If the "error" instruction represents an error from the upstream
remote desktop. | [
"Parses",
"the",
"given",
"error",
"instruction",
"throwing",
"an",
"exception",
"if",
"the",
"instruction",
"represents",
"an",
"error",
"from",
"the",
"upstream",
"remote",
"desktop",
"."
] | ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9 | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole-common/src/main/java/org/apache/guacamole/protocol/FailoverGuacamoleSocket.java#L80-L128 | train | Handles the error instruction of the type CRUD_IDENTITY_EXCEPTION and CRUD_IDENTITY_EXCEPTION_EXCEPTION exceptions. | Of course, here is the Java code you requested:
```java
private static void handleUpstreamErrors(GuacamoleInstruction instruction)
throws GuacamoleUpstreamException {
// Ignore error instructions which are missing the status code
List<String> args = instruction.getArgs();
if (args.... |
lukas-krecan/future-converter | spring-rxjava2/src/main/java/net/javacrumbs/futureconverter/springrx2/FutureConverter.java | FutureConverter.toListenableFuture | public static <T> ListenableFuture<T> toListenableFuture(Single<T> single) {
return SpringFutureUtils.createListenableFuture(RxJava2FutureUtils.createValueSource(single));
} | java | public static <T> ListenableFuture<T> toListenableFuture(Single<T> single) {
return SpringFutureUtils.createListenableFuture(RxJava2FutureUtils.createValueSource(single));
} | [
"public",
"static",
"<",
"T",
">",
"ListenableFuture",
"<",
"T",
">",
"toListenableFuture",
"(",
"Single",
"<",
"T",
">",
"single",
")",
"{",
"return",
"SpringFutureUtils",
".",
"createListenableFuture",
"(",
"RxJava2FutureUtils",
".",
"createValueSource",
"(",
... | Converts {@link io.reactivex.Single} to {@link ListenableFuture}. | [
"Converts",
"{"
] | 652b845824de90b075cf5ddbbda6fdf440f3ed0a | https://github.com/lukas-krecan/future-converter/blob/652b845824de90b075cf5ddbbda6fdf440f3ed0a/spring-rxjava2/src/main/java/net/javacrumbs/futureconverter/springrx2/FutureConverter.java#L36-L38 | train | Creates a listenable future that will be completed with the given single value. | Of course, here is the Java code you requested:
```java
public static <T> ListenableFuture<T> toListenableFuture(Single<T> single) {
return SpringFutureUtils.createListenableFuture(RxJava2FutureUtils.createValueSource(single));
}
```
Hope this helps! |
dmfs/http-client-interfaces | src/org/dmfs/httpclientinterfaces/requestutils/ByteArrayOutputStream.java | ByteArrayOutputStream.trim | public void trim()
{
List<byte[]> chunkList = mChunkList;
while (chunkList.size() - 1 > mCurrentChunkIndex)
{
chunkList.remove(chunkList.size() - 1);
}
} | java | public void trim()
{
List<byte[]> chunkList = mChunkList;
while (chunkList.size() - 1 > mCurrentChunkIndex)
{
chunkList.remove(chunkList.size() - 1);
}
} | [
"public",
"void",
"trim",
"(",
")",
"{",
"List",
"<",
"byte",
"[",
"]",
">",
"chunkList",
"=",
"mChunkList",
";",
"while",
"(",
"chunkList",
".",
"size",
"(",
")",
"-",
"1",
">",
"mCurrentChunkIndex",
")",
"{",
"chunkList",
".",
"remove",
"(",
"chunk... | Reduce the memory allocated by this object by freeing all unused chunks. | [
"Reduce",
"the",
"memory",
"allocated",
"by",
"this",
"object",
"by",
"freeing",
"all",
"unused",
"chunks",
"."
] | 10896c71270ccaf32ac4ed5d706dfa0001fd3862 | https://github.com/dmfs/http-client-interfaces/blob/10896c71270ccaf32ac4ed5d706dfa0001fd3862/src/org/dmfs/httpclientinterfaces/requestutils/ByteArrayOutputStream.java#L236-L243 | train | Removes all trailing chunks from the list. | Of course, here is the Java code you requested:
```java
public void trim()
{
List<byte[]> chunkList = mChunkList;
while (chunkList.size() - 1 > mCurrentChunkIndex)
{
chunkList.remove(chunkList.size() - 1);
}
}
```
Hope this helps! |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java | NumeratorSubstitution.doParse | public Number doParse(String text, ParsePosition parsePosition, double baseValue,
double upperBound, boolean lenientParse) {
// we don't have to do anything special to do the parsing here,
// but we have to turn lenient parsing off-- if we leave it on,
// it SERIOUSLY mes... | java | public Number doParse(String text, ParsePosition parsePosition, double baseValue,
double upperBound, boolean lenientParse) {
// we don't have to do anything special to do the parsing here,
// but we have to turn lenient parsing off-- if we leave it on,
// it SERIOUSLY mes... | [
"public",
"Number",
"doParse",
"(",
"String",
"text",
",",
"ParsePosition",
"parsePosition",
",",
"double",
"baseValue",
",",
"double",
"upperBound",
",",
"boolean",
"lenientParse",
")",
"{",
"// we don't have to do anything special to do the parsing here,",
"// but we have... | Dispatches to the inherited version of this function, but makes
sure that lenientParse is off. | [
"Dispatches",
"to",
"the",
"inherited",
"version",
"of",
"this",
"function",
"but",
"makes",
"sure",
"that",
"lenientParse",
"is",
"off",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java#L1559-L1618 | train | This method is called to parse a number from a String. | Of course, here is the Java code you requested:
```java
public Number doParse(String text, ParsePosition parsePosition, double baseValue,
double upperBound, boolean lenientParse) {
// we don't have to do anything special to do the parsing here,
// but we have to turn lenient par... |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/transform/SourceTableFeatureDetailsMarshaller.java | SourceTableFeatureDetailsMarshaller.marshall | public void marshall(SourceTableFeatureDetails sourceTableFeatureDetails, ProtocolMarshaller protocolMarshaller) {
if (sourceTableFeatureDetails == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(sour... | java | public void marshall(SourceTableFeatureDetails sourceTableFeatureDetails, ProtocolMarshaller protocolMarshaller) {
if (sourceTableFeatureDetails == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(sour... | [
"public",
"void",
"marshall",
"(",
"SourceTableFeatureDetails",
"sourceTableFeatureDetails",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"sourceTableFeatureDetails",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid ar... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/transform/SourceTableFeatureDetailsMarshaller.java#L51-L66 | train | marshalls the given SourceTableFeatureDetails object to the JSON file. | Of course, here is the Java code you requested:
```java
public void marshall(SourceTableFeatureDetails sourceTableFeatureDetails, ProtocolMarshaller protocolMarshaller) {
if (sourceTableFeatureDetails == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
... |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/validation/beanvalidation/CsvBeanValidator.java | CsvBeanValidator.isCsvField | private boolean isCsvField(final String field, final ValidationContext<Object> validationContext) {
return validationContext.getBeanMapping().getColumnMapping(field).isPresent();
} | java | private boolean isCsvField(final String field, final ValidationContext<Object> validationContext) {
return validationContext.getBeanMapping().getColumnMapping(field).isPresent();
} | [
"private",
"boolean",
"isCsvField",
"(",
"final",
"String",
"field",
",",
"final",
"ValidationContext",
"<",
"Object",
">",
"validationContext",
")",
"{",
"return",
"validationContext",
".",
"getBeanMapping",
"(",
")",
".",
"getColumnMapping",
"(",
"field",
")",
... | CSVのカラムのフィールドか判定する。
@param field フィールド名
@param validationContext CSVの検証情報
@return trueのとき、CSVのカラムフィールド。 | [
"CSVのカラムのフィールドか判定する。"
] | 9910320cb6dc143be972c7d10d9ab5ffb09c3b84 | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/validation/beanvalidation/CsvBeanValidator.java#L209-L211 | train | Is csv field. | Of course, here is the Java code you requested:
```java
private boolean isCsvField(final String field, final ValidationContext<Object> validationContext) {
return validationContext.getBeanMapping().getColumnMapping(field).isPresent();
}
```
Hope this helps! |
cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/MDLV2000Writer.java | MDLV2000Writer.writeMolecule | public void writeMolecule(IAtomContainer container) throws Exception {
final int dim = getNumberOfDimensions(container);
StringBuilder line = new StringBuilder();
Map<Integer, Integer> rgroups = null;
Map<Integer, String> aliases = null;
// write header block
// lines ge... | java | public void writeMolecule(IAtomContainer container) throws Exception {
final int dim = getNumberOfDimensions(container);
StringBuilder line = new StringBuilder();
Map<Integer, Integer> rgroups = null;
Map<Integer, String> aliases = null;
// write header block
// lines ge... | [
"public",
"void",
"writeMolecule",
"(",
"IAtomContainer",
"container",
")",
"throws",
"Exception",
"{",
"final",
"int",
"dim",
"=",
"getNumberOfDimensions",
"(",
"container",
")",
";",
"StringBuilder",
"line",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Map",
... | Writes a Molecule to an OutputStream in MDL sdf format.
@param container Molecule that is written to an OutputStream | [
"Writes",
"a",
"Molecule",
"to",
"an",
"OutputStream",
"in",
"MDL",
"sdf",
"format",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLV2000Writer.java#L360-L771 | train | Write a molecule to the output stream. | Of course, here is the Java code you requested:
```java
public void writeMolecule(IAtomContainer container) throws Exception {
final int dim = getNumberOfDimensions(container);
StringBuilder line = new StringBuilder();
Map<Integer, Integer> rgroups = null;
Map<Integer, String> aliases ... |
l0rdn1kk0n/wicket-jquery-selectors | src/main/java/de/agilecoders/wicket/jquery/util/Generics2.java | Generics2.split | public static List<String> split(final CharSequence value, final String separator) {
return newArrayList(Splitter.on(separator).omitEmptyStrings().trimResults().split(value));
} | java | public static List<String> split(final CharSequence value, final String separator) {
return newArrayList(Splitter.on(separator).omitEmptyStrings().trimResults().split(value));
} | [
"public",
"static",
"List",
"<",
"String",
">",
"split",
"(",
"final",
"CharSequence",
"value",
",",
"final",
"String",
"separator",
")",
"{",
"return",
"newArrayList",
"(",
"Splitter",
".",
"on",
"(",
"separator",
")",
".",
"omitEmptyStrings",
"(",
")",
"... | splits a {@link CharSequence} by given separator.
@param value the value to split
@param separator the separator to use to split value
@return list of values | [
"splits",
"a",
"{",
"@link",
"CharSequence",
"}",
"by",
"given",
"separator",
"."
] | a606263f7821d0b5f337c9e65f8caa466ad398ad | https://github.com/l0rdn1kk0n/wicket-jquery-selectors/blob/a606263f7821d0b5f337c9e65f8caa466ad398ad/src/main/java/de/agilecoders/wicket/jquery/util/Generics2.java#L146-L148 | train | Split a string into a list of strings. | Of course, here is the Java code you requested:
```java
public static List<String> split(final CharSequence value, final String separator) {
return newArrayList(Splitter.on(separator).omitEmptyStrings().trimResults().split(value));
}
```
Hope this helps! |
RestComm/jss7 | scheduler/src/main/java/org/restcomm/protocols/ss7/scheduler/Scheduler.java | Scheduler.start | public void start() {
if (this.isActive)
return;
if (clock == null) {
throw new IllegalStateException("Clock is not set");
}
this.isActive = true;
logger.info("Starting ");
cpuThread.activate();
logger.info("Started ");
} | java | public void start() {
if (this.isActive)
return;
if (clock == null) {
throw new IllegalStateException("Clock is not set");
}
this.isActive = true;
logger.info("Starting ");
cpuThread.activate();
logger.info("Started ");
} | [
"public",
"void",
"start",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isActive",
")",
"return",
";",
"if",
"(",
"clock",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Clock is not set\"",
")",
";",
"}",
"this",
".",
"isActive",
... | Starts scheduler. | [
"Starts",
"scheduler",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/scheduler/src/main/java/org/restcomm/protocols/ss7/scheduler/Scheduler.java#L144-L159 | train | Start the thread. | Of course, here is the Java code you requested:
```java
public void start() {
if (this.isActive)
return;
if (clock == null) {
throw new IllegalStateException("Clock is not set");
}
this.isActive = true;
logger.info("Starting ");
cpuThread.acti... |
ecclesia/kipeto | kipeto/src/main/java/de/ecclesia/kipeto/RepositoryResolver.java | RepositoryResolver.resolveReposUrl | public String resolveReposUrl() throws IOException {
// Zur Zeit nur für HTTP implementiert.
try {
URL url;
// TODO: Schön machen
try {
url = new URL(defaultRepositoryUrl);
} catch (MalformedURLException e) {
url = new File(defaultRepositoryUrl).toURI().toURL();
}
if (!url.getProtocol().e... | java | public String resolveReposUrl() throws IOException {
// Zur Zeit nur für HTTP implementiert.
try {
URL url;
// TODO: Schön machen
try {
url = new URL(defaultRepositoryUrl);
} catch (MalformedURLException e) {
url = new File(defaultRepositoryUrl).toURI().toURL();
}
if (!url.getProtocol().e... | [
"public",
"String",
"resolveReposUrl",
"(",
")",
"throws",
"IOException",
"{",
"// Zur Zeit nur für HTTP implementiert.",
"try",
"{",
"URL",
"url",
";",
"// TODO: Schön machen",
"try",
"{",
"url",
"=",
"new",
"URL",
"(",
"defaultRepositoryUrl",
")",
";",
"}",
"cat... | Versucht, im übergebenen Repository die Konfigurations-Datei zu finden
und daraus ein passendes Repository abzuleiten. Schlägt dies fehlt oder
tritt ein Fehler auf, wird dieser Fehler gelogt, und das übergebene
Repository zurückgegeben.
@return
@throws IOException | [
"Versucht",
"im",
"übergebenen",
"Repository",
"die",
"Konfigurations",
"-",
"Datei",
"zu",
"finden",
"und",
"daraus",
"ein",
"passendes",
"Repository",
"abzuleiten",
".",
"Schlägt",
"dies",
"fehlt",
"oder",
"tritt",
"ein",
"Fehler",
"auf",
"wird",
"dieser",
"Fe... | ea39a10ae4eaa550f71a856ab2f2845270a64913 | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto/src/main/java/de/ecclesia/kipeto/RepositoryResolver.java#L69-L99 | train | Resolves the repository URL. | Of course, here is the Java code you requested:
```java
public String resolveReposUrl() throws IOException {
// Zur Zeit nur für HTTP implementiert.
try {
URL url;
// TODO: Schön machen
try {
url = new URL(defaultRepositoryUrl);
} catch (MalformedURLException e) {
url = new File(defaultReposit... |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/CloseableIterator.java | CloseableIterator.wrap | public static <T> CloseableIterator<T> wrap(CloseableIterator<T> iterator, AutoCloseable... otherCloseables) {
return new CloseablesIteratorWrapper<>(iterator, otherCloseables);
} | java | public static <T> CloseableIterator<T> wrap(CloseableIterator<T> iterator, AutoCloseable... otherCloseables) {
return new CloseablesIteratorWrapper<>(iterator, otherCloseables);
} | [
"public",
"static",
"<",
"T",
">",
"CloseableIterator",
"<",
"T",
">",
"wrap",
"(",
"CloseableIterator",
"<",
"T",
">",
"iterator",
",",
"AutoCloseable",
"...",
"otherCloseables",
")",
"{",
"return",
"new",
"CloseablesIteratorWrapper",
"<>",
"(",
"iterator",
"... | Wraps a {@code CloseableIterator} and optionally other instances of {@code AutoCloseable} that must be closed
at the same time. The wrapped iterator is closed first then the other {@code AutoCloseable} in the defined order.
@throws IllegalArgumentException if the parameter {@code otherCloseables} contains the wrapped ... | [
"Wraps",
"a",
"{",
"@code",
"CloseableIterator",
"}",
"and",
"optionally",
"other",
"instances",
"of",
"{",
"@code",
"AutoCloseable",
"}",
"that",
"must",
"be",
"closed",
"at",
"the",
"same",
"time",
".",
"The",
"wrapped",
"iterator",
"is",
"closed",
"first"... | 2fffa4c2f79ae3714844d7742796e82822b6a98a | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/CloseableIterator.java#L77-L79 | train | Wrap the given iterator with the given other closeables. | Of course, here is the Java code you requested:
```java
public static <T> CloseableIterator<T> wrap(CloseableIterator<T> iterator, AutoCloseable... otherCloseables) {
return new CloseablesIteratorWrapper<>(iterator, otherCloseables);
}
```
Hope this helps! |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingPushbackReader.java | NonBlockingPushbackReader.skip | @Override
public long skip (final long nSkip) throws IOException
{
ValueEnforcer.isGE0 (nSkip, "SkipValue");
_ensureOpen ();
if (nSkip == 0)
return 0L;
long nRealSkip = nSkip;
final int nBufAvail = m_aBuf.length - m_nBufPos;
if (nBufAvail > 0)
{
if (nRealSkip <= nBufAvail)... | java | @Override
public long skip (final long nSkip) throws IOException
{
ValueEnforcer.isGE0 (nSkip, "SkipValue");
_ensureOpen ();
if (nSkip == 0)
return 0L;
long nRealSkip = nSkip;
final int nBufAvail = m_aBuf.length - m_nBufPos;
if (nBufAvail > 0)
{
if (nRealSkip <= nBufAvail)... | [
"@",
"Override",
"public",
"long",
"skip",
"(",
"final",
"long",
"nSkip",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nSkip",
",",
"\"SkipValue\"",
")",
";",
"_ensureOpen",
"(",
")",
";",
"if",
"(",
"nSkip",
"==",
"0",
")",
... | Skips characters. This method will block until some characters are
available, an I/O error occurs, or the end of the stream is reached.
@param nSkip
The number of characters to skip. Must be ≥ 0.
@return The number of characters actually skipped
@exception IllegalArgumentException
If <code>n</code> is negative.
@ex... | [
"Skips",
"characters",
".",
"This",
"method",
"will",
"block",
"until",
"some",
"characters",
"are",
"available",
"an",
"I",
"/",
"O",
"error",
"occurs",
"or",
"the",
"end",
"of",
"the",
"stream",
"is",
"reached",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingPushbackReader.java#L308-L331 | train | Skip the next N bytes of the record. | Of course, here is the Java code you requested:
```java
@Override
public long skip (final long nSkip) throws IOException
{
ValueEnforcer.isGE0 (nSkip, "SkipValue");
_ensureOpen ();
if (nSkip == 0)
return 0L;
long nRealSkip = nSkip;
final int nBufAvail = m_aBuf.length - m_nBufPos;
i... |
Unidata/thredds | opendap/src/main/java/opendap/dap/Int16PrimitiveVector.java | Int16PrimitiveVector.externalize | public void externalize(DataOutputStream sink, int start, int stop, int stride) throws IOException {
for (int i = start; i <= stop; i += stride)
sink.writeInt((int) vals[i]);
}
/**
* Returns (a reference to) the internal storage for this PrimitiveVector
* object.
* <h... | java | public void externalize(DataOutputStream sink, int start, int stop, int stride) throws IOException {
for (int i = start; i <= stop; i += stride)
sink.writeInt((int) vals[i]);
}
/**
* Returns (a reference to) the internal storage for this PrimitiveVector
* object.
* <h... | [
"public",
"void",
"externalize",
"(",
"DataOutputStream",
"sink",
",",
"int",
"start",
",",
"int",
"stop",
",",
"int",
"stride",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<=",
"stop",
";",
"i",
"+=",
"stride",
... | Write a subset of the data to a <code>DataOutputStream</code>.
@param sink a <code>DataOutputStream</code> to write to.
@param start starting index (i=start)
@param stop ending index (i<=stop)
@param stride index stride (i+=stride)
@throws IOException thrown on any <code>OutputStream</code> exception. | [
"Write",
"a",
"subset",
"of",
"the",
"data",
"to",
"a",
"<code",
">",
"DataOutputStream<",
"/",
"code",
">",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/Int16PrimitiveVector.java#L200-L292 | test | Externalize the data. | Of course, here is the Java code you requested:
```java
public void externalize(DataOutputStream sink, int start, int stop, int stride) throws IOException {
for (int i = start; i <= stop; i += stride)
sink.writeInt((int) vals[i]);
}
/**
* Returns (a reference to) the internal st... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java | AtomicIntegerFieldUpdater.addAndGet | public int addAndGet(T obj, int delta) {
int prev, next;
do {
prev = get(obj);
next = prev + delta;
} while (!compareAndSet(obj, prev, next));
return next;
} | java | public int addAndGet(T obj, int delta) {
int prev, next;
do {
prev = get(obj);
next = prev + delta;
} while (!compareAndSet(obj, prev, next));
return next;
} | [
"public",
"int",
"addAndGet",
"(",
"T",
"obj",
",",
"int",
"delta",
")",
"{",
"int",
"prev",
",",
"next",
";",
"do",
"{",
"prev",
"=",
"get",
"(",
"obj",
")",
";",
"next",
"=",
"prev",
"+",
"delta",
";",
"}",
"while",
"(",
"!",
"compareAndSet",
... | Atomically adds the given value to the current value of the field of
the given object managed by this updater.
@param obj An object whose field to get and set
@param delta the value to add
@return the updated value | [
"Atomically",
"adds",
"the",
"given",
"value",
"to",
"the",
"current",
"value",
"of",
"the",
"field",
"of",
"the",
"given",
"object",
"managed",
"by",
"this",
"updater",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java#L265-L272 | train | Add delta to an object and return the new value. | Of course, here is the Java code you requested:
```java
public int addAndGet(T obj, int delta) {
int prev, next;
do {
prev = get(obj);
next = prev + delta;
} while (!compareAndSet(obj, prev, next));
return next;
}
```
Hope this helps! |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java | AiMesh.getTexCoordBuffer | public FloatBuffer getTexCoordBuffer(int coords) {
if (m_texcoords[coords] == null) {
return null;
}
return m_texcoords[coords].asFloatBuffer();
} | java | public FloatBuffer getTexCoordBuffer(int coords) {
if (m_texcoords[coords] == null) {
return null;
}
return m_texcoords[coords].asFloatBuffer();
} | [
"public",
"FloatBuffer",
"getTexCoordBuffer",
"(",
"int",
"coords",
")",
"{",
"if",
"(",
"m_texcoords",
"[",
"coords",
"]",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"m_texcoords",
"[",
"coords",
"]",
".",
"asFloatBuffer",
"(",
")",
"... | Returns a buffer containing coordinates for a texture coordinate set.<p>
A texture coordinate consists of up to 3 floats (u, v, w). The actual
number can be queried via {@link #getNumUVComponents(int)}. The
buffer will contain
<code>getNumUVComponents(coords) * getNumVertices()</code> floats
@param coords the texture... | [
"Returns",
"a",
"buffer",
"containing",
"coordinates",
"for",
"a",
"texture",
"coordinate",
"set",
".",
"<p",
">"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java#L611-L617 | train | Get the texture coordinates as a FloatBuffer. | Of course, here is the Java code you requested:
```java
public FloatBuffer getTexCoordBuffer(int coords) {
if (m_texcoords[coords] == null) {
return null;
}
return m_texcoords[coords].asFloatBuffer();
}
```
Hope this helps! |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java | JSONHelpers.merge | public static JSONArray merge(final JSONArray src,
final UnmodifiableJSONArray dest) {
return merge(src, copy(dest));
} | java | public static JSONArray merge(final JSONArray src,
final UnmodifiableJSONArray dest) {
return merge(src, copy(dest));
} | [
"public",
"static",
"JSONArray",
"merge",
"(",
"final",
"JSONArray",
"src",
",",
"final",
"UnmodifiableJSONArray",
"dest",
")",
"{",
"return",
"merge",
"(",
"src",
",",
"copy",
"(",
"dest",
")",
")",
";",
"}"
] | Merges values from {@code src} into a copy of {@code dest}.
See {@link #merge(JSONArray, JSONArray)}.
@param src {@code JSONArray} to merge from
@param dest {@code JSONArray} to merge to
@return The modified {@code dest} array. | [
"Merges",
"values",
"from",
"{",
"@code",
"src",
"}",
"into",
"a",
"copy",
"of",
"{",
"@code",
"dest",
"}",
".",
"See",
"{",
"@link",
"#merge",
"(",
"JSONArray",
"JSONArray",
")",
"}",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L1444-L1447 | train | Merge two JSONArray objects. | Of course, here is the Java code you requested:
```java
public static JSONArray merge(final JSONArray src,
final UnmodifiableJSONArray dest) {
return merge(src, copy(dest));
}
```
Hope this helps! |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/log/RaftLog.java | RaftLog.appendEntries | public void appendEntries(LogEntry... newEntries) {
int lastTerm = lastLogOrSnapshotTerm();
long lastIndex = lastLogOrSnapshotIndex();
if (!checkAvailableCapacity(newEntries.length)) {
throw new IllegalStateException("Not enough capacity! Capacity: " + logs.getCapacity()
... | java | public void appendEntries(LogEntry... newEntries) {
int lastTerm = lastLogOrSnapshotTerm();
long lastIndex = lastLogOrSnapshotIndex();
if (!checkAvailableCapacity(newEntries.length)) {
throw new IllegalStateException("Not enough capacity! Capacity: " + logs.getCapacity()
... | [
"public",
"void",
"appendEntries",
"(",
"LogEntry",
"...",
"newEntries",
")",
"{",
"int",
"lastTerm",
"=",
"lastLogOrSnapshotTerm",
"(",
")",
";",
"long",
"lastIndex",
"=",
"lastLogOrSnapshotIndex",
"(",
")",
";",
"if",
"(",
"!",
"checkAvailableCapacity",
"(",
... | Appends new entries to the Raft log.
@throws IllegalArgumentException If an entry is appended with a lower
term than the last term in the log or
if an entry is appended with an index
not equal to
{@code index == lastIndex + 1}. | [
"Appends",
"new",
"entries",
"to",
"the",
"Raft",
"log",
"."
] | 8c4bc10515dbbfb41a33e0302c0caedf3cda1baf | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/log/RaftLog.java#L172-L194 | train | Append the new log entries to the log. | Of course, here is the Java code you requested:
```java
public void appendEntries(LogEntry... newEntries) {
int lastTerm = lastLogOrSnapshotTerm();
long lastIndex = lastLogOrSnapshotIndex();
if (!checkAvailableCapacity(newEntries.length)) {
throw new IllegalStateException("Not enou... |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginGenerateVpnProfileAsync | public Observable<String> beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1<ServiceResponse<String>, String>() {... | java | public Observable<String> beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1<ServiceResponse<String>, String>() {... | [
"public",
"Observable",
"<",
"String",
">",
"beginGenerateVpnProfileAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VpnClientParameters",
"parameters",
")",
"{",
"return",
"beginGenerateVpnProfileWithServiceResponseAsync",
"(",
"r... | Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied t... | [
"Generates",
"VPN",
"profile",
"for",
"P2S",
"client",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
".",
"Used",
"for",
"IKEV2",
"and",
"radius",
"based",
"authentication",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1734-L1741 | train | Generate VPN profile. | Of course, here is the Java code you requested:
```java
public Observable<String> beginGenerateVpnProfileAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, param... |
greenjoe/lambdaFromString | src/main/java/pl/joegreen/lambdaFromString/LambdaFactory.java | LambdaFactory.get | public static LambdaFactory get(LambdaFactoryConfiguration configuration) {
JavaCompiler compiler = Optional.ofNullable(configuration.getJavaCompiler()).orElseThrow(JavaCompilerNotFoundException::new);
return new LambdaFactory(
configuration.getDefaultHelperClassSourceProvider(),
... | java | public static LambdaFactory get(LambdaFactoryConfiguration configuration) {
JavaCompiler compiler = Optional.ofNullable(configuration.getJavaCompiler()).orElseThrow(JavaCompilerNotFoundException::new);
return new LambdaFactory(
configuration.getDefaultHelperClassSourceProvider(),
... | [
"public",
"static",
"LambdaFactory",
"get",
"(",
"LambdaFactoryConfiguration",
"configuration",
")",
"{",
"JavaCompiler",
"compiler",
"=",
"Optional",
".",
"ofNullable",
"(",
"configuration",
".",
"getJavaCompiler",
"(",
")",
")",
".",
"orElseThrow",
"(",
"JavaCompi... | Returns a LambdaFactory instance with the given configuration.
@throws JavaCompilerNotFoundException if the library cannot find any java compiler and it's not provided
in the configuration | [
"Returns",
"a",
"LambdaFactory",
"instance",
"with",
"the",
"given",
"configuration",
"."
] | 67d383f3922ab066e908b852a531880772bbdf29 | https://github.com/greenjoe/lambdaFromString/blob/67d383f3922ab066e908b852a531880772bbdf29/src/main/java/pl/joegreen/lambdaFromString/LambdaFactory.java#L27-L37 | train | Creates a LambdaFactory instance from the given configuration. | Of course, here is the Java code you requested:
```java
public static LambdaFactory get(LambdaFactoryConfiguration configuration) {
JavaCompiler compiler = Optional.ofNullable(configuration.getJavaCompiler()).orElseThrow(JavaCompilerNotFoundException::new);
return new LambdaFactory(
con... |
att/AAF | cadi/core/src/main/java/com/att/cadi/Symm.java | Symm.encode | public void encode(InputStream is, OutputStream os) throws IOException {
// StringBuilder sb = new StringBuilder((int)(estimate*1.255)); // try to get the right size of StringBuilder from start.. slightly more than 1.25 times
int prev=0;
int read, idx=0, line=0;
boolean go;
do {
read = i... | java | public void encode(InputStream is, OutputStream os) throws IOException {
// StringBuilder sb = new StringBuilder((int)(estimate*1.255)); // try to get the right size of StringBuilder from start.. slightly more than 1.25 times
int prev=0;
int read, idx=0, line=0;
boolean go;
do {
read = i... | [
"public",
"void",
"encode",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"// StringBuilder sb = new StringBuilder((int)(estimate*1.255)); // try to get the right size of StringBuilder from start.. slightly more than 1.25 times ",
"int",
"prev"... | encode InputStream onto Output Stream
@param is
@param estimate
@return
@throws IOException | [
"encode",
"InputStream",
"onto",
"Output",
"Stream"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/Symm.java#L303-L353 | train | Encode the input stream using the standard Java encoding. | Of course, here is the Java code you requested:
```java
public void encode(InputStream is, OutputStream os) throws IOException {
// StringBuilder sb = new StringBuilder((int)(estimate*1.255)); // try to get the right size of StringBuilder from start.. slightly more than 1.25 times
int prev=0;
int read,... |
RestComm/sip-servlets | containers/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipNamingContextListener.java | SipNamingContextListener.removeSipSessionsUtil | public static void removeSipSessionsUtil(Context envCtx, String appName, SipSessionsUtil sipSessionsUtil) {
if(envCtx != null) {
try {
javax.naming.Context sipContext = (javax.naming.Context)envCtx.lookup(SIP_SUBCONTEXT + "/" + appName);
sipContext.unbind(SIP_SESSIONS_UTIL_JNDI_NAME);
} catch (Nami... | java | public static void removeSipSessionsUtil(Context envCtx, String appName, SipSessionsUtil sipSessionsUtil) {
if(envCtx != null) {
try {
javax.naming.Context sipContext = (javax.naming.Context)envCtx.lookup(SIP_SUBCONTEXT + "/" + appName);
sipContext.unbind(SIP_SESSIONS_UTIL_JNDI_NAME);
} catch (Nami... | [
"public",
"static",
"void",
"removeSipSessionsUtil",
"(",
"Context",
"envCtx",
",",
"String",
"appName",
",",
"SipSessionsUtil",
"sipSessionsUtil",
")",
"{",
"if",
"(",
"envCtx",
"!=",
"null",
")",
"{",
"try",
"{",
"javax",
".",
"naming",
".",
"Context",
"si... | Removes the sip sessions util binding from the jndi mapping
@param appName the application name subcontext
@param sipSessionsUtil the sip sessions util to remove | [
"Removes",
"the",
"sip",
"sessions",
"util",
"binding",
"from",
"the",
"jndi",
"mapping"
] | fd7011d2803ab1d205b140768a760c8c69e0c997 | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/containers/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipNamingContextListener.java#L229-L238 | train | Remove the SipSessionsUtil from the specified application. | Of course, here is the Java code you requested:
```java
public static void removeSipSessionsUtil(Context envCtx, String appName, SipSessionsUtil sipSessionsUtil) {
if(envCtx != null) {
try {
javax.naming.Context sipContext = (javax.naming.Context)envCtx.lookup(SIP_SUBCONTEXT + "/" + appName);
sipConte... |
markzhai/AndroidPerformanceMonitor | blockcanary-android/src/main/java/com/github/moduth/blockcanary/ui/BlockCanaryUtils.java | BlockCanaryUtils.concernStackString | public static String concernStackString(BlockInfo blockInfo) {
String result = "";
for (String stackEntry : blockInfo.threadStackEntries) {
if (Character.isLetter(stackEntry.charAt(0))) {
String[] lines = stackEntry.split(BlockInfo.SEPARATOR);
for (String line... | java | public static String concernStackString(BlockInfo blockInfo) {
String result = "";
for (String stackEntry : blockInfo.threadStackEntries) {
if (Character.isLetter(stackEntry.charAt(0))) {
String[] lines = stackEntry.split(BlockInfo.SEPARATOR);
for (String line... | [
"public",
"static",
"String",
"concernStackString",
"(",
"BlockInfo",
"blockInfo",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"for",
"(",
"String",
"stackEntry",
":",
"blockInfo",
".",
"threadStackEntries",
")",
"{",
"if",
"(",
"Character",
".",
"isLetter... | Get key stack string to show as title in ui list. | [
"Get",
"key",
"stack",
"string",
"to",
"show",
"as",
"title",
"in",
"ui",
"list",
"."
] | ed688391cdf95742892ce61494736667cf5baf08 | https://github.com/markzhai/AndroidPerformanceMonitor/blob/ed688391cdf95742892ce61494736667cf5baf08/blockcanary-android/src/main/java/com/github/moduth/blockcanary/ui/BlockCanaryUtils.java#L31-L46 | train | Get the concernStackString for a block info. | Of course, here is the Java code you requested:
```java
public static String concernStackString(BlockInfo blockInfo) {
String result = "";
for (String stackEntry : blockInfo.threadStackEntries) {
if (Character.isLetter(stackEntry.charAt(0))) {
String[] lines = stackEntry.spl... |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeItem.java | TreeItem.doTag | public void doTag()
throws JspException, IOException
{
// It is only legal to set either an action or an href, this will verify we have exactly one.
// report an error when there is more than one specified.
int have = 0;
if (_href != null) have++;
if (_action != n... | java | public void doTag()
throws JspException, IOException
{
// It is only legal to set either an action or an href, this will verify we have exactly one.
// report an error when there is more than one specified.
int have = 0;
if (_href != null) have++;
if (_action != n... | [
"public",
"void",
"doTag",
"(",
")",
"throws",
"JspException",
",",
"IOException",
"{",
"// It is only legal to set either an action or an href, this will verify we have exactly one.",
"// report an error when there is more than one specified.",
"int",
"have",
"=",
"0",
";",
"if",
... | Instantiate a new TreeElement.
@throws JspException if a JSP exception has occurred | [
"Instantiate",
"a",
"new",
"TreeElement",
"."
] | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeItem.java#L325-L439 | train | This method is called to generate the tag. | Of course, here is the Java code you requested:
```java
public void doTag()
throws JspException, IOException
{
// It is only legal to set either an action or an href, this will verify we have exactly one.
// report an error when there is more than one specified.
int have = 0;
... |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/agent/FalseReturner.java | FalseReturner.visitMethod | public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (name.equals(methodname)) {
// return new FakeMethodVisitor();
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
mv.visitCode();
mv.visitInsn(ICONST_0);
mv... | java | public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (name.equals(methodname)) {
// return new FakeMethodVisitor();
MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);
mv.visitCode();
mv.visitInsn(ICONST_0);
mv... | [
"public",
"MethodVisitor",
"visitMethod",
"(",
"int",
"access",
",",
"String",
"name",
",",
"String",
"desc",
",",
"String",
"signature",
",",
"String",
"[",
"]",
"exceptions",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"methodname",
")",
")",
"{",... | } | [
"}"
] | 59b32f957a05c6d9f149148158053605e2a6205a | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/agent/FalseReturner.java#L52-L67 | train | overrides the visitor to look for methods that are not public. | Of course, here is the Java code you requested:
```java
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (name.equals(methodname)) {
// return new FakeMethodVisitor();
MethodVisitor mv = super.visitMethod(access, name, desc, signature, excepti... |
Berico-Technologies/CLAVIN | src/main/java/com/bericotech/clavin/GeoParser.java | GeoParser.parse | public List<ResolvedLocation> parse(String inputText) throws Exception {
return parse(inputText, ClavinLocationResolver.DEFAULT_ANCESTRY_MODE);
} | java | public List<ResolvedLocation> parse(String inputText) throws Exception {
return parse(inputText, ClavinLocationResolver.DEFAULT_ANCESTRY_MODE);
} | [
"public",
"List",
"<",
"ResolvedLocation",
">",
"parse",
"(",
"String",
"inputText",
")",
"throws",
"Exception",
"{",
"return",
"parse",
"(",
"inputText",
",",
"ClavinLocationResolver",
".",
"DEFAULT_ANCESTRY_MODE",
")",
";",
"}"
] | Takes an unstructured text document (as a String), extracts the
location names contained therein, and resolves them into
geographic entities representing the best match for those
location names.
@param inputText unstructured text to be processed
@return list of geo entities resolved from text
@throws ... | [
"Takes",
"an",
"unstructured",
"text",
"document",
"(",
"as",
"a",
"String",
")",
"extracts",
"the",
"location",
"names",
"contained",
"therein",
"and",
"resolves",
"them",
"into",
"geographic",
"entities",
"representing",
"the",
"best",
"match",
"for",
"those",... | f73c741f33a01b91aa5b06e71860bc354ef3010d | https://github.com/Berico-Technologies/CLAVIN/blob/f73c741f33a01b91aa5b06e71860bc354ef3010d/src/main/java/com/bericotech/clavin/GeoParser.java#L96-L98 | train | Parse the input text. | Of course, here is the Java code you requested:
```java
public List<ResolvedLocation> parse(String inputText) throws Exception {
return parse(inputText, ClavinLocationResolver.DEFAULT_ANCESTRY_MODE);
}
```
Hope this helps! |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/OHLCChart.java | OHLCChart.updateOHLCSeries | public OHLCSeries updateOHLCSeries(
String seriesName,
double[] newXData,
double[] newOpenData,
double[] newHighData,
double[] newLowData,
double[] newCloseData) {
sanityCheck(seriesName, newOpenData, newHighData, newLowData, newCloseData);
Map<String, OHLCSeries> seriesMap... | java | public OHLCSeries updateOHLCSeries(
String seriesName,
double[] newXData,
double[] newOpenData,
double[] newHighData,
double[] newLowData,
double[] newCloseData) {
sanityCheck(seriesName, newOpenData, newHighData, newLowData, newCloseData);
Map<String, OHLCSeries> seriesMap... | [
"public",
"OHLCSeries",
"updateOHLCSeries",
"(",
"String",
"seriesName",
",",
"double",
"[",
"]",
"newXData",
",",
"double",
"[",
"]",
"newOpenData",
",",
"double",
"[",
"]",
"newHighData",
",",
"double",
"[",
"]",
"newLowData",
",",
"double",
"[",
"]",
"n... | Update a series by updating the X-Axis and Y-Axis
@param seriesName
@param newXData - set null to be automatically generated as a list of increasing Integers
starting from 1 and ending at the size of the new Y-Axis data list.
@param newOpenData
@param newHighData
@param newLowData
@param newCloseData
@return | [
"Update",
"a",
"series",
"by",
"updating",
"the",
"X",
"-",
"Axis",
"and",
"Y",
"-",
"Axis"
] | 677a105753a855edf24782fab1bf1f5aec3e642b | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/OHLCChart.java#L382-L409 | train | Update an OHLC Series. | Of course, here is the Java code you requested:
```java
public OHLCSeries updateOHLCSeries(
String seriesName,
double[] newXData,
double[] newOpenData,
double[] newHighData,
double[] newLowData,
double[] newCloseData) {
sanityCheck(seriesName, newOpenData, newHighData, newLowDa... |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201811/GrpSettings.java | GrpSettings.setProvider | public void setProvider(com.google.api.ads.admanager.axis.v201811.GrpProvider provider) {
this.provider = provider;
} | java | public void setProvider(com.google.api.ads.admanager.axis.v201811.GrpProvider provider) {
this.provider = provider;
} | [
"public",
"void",
"setProvider",
"(",
"com",
".",
"google",
".",
"api",
".",
"ads",
".",
"admanager",
".",
"axis",
".",
"v201811",
".",
"GrpProvider",
"provider",
")",
"{",
"this",
".",
"provider",
"=",
"provider",
";",
"}"
] | Sets the provider value for this GrpSettings.
@param provider * Specifies the GRP provider of the {@link LineItem}. | [
"Sets",
"the",
"provider",
"value",
"for",
"this",
"GrpSettings",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v201811/GrpSettings.java#L175-L177 | train | Sets the provider value for this CrazyNorthGrp. | Of course, here is the Java code you requested:
```java
public void setProvider(com.google.api.ads.admanager.axis.v201811.GrpProvider provider) {
this.provider = provider;
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/ProviderRegistry.java | ProviderRegistry.getConfigProvider | @Override
public AuthConfigProvider getConfigProvider(String layer, String appContext, RegistrationListener listener) {
CacheEntry<AuthConfigProvider, RegistrationContext, Collection<RegistrationListener>> entry = null;
lock.lock();
try {
if (layer != null && appContext != null)
... | java | @Override
public AuthConfigProvider getConfigProvider(String layer, String appContext, RegistrationListener listener) {
CacheEntry<AuthConfigProvider, RegistrationContext, Collection<RegistrationListener>> entry = null;
lock.lock();
try {
if (layer != null && appContext != null)
... | [
"@",
"Override",
"public",
"AuthConfigProvider",
"getConfigProvider",
"(",
"String",
"layer",
",",
"String",
"appContext",
",",
"RegistrationListener",
"listener",
")",
"{",
"CacheEntry",
"<",
"AuthConfigProvider",
",",
"RegistrationContext",
",",
"Collection",
"<",
"... | /*
Implements lookup algorithm following the precedence rules in JSR-196:
All factories shall employ the following precedence rules to select the registered AuthConfigProvider that
matches the layer and appContext arguments:
(1) The provider that is specifically registered for both the corresponding message layer and... | [
"/",
"*",
"Implements",
"lookup",
"algorithm",
"following",
"the",
"precedence",
"rules",
"in",
"JSR",
"-",
"196",
":"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/ProviderRegistry.java#L186-L215 | train | Gets the config provider. | Of course, here is the Java code you requested:
```java
@Override
public AuthConfigProvider getConfigProvider(String layer, String appContext, RegistrationListener listener) {
CacheEntry<AuthConfigProvider, RegistrationContext, Collection<RegistrationListener>> entry = null;
lock.lock();
tr... |
google/closure-templates | java/src/com/google/template/soy/jssrc/dsl/Statement.java | Statement.treatRawStringAsStatementLegacyOnly | public static Statement treatRawStringAsStatementLegacyOnly(
String rawString, Iterable<GoogRequire> requires) {
return LeafStatement.create(rawString, requires);
} | java | public static Statement treatRawStringAsStatementLegacyOnly(
String rawString, Iterable<GoogRequire> requires) {
return LeafStatement.create(rawString, requires);
} | [
"public",
"static",
"Statement",
"treatRawStringAsStatementLegacyOnly",
"(",
"String",
"rawString",
",",
"Iterable",
"<",
"GoogRequire",
">",
"requires",
")",
"{",
"return",
"LeafStatement",
".",
"create",
"(",
"rawString",
",",
"requires",
")",
";",
"}"
] | Creates a code chunk from the given text, treating it as a series of statements rather than an
expression. For use only by {@link
com.google.template.soy.jssrc.internal.GenJsCodeVisitor#visitReturningCodeChunk}.
<p>TODO(b/33382980): remove. | [
"Creates",
"a",
"code",
"chunk",
"from",
"the",
"given",
"text",
"treating",
"it",
"as",
"a",
"series",
"of",
"statements",
"rather",
"than",
"an",
"expression",
".",
"For",
"use",
"only",
"by",
"{",
"@link",
"com",
".",
"google",
".",
"template",
".",
... | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/dsl/Statement.java#L99-L102 | train | This method is used to treat raw string as a statement. | Of course, here is the Java code you requested:
```java
public static Statement treatRawStringAsStatementLegacyOnly(
String rawString, Iterable<GoogRequire> requires) {
return LeafStatement.create(rawString, requires);
}
```
Hope this helps! |
susom/database | src/main/java/com/github/susom/database/VertxUtil.java | VertxUtil.mdc | public static <T> Handler<T> mdc(final Handler<T> handler) {
if (handler == null) {
// Throw here instead of getting NPE inside the handler so we can see the stack trace
throw new IllegalArgumentException("handler may not be null");
}
final Map<String, String> mdc = MDC.getCopyOfContextMap();
... | java | public static <T> Handler<T> mdc(final Handler<T> handler) {
if (handler == null) {
// Throw here instead of getting NPE inside the handler so we can see the stack trace
throw new IllegalArgumentException("handler may not be null");
}
final Map<String, String> mdc = MDC.getCopyOfContextMap();
... | [
"public",
"static",
"<",
"T",
">",
"Handler",
"<",
"T",
">",
"mdc",
"(",
"final",
"Handler",
"<",
"T",
">",
"handler",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"// Throw here instead of getting NPE inside the handler so we can see the stack trace",
... | Wrap a Handler in a way that will preserve the SLF4J MDC context.
The context from the current thread at the time of this method call
will be cached and restored within the wrapper at the time the
handler is invoked. This version delegates the handler call directly
on the thread that calls it. | [
"Wrap",
"a",
"Handler",
"in",
"a",
"way",
"that",
"will",
"preserve",
"the",
"SLF4J",
"MDC",
"context",
".",
"The",
"context",
"from",
"the",
"current",
"thread",
"at",
"the",
"time",
"of",
"this",
"method",
"call",
"will",
"be",
"cached",
"and",
"restor... | 25add9e08ad863712f9b5e319b6cb826f6f97640 | https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/VertxUtil.java#L29-L54 | train | Returns a handler that will handle the current context of the specified handler. | Of course, here is the Java code you requested:
```java
public static <T> Handler<T> mdc(final Handler<T> handler) {
if (handler == null) {
// Throw here instead of getting NPE inside the handler so we can see the stack trace
throw new IllegalArgumentException("handler may not be null");
}
fin... |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.zero | public SDVariable zero(String name, org.nd4j.linalg.api.buffer.DataType dataType, int... shape) {
return var(name, new ZeroInitScheme(), dataType, ArrayUtil.toLongArray(shape));
} | java | public SDVariable zero(String name, org.nd4j.linalg.api.buffer.DataType dataType, int... shape) {
return var(name, new ZeroInitScheme(), dataType, ArrayUtil.toLongArray(shape));
} | [
"public",
"SDVariable",
"zero",
"(",
"String",
"name",
",",
"org",
".",
"nd4j",
".",
"linalg",
".",
"api",
".",
"buffer",
".",
"DataType",
"dataType",
",",
"int",
"...",
"shape",
")",
"{",
"return",
"var",
"(",
"name",
",",
"new",
"ZeroInitScheme",
"("... | Create a new variable with the specified shape, with all values initialized to 0
@param name the name of the variable to create
@param shape the shape of the array to be created
@return the created variable | [
"Create",
"a",
"new",
"variable",
"with",
"the",
"specified",
"shape",
"with",
"all",
"values",
"initialized",
"to",
"0"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L1989-L1991 | train | Zero operation. | Of course, here is the Java code you requested:
```java
public SDVariable zero(String name, org.nd4j.linalg.api.buffer.DataType dataType, int... shape) {
return var(name, new ZeroInitScheme(), dataType, ArrayUtil.toLongArray(shape));
}
```
Hope this helps! |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/io/ProxyInputStream.java | ProxyInputStream.read | @Override
public int read(byte[] bts, int off, int len) throws IOException {
try {
beforeRead(len);
int n = in.read(bts, off, len);
afterRead(n);
return n;
} catch (IOException e) {
handleIOException(e);
return -1;
... | java | @Override
public int read(byte[] bts, int off, int len) throws IOException {
try {
beforeRead(len);
int n = in.read(bts, off, len);
afterRead(n);
return n;
} catch (IOException e) {
handleIOException(e);
return -1;
... | [
"@",
"Override",
"public",
"int",
"read",
"(",
"byte",
"[",
"]",
"bts",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"try",
"{",
"beforeRead",
"(",
"len",
")",
";",
"int",
"n",
"=",
"in",
".",
"read",
"(",
"bts",
",",
... | Invokes the delegate's <code>read(byte[], int, int)</code> method.
@param bts the buffer to read the bytes into
@param off The start offset
@param len The number of bytes to read
@return the number of bytes read or -1 if the end of stream
@throws java.io.IOException if an I/O error occurs | [
"Invokes",
"the",
"delegate",
"s",
"<code",
">",
"read",
"(",
"byte",
"[]",
"int",
"int",
")",
"<",
"/",
"code",
">",
"method",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/io/ProxyInputStream.java#L147-L158 | train | Reads a sequence of bytes from the underlying stream. | Of course, here is the Java code you requested:
```java
@Override
public int read(byte[] bts, int off, int len) throws IOException {
try {
beforeRead(len);
int n = in.read(bts, off, len);
afterRead(n);
return n;
} catch (IOException e) {
... |
arquillian/arquillian-testrunner-spock | examples/groovy-1.x/src/main/java/org/jboss/arquillian/spock/SecureAccountService.java | SecureAccountService.transfer | public void transfer(Account from, Account to, int amount) {
from.withdraw(amount);
to.diposit(amount);
} | java | public void transfer(Account from, Account to, int amount) {
from.withdraw(amount);
to.diposit(amount);
} | [
"public",
"void",
"transfer",
"(",
"Account",
"from",
",",
"Account",
"to",
",",
"int",
"amount",
")",
"{",
"from",
".",
"withdraw",
"(",
"amount",
")",
";",
"to",
".",
"diposit",
"(",
"amount",
")",
";",
"}"
] | /* (non-Javadoc)
@see org.jboss.arquillian.framework.spock.AccountService#transfer(org.jboss.arquillian.framework.spock.Account, org.jboss.arquillian.framework.spock.Account, java.math.BigDecimal) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 009975fbc7faaa66575305a7cff1def888acaf6e | https://github.com/arquillian/arquillian-testrunner-spock/blob/009975fbc7faaa66575305a7cff1def888acaf6e/examples/groovy-1.x/src/main/java/org/jboss/arquillian/spock/SecureAccountService.java#L32-L35 | train | Transfer the amount of data from one account to another. | Of course, here is the Java code you requested:
```java
public void transfer(Account from, Account to, int amount) {
from.withdraw(amount);
to.diposit(amount);
}
```
Hope this helps! |
Impetus/Kundera | src/kundera-redis/src/main/java/com/impetus/client/redis/RedisClientFactory.java | RedisClientFactory.createPoolOrConnection | @Override
protected Object createPoolOrConnection()
{
logger.info("Initializing Redis connection pool");
final byte WHEN_EXHAUSTED_FAIL = 0;
PersistenceUnitMetadata puMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(
getPersistenceUnit());
... | java | @Override
protected Object createPoolOrConnection()
{
logger.info("Initializing Redis connection pool");
final byte WHEN_EXHAUSTED_FAIL = 0;
PersistenceUnitMetadata puMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(
getPersistenceUnit());
... | [
"@",
"Override",
"protected",
"Object",
"createPoolOrConnection",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Initializing Redis connection pool\"",
")",
";",
"final",
"byte",
"WHEN_EXHAUSTED_FAIL",
"=",
"0",
";",
"PersistenceUnitMetadata",
"puMetadata",
"=",
"kunde... | /*
(non-Javadoc)
@see
com.impetus.kundera.loader.GenericClientFactory#createPoolOrConnection() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-redis/src/main/java/com/impetus/client/redis/RedisClientFactory.java#L69-L183 | train | Create pool or connection. | Of course, here is the Java code you requested:
```java
@Override
protected Object createPoolOrConnection()
{
logger.info("Initializing Redis connection pool");
final byte WHEN_EXHAUSTED_FAIL = 0;
PersistenceUnitMetadata puMetadata = kunderaMetadata.getApplicationMetadata().getPersist... |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java | AbstractCachedGenerator.retrieveFromCache | protected Reader retrieveFromCache(String path, GeneratorContext context, CacheMode cacheMode) {
Reader rd = null;
String filePath = getTempFilePath(context, cacheMode);
FileInputStream fis = null;
File file = new File(filePath);
if (file.exists()) {
try {
fis = new FileInputStream(file);
} catc... | java | protected Reader retrieveFromCache(String path, GeneratorContext context, CacheMode cacheMode) {
Reader rd = null;
String filePath = getTempFilePath(context, cacheMode);
FileInputStream fis = null;
File file = new File(filePath);
if (file.exists()) {
try {
fis = new FileInputStream(file);
} catc... | [
"protected",
"Reader",
"retrieveFromCache",
"(",
"String",
"path",
",",
"GeneratorContext",
"context",
",",
"CacheMode",
"cacheMode",
")",
"{",
"Reader",
"rd",
"=",
"null",
";",
"String",
"filePath",
"=",
"getTempFilePath",
"(",
"context",
",",
"cacheMode",
")",... | Retrieves the resource from cache if it exists
@param path
the resource path
@param context
the generator context
@param cacheMode
the cache mode
@return the reader to the resource | [
"Retrieves",
"the",
"resource",
"from",
"cache",
"if",
"it",
"exists"
] | 5381f6acf461cd2502593c67a77bd6ef9eab848d | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java#L456-L478 | train | Retrieve a resource from the cache. | Of course, here is the Java code you requested:
```java
protected Reader retrieveFromCache(String path, GeneratorContext context, CacheMode cacheMode) {
Reader rd = null;
String filePath = getTempFilePath(context, cacheMode);
FileInputStream fis = null;
File file = new File(filePath);
if (file.exists()) ... |
facebook/fresco | samples/gestures/src/main/java/com/facebook/samples/gestures/TransformGestureDetector.java | TransformGestureDetector.getScale | public float getScale() {
if (mDetector.getPointerCount() < 2) {
return 1;
} else {
float startDeltaX = mDetector.getStartX()[1] - mDetector.getStartX()[0];
float startDeltaY = mDetector.getStartY()[1] - mDetector.getStartY()[0];
float currentDeltaX = mDetector.getCurrentX()[1] - mDetect... | java | public float getScale() {
if (mDetector.getPointerCount() < 2) {
return 1;
} else {
float startDeltaX = mDetector.getStartX()[1] - mDetector.getStartX()[0];
float startDeltaY = mDetector.getStartY()[1] - mDetector.getStartY()[0];
float currentDeltaX = mDetector.getCurrentX()[1] - mDetect... | [
"public",
"float",
"getScale",
"(",
")",
"{",
"if",
"(",
"mDetector",
".",
"getPointerCount",
"(",
")",
"<",
"2",
")",
"{",
"return",
"1",
";",
"}",
"else",
"{",
"float",
"startDeltaX",
"=",
"mDetector",
".",
"getStartX",
"(",
")",
"[",
"1",
"]",
"... | Gets the scale | [
"Gets",
"the",
"scale"
] | 0b85879d51c5036d5e46e627a6651afefc0b971a | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/samples/gestures/src/main/java/com/facebook/samples/gestures/TransformGestureDetector.java#L148-L160 | train | Get the scale of the detector. | Of course, here is the Java code you requested:
```java
public float getScale() {
if (mDetector.getPointerCount() < 2) {
return 1;
} else {
float startDeltaX = mDetector.getStartX()[1] - mDetector.getStartX()[0];
float startDeltaY = mDetector.getStartY()[1] - mDetector.getStartY()[0];
f... |
Jasig/NotificationPortlet | notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/classloader/ClassLoaderResourceNotificationService.java | ClassLoaderResourceNotificationService.fetchFromClasspath | private NotificationResponse fetchFromClasspath(List<String> locations) {
if (locations.isEmpty()) {
return NotificationResponse.EMPTY_RESPONSE;
}
NotificationResponse rslt;
final Element m = cache.get(locations);
if (m != null) {
// ## CACHE HIT ##
... | java | private NotificationResponse fetchFromClasspath(List<String> locations) {
if (locations.isEmpty()) {
return NotificationResponse.EMPTY_RESPONSE;
}
NotificationResponse rslt;
final Element m = cache.get(locations);
if (m != null) {
// ## CACHE HIT ##
... | [
"private",
"NotificationResponse",
"fetchFromClasspath",
"(",
"List",
"<",
"String",
">",
"locations",
")",
"{",
"if",
"(",
"locations",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"NotificationResponse",
".",
"EMPTY_RESPONSE",
";",
"}",
"NotificationResponse",
... | /*
Implementation | [
"/",
"*",
"Implementation"
] | a74b87c145b66166a2cb6849d17ce9b0f2c98f3b | https://github.com/Jasig/NotificationPortlet/blob/a74b87c145b66166a2cb6849d17ce9b0f2c98f3b/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/service/classloader/ClassLoaderResourceNotificationService.java#L109-L135 | test | Fetch from classpath. | Of course, here is the Java code you requested:
```java
private NotificationResponse fetchFromClasspath(List<String> locations) {
if (locations.isEmpty()) {
return NotificationResponse.EMPTY_RESPONSE;
}
NotificationResponse rslt;
final Element m = cache.get(locations);
... |
googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java | StorageSnippets.deleteBucketAcl | public boolean deleteBucketAcl(String bucketName) {
// [START deleteBucketAcl]
boolean deleted = storage.deleteAcl(bucketName, User.ofAllAuthenticatedUsers());
if (deleted) {
// the acl entry was deleted
} else {
// the acl entry was not found
}
// [END deleteBucketAcl]
return de... | java | public boolean deleteBucketAcl(String bucketName) {
// [START deleteBucketAcl]
boolean deleted = storage.deleteAcl(bucketName, User.ofAllAuthenticatedUsers());
if (deleted) {
// the acl entry was deleted
} else {
// the acl entry was not found
}
// [END deleteBucketAcl]
return de... | [
"public",
"boolean",
"deleteBucketAcl",
"(",
"String",
"bucketName",
")",
"{",
"// [START deleteBucketAcl]",
"boolean",
"deleted",
"=",
"storage",
".",
"deleteAcl",
"(",
"bucketName",
",",
"User",
".",
"ofAllAuthenticatedUsers",
"(",
")",
")",
";",
"if",
"(",
"d... | [VARIABLE "my_unique_bucket"] | [
"[",
"VARIABLE",
"my_unique_bucket",
"]"
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java#L781-L791 | train | Delete the ACL entry for the specified bucket. | Of course, here is the Java code you requested:
```java
public boolean deleteBucketAcl(String bucketName) {
// [START deleteBucketAcl]
boolean deleted = storage.deleteAcl(bucketName, User.ofAllAuthenticatedUsers());
if (deleted) {
// the acl entry was deleted
} else {
// the acl entry was n... |
kiegroup/optaplanner | optaplanner-core/src/main/java/org/optaplanner/core/impl/domain/variable/anchor/AnchorVariableDemand.java | AnchorVariableDemand.createExternalizedSupply | @Override
public AnchorVariableSupply createExternalizedSupply(InnerScoreDirector scoreDirector) {
SingletonInverseVariableSupply inverseVariableSupply = scoreDirector.getSupplyManager()
.demand(new SingletonInverseVariableDemand(sourceVariableDescriptor));
return new ExternalizedAnc... | java | @Override
public AnchorVariableSupply createExternalizedSupply(InnerScoreDirector scoreDirector) {
SingletonInverseVariableSupply inverseVariableSupply = scoreDirector.getSupplyManager()
.demand(new SingletonInverseVariableDemand(sourceVariableDescriptor));
return new ExternalizedAnc... | [
"@",
"Override",
"public",
"AnchorVariableSupply",
"createExternalizedSupply",
"(",
"InnerScoreDirector",
"scoreDirector",
")",
"{",
"SingletonInverseVariableSupply",
"inverseVariableSupply",
"=",
"scoreDirector",
".",
"getSupplyManager",
"(",
")",
".",
"demand",
"(",
"new"... | ************************************************************************ | [
"************************************************************************"
] | b8f1459b4e6b0f7aafe941fd165bff640c11d7d5 | https://github.com/kiegroup/optaplanner/blob/b8f1459b4e6b0f7aafe941fd165bff640c11d7d5/optaplanner-core/src/main/java/org/optaplanner/core/impl/domain/variable/anchor/AnchorVariableDemand.java#L43-L48 | valid | Create an externalized supply. | Of course, here is the Java code you requested:
```java
@Override
public AnchorVariableSupply createExternalizedSupply(InnerScoreDirector scoreDirector) {
SingletonInverseVariableSupply inverseVariableSupply = scoreDirector.getSupplyManager()
.demand(new SingletonInverseVariableDemand(sourc... |
scalecube/scalecube-services | services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Client.java | Client.forService | public <T> T forService(Class<T> serviceClazz, ClientErrorMapper errorMapper) {
// noinspection unchecked
return (T)
proxyMap.computeIfAbsent(
serviceClazz,
(clazz) -> {
Map<Method, MethodInfo> methods = Reflect.methodsInfo(serviceClazz);
return Proxy.... | java | public <T> T forService(Class<T> serviceClazz, ClientErrorMapper errorMapper) {
// noinspection unchecked
return (T)
proxyMap.computeIfAbsent(
serviceClazz,
(clazz) -> {
Map<Method, MethodInfo> methods = Reflect.methodsInfo(serviceClazz);
return Proxy.... | [
"public",
"<",
"T",
">",
"T",
"forService",
"(",
"Class",
"<",
"T",
">",
"serviceClazz",
",",
"ClientErrorMapper",
"errorMapper",
")",
"{",
"// noinspection unchecked",
"return",
"(",
"T",
")",
"proxyMap",
".",
"computeIfAbsent",
"(",
"serviceClazz",
",",
"(",... | Proxy creator function.
@param serviceClazz service interface.
@param errorMapper error mapper.
@param <T> type of service interface.
@return proxied service object. | [
"Proxy",
"creator",
"function",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Client.java#L139-L150 | train | Creates a proxy instance for the given service class. | Of course, here is the Java code you requested:
```java
public <T> T forService(Class<T> serviceClazz, ClientErrorMapper errorMapper) {
// noinspection unchecked
return (T)
proxyMap.computeIfAbsent(
serviceClazz,
(clazz) -> {
Map<Method, MethodInfo> methods = Refle... |
webjars/webjars-locator | src/main/java/org/webjars/RequireJS.java | RequireJS.getSetupJavaScript | public synchronized static String getSetupJavaScript(String urlPrefix) {
if (requireConfigJavaScript == null) {
List<String> prefixes = new ArrayList<>();
prefixes.add(urlPrefix);
requireConfigJavaScript = generateSetupJavaScript(prefixes);
}
return requireCo... | java | public synchronized static String getSetupJavaScript(String urlPrefix) {
if (requireConfigJavaScript == null) {
List<String> prefixes = new ArrayList<>();
prefixes.add(urlPrefix);
requireConfigJavaScript = generateSetupJavaScript(prefixes);
}
return requireCo... | [
"public",
"synchronized",
"static",
"String",
"getSetupJavaScript",
"(",
"String",
"urlPrefix",
")",
"{",
"if",
"(",
"requireConfigJavaScript",
"==",
"null",
")",
"{",
"List",
"<",
"String",
">",
"prefixes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"pre... | Returns the JavaScript that is used to setup the RequireJS config.
This value is cached in memory so that all of the processing to get the String only has to happen once.
@param urlPrefix The URL prefix where the WebJars can be downloaded from with a trailing slash, e.g. /webJars/
@return The JavaScript block that can... | [
"Returns",
"the",
"JavaScript",
"that",
"is",
"used",
"to",
"setup",
"the",
"RequireJS",
"config",
".",
"This",
"value",
"is",
"cached",
"in",
"memory",
"so",
"that",
"all",
"of",
"the",
"processing",
"to",
"get",
"the",
"String",
"only",
"has",
"to",
"h... | 8796fb3ff1b9ad5c0d433ecf63a60520c715e3a0 | https://github.com/webjars/webjars-locator/blob/8796fb3ff1b9ad5c0d433ecf63a60520c715e3a0/src/main/java/org/webjars/RequireJS.java#L45-L53 | train | Get the setup JavaScript for the application. | Of course, here is the Java code you requested:
```java
public synchronized static String getSetupJavaScript(String urlPrefix) {
if (requireConfigJavaScript == null) {
List<String> prefixes = new ArrayList<>();
prefixes.add(urlPrefix);
requireConfigJavaScript = generateSetu... |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.translate | public Matrix4d translate(Vector3fc offset) {
return translate(offset.x(), offset.y(), offset.z());
} | java | public Matrix4d translate(Vector3fc offset) {
return translate(offset.x(), offset.y(), offset.z());
} | [
"public",
"Matrix4d",
"translate",
"(",
"Vector3fc",
"offset",
")",
"{",
"return",
"translate",
"(",
"offset",
".",
"x",
"(",
")",
",",
"offset",
".",
"y",
"(",
")",
",",
"offset",
".",
"z",
"(",
")",
")",
";",
"}"
] | Apply a translation to this matrix by translating by the given number of
units in x, y and z.
<p>
If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation
matrix, then the new matrix will be <code>M * T</code>. So when
transforming a vector <code>v</code> with the new matrix by using
<code>M * T... | [
"Apply",
"a",
"translation",
"to",
"this",
"matrix",
"by",
"translating",
"by",
"the",
"given",
"number",
"of",
"units",
"in",
"x",
"y",
"and",
"z",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
"/",
"code",
">",
"is",
"<code",
">",
"this<",
"/",
"code... | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L5436-L5438 | train | Translate the image by the given offset. | Of course, here is the Java code you requested:
```java
public Matrix4d translate(Vector3fc offset) {
return translate(offset.x(), offset.y(), offset.z());
}
```
Hope this helps! |
androiddevelop/CommonBase | src/main/java/me/codeboy/common/base/net/core/CBConnection.java | CBConnection.data | public CBConnection data(String... data) {
if (data.length % 2 == 0) {
this.data = CBParam.paramsToString(charset, data);
}
return this;
} | java | public CBConnection data(String... data) {
if (data.length % 2 == 0) {
this.data = CBParam.paramsToString(charset, data);
}
return this;
} | [
"public",
"CBConnection",
"data",
"(",
"String",
"...",
"data",
")",
"{",
"if",
"(",
"data",
".",
"length",
"%",
"2",
"==",
"0",
")",
"{",
"this",
".",
"data",
"=",
"CBParam",
".",
"paramsToString",
"(",
"charset",
",",
"data",
")",
";",
"}",
"retu... | 设置请求数据
@param data 表单数据
@return 连接 | [
"设置请求数据"
] | 9528eb3a040177596a3f131fa958a94c63614fc4 | https://github.com/androiddevelop/CommonBase/blob/9528eb3a040177596a3f131fa958a94c63614fc4/src/main/java/me/codeboy/common/base/net/core/CBConnection.java#L239-L244 | valid | Sets the data to be used in the CBConnection. | Of course, here is the Java code you requested:
```java
public CBConnection data(String... data) {
if (data.length % 2 == 0) {
this.data = CBParam.paramsToString(charset, data);
}
return this;
}
```
Hope this helps! |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipCall.java | SipCall.sendReinvite | public SipTransaction sendReinvite(String newContact, String displayName, String body,
String contentType, String contentSubType) {
return sendReinvite(newContact, displayName, body, contentType, contentSubType, null, null);
} | java | public SipTransaction sendReinvite(String newContact, String displayName, String body,
String contentType, String contentSubType) {
return sendReinvite(newContact, displayName, body, contentType, contentSubType, null, null);
} | [
"public",
"SipTransaction",
"sendReinvite",
"(",
"String",
"newContact",
",",
"String",
"displayName",
",",
"String",
"body",
",",
"String",
"contentType",
",",
"String",
"contentSubType",
")",
"{",
"return",
"sendReinvite",
"(",
"newContact",
",",
"displayName",
... | This method sends a basic RE-INVITE on the current dialog.
<p>
This method returns when the request message has been sent out. The calling program must
subsequently call the waitReinviteResponse() method (one or more times) to get the response(s)
and perhaps the sendReinviteOkAck() method to send an ACK. On the receive... | [
"This",
"method",
"sends",
"a",
"basic",
"RE",
"-",
"INVITE",
"on",
"the",
"current",
"dialog",
".",
"<p",
">",
"This",
"method",
"returns",
"when",
"the",
"request",
"message",
"has",
"been",
"sent",
"out",
".",
"The",
"calling",
"program",
"must",
"sub... | 18a6be2e29be3fbdc14226e8c41b25e2d57378b1 | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipCall.java#L1762-L1765 | train | Send a Reinvite message to the user. | Of course, here is the Java code you requested:
```java
public SipTransaction sendReinvite(String newContact, String displayName, String body,
String contentType, String contentSubType) {
return sendReinvite(newContact, displayName, body, contentType, contentSubType, null, null);
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-migrationhub/src/main/java/com/amazonaws/services/migrationhub/AWSMigrationHubClient.java | AWSMigrationHubClient.describeMigrationTask | @Override
public DescribeMigrationTaskResult describeMigrationTask(DescribeMigrationTaskRequest request) {
request = beforeClientExecution(request);
return executeDescribeMigrationTask(request);
} | java | @Override
public DescribeMigrationTaskResult describeMigrationTask(DescribeMigrationTaskRequest request) {
request = beforeClientExecution(request);
return executeDescribeMigrationTask(request);
} | [
"@",
"Override",
"public",
"DescribeMigrationTaskResult",
"describeMigrationTask",
"(",
"DescribeMigrationTaskRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeMigrationTask",
"(",
"request",
")",
"... | <p>
Retrieves a list of all attributes associated with a specific migration task.
</p>
@param describeMigrationTaskRequest
@return Result of the DescribeMigrationTask operation returned by the service.
@throws AccessDeniedException
You do not have sufficient access to perform this action.
@throws InternalServerErrorEx... | [
"<p",
">",
"Retrieves",
"a",
"list",
"of",
"all",
"attributes",
"associated",
"with",
"a",
"specific",
"migration",
"task",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-migrationhub/src/main/java/com/amazonaws/services/migrationhub/AWSMigrationHubClient.java#L591-L595 | train | Returns a description of a migration task. | Of course, here is the Java code you requested:
```java
@Override
public DescribeMigrationTaskResult describeMigrationTask(DescribeMigrationTaskRequest request) {
request = beforeClientExecution(request);
return executeDescribeMigrationTask(request);
}
```
Hope this helps! |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/extension/std/XSemanticExtension.java | XSemanticExtension.extractModelReferenceURIs | public List<URI> extractModelReferenceURIs(XAttributable target) {
List<String> refStrings = extractModelReferences(target);
List<URI> refURIs = new ArrayList<URI>(refStrings.size());
for (String refString : refStrings) {
refURIs.add(URI.create(refString));
}
return refURIs;
} | java | public List<URI> extractModelReferenceURIs(XAttributable target) {
List<String> refStrings = extractModelReferences(target);
List<URI> refURIs = new ArrayList<URI>(refStrings.size());
for (String refString : refStrings) {
refURIs.add(URI.create(refString));
}
return refURIs;
} | [
"public",
"List",
"<",
"URI",
">",
"extractModelReferenceURIs",
"(",
"XAttributable",
"target",
")",
"{",
"List",
"<",
"String",
">",
"refStrings",
"=",
"extractModelReferences",
"(",
"target",
")",
";",
"List",
"<",
"URI",
">",
"refURIs",
"=",
"new",
"Array... | Retrieves the list of model reference URIs which describe a log element
(archive, log, trace, event, attribute).
@param target
Any log element (i.e., archive, log, trace, event, or
attribute) to be queried.
@return The list of model references, as a list of URIs, referred to by
this element. | [
"Retrieves",
"the",
"list",
"of",
"model",
"reference",
"URIs",
"which",
"describe",
"a",
"log",
"element",
"(",
"archive",
"log",
"trace",
"event",
"attribute",
")",
"."
] | e791cb07a6e62ecf837d760d58a25f32fbf6bbca | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XSemanticExtension.java#L163-L170 | train | Extract the list of model reference URIs from the given XAttributable object. | Of course, here is the Java code you requested:
```java
public List<URI> extractModelReferenceURIs(XAttributable target) {
List<String> refStrings = extractModelReferences(target);
List<URI> refURIs = new ArrayList<URI>(refStrings.size());
for (String refString : refStrings) {
refURIs.add(URI.create(refString... |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/Var2Data.java | Var2Data.getString | public String getString(Integer offset)
{
String result = null;
if (offset != null)
{
byte[] value = m_map.get(offset);
if (value != null)
{
result = MPPUtility.getString(value, 0);
}
}
return (result);
} | java | public String getString(Integer offset)
{
String result = null;
if (offset != null)
{
byte[] value = m_map.get(offset);
if (value != null)
{
result = MPPUtility.getString(value, 0);
}
}
return (result);
} | [
"public",
"String",
"getString",
"(",
"Integer",
"offset",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"offset",
"!=",
"null",
")",
"{",
"byte",
"[",
"]",
"value",
"=",
"m_map",
".",
"get",
"(",
"offset",
")",
";",
"if",
"(",
"value"... | This method retrieves the data at the given offset and returns
it as a String, assuming the underlying data is composed of
single byte characters.
@param offset offset of required data
@return string containing required data | [
"This",
"method",
"retrieves",
"the",
"data",
"at",
"the",
"given",
"offset",
"and",
"returns",
"it",
"as",
"a",
"String",
"assuming",
"the",
"underlying",
"data",
"is",
"composed",
"of",
"single",
"byte",
"characters",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L215-L229 | train | Get a string value from the mapped byte array. | Of course, here is the Java code you requested:
```java
public String getString(Integer offset)
{
String result = null;
if (offset != null)
{
byte[] value = m_map.get(offset);
if (value != null)
{
result = MPPUtility.getString(value, 0);
}
}
... |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/http/HttpHeaders.java | HttpHeaders.add | @Override
public void add(String headerName, String headerValue) {
List<String> headerValues = headers.get(headerName);
if (headerValues == null) {
headerValues = new LinkedList<String>();
this.headers.put(headerName, headerValues);
}
headerValues.add(headerValue);
} | java | @Override
public void add(String headerName, String headerValue) {
List<String> headerValues = headers.get(headerName);
if (headerValues == null) {
headerValues = new LinkedList<String>();
this.headers.put(headerName, headerValues);
}
headerValues.add(headerValue);
} | [
"@",
"Override",
"public",
"void",
"add",
"(",
"String",
"headerName",
",",
"String",
"headerValue",
")",
"{",
"List",
"<",
"String",
">",
"headerValues",
"=",
"headers",
".",
"get",
"(",
"headerName",
")",
";",
"if",
"(",
"headerValues",
"==",
"null",
"... | Add the given, single header value under the given name.
@param headerName the header name
@param headerValue the header value
@throws UnsupportedOperationException if adding headers is not supported
@see #put(String, List)
@see #set(String, String) | [
"Add",
"the",
"given",
"single",
"header",
"value",
"under",
"the",
"given",
"name",
"."
] | 941296e152d49a40e0745a3e81628a974f72b7e4 | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/HttpHeaders.java#L935-L943 | train | Add a header value to the response. | Of course, here is the Java code you requested:
```java
@Override
public void add(String headerName, String headerValue) {
List<String> headerValues = headers.get(headerName);
if (headerValues == null) {
headerValues = new LinkedList<String>();
this.headers.put(headerName, headerValues);
}
headerValues.... |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentProperty.java | CmsXmlContentProperty.withNiceName | public CmsXmlContentProperty withNiceName(String niceName) {
return new CmsXmlContentProperty(
m_name,
m_type,
m_visibility,
m_widget,
m_widgetConfiguration,
m_ruleRegex,
m_ruleType,
m_default,
niceName,... | java | public CmsXmlContentProperty withNiceName(String niceName) {
return new CmsXmlContentProperty(
m_name,
m_type,
m_visibility,
m_widget,
m_widgetConfiguration,
m_ruleRegex,
m_ruleType,
m_default,
niceName,... | [
"public",
"CmsXmlContentProperty",
"withNiceName",
"(",
"String",
"niceName",
")",
"{",
"return",
"new",
"CmsXmlContentProperty",
"(",
"m_name",
",",
"m_type",
",",
"m_visibility",
",",
"m_widget",
",",
"m_widgetConfiguration",
",",
"m_ruleRegex",
",",
"m_ruleType",
... | Copies a property definition, but replaces the nice name attribute.<p>
@param niceName the new nice name attribute
@return the copied property definition | [
"Copies",
"a",
"property",
"definition",
"but",
"replaces",
"the",
"nice",
"name",
"attribute",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentProperty.java#L594-L609 | train | Creates a CmsXmlContentProperty with the specified nice name. | Of course, here is the Java code you requested:
```java
public CmsXmlContentProperty withNiceName(String niceName) {
return new CmsXmlContentProperty(
m_name,
m_type,
m_visibility,
m_widget,
m_widgetConfiguration,
m_ruleRegex,
... |
liveontologies/elk-reasoner | elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/rules/backwardlinks/BackwardLinkChainFromBackwardLinkRule.java | BackwardLinkChainFromBackwardLinkRule.addRuleFor | public static boolean addRuleFor(ForwardLink link, Context context) {
BackwardLinkChainFromBackwardLinkRule rule = context
.getBackwardLinkRuleChain().getCreate(MATCHER_, FACTORY_);
return rule.forwardLinksByObjectProperty_.add(link.getChain(),
link.getTarget());
} | java | public static boolean addRuleFor(ForwardLink link, Context context) {
BackwardLinkChainFromBackwardLinkRule rule = context
.getBackwardLinkRuleChain().getCreate(MATCHER_, FACTORY_);
return rule.forwardLinksByObjectProperty_.add(link.getChain(),
link.getTarget());
} | [
"public",
"static",
"boolean",
"addRuleFor",
"(",
"ForwardLink",
"link",
",",
"Context",
"context",
")",
"{",
"BackwardLinkChainFromBackwardLinkRule",
"rule",
"=",
"context",
".",
"getBackwardLinkRuleChain",
"(",
")",
".",
"getCreate",
"(",
"MATCHER_",
",",
"FACTORY... | Adds a {@link BackwardLinkChainFromBackwardLinkRule} inferences for the
given {@link ForwardLink} in the given {@link Context}
@param link
@param context
@return {@code true} if the {@link BackwardLinkChainFromBackwardLinkRule}
stored in the {@link Context} is modified as a result of this
operation | [
"Adds",
"a",
"{",
"@link",
"BackwardLinkChainFromBackwardLinkRule",
"}",
"inferences",
"for",
"the",
"given",
"{",
"@link",
"ForwardLink",
"}",
"in",
"the",
"given",
"{",
"@link",
"Context",
"}"
] | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/rules/backwardlinks/BackwardLinkChainFromBackwardLinkRule.java#L88-L93 | test | Add a rule for the given forward link. | Of course, here is the Java code you requested:
```java
public static boolean addRuleFor(ForwardLink link, Context context) {
BackwardLinkChainFromBackwardLinkRule rule = context
.getBackwardLinkRuleChain().getCreate(MATCHER_, FACTORY_);
return rule.forwardLinksByObjectProperty_.add(link.getChain(),
link.g... |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/LicensesApi.java | LicensesApi.getPopularLicenseTemplates | public List<LicenseTemplate> getPopularLicenseTemplates() throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("popular", true, true);
Response response = get(Response.Status.OK, formData.asMap(), "licenses");
return (response.readEntity(new GenericType<List<LicenseTemplate>... | java | public List<LicenseTemplate> getPopularLicenseTemplates() throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("popular", true, true);
Response response = get(Response.Status.OK, formData.asMap(), "licenses");
return (response.readEntity(new GenericType<List<LicenseTemplate>... | [
"public",
"List",
"<",
"LicenseTemplate",
">",
"getPopularLicenseTemplates",
"(",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"popular\"",
",",
"true",
",",
"true",
")",
";",
"Re... | Get popular license templates.
GET /licenses
@return a list of LicenseTemplate instances
@throws GitLabApiException if any exception occurs | [
"Get",
"popular",
"license",
"templates",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/LicensesApi.java#L41-L45 | train | Get a list of popular license templates. | Of course, here is the Java code you requested:
```java
public List<LicenseTemplate> getPopularLicenseTemplates() throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("popular", true, true);
Response response = get(Response.Status.OK, formData.asMap(), "licenses");
return (... |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/SharedTorrent.java | SharedTorrent.finish | public synchronized void finish() {
if (!this.isInitialized()) {
throw new IllegalStateException("Torrent not yet initialized!");
}
if (!this.isComplete()) {
throw new IllegalStateException("Torrent download is not complete!");
}
eventDispatcher.multicaster().downloadComplete();
se... | java | public synchronized void finish() {
if (!this.isInitialized()) {
throw new IllegalStateException("Torrent not yet initialized!");
}
if (!this.isComplete()) {
throw new IllegalStateException("Torrent download is not complete!");
}
eventDispatcher.multicaster().downloadComplete();
se... | [
"public",
"synchronized",
"void",
"finish",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isInitialized",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Torrent not yet initialized!\"",
")",
";",
"}",
"if",
"(",
"!",
"this",
".",
"isCo... | Finalize the download of this torrent.
<p/>
<p>
This realizes the final, pre-seeding phase actions on this torrent,
which usually consists in putting the torrent data in their final form
and at their target location.
</p>
@see TorrentByteStorage#finish | [
"Finalize",
"the",
"download",
"of",
"this",
"torrent",
".",
"<p",
"/",
">",
"<p",
">",
"This",
"realizes",
"the",
"final",
"pre",
"-",
"seeding",
"phase",
"actions",
"on",
"this",
"torrent",
"which",
"usually",
"consists",
"in",
"putting",
"the",
"torrent... | ecd0e6caf853b63393c4ab63cfd8f20114f73f70 | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/SharedTorrent.java#L366-L377 | train | Finishes the download. | Of course, here is the Java code you requested:
```java
public synchronized void finish() {
if (!this.isInitialized()) {
throw new IllegalStateException("Torrent not yet initialized!");
}
if (!this.isComplete()) {
throw new IllegalStateException("Torrent download is not complete!");
}
... |
DiUS/pact-jvm | pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslObject.java | LambdaDslObject.eachKeyLike | public LambdaDslObject eachKeyLike(String exampleKey, Consumer<LambdaDslObject> nestedObject) {
final PactDslJsonBody objectLike = object.eachKeyLike(exampleKey);
final LambdaDslObject dslObject = new LambdaDslObject(objectLike);
nestedObject.accept(dslObject);
objectLike.closeObject();
... | java | public LambdaDslObject eachKeyLike(String exampleKey, Consumer<LambdaDslObject> nestedObject) {
final PactDslJsonBody objectLike = object.eachKeyLike(exampleKey);
final LambdaDslObject dslObject = new LambdaDslObject(objectLike);
nestedObject.accept(dslObject);
objectLike.closeObject();
... | [
"public",
"LambdaDslObject",
"eachKeyLike",
"(",
"String",
"exampleKey",
",",
"Consumer",
"<",
"LambdaDslObject",
">",
"nestedObject",
")",
"{",
"final",
"PactDslJsonBody",
"objectLike",
"=",
"object",
".",
"eachKeyLike",
"(",
"exampleKey",
")",
";",
"final",
"Lam... | Accepts any key, and each key is mapped to a map that must match the following object definition.
Note: this needs the Java system property "pact.matching.wildcard" set to value "true" when the pact file is verified.
@param exampleKey Example key to use for generating bodies | [
"Accepts",
"any",
"key",
"and",
"each",
"key",
"is",
"mapped",
"to",
"a",
"map",
"that",
"must",
"match",
"the",
"following",
"object",
"definition",
".",
"Note",
":",
"this",
"needs",
"the",
"Java",
"system",
"property",
"pact",
".",
"matching",
".",
"w... | 2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslObject.java#L665-L671 | train | Each object in the object that is a key like | Of course, here is the Java code you requested:
```java
public LambdaDslObject eachKeyLike(String exampleKey, Consumer<LambdaDslObject> nestedObject) {
final PactDslJsonBody objectLike = object.eachKeyLike(exampleKey);
final LambdaDslObject dslObject = new LambdaDslObject(objectLike);
nestedObj... |
wildfly/wildfly | weld/subsystem/src/main/java/org/jboss/as/weld/WeldExtension.java | WeldExtension.initialize | @Override
public void initialize(final ExtensionContext context) {
WeldLogger.ROOT_LOGGER.debug("Activating Weld Extension");
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
final ManagementResourceRegistration registration = subsyste... | java | @Override
public void initialize(final ExtensionContext context) {
WeldLogger.ROOT_LOGGER.debug("Activating Weld Extension");
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
final ManagementResourceRegistration registration = subsyste... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"final",
"ExtensionContext",
"context",
")",
"{",
"WeldLogger",
".",
"ROOT_LOGGER",
".",
"debug",
"(",
"\"Activating Weld Extension\"",
")",
";",
"final",
"SubsystemRegistration",
"subsystem",
"=",
"context",
"."... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/weld/subsystem/src/main/java/org/jboss/as/weld/WeldExtension.java#L66-L74 | test | Initializes the resource manager. | Of course, here is the Java code you requested:
```java
@Override
public void initialize(final ExtensionContext context) {
WeldLogger.ROOT_LOGGER.debug("Activating Weld Extension");
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
fin... |
apache/flink | flink-core/src/main/java/org/apache/flink/core/plugin/PluginLoader.java | PluginLoader.load | public <P extends Plugin> Iterator<P> load(Class<P> service) {
try (TemporaryClassLoaderContext classLoaderContext = new TemporaryClassLoaderContext(pluginClassLoader)) {
return new ContextClassLoaderSettingIterator<>(
ServiceLoader.load(service, pluginClassLoader).iterator(),
pluginClassLoader);
}
} | java | public <P extends Plugin> Iterator<P> load(Class<P> service) {
try (TemporaryClassLoaderContext classLoaderContext = new TemporaryClassLoaderContext(pluginClassLoader)) {
return new ContextClassLoaderSettingIterator<>(
ServiceLoader.load(service, pluginClassLoader).iterator(),
pluginClassLoader);
}
} | [
"public",
"<",
"P",
"extends",
"Plugin",
">",
"Iterator",
"<",
"P",
">",
"load",
"(",
"Class",
"<",
"P",
">",
"service",
")",
"{",
"try",
"(",
"TemporaryClassLoaderContext",
"classLoaderContext",
"=",
"new",
"TemporaryClassLoaderContext",
"(",
"pluginClassLoader... | Returns in iterator over all available implementations of the given service interface (SPI) for the plugin.
@param service the service interface (SPI) for which implementations are requested.
@param <P> Type of the requested plugin service.
@return An iterator of all implementations of the given service interface that... | [
"Returns",
"in",
"iterator",
"over",
"all",
"available",
"implementations",
"of",
"the",
"given",
"service",
"interface",
"(",
"SPI",
")",
"for",
"the",
"plugin",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/plugin/PluginLoader.java#L57-L63 | train | Load the plugin service. | Of course, here is the Java code you requested:
```java
public <P extends Plugin> Iterator<P> load(Class<P> service) {
try (TemporaryClassLoaderContext classLoaderContext = new TemporaryClassLoaderContext(pluginClassLoader)) {
return new ContextClassLoaderSettingIterator<>(
ServiceLoader.load(service, pluginC... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/ControlMessageFactoryImpl.java | ControlMessageFactoryImpl.createNewSubscriptionMessage | public final SubscriptionMessage createNewSubscriptionMessage() throws MessageCreateFailedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewSubscriptionMessage");
SubscriptionMessage msg = null;
try {
msg = new SubscriptionMessageImpl(MfpConstants.C... | java | public final SubscriptionMessage createNewSubscriptionMessage() throws MessageCreateFailedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewSubscriptionMessage");
SubscriptionMessage msg = null;
try {
msg = new SubscriptionMessageImpl(MfpConstants.C... | [
"public",
"final",
"SubscriptionMessage",
"createNewSubscriptionMessage",
"(",
")",
"throws",
"MessageCreateFailedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"ent... | Create a new, empty Subscription Propagation message
@return The new SubscriptionMessage
@exception MessageCreateFailedException Thrown if such a message can not be created | [
"Create",
"a",
"new",
"empty",
"Subscription",
"Propagation",
"message"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/ControlMessageFactoryImpl.java#L82-L95 | train | Create a new empty SubscriptionMessage | Of course, here is the Java code you requested:
```java
public final SubscriptionMessage createNewSubscriptionMessage() throws MessageCreateFailedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewSubscriptionMessage");
SubscriptionMessage msg = null;
try... |
aws/aws-sdk-java | aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/AWSServiceCatalogClient.java | AWSServiceCatalogClient.associateProductWithPortfolio | @Override
public AssociateProductWithPortfolioResult associateProductWithPortfolio(AssociateProductWithPortfolioRequest request) {
request = beforeClientExecution(request);
return executeAssociateProductWithPortfolio(request);
} | java | @Override
public AssociateProductWithPortfolioResult associateProductWithPortfolio(AssociateProductWithPortfolioRequest request) {
request = beforeClientExecution(request);
return executeAssociateProductWithPortfolio(request);
} | [
"@",
"Override",
"public",
"AssociateProductWithPortfolioResult",
"associateProductWithPortfolio",
"(",
"AssociateProductWithPortfolioRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeAssociateProductWithPortfolio"... | <p>
Associates the specified product with the specified portfolio.
</p>
@param associateProductWithPortfolioRequest
@return Result of the AssociateProductWithPortfolio operation returned by the service.
@throws InvalidParametersException
One or more parameters provided to the operation are not valid.
@throws ResourceN... | [
"<p",
">",
"Associates",
"the",
"specified",
"product",
"with",
"the",
"specified",
"portfolio",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/AWSServiceCatalogClient.java#L449-L453 | train | Associates a product with an portfolio. | Of course, here is the Java code you requested:
```java
@Override
public AssociateProductWithPortfolioResult associateProductWithPortfolio(AssociateProductWithPortfolioRequest request) {
request = beforeClientExecution(request);
return executeAssociateProductWithPortfolio(request);
}
```
Hope ... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/EnumUtil.java | EnumUtil.fromString | public static <T extends Enum<T>> T fromString(Class<T> enumClass, String value) {
return Enum.valueOf(enumClass, value);
} | java | public static <T extends Enum<T>> T fromString(Class<T> enumClass, String value) {
return Enum.valueOf(enumClass, value);
} | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"fromString",
"(",
"Class",
"<",
"T",
">",
"enumClass",
",",
"String",
"value",
")",
"{",
"return",
"Enum",
".",
"valueOf",
"(",
"enumClass",
",",
"value",
")",
";",
"}"
] | 字符串转枚举,调用{@link Enum#valueOf(Class, String)}
@param <T> 枚举类型泛型
@param enumClass 枚举类
@param value 值
@return 枚举值
@since 4.1.13 | [
"字符串转枚举,调用",
"{",
"@link",
"Enum#valueOf",
"(",
"Class",
"String",
")",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/EnumUtil.java#L62-L64 | train | Creates an enum value from a string. | Of course, here is the Java code you requested:
```java
public static <T extends Enum<T>> T fromString(Class<T> enumClass, String value) {
return Enum.valueOf(enumClass, value);
}
```
Hope this helps! |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java | HttpUtils.execute | public static HttpResponse execute(final String url, final String method,
final Map<String, Object> headers) {
return execute(url, method, null, null, new HashMap<>(), headers);
} | java | public static HttpResponse execute(final String url, final String method,
final Map<String, Object> headers) {
return execute(url, method, null, null, new HashMap<>(), headers);
} | [
"public",
"static",
"HttpResponse",
"execute",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"method",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
")",
"{",
"return",
"execute",
"(",
"url",
",",
"method",
",",
"null",
",",... | Execute http response.
@param url the url
@param method the method
@param headers the headers
@return the http response | [
"Execute",
"http",
"response",
"."
] | b4b306433a8782cef803a39bea5b1f96740e0e9b | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java#L87-L90 | train | Execute a HTTP request to a URL. | Of course, here is the Java code you requested:
```java
public static HttpResponse execute(final String url, final String method,
final Map<String, Object> headers) {
return execute(url, method, null, null, new HashMap<>(), headers);
}
```
Hope this helps! |
albfernandez/itext2 | src/main/java/com/lowagie/text/GreekList.java | GreekList.setGreekFont | protected void setGreekFont() {
float fontsize = symbol.getFont().getSize();
symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL));
} | java | protected void setGreekFont() {
float fontsize = symbol.getFont().getSize();
symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL));
} | [
"protected",
"void",
"setGreekFont",
"(",
")",
"{",
"float",
"fontsize",
"=",
"symbol",
".",
"getFont",
"(",
")",
".",
"getSize",
"(",
")",
";",
"symbol",
".",
"setFont",
"(",
"FontFactory",
".",
"getFont",
"(",
"FontFactory",
".",
"SYMBOL",
",",
"fontsi... | change the font to SYMBOL | [
"change",
"the",
"font",
"to",
"SYMBOL"
] | 438fc1899367fd13dfdfa8dfdca9a3c1a7783b84 | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/GreekList.java#L95-L98 | train | Sets the greek font. | Of course, here is the Java code you requested:
```java
protected void setGreekFont() {
float fontsize = symbol.getFont().getSize();
symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL));
}
```
Hope this helps! |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java | SimpleDateFormat.diffCalFieldValue | private boolean diffCalFieldValue(Calendar fromCalendar,
Calendar toCalendar,
Object[] items,
int i) throws IllegalArgumentException {
if ( items[i] instanceof String) {
return false;
... | java | private boolean diffCalFieldValue(Calendar fromCalendar,
Calendar toCalendar,
Object[] items,
int i) throws IllegalArgumentException {
if ( items[i] instanceof String) {
return false;
... | [
"private",
"boolean",
"diffCalFieldValue",
"(",
"Calendar",
"fromCalendar",
",",
"Calendar",
"toCalendar",
",",
"Object",
"[",
"]",
"items",
",",
"int",
"i",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"items",
"[",
"i",
"]",
"instanceof",
"Stri... | check whether the i-th item in 2 calendar is in different value.
It is supposed to be used only by CLDR survey tool.
It is used by intervalFormatByAlgorithm().
@param fromCalendar one calendar
@param toCalendar the other calendar
@param items pattern items
@param i the i-th item in pattern... | [
"check",
"whether",
"the",
"i",
"-",
"th",
"item",
"in",
"2",
"calendar",
"is",
"in",
"different",
"value",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L4299-L4324 | train | Checks if two calendar fields are the same. | Of course, here is the Java code you requested:
```java
private boolean diffCalFieldValue(Calendar fromCalendar,
Calendar toCalendar,
Object[] items,
int i) throws IllegalArgumentException {
if ( i... |
unbescape/unbescape | src/main/java/org/unbescape/xml/XmlEscape.java | XmlEscape.escapeXml11 | public static void escapeXml11(final Reader reader, final Writer writer, final XmlEscapeType type, final XmlEscapeLevel level)
throws IOException {
escapeXml(reader, writer, XmlEscapeSymbols.XML11_SYMBOLS, type, level);
} | java | public static void escapeXml11(final Reader reader, final Writer writer, final XmlEscapeType type, final XmlEscapeLevel level)
throws IOException {
escapeXml(reader, writer, XmlEscapeSymbols.XML11_SYMBOLS, type, level);
} | [
"public",
"static",
"void",
"escapeXml11",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
",",
"final",
"XmlEscapeType",
"type",
",",
"final",
"XmlEscapeLevel",
"level",
")",
"throws",
"IOException",
"{",
"escapeXml",
"(",
"reader",
",",
"... | <p>
Perform a (configurable) XML 1.1 <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel}
argument values.
... | [
"<p",
">",
"Perform",
"a",
"(",
"configurable",
")",
"XML",
"1",
".",
"1",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
... | ec5435fb3508c2eed25d8165dc27ded2602cae13 | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L1622-L1625 | train | Escape XML 1. 0. 0 | Of course, here is the Java code you requested:
```java
public static void escapeXml11(final Reader reader, final Writer writer, final XmlEscapeType type, final XmlEscapeLevel level)
throws IOException {
escapeXml(reader, writer, XmlEscapeSymbols.XML11_SYMBOLS, type, level);
}
```
Hope this he... |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Bridge.java | Bridge.create | public static Bridge create(final BandwidthClient client, final String callId1, final String callId2)
throws Exception
{
assert (callId1 != null);
final HashMap<String, Object> params = new HashMap<String, Object>();
params.put("bridgeAudio", "true");
String[] callIds = null;
... | java | public static Bridge create(final BandwidthClient client, final String callId1, final String callId2)
throws Exception
{
assert (callId1 != null);
final HashMap<String, Object> params = new HashMap<String, Object>();
params.put("bridgeAudio", "true");
String[] callIds = null;
... | [
"public",
"static",
"Bridge",
"create",
"(",
"final",
"BandwidthClient",
"client",
",",
"final",
"String",
"callId1",
",",
"final",
"String",
"callId2",
")",
"throws",
"Exception",
"{",
"assert",
"(",
"callId1",
"!=",
"null",
")",
";",
"final",
"HashMap",
"<... | Convenience method to create a Bridge object from two call ids
@param client the client
@param callId1 the call id
@param callId2 the call id
@return the Bridge
@throws IOException unexpected error. | [
"Convenience",
"method",
"to",
"create",
"a",
"Bridge",
"object",
"from",
"two",
"call",
"ids"
] | 2124c85148ad6a54d2f2949cb952eb3985830e2a | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Bridge.java#L101-L124 | train | Factory method to create a Bridge object from a list of callIds and callIds | Of course, here is the Java code you requested:
```java
public static Bridge create(final BandwidthClient client, final String callId1, final String callId2)
throws Exception
{
assert (callId1 != null);
final HashMap<String, Object> params = new HashMap<String, Object>();
params.put("bri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.