repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPTimephasedBaselineWorkNormaliser.java | MPPTimephasedBaselineWorkNormaliser.mergeSameDay | @Override protected void mergeSameDay(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
{
LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
TimephasedWork previousAssignment = null;
for (TimephasedWork assignment : list)
{
if (previousAssignment == null)... | java | @Override protected void mergeSameDay(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
{
LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
TimephasedWork previousAssignment = null;
for (TimephasedWork assignment : list)
{
if (previousAssignment == null)... | [
"@",
"Override",
"protected",
"void",
"mergeSameDay",
"(",
"ProjectCalendar",
"calendar",
",",
"LinkedList",
"<",
"TimephasedWork",
">",
"list",
")",
"{",
"LinkedList",
"<",
"TimephasedWork",
">",
"result",
"=",
"new",
"LinkedList",
"<",
"TimephasedWork",
">",
"... | This method merges together assignment data for the same day.
@param calendar current calendar
@param list assignment data | [
"This",
"method",
"merges",
"together",
"assignment",
"data",
"for",
"the",
"same",
"day",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPTimephasedBaselineWorkNormaliser.java#L46-L89 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkConstant | private SemanticType checkConstant(Expr.Constant expr, Environment env) {
Value item = expr.getValue();
switch (item.getOpcode()) {
case ITEM_null:
return Type.Null;
case ITEM_bool:
return Type.Bool;
case ITEM_int:
return Type.Int;
case ITEM_byte:
return Type.Byte;
case ITEM_utf8:
// FIXME:... | java | private SemanticType checkConstant(Expr.Constant expr, Environment env) {
Value item = expr.getValue();
switch (item.getOpcode()) {
case ITEM_null:
return Type.Null;
case ITEM_bool:
return Type.Bool;
case ITEM_int:
return Type.Int;
case ITEM_byte:
return Type.Byte;
case ITEM_utf8:
// FIXME:... | [
"private",
"SemanticType",
"checkConstant",
"(",
"Expr",
".",
"Constant",
"expr",
",",
"Environment",
"env",
")",
"{",
"Value",
"item",
"=",
"expr",
".",
"getValue",
"(",
")",
";",
"switch",
"(",
"item",
".",
"getOpcode",
"(",
")",
")",
"{",
"case",
"I... | Check the type of a given constant expression. This is straightforward since
the determine is fully determined by the kind of constant we have.
@param expr
@return | [
"Check",
"the",
"type",
"of",
"a",
"given",
"constant",
"expression",
".",
"This",
"is",
"straightforward",
"since",
"the",
"determine",
"is",
"fully",
"determined",
"by",
"the",
"kind",
"of",
"constant",
"we",
"have",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L1451-L1470 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.areSameTsi | private static boolean areSameTsi(String a, String b) {
return a.length() == b.length() && b.length() > SQL_TSI_ROOT.length()
&& a.regionMatches(true, SQL_TSI_ROOT.length(), b, SQL_TSI_ROOT.length(), b.length() - SQL_TSI_ROOT.length());
} | java | private static boolean areSameTsi(String a, String b) {
return a.length() == b.length() && b.length() > SQL_TSI_ROOT.length()
&& a.regionMatches(true, SQL_TSI_ROOT.length(), b, SQL_TSI_ROOT.length(), b.length() - SQL_TSI_ROOT.length());
} | [
"private",
"static",
"boolean",
"areSameTsi",
"(",
"String",
"a",
",",
"String",
"b",
")",
"{",
"return",
"a",
".",
"length",
"(",
")",
"==",
"b",
".",
"length",
"(",
")",
"&&",
"b",
".",
"length",
"(",
")",
">",
"SQL_TSI_ROOT",
".",
"length",
"(",... | Compares two TSI intervals. It is
@param a first interval to compare
@param b second interval to compare
@return true when both intervals are equal (case insensitive) | [
"Compares",
"two",
"TSI",
"intervals",
".",
"It",
"is"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L546-L549 |
sdl/odata | odata_api/src/main/java/com/sdl/odata/util/AnnotationsUtil.java | AnnotationsUtil.checkAnnotationPresent | public static <T extends Annotation> T checkAnnotationPresent(AnnotatedElement annotatedType,
Class<T> annotationClass) {
return getAnnotation(annotatedType, annotationClass);
} | java | public static <T extends Annotation> T checkAnnotationPresent(AnnotatedElement annotatedType,
Class<T> annotationClass) {
return getAnnotation(annotatedType, annotationClass);
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"checkAnnotationPresent",
"(",
"AnnotatedElement",
"annotatedType",
",",
"Class",
"<",
"T",
">",
"annotationClass",
")",
"{",
"return",
"getAnnotation",
"(",
"annotatedType",
",",
"annotationClass",
... | Check if the annotation is present and if not throws an exception,
this is just an overload for more clear naming.
@param annotatedType The source type to tcheck the annotation on
@param annotationClass The annotation to look for
@param <T> The annotation subtype
@return The annotation that was requested... | [
"Check",
"if",
"the",
"annotation",
"is",
"present",
"and",
"if",
"not",
"throws",
"an",
"exception",
"this",
"is",
"just",
"an",
"overload",
"for",
"more",
"clear",
"naming",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/AnnotationsUtil.java#L43-L46 |
twilio/twilio-java | src/main/java/com/twilio/rest/fax/v1/fax/FaxMediaReader.java | FaxMediaReader.previousPage | @Override
public Page<FaxMedia> previousPage(final Page<FaxMedia> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.FAX.toString(),
client.getR... | java | @Override
public Page<FaxMedia> previousPage(final Page<FaxMedia> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.FAX.toString(),
client.getR... | [
"@",
"Override",
"public",
"Page",
"<",
"FaxMedia",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"FaxMedia",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
"... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/fax/v1/fax/FaxMediaReader.java#L114-L125 |
sdl/Testy | src/main/java/com/sdl/selenium/extjs3/grid/GridPanel.java | GridPanel.getRowIndex | public int getRowIndex(String searchElement, int startRowIndex) {
int index = -1;
if (ready()) {
String path = getGridCell(startRowIndex).getXPath();
WebLocator currentElement = new WebLocator().setElPath(path);
while (currentElement.isElementPresent()) {
... | java | public int getRowIndex(String searchElement, int startRowIndex) {
int index = -1;
if (ready()) {
String path = getGridCell(startRowIndex).getXPath();
WebLocator currentElement = new WebLocator().setElPath(path);
while (currentElement.isElementPresent()) {
... | [
"public",
"int",
"getRowIndex",
"(",
"String",
"searchElement",
",",
"int",
"startRowIndex",
")",
"{",
"int",
"index",
"=",
"-",
"1",
";",
"if",
"(",
"ready",
"(",
")",
")",
"{",
"String",
"path",
"=",
"getGridCell",
"(",
"startRowIndex",
")",
".",
"ge... | this method is working only for normal grids (no buffer views), and first page if grid has buffer view | [
"this",
"method",
"is",
"working",
"only",
"for",
"normal",
"grids",
"(",
"no",
"buffer",
"views",
")",
"and",
"first",
"page",
"if",
"grid",
"has",
"buffer",
"view"
] | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/extjs3/grid/GridPanel.java#L394-L418 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/errors/ApplicationException.java | ApplicationException.withDetails | public ApplicationException withDetails(String key, Object value) {
_details = _details != null ? _details : new StringValueMap();
_details.setAsObject(key, value);
return this;
} | java | public ApplicationException withDetails(String key, Object value) {
_details = _details != null ? _details : new StringValueMap();
_details.setAsObject(key, value);
return this;
} | [
"public",
"ApplicationException",
"withDetails",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"_details",
"=",
"_details",
"!=",
"null",
"?",
"_details",
":",
"new",
"StringValueMap",
"(",
")",
";",
"_details",
".",
"setAsObject",
"(",
"key",
",",... | Sets a parameter for additional error details. This details can be used to
restore error description in other languages.
This method returns reference to this exception to implement Builder pattern
to chain additional calls.
@param key a details parameter name
@param value a details parameter name
@return this exce... | [
"Sets",
"a",
"parameter",
"for",
"additional",
"error",
"details",
".",
"This",
"details",
"can",
"be",
"used",
"to",
"restore",
"error",
"description",
"in",
"other",
"languages",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/errors/ApplicationException.java#L240-L244 |
joniles/mpxj | src/main/java/net/sf/mpxj/sample/MpxjFilter.java | MpxjFilter.processResourceFilter | private static void processResourceFilter(ProjectFile project, Filter filter)
{
for (Resource resource : project.getResources())
{
if (filter.evaluate(resource, null))
{
System.out.println(resource.getID() + "," + resource.getUniqueID() + "," + resource.getName());
... | java | private static void processResourceFilter(ProjectFile project, Filter filter)
{
for (Resource resource : project.getResources())
{
if (filter.evaluate(resource, null))
{
System.out.println(resource.getID() + "," + resource.getUniqueID() + "," + resource.getName());
... | [
"private",
"static",
"void",
"processResourceFilter",
"(",
"ProjectFile",
"project",
",",
"Filter",
"filter",
")",
"{",
"for",
"(",
"Resource",
"resource",
":",
"project",
".",
"getResources",
"(",
")",
")",
"{",
"if",
"(",
"filter",
".",
"evaluate",
"(",
... | Apply a filter to the list of all resources, and show the results.
@param project project file
@param filter filter | [
"Apply",
"a",
"filter",
"to",
"the",
"list",
"of",
"all",
"resources",
"and",
"show",
"the",
"results",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/sample/MpxjFilter.java#L145-L154 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/core/N1qlQueryExecutor.java | N1qlQueryExecutor.prepareAndExecute | protected Observable<AsyncN1qlQueryResult> prepareAndExecute(final N1qlQuery query, final CouchbaseEnvironment env, final long timeout, final TimeUnit timeUnit) {
return prepare(query.statement())
.flatMap(new Func1<PreparedPayload, Observable<AsyncN1qlQueryResult>>() {
@Over... | java | protected Observable<AsyncN1qlQueryResult> prepareAndExecute(final N1qlQuery query, final CouchbaseEnvironment env, final long timeout, final TimeUnit timeUnit) {
return prepare(query.statement())
.flatMap(new Func1<PreparedPayload, Observable<AsyncN1qlQueryResult>>() {
@Over... | [
"protected",
"Observable",
"<",
"AsyncN1qlQueryResult",
">",
"prepareAndExecute",
"(",
"final",
"N1qlQuery",
"query",
",",
"final",
"CouchbaseEnvironment",
"env",
",",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"prepare",
... | Issues a N1QL PREPARE, puts the plan in cache then EXECUTE it. | [
"Issues",
"a",
"N1QL",
"PREPARE",
"puts",
"the",
"plan",
"in",
"cache",
"then",
"EXECUTE",
"it",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/core/N1qlQueryExecutor.java#L396-L405 |
mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/layer/download/TileDownloadLayer.java | TileDownloadLayer.isTileStale | @Override
protected boolean isTileStale(Tile tile, TileBitmap bitmap) {
if (bitmap.isExpired())
return true;
return cacheTimeToLive != 0 && ((bitmap.getTimestamp() + cacheTimeToLive) < System.currentTimeMillis());
} | java | @Override
protected boolean isTileStale(Tile tile, TileBitmap bitmap) {
if (bitmap.isExpired())
return true;
return cacheTimeToLive != 0 && ((bitmap.getTimestamp() + cacheTimeToLive) < System.currentTimeMillis());
} | [
"@",
"Override",
"protected",
"boolean",
"isTileStale",
"(",
"Tile",
"tile",
",",
"TileBitmap",
"bitmap",
")",
"{",
"if",
"(",
"bitmap",
".",
"isExpired",
"(",
")",
")",
"return",
"true",
";",
"return",
"cacheTimeToLive",
"!=",
"0",
"&&",
"(",
"(",
"bitm... | Whether the tile is stale and should be refreshed.
<p/>
This method is called from {@link #draw(BoundingBox, byte, Canvas, Point)} to determine whether the tile needs to
be refreshed.
<p/>
A tile is considered stale if one or more of the following two conditions apply:
<ul>
<li>The {@code bitmap}'s {@link org.mapsforge... | [
"Whether",
"the",
"tile",
"is",
"stale",
"and",
"should",
"be",
"refreshed",
".",
"<p",
"/",
">",
"This",
"method",
"is",
"called",
"from",
"{",
"@link",
"#draw",
"(",
"BoundingBox",
"byte",
"Canvas",
"Point",
")",
"}",
"to",
"determine",
"whether",
"the... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/download/TileDownloadLayer.java#L161-L166 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java | EllipseClustersIntoGrid.computeNodeInfo | void computeNodeInfo(List<EllipseRotated_F64> ellipses , List<Node> cluster ) {
// create an info object for each member inside of the cluster
listInfo.reset();
for (int i = 0; i < cluster.size(); i++) {
Node n = cluster.get(i);
EllipseRotated_F64 t = ellipses.get( n.which );
NodeInfo info = listInfo.g... | java | void computeNodeInfo(List<EllipseRotated_F64> ellipses , List<Node> cluster ) {
// create an info object for each member inside of the cluster
listInfo.reset();
for (int i = 0; i < cluster.size(); i++) {
Node n = cluster.get(i);
EllipseRotated_F64 t = ellipses.get( n.which );
NodeInfo info = listInfo.g... | [
"void",
"computeNodeInfo",
"(",
"List",
"<",
"EllipseRotated_F64",
">",
"ellipses",
",",
"List",
"<",
"Node",
">",
"cluster",
")",
"{",
"// create an info object for each member inside of the cluster",
"listInfo",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"i... | For each cluster create a {@link NodeInfo} and compute different properties | [
"For",
"each",
"cluster",
"create",
"a",
"{"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipseClustersIntoGrid.java#L267-L283 |
roskart/dropwizard-jaxws | dropwizard-jaxws/src/main/java/com/roskart/dropwizard/jaxws/JAXWSBundle.java | JAXWSBundle.publishEndpoint | public Endpoint publishEndpoint(String path, Object service, SessionFactory sessionFactory) {
return this.publishEndpoint(path, service, null, sessionFactory);
} | java | public Endpoint publishEndpoint(String path, Object service, SessionFactory sessionFactory) {
return this.publishEndpoint(path, service, null, sessionFactory);
} | [
"public",
"Endpoint",
"publishEndpoint",
"(",
"String",
"path",
",",
"Object",
"service",
",",
"SessionFactory",
"sessionFactory",
")",
"{",
"return",
"this",
".",
"publishEndpoint",
"(",
"path",
",",
"service",
",",
"null",
",",
"sessionFactory",
")",
";",
"}... | Publish JAX-WS endpoint with Dropwizard Hibernate Bundle integration. Service is scanned for @UnitOfWork
annotations. EndpointBuilder is published relative to the CXF servlet path.
@param path Relative endpoint path.
@param service Service implementation.
@param sessionFactory Hibernate session factory.
@return javax.x... | [
"Publish",
"JAX",
"-",
"WS",
"endpoint",
"with",
"Dropwizard",
"Hibernate",
"Bundle",
"integration",
".",
"Service",
"is",
"scanned",
"for",
"@UnitOfWork",
"annotations",
".",
"EndpointBuilder",
"is",
"published",
"relative",
"to",
"the",
"CXF",
"servlet",
"path",... | train | https://github.com/roskart/dropwizard-jaxws/blob/972eb63ba9626f3282d4a1d6127dc2b60b28f2bc/dropwizard-jaxws/src/main/java/com/roskart/dropwizard/jaxws/JAXWSBundle.java#L110-L112 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java | VariantMetadataManager.removeCohort | public void removeCohort(Cohort cohort, String studyId) {
// Sanity check
if (cohort == null) {
logger.error("Cohort is null.");
return;
}
removeCohort(cohort.getId(), studyId);
} | java | public void removeCohort(Cohort cohort, String studyId) {
// Sanity check
if (cohort == null) {
logger.error("Cohort is null.");
return;
}
removeCohort(cohort.getId(), studyId);
} | [
"public",
"void",
"removeCohort",
"(",
"Cohort",
"cohort",
",",
"String",
"studyId",
")",
"{",
"// Sanity check",
"if",
"(",
"cohort",
"==",
"null",
")",
"{",
"logger",
".",
"error",
"(",
"\"Cohort is null.\"",
")",
";",
"return",
";",
"}",
"removeCohort",
... | Remove a cohort of a given variant study metadata (from study ID).
@param cohort Cohort
@param studyId Study ID | [
"Remove",
"a",
"cohort",
"of",
"a",
"given",
"variant",
"study",
"metadata",
"(",
"from",
"study",
"ID",
")",
"."
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java#L431-L438 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Get.java | Get.withKey | public Get withKey(java.util.Map<String, AttributeValue> key) {
setKey(key);
return this;
} | java | public Get withKey(java.util.Map<String, AttributeValue> key) {
setKey(key);
return this;
} | [
"public",
"Get",
"withKey",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"key",
")",
"{",
"setKey",
"(",
"key",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of attribute names to <code>AttributeValue</code> objects that specifies the primary key of the item to
retrieve.
</p>
@param key
A map of attribute names to <code>AttributeValue</code> objects that specifies the primary key of the item
to retrieve.
@return Returns a reference to this object so that method c... | [
"<p",
">",
"A",
"map",
"of",
"attribute",
"names",
"to",
"<code",
">",
"AttributeValue<",
"/",
"code",
">",
"objects",
"that",
"specifies",
"the",
"primary",
"key",
"of",
"the",
"item",
"to",
"retrieve",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/Get.java#L99-L102 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java | ForkJoinPool.tryCreateExternalQueue | private void tryCreateExternalQueue(int index) {
AuxState aux;
if ((aux = auxState) != null && index >= 0) {
WorkQueue q = new WorkQueue(this, null);
q.config = index;
q.scanState = ~UNSIGNALLED;
q.qlock = 1; // lock queue
boo... | java | private void tryCreateExternalQueue(int index) {
AuxState aux;
if ((aux = auxState) != null && index >= 0) {
WorkQueue q = new WorkQueue(this, null);
q.config = index;
q.scanState = ~UNSIGNALLED;
q.qlock = 1; // lock queue
boo... | [
"private",
"void",
"tryCreateExternalQueue",
"(",
"int",
"index",
")",
"{",
"AuxState",
"aux",
";",
"if",
"(",
"(",
"aux",
"=",
"auxState",
")",
"!=",
"null",
"&&",
"index",
">=",
"0",
")",
"{",
"WorkQueue",
"q",
"=",
"new",
"WorkQueue",
"(",
"this",
... | Constructs and tries to install a new external queue,
failing if the workQueues array already has a queue at
the given index.
@param index the index of the new queue | [
"Constructs",
"and",
"tries",
"to",
"install",
"a",
"new",
"external",
"queue",
"failing",
"if",
"the",
"workQueues",
"array",
"already",
"has",
"a",
"queue",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ForkJoinPool.java#L2487-L2514 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.templateModem_name_GET | public OvhTemplateModem templateModem_name_GET(String name) throws IOException {
String qPath = "/xdsl/templateModem/{name}";
StringBuilder sb = path(qPath, name);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhTemplateModem.class);
} | java | public OvhTemplateModem templateModem_name_GET(String name) throws IOException {
String qPath = "/xdsl/templateModem/{name}";
StringBuilder sb = path(qPath, name);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhTemplateModem.class);
} | [
"public",
"OvhTemplateModem",
"templateModem_name_GET",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/templateModem/{name}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"name",
")",
";",
"String",
"res... | Get this object properties
REST: GET /xdsl/templateModem/{name}
@param name [required] Name of the Modem Template
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L122-L127 |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java | TableSchema.fromTypeInfo | public static TableSchema fromTypeInfo(TypeInformation<?> typeInfo) {
if (typeInfo instanceof CompositeType<?>) {
final CompositeType<?> compositeType = (CompositeType<?>) typeInfo;
// get field names and types from composite type
final String[] fieldNames = compositeType.getFieldNames();
final TypeInform... | java | public static TableSchema fromTypeInfo(TypeInformation<?> typeInfo) {
if (typeInfo instanceof CompositeType<?>) {
final CompositeType<?> compositeType = (CompositeType<?>) typeInfo;
// get field names and types from composite type
final String[] fieldNames = compositeType.getFieldNames();
final TypeInform... | [
"public",
"static",
"TableSchema",
"fromTypeInfo",
"(",
"TypeInformation",
"<",
"?",
">",
"typeInfo",
")",
"{",
"if",
"(",
"typeInfo",
"instanceof",
"CompositeType",
"<",
"?",
">",
")",
"{",
"final",
"CompositeType",
"<",
"?",
">",
"compositeType",
"=",
"(",... | Creates a table schema from a {@link TypeInformation} instance. If the type information is
a {@link CompositeType}, the field names and types for the composite type are used to
construct the {@link TableSchema} instance. Otherwise, a table schema with a single field
is created. The field name is "f0" and the field type... | [
"Creates",
"a",
"table",
"schema",
"from",
"a",
"{",
"@link",
"TypeInformation",
"}",
"instance",
".",
"If",
"the",
"type",
"information",
"is",
"a",
"{",
"@link",
"CompositeType",
"}",
"the",
"field",
"names",
"and",
"types",
"for",
"the",
"composite",
"t... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java#L216-L232 |
javactic/javactic | src/main/java/com/github/javactic/Accumulation.java | Accumulation.when | @SuppressWarnings("unchecked")
@SafeVarargs
public static <G, ERR> Or<G, Every<ERR>>
when(Or<? extends G, ? extends Every<? extends ERR>> or, Function<? super G, ? extends Validation<ERR>>... validations) {
return when(or, Stream.of(validations));
} | java | @SuppressWarnings("unchecked")
@SafeVarargs
public static <G, ERR> Or<G, Every<ERR>>
when(Or<? extends G, ? extends Every<? extends ERR>> or, Function<? super G, ? extends Validation<ERR>>... validations) {
return when(or, Stream.of(validations));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"SafeVarargs",
"public",
"static",
"<",
"G",
",",
"ERR",
">",
"Or",
"<",
"G",
",",
"Every",
"<",
"ERR",
">",
">",
"when",
"(",
"Or",
"<",
"?",
"extends",
"G",
",",
"?",
"extends",
"Every",
"<... | Enables further validation on an existing accumulating Or by passing validation functions.
@param <G> the Good type of the argument Or
@param <ERR> the type of the error message contained in the accumulating failure
@param or the accumulating or
@param validations the validation functions
@retur... | [
"Enables",
"further",
"validation",
"on",
"an",
"existing",
"accumulating",
"Or",
"by",
"passing",
"validation",
"functions",
"."
] | train | https://github.com/javactic/javactic/blob/dfa040062178c259c3067fd9b59cb4498022d8bc/src/main/java/com/github/javactic/Accumulation.java#L161-L166 |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/patricia/MutableNode.java | MutableNode.addRightChild | void addRightChild(final byte b, @NotNull final MutableNode child) {
final ChildReference right = children.getRight();
if (right != null && (right.firstByte & 0xff) >= (b & 0xff)) {
throw new IllegalArgumentException();
}
children.putRight(new ChildReferenceMutable(b, child))... | java | void addRightChild(final byte b, @NotNull final MutableNode child) {
final ChildReference right = children.getRight();
if (right != null && (right.firstByte & 0xff) >= (b & 0xff)) {
throw new IllegalArgumentException();
}
children.putRight(new ChildReferenceMutable(b, child))... | [
"void",
"addRightChild",
"(",
"final",
"byte",
"b",
",",
"@",
"NotNull",
"final",
"MutableNode",
"child",
")",
"{",
"final",
"ChildReference",
"right",
"=",
"children",
".",
"getRight",
"(",
")",
";",
"if",
"(",
"right",
"!=",
"null",
"&&",
"(",
"right",... | Adds child which is greater (i.e. its next byte greater) than any other.
@param b next byte of child suffix.
@param child child node. | [
"Adds",
"child",
"which",
"is",
"greater",
"(",
"i",
".",
"e",
".",
"its",
"next",
"byte",
"greater",
")",
"than",
"any",
"other",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/patricia/MutableNode.java#L176-L182 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/internal/OperationFuture.java | OperationFuture.getCas | public Long getCas() {
if (cas == null) {
try {
get();
} catch (InterruptedException e) {
status = new OperationStatus(false, "Interrupted", StatusCode.INTERRUPTED);
} catch (ExecutionException e) {
getLogger().warn("Error getting cas of operation", e);
}
}
if... | java | public Long getCas() {
if (cas == null) {
try {
get();
} catch (InterruptedException e) {
status = new OperationStatus(false, "Interrupted", StatusCode.INTERRUPTED);
} catch (ExecutionException e) {
getLogger().warn("Error getting cas of operation", e);
}
}
if... | [
"public",
"Long",
"getCas",
"(",
")",
"{",
"if",
"(",
"cas",
"==",
"null",
")",
"{",
"try",
"{",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"status",
"=",
"new",
"OperationStatus",
"(",
"false",
",",
"\"Interrupte... | Get the CAS for this operation.
The interrupted status of the current thread is cleared by this method.
Inspect the returned OperationStatus to check whether an interruption has taken place.
@throws UnsupportedOperationException If this is for an ASCII protocol
configured client.
@return the CAS for this operation or... | [
"Get",
"the",
"CAS",
"for",
"this",
"operation",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/internal/OperationFuture.java#L218-L233 |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileArtifactNotifier.java | ZipFileArtifactNotifier.registerListener | private boolean registerListener(String newPath, ArtifactListenerSelector newListener) {
boolean updatedCoveringPaths = addCoveringPath(newPath);
Collection<ArtifactListenerSelector> listenersForPath = listeners.get(newPath);
if ( listenersForPath == null ) {
// Each listeners colle... | java | private boolean registerListener(String newPath, ArtifactListenerSelector newListener) {
boolean updatedCoveringPaths = addCoveringPath(newPath);
Collection<ArtifactListenerSelector> listenersForPath = listeners.get(newPath);
if ( listenersForPath == null ) {
// Each listeners colle... | [
"private",
"boolean",
"registerListener",
"(",
"String",
"newPath",
",",
"ArtifactListenerSelector",
"newListener",
")",
"{",
"boolean",
"updatedCoveringPaths",
"=",
"addCoveringPath",
"(",
"newPath",
")",
";",
"Collection",
"<",
"ArtifactListenerSelector",
">",
"listen... | Register a listener to a specified path.
Registration has two effects: The listener is put into a table
which maps the listener to specified path. The path of the
listener are added to the covering paths collection, possibly
causing newly covered paths to be removed from the collection.
If the new path is already cov... | [
"Register",
"a",
"listener",
"to",
"a",
"specified",
"path",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileArtifactNotifier.java#L465-L477 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.createAllPeers | private void createAllPeers() throws NetworkConfigurationException {
// Sanity checks
if (peers != null) {
throw new NetworkConfigurationException("INTERNAL ERROR: peers has already been initialized!");
}
peers = new HashMap<>();
// peers is a JSON object containin... | java | private void createAllPeers() throws NetworkConfigurationException {
// Sanity checks
if (peers != null) {
throw new NetworkConfigurationException("INTERNAL ERROR: peers has already been initialized!");
}
peers = new HashMap<>();
// peers is a JSON object containin... | [
"private",
"void",
"createAllPeers",
"(",
")",
"throws",
"NetworkConfigurationException",
"{",
"// Sanity checks",
"if",
"(",
"peers",
"!=",
"null",
")",
"{",
"throw",
"new",
"NetworkConfigurationException",
"(",
"\"INTERNAL ERROR: peers has already been initialized!\"",
")... | Creates Node instances representing all the peers defined in the config file | [
"Creates",
"Node",
"instances",
"representing",
"all",
"the",
"peers",
"defined",
"in",
"the",
"config",
"file"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L534-L566 |
openengsb/openengsb | connector/userprojectsldap/src/main/java/org/openengsb/connector/userprojects/ldap/internal/ldap/Utils.java | Utils.extractAttributeValueNoEmptyCheck | public static String extractAttributeValueNoEmptyCheck(Entry entry, String attributeType) {
Attribute attribute = entry.get(attributeType);
if (attribute == null) {
return null;
}
try {
return attribute.getString();
} catch (LdapInvalidAttributeValueExcept... | java | public static String extractAttributeValueNoEmptyCheck(Entry entry, String attributeType) {
Attribute attribute = entry.get(attributeType);
if (attribute == null) {
return null;
}
try {
return attribute.getString();
} catch (LdapInvalidAttributeValueExcept... | [
"public",
"static",
"String",
"extractAttributeValueNoEmptyCheck",
"(",
"Entry",
"entry",
",",
"String",
"attributeType",
")",
"{",
"Attribute",
"attribute",
"=",
"entry",
".",
"get",
"(",
"attributeType",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"... | Returns the value of the attribute of attributeType from entry. | [
"Returns",
"the",
"value",
"of",
"the",
"attribute",
"of",
"attributeType",
"from",
"entry",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/connector/userprojectsldap/src/main/java/org/openengsb/connector/userprojects/ldap/internal/ldap/Utils.java#L55-L65 |
hortonworks/dstream | dstream-api/src/main/java/io/dstream/DStreamExecutionGraphBuilder.java | DStreamExecutionGraphBuilder.doBuild | @SuppressWarnings("rawtypes")
private DStreamExecutionGraph doBuild(boolean isDependent){
this.invocationPipeline.getInvocations().forEach(this::addInvocation);
if (this.requiresInitialSetOfOperations()){
this.createDefaultExtractOperation();
}
if (this.requiresPostShuffleOperation(isDependent)){
Ser... | java | @SuppressWarnings("rawtypes")
private DStreamExecutionGraph doBuild(boolean isDependent){
this.invocationPipeline.getInvocations().forEach(this::addInvocation);
if (this.requiresInitialSetOfOperations()){
this.createDefaultExtractOperation();
}
if (this.requiresPostShuffleOperation(isDependent)){
Ser... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"private",
"DStreamExecutionGraph",
"doBuild",
"(",
"boolean",
"isDependent",
")",
"{",
"this",
".",
"invocationPipeline",
".",
"getInvocations",
"(",
")",
".",
"forEach",
"(",
"this",
"::",
"addInvocation",
")",
... | The 'dependentStream' attribute implies that the DStreamOperations the methid is about to build
is a dependency of another DStreamOperations (e.g., for cases such as Join, union etc.)
Basically, each process should have at least two operations - 'read -> write' with shuffle in between.
For cases where we are building a... | [
"The",
"dependentStream",
"attribute",
"implies",
"that",
"the",
"DStreamOperations",
"the",
"methid",
"is",
"about",
"to",
"build",
"is",
"a",
"dependency",
"of",
"another",
"DStreamOperations",
"(",
"e",
".",
"g",
".",
"for",
"cases",
"such",
"as",
"Join",
... | train | https://github.com/hortonworks/dstream/blob/3a106c0f14725b028fe7fe2dbc660406d9a5f142/dstream-api/src/main/java/io/dstream/DStreamExecutionGraphBuilder.java#L89-L117 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java | Configurations.getBoolean | public static boolean getBoolean(String name, boolean defaultVal){
if(getConfiguration().containsKey(name)){
return getConfiguration().getBoolean(name);
} else {
return defaultVal;
}
} | java | public static boolean getBoolean(String name, boolean defaultVal){
if(getConfiguration().containsKey(name)){
return getConfiguration().getBoolean(name);
} else {
return defaultVal;
}
} | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"String",
"name",
",",
"boolean",
"defaultVal",
")",
"{",
"if",
"(",
"getConfiguration",
"(",
")",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"getConfiguration",
"(",
")",
".",
"getBoolean",
... | Get the property object as Boolean, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as boolean, return defaultVal if property is undefined. | [
"Get",
"the",
"property",
"object",
"as",
"Boolean",
"or",
"return",
"defaultVal",
"if",
"property",
"is",
"not",
"defined",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java#L140-L146 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java | MountTable.delete | public boolean delete(Supplier<JournalContext> journalContext, AlluxioURI uri) {
String path = uri.getPath();
LOG.info("Unmounting {}", path);
if (path.equals(ROOT)) {
LOG.warn("Cannot unmount the root mount point.");
return false;
}
try (LockResource r = new LockResource(mWriteLock)) {... | java | public boolean delete(Supplier<JournalContext> journalContext, AlluxioURI uri) {
String path = uri.getPath();
LOG.info("Unmounting {}", path);
if (path.equals(ROOT)) {
LOG.warn("Cannot unmount the root mount point.");
return false;
}
try (LockResource r = new LockResource(mWriteLock)) {... | [
"public",
"boolean",
"delete",
"(",
"Supplier",
"<",
"JournalContext",
">",
"journalContext",
",",
"AlluxioURI",
"uri",
")",
"{",
"String",
"path",
"=",
"uri",
".",
"getPath",
"(",
")",
";",
"LOG",
".",
"info",
"(",
"\"Unmounting {}\"",
",",
"path",
")",
... | Unmounts the given Alluxio path. The path should match an existing mount point.
@param journalContext journal context
@param uri an Alluxio path URI
@return whether the operation succeeded or not | [
"Unmounts",
"the",
"given",
"Alluxio",
"path",
".",
"The",
"path",
"should",
"match",
"an",
"existing",
"mount",
"point",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L157-L187 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.createEmptyTable | public static void createEmptyTable(Connection connection, String tableReference) throws SQLException {
try (Statement statement = connection.createStatement()) {
statement.execute("CREATE TABLE "+ tableReference+ " ()");
}
} | java | public static void createEmptyTable(Connection connection, String tableReference) throws SQLException {
try (Statement statement = connection.createStatement()) {
statement.execute("CREATE TABLE "+ tableReference+ " ()");
}
} | [
"public",
"static",
"void",
"createEmptyTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"statement",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"statement",
... | A method to create an empty table (no columns)
@param connection Connection
@param tableReference Table name
@throws java.sql.SQLException | [
"A",
"method",
"to",
"create",
"an",
"empty",
"table",
"(",
"no",
"columns",
")"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L387-L391 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/MyHTTPUtils.java | MyHTTPUtils.getContent | public static String getContent(String stringUrl, Map<String, String> parameters, Proxy proxy)
throws IOException {
URL url = new URL(stringUrl);
URLConnection conn;
if (proxy != null) {
conn = url.openConnection(proxy);
} else {
conn = url.openConnection();
}
conn.setConnect... | java | public static String getContent(String stringUrl, Map<String, String> parameters, Proxy proxy)
throws IOException {
URL url = new URL(stringUrl);
URLConnection conn;
if (proxy != null) {
conn = url.openConnection(proxy);
} else {
conn = url.openConnection();
}
conn.setConnect... | [
"public",
"static",
"String",
"getContent",
"(",
"String",
"stringUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"Proxy",
"proxy",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"stringUrl",
")",
";",
"U... | Get content for url/parameters/proxy
@param stringUrl the URL to get
@param parameters HTTP parameters to pass
@param proxy Proxy to use
@return content the response content
@throws IOException I/O error happened | [
"Get",
"content",
"for",
"url",
"/",
"parameters",
"/",
"proxy"
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/MyHTTPUtils.java#L96-L122 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationRequest.java | CreateIntegrationRequest.withRequestTemplates | public CreateIntegrationRequest withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} | java | public CreateIntegrationRequest withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} | [
"public",
"CreateIntegrationRequest",
"withRequestTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestTemplates",
")",
"{",
"setRequestTemplates",
"(",
"requestTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
String) is the value.
</p>
@param requestTemplates
Represents a map of Velocity templates that are a... | [
"<p",
">",
"Represents",
"a",
"map",
"of",
"Velocity",
"templates",
"that",
"are",
"applied",
"on",
"the",
"request",
"payload",
"based",
"on",
"the",
"value",
"of",
"the",
"Content",
"-",
"Type",
"header",
"sent",
"by",
"the",
"client",
".",
"The",
"con... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationRequest.java#L1161-L1164 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/CmsImageResourcePreview.java | CmsImageResourcePreview.getImageInfo | private void getImageInfo(final String resourcePath, final I_CmsSimpleCallback<CmsImageInfoBean> callback) {
CmsRpcAction<CmsImageInfoBean> action = new CmsRpcAction<CmsImageInfoBean>() {
/**
* @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
*/
@Overrid... | java | private void getImageInfo(final String resourcePath, final I_CmsSimpleCallback<CmsImageInfoBean> callback) {
CmsRpcAction<CmsImageInfoBean> action = new CmsRpcAction<CmsImageInfoBean>() {
/**
* @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
*/
@Overrid... | [
"private",
"void",
"getImageInfo",
"(",
"final",
"String",
"resourcePath",
",",
"final",
"I_CmsSimpleCallback",
"<",
"CmsImageInfoBean",
">",
"callback",
")",
"{",
"CmsRpcAction",
"<",
"CmsImageInfoBean",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"CmsImageInfo... | Returns the image info bean for the given resource.<p>
@param resourcePath the resource path
@param callback the calback to execute | [
"Returns",
"the",
"image",
"info",
"bean",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsImageResourcePreview.java#L324-L350 |
uber/rides-java-sdk | uber-core-oauth-client-adapter/src/main/java/com/uber/sdk/core/auth/OAuth2Credentials.java | OAuth2Credentials.clearCredential | public void clearCredential(String userId) throws AuthException {
try {
authorizationCodeFlow.getCredentialDataStore().delete(userId);
} catch (IOException e) {
throw new AuthException("Unable to clear credential.", e);
}
} | java | public void clearCredential(String userId) throws AuthException {
try {
authorizationCodeFlow.getCredentialDataStore().delete(userId);
} catch (IOException e) {
throw new AuthException("Unable to clear credential.", e);
}
} | [
"public",
"void",
"clearCredential",
"(",
"String",
"userId",
")",
"throws",
"AuthException",
"{",
"try",
"{",
"authorizationCodeFlow",
".",
"getCredentialDataStore",
"(",
")",
".",
"delete",
"(",
"userId",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",... | Clears the credential for the user in the underlying (@link DateStore}.
@throws AuthException If the credential could not be cleared. | [
"Clears",
"the",
"credential",
"for",
"the",
"user",
"in",
"the",
"underlying",
"("
] | train | https://github.com/uber/rides-java-sdk/blob/6c75570ab7884f8ecafaad312ef471dd33f64c42/uber-core-oauth-client-adapter/src/main/java/com/uber/sdk/core/auth/OAuth2Credentials.java#L287-L293 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java | base_resource.resource_to_string | protected String resource_to_string(nitro_service service, String id, options option)
{
Boolean warning = service.get_warning();
String onerror = service.get_onerror();
String result = service.get_payload_formatter().resource_to_string(this, id, option, warning, onerror);
return result;
} | java | protected String resource_to_string(nitro_service service, String id, options option)
{
Boolean warning = service.get_warning();
String onerror = service.get_onerror();
String result = service.get_payload_formatter().resource_to_string(this, id, option, warning, onerror);
return result;
} | [
"protected",
"String",
"resource_to_string",
"(",
"nitro_service",
"service",
",",
"String",
"id",
",",
"options",
"option",
")",
"{",
"Boolean",
"warning",
"=",
"service",
".",
"get_warning",
"(",
")",
";",
"String",
"onerror",
"=",
"service",
".",
"get_onerr... | Converts netscaler resource to Json string.
@param service nitro_service object.
@param id sessionId.
@param option Options object.
@return string in Json format. | [
"Converts",
"netscaler",
"resource",
"to",
"Json",
"string",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java#L65-L71 |
kamcpp/avicenna | src/avicenna/src/main/java/org/labcrypto/avicenna/Avicenna.java | Avicenna.defineDependency | public static <T> void defineDependency(Class<T> clazz, T dependency) {
defineDependency(clazz, null, dependency);
} | java | public static <T> void defineDependency(Class<T> clazz, T dependency) {
defineDependency(clazz, null, dependency);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"defineDependency",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"T",
"dependency",
")",
"{",
"defineDependency",
"(",
"clazz",
",",
"null",
",",
"dependency",
")",
";",
"}"
] | Adds a direct mapping between a type and an object.
@param clazz Class type which should be injected.
@param dependency Dependency reference which should be copied to injection targets. | [
"Adds",
"a",
"direct",
"mapping",
"between",
"a",
"type",
"and",
"an",
"object",
"."
] | train | https://github.com/kamcpp/avicenna/blob/0fc4eff447761140cd3799287427d99c63ea6e6e/src/avicenna/src/main/java/org/labcrypto/avicenna/Avicenna.java#L145-L147 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java | ArabicShaping.flipArray | private static int flipArray(char [] dest, int start, int e, int w){
int r;
if (w > start) {
// shift, assume small buffer size so don't use arraycopy
r = w;
w = start;
while (r < e) {
dest[w++] = dest[r++];
}
} else {
w ... | java | private static int flipArray(char [] dest, int start, int e, int w){
int r;
if (w > start) {
// shift, assume small buffer size so don't use arraycopy
r = w;
w = start;
while (r < e) {
dest[w++] = dest[r++];
}
} else {
w ... | [
"private",
"static",
"int",
"flipArray",
"(",
"char",
"[",
"]",
"dest",
",",
"int",
"start",
",",
"int",
"e",
",",
"int",
"w",
")",
"{",
"int",
"r",
";",
"if",
"(",
"w",
">",
"start",
")",
"{",
"// shift, assume small buffer size so don't use arraycopy",
... | /*
Name : flipArray
Function: inverts array, so that start becomes end and vice versa | [
"/",
"*",
"Name",
":",
"flipArray",
"Function",
":",
"inverts",
"array",
"so",
"that",
"start",
"becomes",
"end",
"and",
"vice",
"versa"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java#L1183-L1196 |
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java | AppSummaryService.getTimestamp | long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) {
if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) {
// get top of the hour
long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY);
return dayTimestamp;
} else if (AggregationConstants.AGGREGAT... | java | long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) {
if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) {
// get top of the hour
long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY);
return dayTimestamp;
} else if (AggregationConstants.AGGREGAT... | [
"long",
"getTimestamp",
"(",
"long",
"runId",
",",
"AggregationConstants",
".",
"AGGREGATION_TYPE",
"aggType",
")",
"{",
"if",
"(",
"AggregationConstants",
".",
"AGGREGATION_TYPE",
".",
"DAILY",
".",
"equals",
"(",
"aggType",
")",
")",
"{",
"// get top of the hour... | find out the top of the day/week timestamp
@param runId
@return top of the day/week timestamp | [
"find",
"out",
"the",
"top",
"of",
"the",
"day",
"/",
"week",
"timestamp"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/AppSummaryService.java#L366-L383 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/PixelDepthLinearMetric.java | PixelDepthLinearMetric.depth2View | public double depth2View( Point2D_F64 a , Point2D_F64 b , Se3_F64 fromAtoB )
{
DMatrixRMaj R = fromAtoB.getR();
Vector3D_F64 T = fromAtoB.getT();
GeometryMath_F64.multCrossA(b, R, temp0);
GeometryMath_F64.mult(temp0,a,temp1);
GeometryMath_F64.cross(b, T, temp2);
return -(temp2.x+temp2.y+temp2.z)/(temp1.... | java | public double depth2View( Point2D_F64 a , Point2D_F64 b , Se3_F64 fromAtoB )
{
DMatrixRMaj R = fromAtoB.getR();
Vector3D_F64 T = fromAtoB.getT();
GeometryMath_F64.multCrossA(b, R, temp0);
GeometryMath_F64.mult(temp0,a,temp1);
GeometryMath_F64.cross(b, T, temp2);
return -(temp2.x+temp2.y+temp2.z)/(temp1.... | [
"public",
"double",
"depth2View",
"(",
"Point2D_F64",
"a",
",",
"Point2D_F64",
"b",
",",
"Se3_F64",
"fromAtoB",
")",
"{",
"DMatrixRMaj",
"R",
"=",
"fromAtoB",
".",
"getR",
"(",
")",
";",
"Vector3D_F64",
"T",
"=",
"fromAtoB",
".",
"getT",
"(",
")",
";",
... | Computes pixel depth in image 'a' from two observations.
@param a Observation in first frame. In calibrated coordinates. Not modified.
@param b Observation in second frame. In calibrated coordinates. Not modified.
@param fromAtoB Transform from frame a to frame b.
@return Pixel depth in first frame. In same units as... | [
"Computes",
"pixel",
"depth",
"in",
"image",
"a",
"from",
"two",
"observations",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/triangulate/PixelDepthLinearMetric.java#L101-L112 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java | JPAEntity.findByPrimaryKey | public static <E extends Identifiable> E findByPrimaryKey(EntityManager em, BigInteger id, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(id != null && id.compareTo(ZERO) > 0, "ID cannot be null and must be positive and non-zero");
requireArgu... | java | public static <E extends Identifiable> E findByPrimaryKey(EntityManager em, BigInteger id, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(id != null && id.compareTo(ZERO) > 0, "ID cannot be null and must be positive and non-zero");
requireArgu... | [
"public",
"static",
"<",
"E",
"extends",
"Identifiable",
">",
"E",
"findByPrimaryKey",
"(",
"EntityManager",
"em",
",",
"BigInteger",
"id",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"The entity manager ... | Finds a JPA entity by its primary key.
@param <E> The JPA entity type.
@param em The entity manager to use. Cannot be null.
@param id The ID of the entity to find. Must be a positive, non-zero integer.
@param type The runtime type to cast the result value to.
@return The corresponding entity or nu... | [
"Finds",
"a",
"JPA",
"entity",
"by",
"its",
"primary",
"key",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/JPAEntity.java#L181-L196 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java | TmdbMovies.getSimilarMovies | public ResultList<MovieInfo> getSimilarMovies(int movieId, Integer page, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.PAGE, page);
UR... | java | public ResultList<MovieInfo> getSimilarMovies(int movieId, Integer page, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.PAGE, page);
UR... | [
"public",
"ResultList",
"<",
"MovieInfo",
">",
"getSimilarMovies",
"(",
"int",
"movieId",
",",
"Integer",
"page",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"par... | The similar movies method will let you retrieve the similar movies for a particular movie.
This data is created dynamically but with the help of users votes on TMDb.
The data is much better with movies that have more keywords
@param movieId
@param language
@param page
@return
@throws MovieDbException | [
"The",
"similar",
"movies",
"method",
"will",
"let",
"you",
"retrieve",
"the",
"similar",
"movies",
"for",
"a",
"particular",
"movie",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java#L392-L401 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/encode/UrlEncoded.java | UrlEncoded.decodeTo | public static void decodeTo(String content, MultiMap<String> map, String charset) {
decodeTo(content, map, charset == null ? null : Charset.forName(charset));
} | java | public static void decodeTo(String content, MultiMap<String> map, String charset) {
decodeTo(content, map, charset == null ? null : Charset.forName(charset));
} | [
"public",
"static",
"void",
"decodeTo",
"(",
"String",
"content",
",",
"MultiMap",
"<",
"String",
">",
"map",
",",
"String",
"charset",
")",
"{",
"decodeTo",
"(",
"content",
",",
"map",
",",
"charset",
"==",
"null",
"?",
"null",
":",
"Charset",
".",
"f... | Decoded parameters to Map.
@param content the string containing the encoded parameters
@param map the MultiMap to put parsed query parameters into
@param charset the charset to use for decoding | [
"Decoded",
"parameters",
"to",
"Map",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/encode/UrlEncoded.java#L175-L177 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/content/CmsMergePages.java | CmsMergePages.reportList | private void reportList(List collected, boolean doReport) {
int size = collected.size();
// now loop through all collected resources
m_report.println(
Messages.get().container(Messages.RPT_NUM_PAGES_1, new Integer(size)),
I_CmsReport.FORMAT_HEADLINE);
if (doRepor... | java | private void reportList(List collected, boolean doReport) {
int size = collected.size();
// now loop through all collected resources
m_report.println(
Messages.get().container(Messages.RPT_NUM_PAGES_1, new Integer(size)),
I_CmsReport.FORMAT_HEADLINE);
if (doRepor... | [
"private",
"void",
"reportList",
"(",
"List",
"collected",
",",
"boolean",
"doReport",
")",
"{",
"int",
"size",
"=",
"collected",
".",
"size",
"(",
")",
";",
"// now loop through all collected resources",
"m_report",
".",
"println",
"(",
"Messages",
".",
"get",
... | Creates a report list of all resources in one of the collected lists.<p>
@param collected the list to create the output from
@param doReport flag to enable detailed report | [
"Creates",
"a",
"report",
"list",
"of",
"all",
"resources",
"in",
"one",
"of",
"the",
"collected",
"lists",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/content/CmsMergePages.java#L751-L774 |
js-lib-com/dom | src/main/java/js/dom/w3c/DocumentBuilderImpl.java | DocumentBuilderImpl.getDocumentBuilder | private static javax.xml.parsers.DocumentBuilder getDocumentBuilder(Schema schema, boolean useNamespace) throws ParserConfigurationException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setIgnoringComments(true);
dbf.setIgnoringElementContentWhitespace(true);
dbf.setCoalescing(tr... | java | private static javax.xml.parsers.DocumentBuilder getDocumentBuilder(Schema schema, boolean useNamespace) throws ParserConfigurationException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setIgnoringComments(true);
dbf.setIgnoringElementContentWhitespace(true);
dbf.setCoalescing(tr... | [
"private",
"static",
"javax",
".",
"xml",
".",
"parsers",
".",
"DocumentBuilder",
"getDocumentBuilder",
"(",
"Schema",
"schema",
",",
"boolean",
"useNamespace",
")",
"throws",
"ParserConfigurationException",
"{",
"DocumentBuilderFactory",
"dbf",
"=",
"DocumentBuilderFac... | Get XML document builder.
@param schema XML schema,
@param useNamespace flag to use name space.
@return XML document builder.
@throws ParserConfigurationException if document builder factory feature set fail. | [
"Get",
"XML",
"document",
"builder",
"."
] | train | https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/DocumentBuilderImpl.java#L453-L486 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java | ActionUtil.addAction | public static ActionListener addAction(BaseComponent component, IAction action) {
return addAction(component, action, ClickEvent.TYPE);
} | java | public static ActionListener addAction(BaseComponent component, IAction action) {
return addAction(component, action, ClickEvent.TYPE);
} | [
"public",
"static",
"ActionListener",
"addAction",
"(",
"BaseComponent",
"component",
",",
"IAction",
"action",
")",
"{",
"return",
"addAction",
"(",
"component",
",",
"action",
",",
"ClickEvent",
".",
"TYPE",
")",
";",
"}"
] | Adds/removes an action listener to/from a component using the default click trigger event.
@param component Component to be associated with the action.
@param action Action to invoke when listener event is triggered. If null, dissociates the
event listener from the component.
@return The newly created action listener. | [
"Adds",
"/",
"removes",
"an",
"action",
"listener",
"to",
"/",
"from",
"a",
"component",
"using",
"the",
"default",
"click",
"trigger",
"event",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java#L84-L86 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/WaveData.java | WaveData.convertAudioBytes | private static ByteBuffer convertAudioBytes(byte[] audio_bytes, boolean two_bytes_data) {
ByteBuffer dest = ByteBuffer.allocateDirect(audio_bytes.length);
dest.order(ByteOrder.nativeOrder());
ByteBuffer src = ByteBuffer.wrap(audio_bytes);
src.order(ByteOrder.LITTLE_ENDIAN);
if (two_bytes_data) {
Shor... | java | private static ByteBuffer convertAudioBytes(byte[] audio_bytes, boolean two_bytes_data) {
ByteBuffer dest = ByteBuffer.allocateDirect(audio_bytes.length);
dest.order(ByteOrder.nativeOrder());
ByteBuffer src = ByteBuffer.wrap(audio_bytes);
src.order(ByteOrder.LITTLE_ENDIAN);
if (two_bytes_data) {
Shor... | [
"private",
"static",
"ByteBuffer",
"convertAudioBytes",
"(",
"byte",
"[",
"]",
"audio_bytes",
",",
"boolean",
"two_bytes_data",
")",
"{",
"ByteBuffer",
"dest",
"=",
"ByteBuffer",
".",
"allocateDirect",
"(",
"audio_bytes",
".",
"length",
")",
";",
"dest",
".",
... | Convert the audio bytes into the stream
@param audio_bytes The audio byts
@param two_bytes_data True if we using double byte data
@return The byte bufer of data | [
"Convert",
"the",
"audio",
"bytes",
"into",
"the",
"stream"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/WaveData.java#L248-L264 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/RelationalJMapper.java | RelationalJMapper.addClasses | private void addClasses(Class<?>[] classes, HashSet<Class<?>> result){
if(isNull(classes) || classes.length==0)
Error.globalClassesAbsent(configuredClass);
for (Class<?> classe : classes) result.add(classe);
} | java | private void addClasses(Class<?>[] classes, HashSet<Class<?>> result){
if(isNull(classes) || classes.length==0)
Error.globalClassesAbsent(configuredClass);
for (Class<?> classe : classes) result.add(classe);
} | [
"private",
"void",
"addClasses",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"classes",
",",
"HashSet",
"<",
"Class",
"<",
"?",
">",
">",
"result",
")",
"{",
"if",
"(",
"isNull",
"(",
"classes",
")",
"||",
"classes",
".",
"length",
"==",
"0",
")",
"Er... | Adds to the result parameter all classes that aren't present in it
@param classes classes to control
@param result List to enrich | [
"Adds",
"to",
"the",
"result",
"parameter",
"all",
"classes",
"that",
"aren",
"t",
"present",
"in",
"it"
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/RelationalJMapper.java#L291-L297 |
jbundle/jbundle | base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java | ClientTable.fieldsToData | public void fieldsToData(Rec record) throws DBException
{
try {
int iFieldTypes = BaseBuffer.PHYSICAL_FIELDS;
if (!((Record)record).isAllSelected())
iFieldTypes = BaseBuffer.DATA_FIELDS; //SELECTED_FIELDS; (Selected and physical)
m_dataSource = new Vec... | java | public void fieldsToData(Rec record) throws DBException
{
try {
int iFieldTypes = BaseBuffer.PHYSICAL_FIELDS;
if (!((Record)record).isAllSelected())
iFieldTypes = BaseBuffer.DATA_FIELDS; //SELECTED_FIELDS; (Selected and physical)
m_dataSource = new Vec... | [
"public",
"void",
"fieldsToData",
"(",
"Rec",
"record",
")",
"throws",
"DBException",
"{",
"try",
"{",
"int",
"iFieldTypes",
"=",
"BaseBuffer",
".",
"PHYSICAL_FIELDS",
";",
"if",
"(",
"!",
"(",
"(",
"Record",
")",
"record",
")",
".",
"isAllSelected",
"(",
... | Move all the fields to the output buffer.
In this implementation, create a new VectorBuffer and move the fielddata to it.
@exception DBException File exception. | [
"Move",
"all",
"the",
"fields",
"to",
"the",
"output",
"buffer",
".",
"In",
"this",
"implementation",
"create",
"a",
"new",
"VectorBuffer",
"and",
"move",
"the",
"fielddata",
"to",
"it",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java#L561-L572 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/processors/visitors/AbstractDataServiceVisitor.java | AbstractDataServiceVisitor.browseAndWriteMethods | void browseAndWriteMethods(List<ExecutableElement> methodElements, String classname, Writer writer) throws IOException {
Collection<String> methodProceeds = new ArrayList<>();
boolean first = true;
for (ExecutableElement methodElement : methodElements) {
if (isConsiderateMethod(methodProceeds, methodElemen... | java | void browseAndWriteMethods(List<ExecutableElement> methodElements, String classname, Writer writer) throws IOException {
Collection<String> methodProceeds = new ArrayList<>();
boolean first = true;
for (ExecutableElement methodElement : methodElements) {
if (isConsiderateMethod(methodProceeds, methodElemen... | [
"void",
"browseAndWriteMethods",
"(",
"List",
"<",
"ExecutableElement",
">",
"methodElements",
",",
"String",
"classname",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"Collection",
"<",
"String",
">",
"methodProceeds",
"=",
"new",
"ArrayList",
"<>"... | browse valid methods and write equivalent js methods in writer
@param methodElements
@param classname
@param writer
@return
@throws IOException | [
"browse",
"valid",
"methods",
"and",
"write",
"equivalent",
"js",
"methods",
"in",
"writer"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/visitors/AbstractDataServiceVisitor.java#L133-L145 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_bluecatvpx_image.java | xen_bluecatvpx_image.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_bluecatvpx_image_responses result = (xen_bluecatvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_bluecatvpx_image_responses.class, response);
if(result.errorcode != 0)
{... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_bluecatvpx_image_responses result = (xen_bluecatvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_bluecatvpx_image_responses.class, response);
if(result.errorcode != 0)
{... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_bluecatvpx_image_responses",
"result",
"=",
"(",
"xen_bluecatvpx_image_responses",
")",
"service",
".",
"... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_bluecatvpx_image.java#L264-L281 |
josesamuel/remoter | remoter/src/main/java/remoter/compiler/builder/BindingManager.java | BindingManager.getClassBuilder | private ClassBuilder getClassBuilder(Element element) {
ClassBuilder classBuilder = new ClassBuilder(messager, element);
classBuilder.setBindingManager(this);
return classBuilder;
} | java | private ClassBuilder getClassBuilder(Element element) {
ClassBuilder classBuilder = new ClassBuilder(messager, element);
classBuilder.setBindingManager(this);
return classBuilder;
} | [
"private",
"ClassBuilder",
"getClassBuilder",
"(",
"Element",
"element",
")",
"{",
"ClassBuilder",
"classBuilder",
"=",
"new",
"ClassBuilder",
"(",
"messager",
",",
"element",
")",
";",
"classBuilder",
".",
"setBindingManager",
"(",
"this",
")",
";",
"return",
"... | Returns the {@link ClassBuilder} that generates the Builder for the Proxy and Stub classes | [
"Returns",
"the",
"{"
] | train | https://github.com/josesamuel/remoter/blob/007401868c319740d40134ebc07c3406988f9a86/remoter/src/main/java/remoter/compiler/builder/BindingManager.java#L112-L116 |
osglworks/java-tool | src/main/java/org/osgl/util/E.java | E.invalidRangeIfNot | public static void invalidRangeIfNot(boolean tester, String msg, Object... args) {
if (!tester) {
throw new InvalidRangeException(msg, args);
}
} | java | public static void invalidRangeIfNot(boolean tester, String msg, Object... args) {
if (!tester) {
throw new InvalidRangeException(msg, args);
}
} | [
"public",
"static",
"void",
"invalidRangeIfNot",
"(",
"boolean",
"tester",
",",
"String",
"msg",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"tester",
")",
"{",
"throw",
"new",
"InvalidRangeException",
"(",
"msg",
",",
"args",
")",
";",
"}",
... | Throws out an {@link InvalidRangeException} with error message specified
when `tester` is `false`.
@param tester
when `false` then throw out the exception
@param msg
the error message format pattern.
@param args
the error message format arguments. | [
"Throws",
"out",
"an",
"{",
"@link",
"InvalidRangeException",
"}",
"with",
"error",
"message",
"specified",
"when",
"tester",
"is",
"false",
"."
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/E.java#L498-L502 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEConfigData.java | CmsADEConfigData.getFormattersFromSchema | protected CmsFormatterConfiguration getFormattersFromSchema(CmsObject cms, CmsResource res) {
try {
return OpenCms.getResourceManager().getResourceType(res.getTypeId()).getFormattersForResource(cms, res);
} catch (CmsException e) {
LOG.error(e.getLocalizedMessage(), e);
... | java | protected CmsFormatterConfiguration getFormattersFromSchema(CmsObject cms, CmsResource res) {
try {
return OpenCms.getResourceManager().getResourceType(res.getTypeId()).getFormattersForResource(cms, res);
} catch (CmsException e) {
LOG.error(e.getLocalizedMessage(), e);
... | [
"protected",
"CmsFormatterConfiguration",
"getFormattersFromSchema",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"res",
")",
"{",
"try",
"{",
"return",
"OpenCms",
".",
"getResourceManager",
"(",
")",
".",
"getResourceType",
"(",
"res",
".",
"getTypeId",
"(",
")",... | Gets the formatters from the schema.<p>
@param cms the current CMS context
@param res the resource for which the formatters should be retrieved
@return the formatters from the schema | [
"Gets",
"the",
"formatters",
"from",
"the",
"schema",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEConfigData.java#L1116-L1124 |
OpenLiberty/open-liberty | dev/com.ibm.ws.anno/src/com/ibm/ws/anno/info/internal/ClassInfoCache.java | ClassInfoCache.getArrayClassInfo | public ArrayClassInfo getArrayClassInfo(String typeClassName, Type arrayType) {
ClassInfoImpl elementClassInfo = getDelayableClassInfo(arrayType.getElementType());
return new ArrayClassInfo(typeClassName, elementClassInfo);
} | java | public ArrayClassInfo getArrayClassInfo(String typeClassName, Type arrayType) {
ClassInfoImpl elementClassInfo = getDelayableClassInfo(arrayType.getElementType());
return new ArrayClassInfo(typeClassName, elementClassInfo);
} | [
"public",
"ArrayClassInfo",
"getArrayClassInfo",
"(",
"String",
"typeClassName",
",",
"Type",
"arrayType",
")",
"{",
"ClassInfoImpl",
"elementClassInfo",
"=",
"getDelayableClassInfo",
"(",
"arrayType",
".",
"getElementType",
"(",
")",
")",
";",
"return",
"new",
"Arr... | Note that this will recurse as long as the element type is still an array type. | [
"Note",
"that",
"this",
"will",
"recurse",
"as",
"long",
"as",
"the",
"element",
"type",
"is",
"still",
"an",
"array",
"type",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.anno/src/com/ibm/ws/anno/info/internal/ClassInfoCache.java#L394-L398 |
Codearte/catch-exception | catch-throwable/src/main/java/com/googlecode/catchexception/throwable/CatchThrowable.java | CatchThrowable.catchThrowable | public static void catchThrowable(ThrowingCallable actor, Class<? extends Throwable> clazz) {
validateArguments(actor, clazz);
catchThrowable(actor, clazz, false);
} | java | public static void catchThrowable(ThrowingCallable actor, Class<? extends Throwable> clazz) {
validateArguments(actor, clazz);
catchThrowable(actor, clazz, false);
} | [
"public",
"static",
"void",
"catchThrowable",
"(",
"ThrowingCallable",
"actor",
",",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"clazz",
")",
"{",
"validateArguments",
"(",
"actor",
",",
"clazz",
")",
";",
"catchThrowable",
"(",
"actor",
",",
"clazz",
"... | Use it to catch an throwable of a specific type and to get access to the thrown throwable (for further
verifications).
In the following example you catch throwables of type MyThrowable that are thrown by obj.doX():
<code>catchThrowable(obj, MyThrowable.class).doX(); // catch
if (caughtThrowable() != null) {
assert "fo... | [
"Use",
"it",
"to",
"catch",
"an",
"throwable",
"of",
"a",
"specific",
"type",
"and",
"to",
"get",
"access",
"to",
"the",
"thrown",
"throwable",
"(",
"for",
"further",
"verifications",
")",
"."
] | train | https://github.com/Codearte/catch-exception/blob/8cfb1c0a68661ef622011484ff0061b41796b165/catch-throwable/src/main/java/com/googlecode/catchexception/throwable/CatchThrowable.java#L121-L124 |
google/error-prone | check_api/src/main/java/com/google/errorprone/VisitorState.java | VisitorState.incrementCounter | public void incrementCounter(BugChecker bugChecker, String key, int count) {
statisticsCollector.incrementCounter(statsKey(bugChecker.canonicalName() + "-" + key), count);
} | java | public void incrementCounter(BugChecker bugChecker, String key, int count) {
statisticsCollector.incrementCounter(statsKey(bugChecker.canonicalName() + "-" + key), count);
} | [
"public",
"void",
"incrementCounter",
"(",
"BugChecker",
"bugChecker",
",",
"String",
"key",
",",
"int",
"count",
")",
"{",
"statisticsCollector",
".",
"incrementCounter",
"(",
"statsKey",
"(",
"bugChecker",
".",
"canonicalName",
"(",
")",
"+",
"\"-\"",
"+",
"... | Increment the counter for a combination of {@code bugChecker}'s canonical name and {@code key}
by {@code count}.
<p>e.g.: a key of {@code foo} becomes {@code FooChecker-foo}. | [
"Increment",
"the",
"counter",
"for",
"a",
"combination",
"of",
"{",
"@code",
"bugChecker",
"}",
"s",
"canonical",
"name",
"and",
"{",
"@code",
"key",
"}",
"by",
"{",
"@code",
"count",
"}",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/VisitorState.java#L305-L307 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/lang/init/ModuleFileUtil.java | ModuleFileUtil.createPathEntryForModuleFile | public static GosuPathEntry createPathEntryForModuleFile(IFile moduleFile) {
try {
InputStream is = moduleFile.openInputStream();
try {
SimpleXmlNode moduleNode = SimpleXmlNode.parse(is);
IDirectory rootDir = moduleFile.getParent();
List<IDirectory> sourceDirs = new ArrayList<ID... | java | public static GosuPathEntry createPathEntryForModuleFile(IFile moduleFile) {
try {
InputStream is = moduleFile.openInputStream();
try {
SimpleXmlNode moduleNode = SimpleXmlNode.parse(is);
IDirectory rootDir = moduleFile.getParent();
List<IDirectory> sourceDirs = new ArrayList<ID... | [
"public",
"static",
"GosuPathEntry",
"createPathEntryForModuleFile",
"(",
"IFile",
"moduleFile",
")",
"{",
"try",
"{",
"InputStream",
"is",
"=",
"moduleFile",
".",
"openInputStream",
"(",
")",
";",
"try",
"{",
"SimpleXmlNode",
"moduleNode",
"=",
"SimpleXmlNode",
"... | Reads a pom.xml file into a GosuPathEntry object
@param moduleFile the pom.xml file to convert to GosuPathEntry
@return an ordered list of GosuPathEntries created based on the algorithm described above | [
"Reads",
"a",
"pom",
".",
"xml",
"file",
"into",
"a",
"GosuPathEntry",
"object"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/lang/init/ModuleFileUtil.java#L26-L47 |
jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.calcFillSettings | public void calcFillSettings(String field, Map<String,Object> attributes) {
String capitalizedFieldName = StringUtils.capitalize(field);
String methodName = "doFill" + capitalizedFieldName + "Items";
Method method = ReflectionUtils.getPublicMethodNamed(getClass(), methodName);
if(method=... | java | public void calcFillSettings(String field, Map<String,Object> attributes) {
String capitalizedFieldName = StringUtils.capitalize(field);
String methodName = "doFill" + capitalizedFieldName + "Items";
Method method = ReflectionUtils.getPublicMethodNamed(getClass(), methodName);
if(method=... | [
"public",
"void",
"calcFillSettings",
"(",
"String",
"field",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"String",
"capitalizedFieldName",
"=",
"StringUtils",
".",
"capitalize",
"(",
"field",
")",
";",
"String",
"methodName",
"=",
... | Computes the list of other form fields that the given field depends on, via the doFillXyzItems method,
and sets that as the 'fillDependsOn' attribute. Also computes the URL of the doFillXyzItems and
sets that as the 'fillUrl' attribute. | [
"Computes",
"the",
"list",
"of",
"other",
"form",
"fields",
"that",
"the",
"given",
"field",
"depends",
"on",
"via",
"the",
"doFillXyzItems",
"method",
"and",
"sets",
"that",
"as",
"the",
"fillDependsOn",
"attribute",
".",
"Also",
"computes",
"the",
"URL",
"... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L411-L424 |
abel533/Mapper | core/src/main/java/tk/mybatis/mapper/genid/GenIdUtil.java | GenIdUtil.genId | public static void genId(Object target, String property, Class<? extends GenId> genClass, String table, String column) throws MapperException {
try {
GenId genId;
if (CACHE.containsKey(genClass)) {
genId = CACHE.get(genClass);
} else {
LOCK.loc... | java | public static void genId(Object target, String property, Class<? extends GenId> genClass, String table, String column) throws MapperException {
try {
GenId genId;
if (CACHE.containsKey(genClass)) {
genId = CACHE.get(genClass);
} else {
LOCK.loc... | [
"public",
"static",
"void",
"genId",
"(",
"Object",
"target",
",",
"String",
"property",
",",
"Class",
"<",
"?",
"extends",
"GenId",
">",
"genClass",
",",
"String",
"table",
",",
"String",
"column",
")",
"throws",
"MapperException",
"{",
"try",
"{",
"GenId... | 生成 Id
@param target
@param property
@param genClass
@param table
@param column
@throws MapperException | [
"生成",
"Id"
] | train | https://github.com/abel533/Mapper/blob/45c3d716583cba3680e03f1f6790fab5e1f4f668/core/src/main/java/tk/mybatis/mapper/genid/GenIdUtil.java#L55-L79 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/utils/PluginRepositoryUtil.java | PluginRepositoryUtil.getAttributeValue | private static String getAttributeValue(final Element element, final String attributeName, final boolean mandatory)
throws PluginConfigurationException {
String returnValue = element.attributeValue(attributeName);
if (mandatory) {
if (StringUtils.isBlank(returnValue)) {
... | java | private static String getAttributeValue(final Element element, final String attributeName, final boolean mandatory)
throws PluginConfigurationException {
String returnValue = element.attributeValue(attributeName);
if (mandatory) {
if (StringUtils.isBlank(returnValue)) {
... | [
"private",
"static",
"String",
"getAttributeValue",
"(",
"final",
"Element",
"element",
",",
"final",
"String",
"attributeName",
",",
"final",
"boolean",
"mandatory",
")",
"throws",
"PluginConfigurationException",
"{",
"String",
"returnValue",
"=",
"element",
".",
"... | Returns the value of the given attribute name of element. If mandatory is
<code>true</code> and the attribute is blank or null, an exception is
thrown.
@param element
The element whose attribute must be read
@param attributeName
The attribute name
@param mandatory
<code>true</code> if the attribute is mandatory
@ret... | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"attribute",
"name",
"of",
"element",
".",
"If",
"mandatory",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
"and",
"the",
"attribute",
"is",
"blank",
"or",
"null",
"an",
"exception",
"is",
"thrown",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/utils/PluginRepositoryUtil.java#L162-L174 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java | CacheOnDisk.writeDependencyEntry | public int writeDependencyEntry(Object id, Object entry) { // SKS-O
int returnCode = htod.writeDependencyEntry(id, entry);
if (returnCode == HTODDynacache.DISK_EXCEPTION) {
stopOnError(this.htod.diskCacheException);
}
return returnCode;
} | java | public int writeDependencyEntry(Object id, Object entry) { // SKS-O
int returnCode = htod.writeDependencyEntry(id, entry);
if (returnCode == HTODDynacache.DISK_EXCEPTION) {
stopOnError(this.htod.diskCacheException);
}
return returnCode;
} | [
"public",
"int",
"writeDependencyEntry",
"(",
"Object",
"id",
",",
"Object",
"entry",
")",
"{",
"// SKS-O",
"int",
"returnCode",
"=",
"htod",
".",
"writeDependencyEntry",
"(",
"id",
",",
"entry",
")",
";",
"if",
"(",
"returnCode",
"==",
"HTODDynacache",
".",... | Call this method to add a cache id for a specified dependency id to the disk.
@param id
- dependency id.
@param entry
- cache id. | [
"Call",
"this",
"method",
"to",
"add",
"a",
"cache",
"id",
"for",
"a",
"specified",
"dependency",
"id",
"to",
"the",
"disk",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java#L1596-L1602 |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java | RSTImpl.sortChildren | private void sortChildren(JSONObject root) throws JSONException {
JSONArray children = root.getJSONArray("children");
List<JSONObject> childrenSorted = new ArrayList<JSONObject>(children.
length());
for (int i = 0; i < children.length(); i++) {
childrenSorted.add(children.getJSONObject(i)... | java | private void sortChildren(JSONObject root) throws JSONException {
JSONArray children = root.getJSONArray("children");
List<JSONObject> childrenSorted = new ArrayList<JSONObject>(children.
length());
for (int i = 0; i < children.length(); i++) {
childrenSorted.add(children.getJSONObject(i)... | [
"private",
"void",
"sortChildren",
"(",
"JSONObject",
"root",
")",
"throws",
"JSONException",
"{",
"JSONArray",
"children",
"=",
"root",
".",
"getJSONArray",
"(",
"\"children\"",
")",
";",
"List",
"<",
"JSONObject",
">",
"childrenSorted",
"=",
"new",
"ArrayList"... | Sorts the children of root by the the sentence indizes. Since the sentence
indizes are based on the token indizes, some sentences have no sentences
indizes, because sometimes token nodes are out of context.
A kind of insertion sort would be better than the used mergesort.
And it is a pity that the {@link JSONArray} h... | [
"Sorts",
"the",
"children",
"of",
"root",
"by",
"the",
"the",
"sentence",
"indizes",
".",
"Since",
"the",
"sentence",
"indizes",
"are",
"based",
"on",
"the",
"token",
"indizes",
"some",
"sentences",
"have",
"no",
"sentences",
"indizes",
"because",
"sometimes",... | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L679-L722 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Maybe.java | Maybe.flatMapSingle | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Single<R> flatMapSingle(final Function<? super T, ? extends SingleSource<? extends R>> mapper) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
return RxJavaPlugins.onAssembly(new MaybeFlatMapSingle<T, R>(this, m... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Single<R> flatMapSingle(final Function<? super T, ? extends SingleSource<? extends R>> mapper) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
return RxJavaPlugins.onAssembly(new MaybeFlatMapSingle<T, R>(this, m... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"R",
">",
"Single",
"<",
"R",
">",
"flatMapSingle",
"(",
"final",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"SingleSource",
... | Returns a {@link Single} based on applying a specified function to the item emitted by the
source {@link Maybe}, where that function returns a {@link Single}.
When this Maybe completes a {@link NoSuchElementException} will be thrown.
<p>
<img width="640" height="356" src="https://raw.github.com/wiki/ReactiveX/RxJava/im... | [
"Returns",
"a",
"{",
"@link",
"Single",
"}",
"based",
"on",
"applying",
"a",
"specified",
"function",
"to",
"the",
"item",
"emitted",
"by",
"the",
"source",
"{",
"@link",
"Maybe",
"}",
"where",
"that",
"function",
"returns",
"a",
"{",
"@link",
"Single",
... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Maybe.java#L3091-L3096 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java | Constraints.gteProperty | public PropertyConstraint gteProperty(String propertyName, String otherPropertyName) {
return valueProperties(propertyName, GreaterThanEqualTo.instance(), otherPropertyName);
} | java | public PropertyConstraint gteProperty(String propertyName, String otherPropertyName) {
return valueProperties(propertyName, GreaterThanEqualTo.instance(), otherPropertyName);
} | [
"public",
"PropertyConstraint",
"gteProperty",
"(",
"String",
"propertyName",
",",
"String",
"otherPropertyName",
")",
"{",
"return",
"valueProperties",
"(",
"propertyName",
",",
"GreaterThanEqualTo",
".",
"instance",
"(",
")",
",",
"otherPropertyName",
")",
";",
"}... | Apply a "greater than or equal to" constraint to two properties.
@param propertyName The first property
@param otherPropertyName The other property
@return The constraint | [
"Apply",
"a",
"greater",
"than",
"or",
"equal",
"to",
"constraint",
"to",
"two",
"properties",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L864-L866 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PRAcroForm.java | PRAcroForm.mergeAttrib | protected PdfDictionary mergeAttrib(PdfDictionary parent, PdfDictionary child) {
PdfDictionary targ = new PdfDictionary();
if (parent != null) targ.putAll(parent);
for (Iterator it = child.getKeys().iterator(); it.hasNext();) {
PdfName key = (PdfName) it.next();
... | java | protected PdfDictionary mergeAttrib(PdfDictionary parent, PdfDictionary child) {
PdfDictionary targ = new PdfDictionary();
if (parent != null) targ.putAll(parent);
for (Iterator it = child.getKeys().iterator(); it.hasNext();) {
PdfName key = (PdfName) it.next();
... | [
"protected",
"PdfDictionary",
"mergeAttrib",
"(",
"PdfDictionary",
"parent",
",",
"PdfDictionary",
"child",
")",
"{",
"PdfDictionary",
"targ",
"=",
"new",
"PdfDictionary",
"(",
")",
";",
"if",
"(",
"parent",
"!=",
"null",
")",
"targ",
".",
"putAll",
"(",
"pa... | merge field attributes from two dictionaries
@param parent one dictionary
@param child the other dictionary
@return a merged dictionary | [
"merge",
"field",
"attributes",
"from",
"two",
"dictionaries"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PRAcroForm.java#L184-L199 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SharedIndexReader.java | SharedIndexReader.getParent | public DocId getParent(int n, BitSet deleted) throws IOException {
return getBase().getParent(n, deleted);
} | java | public DocId getParent(int n, BitSet deleted) throws IOException {
return getBase().getParent(n, deleted);
} | [
"public",
"DocId",
"getParent",
"(",
"int",
"n",
",",
"BitSet",
"deleted",
")",
"throws",
"IOException",
"{",
"return",
"getBase",
"(",
")",
".",
"getParent",
"(",
"n",
",",
"deleted",
")",
";",
"}"
] | Returns the <code>DocId</code> of the parent of <code>n</code> or
{@link DocId#NULL} if <code>n</code> does not have a parent
(<code>n</code> is the root node).
@param n the document number.
@param deleted the documents that should be regarded as deleted.
@return the <code>DocId</code> of <code>n</code>'s parent.
@thr... | [
"Returns",
"the",
"<code",
">",
"DocId<",
"/",
"code",
">",
"of",
"the",
"parent",
"of",
"<code",
">",
"n<",
"/",
"code",
">",
"or",
"{",
"@link",
"DocId#NULL",
"}",
"if",
"<code",
">",
"n<",
"/",
"code",
">",
"does",
"not",
"have",
"a",
"parent",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SharedIndexReader.java#L61-L63 |
threerings/playn | java/src/playn/java/JavaGraphics.java | JavaGraphics.registerFont | public void registerFont(String name, String path) {
try {
_fonts.put(name, ((JavaAssets) assets()).requireResource(path).createFont());
} catch (Exception e) {
platform.reportError("Failed to load font [name=" + name + ", path=" + path + "]", e);
}
} | java | public void registerFont(String name, String path) {
try {
_fonts.put(name, ((JavaAssets) assets()).requireResource(path).createFont());
} catch (Exception e) {
platform.reportError("Failed to load font [name=" + name + ", path=" + path + "]", e);
}
} | [
"public",
"void",
"registerFont",
"(",
"String",
"name",
",",
"String",
"path",
")",
"{",
"try",
"{",
"_fonts",
".",
"put",
"(",
"name",
",",
"(",
"(",
"JavaAssets",
")",
"assets",
"(",
")",
")",
".",
"requireResource",
"(",
"path",
")",
".",
"create... | Registers a font with the graphics system.
@param name the name under which to register the font.
@param path the path to the font resource (relative to the asset manager's path prefix).
Currently only TrueType ({@code .ttf}) fonts are supported. | [
"Registers",
"a",
"font",
"with",
"the",
"graphics",
"system",
"."
] | train | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/java/src/playn/java/JavaGraphics.java#L83-L89 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readTable | private void readTable(InputStream is, SynchroTable table) throws IOException
{
int skip = table.getOffset() - m_offset;
if (skip != 0)
{
StreamHelper.skip(is, skip);
m_offset += skip;
}
String tableName = DatatypeConverter.getString(is);
int tableNameLength = 2... | java | private void readTable(InputStream is, SynchroTable table) throws IOException
{
int skip = table.getOffset() - m_offset;
if (skip != 0)
{
StreamHelper.skip(is, skip);
m_offset += skip;
}
String tableName = DatatypeConverter.getString(is);
int tableNameLength = 2... | [
"private",
"void",
"readTable",
"(",
"InputStream",
"is",
",",
"SynchroTable",
"table",
")",
"throws",
"IOException",
"{",
"int",
"skip",
"=",
"table",
".",
"getOffset",
"(",
")",
"-",
"m_offset",
";",
"if",
"(",
"skip",
"!=",
"0",
")",
"{",
"StreamHelpe... | Read data for a single table and store it.
@param is input stream
@param table table header | [
"Read",
"data",
"for",
"a",
"single",
"table",
"and",
"store",
"it",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L175-L228 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/viewer/LogViewer.java | LogViewer.execute | public int execute(String[] args) {
Map<String, LevelDetails> levels = readLevels(System.getProperty("logviewer.custom.levels"));
String[] header = readHeader(System.getProperty("logviewer.custom.header"));
return execute(args, levels, header);
} | java | public int execute(String[] args) {
Map<String, LevelDetails> levels = readLevels(System.getProperty("logviewer.custom.levels"));
String[] header = readHeader(System.getProperty("logviewer.custom.header"));
return execute(args, levels, header);
} | [
"public",
"int",
"execute",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"Map",
"<",
"String",
",",
"LevelDetails",
">",
"levels",
"=",
"readLevels",
"(",
"System",
".",
"getProperty",
"(",
"\"logviewer.custom.levels\"",
")",
")",
";",
"String",
"[",
"]",
... | Runs LogViewer using values in System Properties to find custom levels and header.
@param args
- command line arguments to LogViewer
@return code indicating status of the execution: 0 on success, 1 otherwise. | [
"Runs",
"LogViewer",
"using",
"values",
"in",
"System",
"Properties",
"to",
"find",
"custom",
"levels",
"and",
"header",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/viewer/LogViewer.java#L271-L276 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/plugin/Tools.java | Tools.silenceUncaughtExceptionsInThisThread | public static void silenceUncaughtExceptionsInThisThread() {
Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread ignored, Throwable ignored1) {
}
});
} | java | public static void silenceUncaughtExceptionsInThisThread() {
Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread ignored, Throwable ignored1) {
}
});
} | [
"public",
"static",
"void",
"silenceUncaughtExceptionsInThisThread",
"(",
")",
"{",
"Thread",
".",
"currentThread",
"(",
")",
".",
"setUncaughtExceptionHandler",
"(",
"new",
"Thread",
".",
"UncaughtExceptionHandler",
"(",
")",
"{",
"@",
"Override",
"public",
"void",... | The default uncaught exception handler will print to STDERR, which we don't always want for threads.
Using this utility method you can avoid writing to STDERR on a per-thread basis | [
"The",
"default",
"uncaught",
"exception",
"handler",
"will",
"print",
"to",
"STDERR",
"which",
"we",
"don",
"t",
"always",
"want",
"for",
"threads",
".",
"Using",
"this",
"utility",
"method",
"you",
"can",
"avoid",
"writing",
"to",
"STDERR",
"on",
"a",
"p... | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/plugin/Tools.java#L622-L628 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java | Preconditions.checkPrecondition | public static <T> T checkPrecondition(
final T value,
final boolean condition,
final Function<T, String> describer)
{
return innerCheck(value, condition, describer);
} | java | public static <T> T checkPrecondition(
final T value,
final boolean condition,
final Function<T, String> describer)
{
return innerCheck(value, condition, describer);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkPrecondition",
"(",
"final",
"T",
"value",
",",
"final",
"boolean",
"condition",
",",
"final",
"Function",
"<",
"T",
",",
"String",
">",
"describer",
")",
"{",
"return",
"innerCheck",
"(",
"value",
",",
"cond... | <p>Evaluate the given {@code predicate} using {@code value} as input.</p>
<p>The function throws {@link PreconditionViolationException} if the
predicate is false.</p>
@param value The value
@param condition The predicate
@param describer A describer for the predicate
@param <T> The type of values
@return v... | [
"<p",
">",
"Evaluate",
"the",
"given",
"{",
"@code",
"predicate",
"}",
"using",
"{",
"@code",
"value",
"}",
"as",
"input",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java#L235-L241 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java | SourceSnippets.asMethod | public static InjectorMethod asMethod(boolean isNative, String signature, String pkg,
final SourceSnippet body) {
return new AbstractInjectorMethod(isNative, signature, pkg) {
public String getMethodBody(InjectorWriteContext writeContext) {
return body.getSource(writeContext);
}
};
} | java | public static InjectorMethod asMethod(boolean isNative, String signature, String pkg,
final SourceSnippet body) {
return new AbstractInjectorMethod(isNative, signature, pkg) {
public String getMethodBody(InjectorWriteContext writeContext) {
return body.getSource(writeContext);
}
};
} | [
"public",
"static",
"InjectorMethod",
"asMethod",
"(",
"boolean",
"isNative",
",",
"String",
"signature",
",",
"String",
"pkg",
",",
"final",
"SourceSnippet",
"body",
")",
"{",
"return",
"new",
"AbstractInjectorMethod",
"(",
"isNative",
",",
"signature",
",",
"p... | Creates an {@link InjectorMethod} using the given {@link SourceSnippet} as
its body.
@param isNative whether the returned method is a native method
@param signature the signature of the returned method
@param pkg the package in which the returned method should be created
@param body the body text of the new method | [
"Creates",
"an",
"{",
"@link",
"InjectorMethod",
"}",
"using",
"the",
"given",
"{",
"@link",
"SourceSnippet",
"}",
"as",
"its",
"body",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java#L132-L139 |
xsonorg/xson | src/main/java/org/xson/core/asm/MethodWriter.java | MethodWriter.writeShort | static void writeShort(final byte[] b, final int index, final int s) {
b[index] = (byte) (s >>> 8);
b[index + 1] = (byte) s;
} | java | static void writeShort(final byte[] b, final int index, final int s) {
b[index] = (byte) (s >>> 8);
b[index + 1] = (byte) s;
} | [
"static",
"void",
"writeShort",
"(",
"final",
"byte",
"[",
"]",
"b",
",",
"final",
"int",
"index",
",",
"final",
"int",
"s",
")",
"{",
"b",
"[",
"index",
"]",
"=",
"(",
"byte",
")",
"(",
"s",
">>>",
"8",
")",
";",
"b",
"[",
"index",
"+",
"1",... | Writes a short value in the given byte array.
@param b a byte array.
@param index where the first byte of the short value must be written.
@param s the value to be written in the given byte array. | [
"Writes",
"a",
"short",
"value",
"in",
"the",
"given",
"byte",
"array",
"."
] | train | https://github.com/xsonorg/xson/blob/ce1e197ec4ef9be448ed6ca96513e886151f83a9/src/main/java/org/xson/core/asm/MethodWriter.java#L2530-L2533 |
nmdp-bioinformatics/ngs | variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfWriter.java | VcfWriter.writeColumnHeader | public static void writeColumnHeader(final List<VcfSample> samples, final PrintWriter writer) {
checkNotNull(samples);
checkNotNull(writer);
StringBuilder sb = new StringBuilder("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO");
if (!samples.isEmpty()) {
sb.append("\tFORMAT")... | java | public static void writeColumnHeader(final List<VcfSample> samples, final PrintWriter writer) {
checkNotNull(samples);
checkNotNull(writer);
StringBuilder sb = new StringBuilder("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO");
if (!samples.isEmpty()) {
sb.append("\tFORMAT")... | [
"public",
"static",
"void",
"writeColumnHeader",
"(",
"final",
"List",
"<",
"VcfSample",
">",
"samples",
",",
"final",
"PrintWriter",
"writer",
")",
"{",
"checkNotNull",
"(",
"samples",
")",
";",
"checkNotNull",
"(",
"writer",
")",
";",
"StringBuilder",
"sb",
... | Write VCF column header with the specified print writer.
@param samples zero or more VCF samples, must not be null
@param writer print writer to write VCF with, must not be null | [
"Write",
"VCF",
"column",
"header",
"with",
"the",
"specified",
"print",
"writer",
"."
] | train | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfWriter.java#L86-L99 |
spring-projects/spring-android | spring-android-auth/src/main/java/org/springframework/security/crypto/encrypt/AndroidEncryptors.java | AndroidEncryptors.queryableText | public static TextEncryptor queryableText(CharSequence password, CharSequence salt) {
return new HexEncodingTextEncryptor(new AndroidAesBytesEncryptor(password.toString(), salt, AndroidKeyGenerators.shared(16)));
} | java | public static TextEncryptor queryableText(CharSequence password, CharSequence salt) {
return new HexEncodingTextEncryptor(new AndroidAesBytesEncryptor(password.toString(), salt, AndroidKeyGenerators.shared(16)));
} | [
"public",
"static",
"TextEncryptor",
"queryableText",
"(",
"CharSequence",
"password",
",",
"CharSequence",
"salt",
")",
"{",
"return",
"new",
"HexEncodingTextEncryptor",
"(",
"new",
"AndroidAesBytesEncryptor",
"(",
"password",
".",
"toString",
"(",
")",
",",
"salt"... | Creates an encryptor for queryable text strings that uses standard password-based encryption. Uses a shared, or
constant 16 byte initialization vector so encrypting the same data results in the same encryption result. This is
done to allow encrypted data to be queried against. Encrypted text is hex-encoded.
@param pas... | [
"Creates",
"an",
"encryptor",
"for",
"queryable",
"text",
"strings",
"that",
"uses",
"standard",
"password",
"-",
"based",
"encryption",
".",
"Uses",
"a",
"shared",
"or",
"constant",
"16",
"byte",
"initialization",
"vector",
"so",
"encrypting",
"the",
"same",
... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-auth/src/main/java/org/springframework/security/crypto/encrypt/AndroidEncryptors.java#L63-L65 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.addFormParam | protected void addFormParam(Form formData, String name, Object value, boolean required) throws IllegalArgumentException {
if (value == null) {
if (required) {
throw new IllegalArgumentException(name + " cannot be empty or null");
}
return;
}
... | java | protected void addFormParam(Form formData, String name, Object value, boolean required) throws IllegalArgumentException {
if (value == null) {
if (required) {
throw new IllegalArgumentException(name + " cannot be empty or null");
}
return;
}
... | [
"protected",
"void",
"addFormParam",
"(",
"Form",
"formData",
",",
"String",
"name",
",",
"Object",
"value",
",",
"boolean",
"required",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"required",
")",
... | Convenience method for adding query and form parameters to a get() or post() call.
If required is true and value is null, will throw an IllegalArgumentException.
@param formData the Form containing the name/value pairs
@param name the name of the field/attribute to add
@param value the value of the field/attribute to ... | [
"Convenience",
"method",
"for",
"adding",
"query",
"and",
"form",
"parameters",
"to",
"a",
"get",
"()",
"or",
"post",
"()",
"call",
".",
"If",
"required",
"is",
"true",
"and",
"value",
"is",
"null",
"will",
"throw",
"an",
"IllegalArgumentException",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L555-L572 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_vmEncryption_kms_kmsId_changeProperties_POST | public OvhTask serviceName_vmEncryption_kms_kmsId_changeProperties_POST(String serviceName, Long kmsId, String description, String sslThumbprint) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}/changeProperties";
StringBuilder sb = path(qPath, serviceName, kmsId);
HashM... | java | public OvhTask serviceName_vmEncryption_kms_kmsId_changeProperties_POST(String serviceName, Long kmsId, String description, String sslThumbprint) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}/changeProperties";
StringBuilder sb = path(qPath, serviceName, kmsId);
HashM... | [
"public",
"OvhTask",
"serviceName_vmEncryption_kms_kmsId_changeProperties_POST",
"(",
"String",
"serviceName",
",",
"Long",
"kmsId",
",",
"String",
"description",
",",
"String",
"sslThumbprint",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud... | Change option user access properties
REST: POST /dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}/changeProperties
@param sslThumbprint [required] SSL thumbprint of the remote service, e.g. A7:61:68:...:61:91:2F
@param description [required] Description of your option access network
@param serviceName [required] ... | [
"Change",
"option",
"user",
"access",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L590-L598 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/restrictor/policy/MBeanAccessChecker.java | MBeanAccessChecker.extractMbeanConfiguration | private void extractMbeanConfiguration(NodeList pNodes,MBeanPolicyConfig pConfig) throws MalformedObjectNameException {
for (int i = 0;i< pNodes.getLength();i++) {
Node node = pNodes.item(i);
if (node.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
... | java | private void extractMbeanConfiguration(NodeList pNodes,MBeanPolicyConfig pConfig) throws MalformedObjectNameException {
for (int i = 0;i< pNodes.getLength();i++) {
Node node = pNodes.item(i);
if (node.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
... | [
"private",
"void",
"extractMbeanConfiguration",
"(",
"NodeList",
"pNodes",
",",
"MBeanPolicyConfig",
"pConfig",
")",
"throws",
"MalformedObjectNameException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pNodes",
".",
"getLength",
"(",
")",
";",
"i",... | Extract configuration and put it into a given MBeanPolicyConfig | [
"Extract",
"configuration",
"and",
"put",
"it",
"into",
"a",
"given",
"MBeanPolicyConfig"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/restrictor/policy/MBeanAccessChecker.java#L103-L111 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/metadata/CatalogMetadataBuilder.java | CatalogMetadataBuilder.withOptions | @TimerJ
public CatalogMetadataBuilder withOptions(Map<Selector, Selector> opts) {
options = new HashMap<Selector, Selector>(opts);
return this;
} | java | @TimerJ
public CatalogMetadataBuilder withOptions(Map<Selector, Selector> opts) {
options = new HashMap<Selector, Selector>(opts);
return this;
} | [
"@",
"TimerJ",
"public",
"CatalogMetadataBuilder",
"withOptions",
"(",
"Map",
"<",
"Selector",
",",
"Selector",
">",
"opts",
")",
"{",
"options",
"=",
"new",
"HashMap",
"<",
"Selector",
",",
"Selector",
">",
"(",
"opts",
")",
";",
"return",
"this",
";",
... | Set the options. Any options previously created are removed.
@param opts the opts
@return the catalog metadata builder | [
"Set",
"the",
"options",
".",
"Any",
"options",
"previously",
"created",
"are",
"removed",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/metadata/CatalogMetadataBuilder.java#L82-L86 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/eme/element/ExplicitMessageEncryptionElement.java | ExplicitMessageEncryptionElement.hasProtocol | public static boolean hasProtocol(Message message, String protocolNamespace) {
List<ExtensionElement> extensionElements = message.getExtensions(
ExplicitMessageEncryptionElement.ELEMENT,
ExplicitMessageEncryptionElement.NAMESPACE);
for (ExtensionElement extensionElement ... | java | public static boolean hasProtocol(Message message, String protocolNamespace) {
List<ExtensionElement> extensionElements = message.getExtensions(
ExplicitMessageEncryptionElement.ELEMENT,
ExplicitMessageEncryptionElement.NAMESPACE);
for (ExtensionElement extensionElement ... | [
"public",
"static",
"boolean",
"hasProtocol",
"(",
"Message",
"message",
",",
"String",
"protocolNamespace",
")",
"{",
"List",
"<",
"ExtensionElement",
">",
"extensionElements",
"=",
"message",
".",
"getExtensions",
"(",
"ExplicitMessageEncryptionElement",
".",
"ELEME... | Return true, if the {@code message} already contains an EME element with the specified {@code protocolNamespace}.
@param message message
@param protocolNamespace namespace
@return true if message has EME element for that namespace, otherwise false | [
"Return",
"true",
"if",
"the",
"{",
"@code",
"message",
"}",
"already",
"contains",
"an",
"EME",
"element",
"with",
"the",
"specified",
"{",
"@code",
"protocolNamespace",
"}",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/eme/element/ExplicitMessageEncryptionElement.java#L157-L170 |
aws/aws-sdk-java | aws-java-sdk-servicediscovery/src/main/java/com/amazonaws/services/servicediscovery/model/Operation.java | Operation.withTargets | public Operation withTargets(java.util.Map<String, String> targets) {
setTargets(targets);
return this;
} | java | public Operation withTargets(java.util.Map<String, String> targets) {
setTargets(targets);
return this;
} | [
"public",
"Operation",
"withTargets",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"targets",
")",
"{",
"setTargets",
"(",
"targets",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The name of the target entity that is associated with the operation:
</p>
<ul>
<li>
<p>
<b>NAMESPACE</b>: The namespace ID is returned in the <code>ResourceId</code> property.
</p>
</li>
<li>
<p>
<b>SERVICE</b>: The service ID is returned in the <code>ResourceId</code> property.
</p>
</li>
<li>
<p>
<b>INSTANCE</b>:... | [
"<p",
">",
"The",
"name",
"of",
"the",
"target",
"entity",
"that",
"is",
"associated",
"with",
"the",
"operation",
":",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"<p",
">",
"<b",
">",
"NAMESPACE<",
"/",
"b",
">",
":",
"The",
"namespace",
"ID",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicediscovery/src/main/java/com/amazonaws/services/servicediscovery/model/Operation.java#L1033-L1036 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java | SASLMechanism.authenticate | public void authenticate(String host, DomainBareJid serviceName, CallbackHandler cbh, EntityBareJid authzid, SSLSession sslSession)
throws SmackSaslException, NotConnectedException, InterruptedException {
this.host = host;
this.serviceName = serviceName;
this.authorizationId ... | java | public void authenticate(String host, DomainBareJid serviceName, CallbackHandler cbh, EntityBareJid authzid, SSLSession sslSession)
throws SmackSaslException, NotConnectedException, InterruptedException {
this.host = host;
this.serviceName = serviceName;
this.authorizationId ... | [
"public",
"void",
"authenticate",
"(",
"String",
"host",
",",
"DomainBareJid",
"serviceName",
",",
"CallbackHandler",
"cbh",
",",
"EntityBareJid",
"authzid",
",",
"SSLSession",
"sslSession",
")",
"throws",
"SmackSaslException",
",",
"NotConnectedException",
",",
"Inte... | Builds and sends the <tt>auth</tt> stanza to the server. The callback handler will handle
any additional information, such as the authentication ID or realm, if it is needed.
@param host the hostname where the user account resides.
@param serviceName the xmpp service location
@param cbh the CallbackHandler to... | [
"Builds",
"and",
"sends",
"the",
"<tt",
">",
"auth<",
"/",
"tt",
">",
"stanza",
"to",
"the",
"server",
".",
"The",
"callback",
"handler",
"will",
"handle",
"any",
"additional",
"information",
"such",
"as",
"the",
"authentication",
"ID",
"or",
"realm",
"if"... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java#L176-L185 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/resourceindex/updater/LocalResourceIndexUpdater.java | LocalResourceIndexUpdater.init | public void init() throws ConfigurationException {
if(index == null) {
throw new ConfigurationException("No index target");
}
if(!index.isUpdatable()) {
throw new ConfigurationException("ResourceIndex is not updatable");
}
if(incoming == null) {
throw new ConfigurationException("No incoming");
}... | java | public void init() throws ConfigurationException {
if(index == null) {
throw new ConfigurationException("No index target");
}
if(!index.isUpdatable()) {
throw new ConfigurationException("ResourceIndex is not updatable");
}
if(incoming == null) {
throw new ConfigurationException("No incoming");
}... | [
"public",
"void",
"init",
"(",
")",
"throws",
"ConfigurationException",
"{",
"if",
"(",
"index",
"==",
"null",
")",
"{",
"throw",
"new",
"ConfigurationException",
"(",
"\"No index target\"",
")",
";",
"}",
"if",
"(",
"!",
"index",
".",
"isUpdatable",
"(",
... | start the background index merging thread
@throws ConfigurationException | [
"start",
"the",
"background",
"index",
"merging",
"thread"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/resourceindex/updater/LocalResourceIndexUpdater.java#L76-L90 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ProductUrl.java | ProductUrl.getProductInventoryUrl | public static MozuUrl getProductInventoryUrl(String locationCodes, String productCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/products/{productCode}/locationinventory?locationCodes={locationCodes}&responseFields={responseFields}");
formatter.formatUr... | java | public static MozuUrl getProductInventoryUrl(String locationCodes, String productCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/products/{productCode}/locationinventory?locationCodes={locationCodes}&responseFields={responseFields}");
formatter.formatUr... | [
"public",
"static",
"MozuUrl",
"getProductInventoryUrl",
"(",
"String",
"locationCodes",
",",
"String",
"productCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/storefront/products/{prod... | Get Resource Url for GetProductInventory
@param locationCodes Array of location codes for which to retrieve product inventory information.
@param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product.
@param responseFields Filtering syntax appended to a... | [
"Get",
"Resource",
"Url",
"for",
"GetProductInventory"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ProductUrl.java#L49-L56 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.payment_thod_POST | public OvhValidationResult payment_thod_POST(Long billingContactId, OvhCallbackUrl callbackUrl, Boolean _default, String description, Long orderId, String paymentType, Boolean register) throws IOException {
String qPath = "/me/payment/method";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap... | java | public OvhValidationResult payment_thod_POST(Long billingContactId, OvhCallbackUrl callbackUrl, Boolean _default, String description, Long orderId, String paymentType, Boolean register) throws IOException {
String qPath = "/me/payment/method";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap... | [
"public",
"OvhValidationResult",
"payment_thod_POST",
"(",
"Long",
"billingContactId",
",",
"OvhCallbackUrl",
"callbackUrl",
",",
"Boolean",
"_default",
",",
"String",
"description",
",",
"Long",
"orderId",
",",
"String",
"paymentType",
",",
"Boolean",
"register",
")"... | Pay an order and register a new payment method if necessary
REST: POST /me/payment/method
@param billingContactId [required] Billing contact id
@param callbackUrl [required] URL's necessary to register
@param _default [required] Is this payment method set as the default one
@param description [required] Customer perso... | [
"Pay",
"an",
"order",
"and",
"register",
"a",
"new",
"payment",
"method",
"if",
"necessary"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1034-L1047 |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/network/Network.java | Network.newSwitch | public Switch newSwitch(int id, int capacity) {
Switch s = swBuilder.newSwitch(id, capacity);
switches.add(s);
return s;
} | java | public Switch newSwitch(int id, int capacity) {
Switch s = swBuilder.newSwitch(id, capacity);
switches.add(s);
return s;
} | [
"public",
"Switch",
"newSwitch",
"(",
"int",
"id",
",",
"int",
"capacity",
")",
"{",
"Switch",
"s",
"=",
"swBuilder",
".",
"newSwitch",
"(",
"id",
",",
"capacity",
")",
";",
"switches",
".",
"add",
"(",
"s",
")",
";",
"return",
"s",
";",
"}"
] | Create a new switch with a specific identifier and a given maximal capacity
@param id the switch identifier
@param capacity the switch maximal capacity (put a nul or negative number for non-blocking switch)
@return the switch | [
"Create",
"a",
"new",
"switch",
"with",
"a",
"specific",
"identifier",
"and",
"a",
"given",
"maximal",
"capacity"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Network.java#L140-L144 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/swift/IBANCountryData.java | IBANCountryData.createFromString | @Nonnull
public static IBANCountryData createFromString (@Nonnull @Nonempty final String sCountryCode,
@Nonnegative final int nExpectedLength,
@Nullable final String sLayout,
... | java | @Nonnull
public static IBANCountryData createFromString (@Nonnull @Nonempty final String sCountryCode,
@Nonnegative final int nExpectedLength,
@Nullable final String sLayout,
... | [
"@",
"Nonnull",
"public",
"static",
"IBANCountryData",
"createFromString",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sCountryCode",
",",
"@",
"Nonnegative",
"final",
"int",
"nExpectedLength",
",",
"@",
"Nullable",
"final",
"String",
"sLayout",
",",... | This method is used to create an instance of this class from a string
representation.
@param sCountryCode
Country code to use. Neither <code>null</code> nor empty.
@param nExpectedLength
The expected length having only validation purpose.
@param sLayout
<code>null</code> or the layout descriptor
@param sFixedCheckDigi... | [
"This",
"method",
"is",
"used",
"to",
"create",
"an",
"instance",
"of",
"this",
"class",
"from",
"a",
"string",
"representation",
"."
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/swift/IBANCountryData.java#L319-L345 |
febit/wit | wit-core/src/main/java/org/febit/wit/loaders/AbstractLoader.java | AbstractLoader.concat | @Override
public String concat(final String parent, final String name) {
return parent != null
? FileNameUtil.concat(FileNameUtil.getPath(parent), name)
: name;
} | java | @Override
public String concat(final String parent, final String name) {
return parent != null
? FileNameUtil.concat(FileNameUtil.getPath(parent), name)
: name;
} | [
"@",
"Override",
"public",
"String",
"concat",
"(",
"final",
"String",
"parent",
",",
"final",
"String",
"name",
")",
"{",
"return",
"parent",
"!=",
"null",
"?",
"FileNameUtil",
".",
"concat",
"(",
"FileNameUtil",
".",
"getPath",
"(",
"parent",
")",
",",
... | get child template name by parent template name and relative name.
<pre>
example:
/path/to/tmpl1.wit , tmpl2.wit => /path/to/tmpl2.wit
/path/to/tmpl1.wit , /tmpl2.wit => /tmpl2.wit
/path/to/tmpl1.wit , ./tmpl2.wit => /path/to/tmpl2.wit
/path/to/tmpl1.wit , ../tmpl2.wit => /path/tmpl2.wit
</pre>
@param par... | [
"get",
"child",
"template",
"name",
"by",
"parent",
"template",
"name",
"and",
"relative",
"name",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit/loaders/AbstractLoader.java#L43-L48 |
ansell/restlet-utils | src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java | FixedRedirectCookieAuthenticator.isLoggingOut | protected boolean isLoggingOut(final Request request, final Response response)
{
return this.isInterceptingLogout()
&& this.getLogoutPath().equals(request.getResourceRef().getRemainingPart(false, false))
&& (Method.GET.equals(request.getMethod()) || Method.POST.equals(request... | java | protected boolean isLoggingOut(final Request request, final Response response)
{
return this.isInterceptingLogout()
&& this.getLogoutPath().equals(request.getResourceRef().getRemainingPart(false, false))
&& (Method.GET.equals(request.getMethod()) || Method.POST.equals(request... | [
"protected",
"boolean",
"isLoggingOut",
"(",
"final",
"Request",
"request",
",",
"final",
"Response",
"response",
")",
"{",
"return",
"this",
".",
"isInterceptingLogout",
"(",
")",
"&&",
"this",
".",
"getLogoutPath",
"(",
")",
".",
"equals",
"(",
"request",
... | Indicates if the request is an attempt to log out and should be intercepted.
@param request
The current request.
@param response
The current response.
@return True if the request is an attempt to log out and should be intercepted. | [
"Indicates",
"if",
"the",
"request",
"is",
"an",
"attempt",
"to",
"log",
"out",
"and",
"should",
"be",
"intercepted",
"."
] | train | https://github.com/ansell/restlet-utils/blob/6c39a3e91aa8295936af1dbfccd6ba27230c40a9/src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java#L608-L613 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java | AnalyzeSpark.analyzeQualitySequence | public static DataQualityAnalysis analyzeQualitySequence(Schema schema, JavaRDD<List<List<Writable>>> data) {
JavaRDD<List<Writable>> fmSeq = data.flatMap(new SequenceFlatMapFunction());
return analyzeQuality(schema, fmSeq);
} | java | public static DataQualityAnalysis analyzeQualitySequence(Schema schema, JavaRDD<List<List<Writable>>> data) {
JavaRDD<List<Writable>> fmSeq = data.flatMap(new SequenceFlatMapFunction());
return analyzeQuality(schema, fmSeq);
} | [
"public",
"static",
"DataQualityAnalysis",
"analyzeQualitySequence",
"(",
"Schema",
"schema",
",",
"JavaRDD",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"data",
")",
"{",
"JavaRDD",
"<",
"List",
"<",
"Writable",
">>",
"fmSeq",
"=",
"data",
"... | Analyze the data quality of sequence data - provides a report on missing values, values that don't comply with schema, etc
@param schema Schema for data
@param data Data to analyze
@return DataQualityAnalysis object | [
"Analyze",
"the",
"data",
"quality",
"of",
"sequence",
"data",
"-",
"provides",
"a",
"report",
"on",
"missing",
"values",
"values",
"that",
"don",
"t",
"comply",
"with",
"schema",
"etc"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L277-L280 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getCertificateOperationAsync | public Observable<CertificateOperation> getCertificateOperationAsync(String vaultBaseUrl, String certificateName) {
return getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<CertificateOperation>, CertificateOperation>() {
@Override
... | java | public Observable<CertificateOperation> getCertificateOperationAsync(String vaultBaseUrl, String certificateName) {
return getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<CertificateOperation>, CertificateOperation>() {
@Override
... | [
"public",
"Observable",
"<",
"CertificateOperation",
">",
"getCertificateOperationAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"getCertificateOperationWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
... | Gets the creation operation of a certificate.
Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate.
@throws Illega... | [
"Gets",
"the",
"creation",
"operation",
"of",
"a",
"certificate",
".",
"Gets",
"the",
"creation",
"operation",
"associated",
"with",
"a",
"specified",
"certificate",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"get",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7761-L7768 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java | SpiceServiceListenerNotifier.notifyObserversOfRequestAggregated | public void notifyObserversOfRequestAggregated(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
requestProcessingContext.setExecutionThread(Thread.currentThread());
requestProcessingCont... | java | public void notifyObserversOfRequestAggregated(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
requestProcessingContext.setExecutionThread(Thread.currentThread());
requestProcessingCont... | [
"public",
"void",
"notifyObserversOfRequestAggregated",
"(",
"CachedSpiceRequest",
"<",
"?",
">",
"request",
",",
"Set",
"<",
"RequestListener",
"<",
"?",
">",
">",
"requestListeners",
")",
"{",
"RequestProcessingContext",
"requestProcessingContext",
"=",
"new",
"Requ... | Inform the observers of a request. The observers can optionally observe
the new request if required.
@param request the request that has been aggregated. | [
"Inform",
"the",
"observers",
"of",
"a",
"request",
".",
"The",
"observers",
"can",
"optionally",
"observe",
"the",
"new",
"request",
"if",
"required",
"."
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L79-L84 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Cluster.java | Cluster.writeToText | @Override
public void writeToText(TextWriterStream out, String label) {
String name = getNameAutomatic();
if(name != null) {
out.commentPrintLn("Cluster name: " + name);
}
out.commentPrintLn("Cluster noise flag: " + isNoise());
out.commentPrintLn("Cluster size: " + ids.size());
// also p... | java | @Override
public void writeToText(TextWriterStream out, String label) {
String name = getNameAutomatic();
if(name != null) {
out.commentPrintLn("Cluster name: " + name);
}
out.commentPrintLn("Cluster noise flag: " + isNoise());
out.commentPrintLn("Cluster size: " + ids.size());
// also p... | [
"@",
"Override",
"public",
"void",
"writeToText",
"(",
"TextWriterStream",
"out",
",",
"String",
"label",
")",
"{",
"String",
"name",
"=",
"getNameAutomatic",
"(",
")",
";",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"out",
".",
"commentPrintLn",
"(",
"\... | Write to a textual representation. Writing the actual group data will be
handled by the caller, this is only meant to write the meta information.
@param out output writer stream
@param label Label to prefix | [
"Write",
"to",
"a",
"textual",
"representation",
".",
"Writing",
"the",
"actual",
"group",
"data",
"will",
"be",
"handled",
"by",
"the",
"caller",
"this",
"is",
"only",
"meant",
"to",
"write",
"the",
"meta",
"information",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Cluster.java#L247-L259 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMPool.java | JPAEMPool.createEntityManager | @Override
public EntityManager createEntityManager()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "createEntityManager : " + this);
EntityManager em = getEntityManager(false, false);
JPAPooledEntityManager pem = new JPAPooledEntityManager(t... | java | @Override
public EntityManager createEntityManager()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "createEntityManager : " + this);
EntityManager em = getEntityManager(false, false);
JPAPooledEntityManager pem = new JPAPooledEntityManager(t... | [
"@",
"Override",
"public",
"EntityManager",
"createEntityManager",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"createEntityManager : ... | Gets entity manager from pool and wraps it in an invocation type aware,
enlistment capable em. | [
"Gets",
"entity",
"manager",
"from",
"pool",
"and",
"wraps",
"it",
"in",
"an",
"invocation",
"type",
"aware",
"enlistment",
"capable",
"em",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMPool.java#L262-L271 |
alexvasilkov/AndroidCommons | library/src/main/java/com/alexvasilkov/android/commons/prefs/PreferencesHelper.java | PreferencesHelper.getJson | @Nullable
public static <T> T getJson(@NonNull SharedPreferences prefs,
@NonNull String key, @NonNull Class<T> clazz) {
return getJson(prefs, key, (Type) clazz);
} | java | @Nullable
public static <T> T getJson(@NonNull SharedPreferences prefs,
@NonNull String key, @NonNull Class<T> clazz) {
return getJson(prefs, key, (Type) clazz);
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
">",
"T",
"getJson",
"(",
"@",
"NonNull",
"SharedPreferences",
"prefs",
",",
"@",
"NonNull",
"String",
"key",
",",
"@",
"NonNull",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"getJson",
"(",
"pref... | Retrieves object stored as json encoded string.
Gson library should be available in classpath. | [
"Retrieves",
"object",
"stored",
"as",
"json",
"encoded",
"string",
".",
"Gson",
"library",
"should",
"be",
"available",
"in",
"classpath",
"."
] | train | https://github.com/alexvasilkov/AndroidCommons/blob/aca9f6d5acfc6bd3694984b7f89956e1a0146ddb/library/src/main/java/com/alexvasilkov/android/commons/prefs/PreferencesHelper.java#L140-L144 |
Domo42/saga-lib | saga-lib-guice/src/main/java/com/codebullets/sagalib/guice/SagaLibModule.java | SagaLibModule.bindIfNotNull | private <T> void bindIfNotNull(final Class<T> interfaceType, @Nullable final Class<? extends T> implementationType) {
if (implementationType != null) {
bind(interfaceType).to(implementationType);
}
} | java | private <T> void bindIfNotNull(final Class<T> interfaceType, @Nullable final Class<? extends T> implementationType) {
if (implementationType != null) {
bind(interfaceType).to(implementationType);
}
} | [
"private",
"<",
"T",
">",
"void",
"bindIfNotNull",
"(",
"final",
"Class",
"<",
"T",
">",
"interfaceType",
",",
"@",
"Nullable",
"final",
"Class",
"<",
"?",
"extends",
"T",
">",
"implementationType",
")",
"{",
"if",
"(",
"implementationType",
"!=",
"null",
... | Perform binding to interface only if implementation type is not null. | [
"Perform",
"binding",
"to",
"interface",
"only",
"if",
"implementation",
"type",
"is",
"not",
"null",
"."
] | train | https://github.com/Domo42/saga-lib/blob/c8f232e2a51fcb6a3fe0082cfbf105c1e6bf90ef/saga-lib-guice/src/main/java/com/codebullets/sagalib/guice/SagaLibModule.java#L155-L159 |
strator-dev/greenpepper | greenpepper-open/greenpepper-maven-runner/src/main/java/com/greenpepper/maven/runner/util/ReflectionUtils.java | ReflectionUtils.setSystemOutputs | public static void setSystemOutputs(ClassLoader classLoader, PrintStream out, PrintStream err)
throws Exception
{
Class<?> systemClass = classLoader.loadClass("java.lang.System");
Method setSystemOutMethod = systemClass.getMethod("setOut", PrintStream.class);
setSystemOutMethod.invoke(null, out);
Method set... | java | public static void setSystemOutputs(ClassLoader classLoader, PrintStream out, PrintStream err)
throws Exception
{
Class<?> systemClass = classLoader.loadClass("java.lang.System");
Method setSystemOutMethod = systemClass.getMethod("setOut", PrintStream.class);
setSystemOutMethod.invoke(null, out);
Method set... | [
"public",
"static",
"void",
"setSystemOutputs",
"(",
"ClassLoader",
"classLoader",
",",
"PrintStream",
"out",
",",
"PrintStream",
"err",
")",
"throws",
"Exception",
"{",
"Class",
"<",
"?",
">",
"systemClass",
"=",
"classLoader",
".",
"loadClass",
"(",
"\"java.la... | <p>setSystemOutputs.</p>
@param classLoader a {@link java.lang.ClassLoader} object.
@param out a {@link java.io.PrintStream} object.
@param err a {@link java.io.PrintStream} object.
@throws java.lang.Exception if any. | [
"<p",
">",
"setSystemOutputs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/greenpepper-maven-runner/src/main/java/com/greenpepper/maven/runner/util/ReflectionUtils.java#L89-L97 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/PrepareRequestInterceptor.java | PrepareRequestInterceptor.getUri | private <T extends IEntity> String getUri(Boolean platformService, String action, Context context, Map<String, String> requestParameters, Boolean entitlementService)
throws FMSException {
String uri = null;
if (!platformService) {
ServiceType serviceType = context.getIntuitServiceType();
if (entitlemen... | java | private <T extends IEntity> String getUri(Boolean platformService, String action, Context context, Map<String, String> requestParameters, Boolean entitlementService)
throws FMSException {
String uri = null;
if (!platformService) {
ServiceType serviceType = context.getIntuitServiceType();
if (entitlemen... | [
"private",
"<",
"T",
"extends",
"IEntity",
">",
"String",
"getUri",
"(",
"Boolean",
"platformService",
",",
"String",
"action",
",",
"Context",
"context",
",",
"Map",
"<",
"String",
",",
"String",
">",
"requestParameters",
",",
"Boolean",
"entitlementService",
... | Method to construct the URI
@param action
the entity name
@param context
the context
@param requestParameters
the request params
@return returns URI | [
"Method",
"to",
"construct",
"the",
"URI"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/PrepareRequestInterceptor.java#L229-L250 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/util/MessageDigestUtility.java | MessageDigestUtility.processMessageDigestForData | public static String processMessageDigestForData(MessageDigest messageDigest, byte[] data) {
String output = ""; //$NON-NLS-1$
if (messageDigest != null) {
// Get the digest for the given data
messageDigest.update(data);
byte[] digest = messageDigest.digest();
o... | java | public static String processMessageDigestForData(MessageDigest messageDigest, byte[] data) {
String output = ""; //$NON-NLS-1$
if (messageDigest != null) {
// Get the digest for the given data
messageDigest.update(data);
byte[] digest = messageDigest.digest();
o... | [
"public",
"static",
"String",
"processMessageDigestForData",
"(",
"MessageDigest",
"messageDigest",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"String",
"output",
"=",
"\"\"",
";",
"//$NON-NLS-1$",
"if",
"(",
"messageDigest",
"!=",
"null",
")",
"{",
"// Get the di... | Calculate the digest specified by byte array of data
@param messageDigest
@param data
@return digest in string with base64 encoding. | [
"Calculate",
"the",
"digest",
"specified",
"by",
"byte",
"array",
"of",
"data"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/util/MessageDigestUtility.java#L42-L51 |
ogaclejapan/SmartTabLayout | library/src/main/java/com/ogaclejapan/smarttablayout/SmartTabStrip.java | SmartTabStrip.setColorAlpha | private static int setColorAlpha(int color, byte alpha) {
return Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color));
} | java | private static int setColorAlpha(int color, byte alpha) {
return Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color));
} | [
"private",
"static",
"int",
"setColorAlpha",
"(",
"int",
"color",
",",
"byte",
"alpha",
")",
"{",
"return",
"Color",
".",
"argb",
"(",
"alpha",
",",
"Color",
".",
"red",
"(",
"color",
")",
",",
"Color",
".",
"green",
"(",
"color",
")",
",",
"Color",
... | Set the alpha value of the {@code color} to be the given {@code alpha} value. | [
"Set",
"the",
"alpha",
"value",
"of",
"the",
"{"
] | train | https://github.com/ogaclejapan/SmartTabLayout/blob/712e81a92f1e12a3c33dcbda03d813e0162e8589/library/src/main/java/com/ogaclejapan/smarttablayout/SmartTabStrip.java#L193-L195 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLAC_ConsoleFileEncoder.java | FLAC_ConsoleFileEncoder.getInt | int getInt(String[] args, int index) {
int result = -1;
if(index >= 0 && index < args.length) {
try {
result = Integer.parseInt(args[index]);
}catch(NumberFormatException e) {
result = -1;
}
}
return result;
} | java | int getInt(String[] args, int index) {
int result = -1;
if(index >= 0 && index < args.length) {
try {
result = Integer.parseInt(args[index]);
}catch(NumberFormatException e) {
result = -1;
}
}
return result;
} | [
"int",
"getInt",
"(",
"String",
"[",
"]",
"args",
",",
"int",
"index",
")",
"{",
"int",
"result",
"=",
"-",
"1",
";",
"if",
"(",
"index",
">=",
"0",
"&&",
"index",
"<",
"args",
".",
"length",
")",
"{",
"try",
"{",
"result",
"=",
"Integer",
".",... | Utility function to parse a positive integer argument out of a String
array at the given index.
@param args String array containing element to find.
@param index Index of array element to parse integer from.
@return Integer parsed, or -1 if error. | [
"Utility",
"function",
"to",
"parse",
"a",
"positive",
"integer",
"argument",
"out",
"of",
"a",
"String",
"array",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLAC_ConsoleFileEncoder.java#L328-L338 |
JodaOrg/joda-time | src/main/java/org/joda/time/convert/ReadableIntervalConverter.java | ReadableIntervalConverter.setInto | public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) {
ReadableInterval interval = (ReadableInterval) object;
chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval));
long start = interval.getStartMillis();
long end = interva... | java | public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) {
ReadableInterval interval = (ReadableInterval) object;
chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval));
long start = interval.getStartMillis();
long end = interva... | [
"public",
"void",
"setInto",
"(",
"ReadWritablePeriod",
"writablePeriod",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"ReadableInterval",
"interval",
"=",
"(",
"ReadableInterval",
")",
"object",
";",
"chrono",
"=",
"(",
"chrono",
"!=",
"null"... | Sets the values of the mutable duration from the specified interval.
@param writablePeriod the period to modify
@param object the interval to set from
@param chrono the chronology to use | [
"Sets",
"the",
"values",
"of",
"the",
"mutable",
"duration",
"from",
"the",
"specified",
"interval",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadableIntervalConverter.java#L63-L72 |
highsource/jaxb2-basics | tools/src/main/java/org/jvnet/jaxb2_commons/plugin/AbstractParameterizablePlugin.java | AbstractParameterizablePlugin.parseArgument | public int parseArgument(Options opt, String[] args, int start)
throws BadCommandLineException, IOException {
int consumed = 0;
final String optionPrefix = "-" + getOptionName() + "-";
final int optionPrefixLength = optionPrefix.length();
final String arg = args[start];
final int equalsPosition = arg.ind... | java | public int parseArgument(Options opt, String[] args, int start)
throws BadCommandLineException, IOException {
int consumed = 0;
final String optionPrefix = "-" + getOptionName() + "-";
final int optionPrefixLength = optionPrefix.length();
final String arg = args[start];
final int equalsPosition = arg.ind... | [
"public",
"int",
"parseArgument",
"(",
"Options",
"opt",
",",
"String",
"[",
"]",
"args",
",",
"int",
"start",
")",
"throws",
"BadCommandLineException",
",",
"IOException",
"{",
"int",
"consumed",
"=",
"0",
";",
"final",
"String",
"optionPrefix",
"=",
"\"-\"... | Parses the arguments and injects values into the beans via properties. | [
"Parses",
"the",
"arguments",
"and",
"injects",
"values",
"into",
"the",
"beans",
"via",
"properties",
"."
] | train | https://github.com/highsource/jaxb2-basics/blob/571cca0ce58a75d984324d33d8af453bf5862e75/tools/src/main/java/org/jvnet/jaxb2_commons/plugin/AbstractParameterizablePlugin.java#L29-L54 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.