repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/workplace/explorer/CmsExplorerTypeAccess.java | CmsExplorerTypeAccess.getPermissionsCacheKey | private String getPermissionsCacheKey(CmsObject cms, CmsResource resource) {
"""
Returns the cache key for the roles and groups of the current user and the given resource.<p>
In this way, it does not matter if the resource and/or user permissions changes, so we never need to clean the cache.<p>
And since the... | java | private String getPermissionsCacheKey(CmsObject cms, CmsResource resource) {
try {
String userName = cms.getRequestContext().getCurrentUser().getName();
StringBuffer key = new StringBuffer(256);
key.append(resource.getRootPath()).append("_");
Iterator<?> itGroups... | [
"private",
"String",
"getPermissionsCacheKey",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"{",
"try",
"{",
"String",
"userName",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
".",
"getName",
"(",
")",
";"... | Returns the cache key for the roles and groups of the current user and the given resource.<p>
In this way, it does not matter if the resource and/or user permissions changes, so we never need to clean the cache.<p>
And since the cache is a LRU map, old trash entries will be automatically removed.<p>
@param cms the c... | [
"Returns",
"the",
"cache",
"key",
"for",
"the",
"roles",
"and",
"groups",
"of",
"the",
"current",
"user",
"and",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsExplorerTypeAccess.java#L318-L344 |
mguymon/naether | src/main/java/com/tobedevoured/naether/maven/Project.java | Project.writePom | public void writePom(File file) throws ProjectException {
"""
Write pom to {@link File}
@param file {@link File}
@throws ProjectException exception
"""
log.debug("Writing pom: {}", file.getPath());
Project copy = this;
copy.removeProperty( "project.basedir" );
Writer write... | java | public void writePom(File file) throws ProjectException {
log.debug("Writing pom: {}", file.getPath());
Project copy = this;
copy.removeProperty( "project.basedir" );
Writer writer;
try {
writer = new BufferedWriter(new FileWriter(file));
} catch (IOExceptio... | [
"public",
"void",
"writePom",
"(",
"File",
"file",
")",
"throws",
"ProjectException",
"{",
"log",
".",
"debug",
"(",
"\"Writing pom: {}\"",
",",
"file",
".",
"getPath",
"(",
")",
")",
";",
"Project",
"copy",
"=",
"this",
";",
"copy",
".",
"removeProperty",... | Write pom to {@link File}
@param file {@link File}
@throws ProjectException exception | [
"Write",
"pom",
"to",
"{",
"@link",
"File",
"}"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/maven/Project.java#L516-L535 |
korpling/ANNIS | annis-service/src/main/java/annis/GraphHelper.java | GraphHelper.createQueryData | public static QueryData createQueryData(MatchGroup matchGroup, QueryDao annisDao) {
"""
This is a helper function to make it easier to create a correct query data object
from a {@link MatchGroup} for a {@link AnnisDao#graph(annis.ql.parser.QueryData) } query.
@param matchGroup
@return
"""
QueryData q... | java | public static QueryData createQueryData(MatchGroup matchGroup, QueryDao annisDao)
{
QueryData queryData = new QueryData();
Set<String> corpusNames = new TreeSet<>();
for(Match m : matchGroup.getMatches())
{
// collect list of used corpora and created pseudo QueryNodes for each URI
List<Q... | [
"public",
"static",
"QueryData",
"createQueryData",
"(",
"MatchGroup",
"matchGroup",
",",
"QueryDao",
"annisDao",
")",
"{",
"QueryData",
"queryData",
"=",
"new",
"QueryData",
"(",
")",
";",
"Set",
"<",
"String",
">",
"corpusNames",
"=",
"new",
"TreeSet",
"<>",... | This is a helper function to make it easier to create a correct query data object
from a {@link MatchGroup} for a {@link AnnisDao#graph(annis.ql.parser.QueryData) } query.
@param matchGroup
@return | [
"This",
"is",
"a",
"helper",
"function",
"to",
"make",
"it",
"easier",
"to",
"create",
"a",
"correct",
"query",
"data",
"object",
"from",
"a",
"{",
"@link",
"MatchGroup",
"}",
"for",
"a",
"{",
"@link",
"AnnisDao#graph",
"(",
"annis",
".",
"ql",
".",
"p... | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/GraphHelper.java#L39-L63 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/content/IntentUtils.java | IntentUtils.buildAction | public static String buildAction(Class<?> clazz, String action) {
"""
Build a custom intent action name, like "jp.co.nohana.amalgam.Sample.ACTION_SAMPLE".
@param clazz the class name.
@param action the action name.
@return the custom action name.
"""
return new StringBuilder().append(clazz.getCanoni... | java | public static String buildAction(Class<?> clazz, String action) {
return new StringBuilder().append(clazz.getCanonicalName()).append(".").append(action).toString();
} | [
"public",
"static",
"String",
"buildAction",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"action",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"clazz",
".",
"getCanonicalName",
"(",
")",
")",
".",
"append",
"(",
"... | Build a custom intent action name, like "jp.co.nohana.amalgam.Sample.ACTION_SAMPLE".
@param clazz the class name.
@param action the action name.
@return the custom action name. | [
"Build",
"a",
"custom",
"intent",
"action",
"name",
"like",
"jp",
".",
"co",
".",
"nohana",
".",
"amalgam",
".",
"Sample",
".",
"ACTION_SAMPLE",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/IntentUtils.java#L33-L35 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedContext.java | TomcatEmbeddedContext.doWithThreadContextClassLoader | private void doWithThreadContextClassLoader(ClassLoader classLoader, Runnable code) {
"""
Some older Servlet frameworks (e.g. Struts, BIRT) use the Thread context class
loader to create servlet instances in this phase. If they do that and then try to
initialize them later the class loader may have changed, so wr... | java | private void doWithThreadContextClassLoader(ClassLoader classLoader, Runnable code) {
ClassLoader existingLoader = (classLoader != null)
? ClassUtils.overrideThreadContextClassLoader(classLoader) : null;
try {
code.run();
}
finally {
if (existingLoader != null) {
ClassUtils.overrideThreadContextCl... | [
"private",
"void",
"doWithThreadContextClassLoader",
"(",
"ClassLoader",
"classLoader",
",",
"Runnable",
"code",
")",
"{",
"ClassLoader",
"existingLoader",
"=",
"(",
"classLoader",
"!=",
"null",
")",
"?",
"ClassUtils",
".",
"overrideThreadContextClassLoader",
"(",
"cl... | Some older Servlet frameworks (e.g. Struts, BIRT) use the Thread context class
loader to create servlet instances in this phase. If they do that and then try to
initialize them later the class loader may have changed, so wrap the call to
loadOnStartup in what we think its going to be the main webapp classloader at
runt... | [
"Some",
"older",
"Servlet",
"frameworks",
"(",
"e",
".",
"g",
".",
"Struts",
"BIRT",
")",
"use",
"the",
"Thread",
"context",
"class",
"loader",
"to",
"create",
"servlet",
"instances",
"in",
"this",
"phase",
".",
"If",
"they",
"do",
"that",
"and",
"then",... | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedContext.java#L104-L115 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java | BitsUtil.onesI | public static void onesI(long[] v, int bits) {
"""
Fill a vector initialized with "bits" ones.
@param v Vector to fill.
@param bits Size
"""
final int fillWords = bits >>> LONG_LOG2_SIZE;
final int fillBits = bits & LONG_LOG2_MASK;
Arrays.fill(v, 0, fillWords, LONG_ALL_BITS);
if(fillBits > ... | java | public static void onesI(long[] v, int bits) {
final int fillWords = bits >>> LONG_LOG2_SIZE;
final int fillBits = bits & LONG_LOG2_MASK;
Arrays.fill(v, 0, fillWords, LONG_ALL_BITS);
if(fillBits > 0) {
v[fillWords] = (1L << fillBits) - 1;
}
if(fillWords + 1 < v.length) {
Arrays.fill(... | [
"public",
"static",
"void",
"onesI",
"(",
"long",
"[",
"]",
"v",
",",
"int",
"bits",
")",
"{",
"final",
"int",
"fillWords",
"=",
"bits",
">>>",
"LONG_LOG2_SIZE",
";",
"final",
"int",
"fillBits",
"=",
"bits",
"&",
"LONG_LOG2_MASK",
";",
"Arrays",
".",
"... | Fill a vector initialized with "bits" ones.
@param v Vector to fill.
@param bits Size | [
"Fill",
"a",
"vector",
"initialized",
"with",
"bits",
"ones",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java#L443-L453 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.findByGroupId | @Override
public List<CommerceWarehouse> findByGroupId(long groupId) {
"""
Returns all the commerce warehouses where groupId = ?.
@param groupId the group ID
@return the matching commerce warehouses
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceWarehouse> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWarehouse",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce warehouses where groupId = ?.
@param groupId the group ID
@return the matching commerce warehouses | [
"Returns",
"all",
"the",
"commerce",
"warehouses",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L124-L127 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java | FirestoreClient.updateDocument | public final Document updateDocument(Document document, DocumentMask updateMask) {
"""
Updates or inserts a document.
<p>Sample code:
<pre><code>
try (FirestoreClient firestoreClient = FirestoreClient.create()) {
Document document = Document.newBuilder().build();
DocumentMask updateMask = DocumentMask.new... | java | public final Document updateDocument(Document document, DocumentMask updateMask) {
UpdateDocumentRequest request =
UpdateDocumentRequest.newBuilder().setDocument(document).setUpdateMask(updateMask).build();
return updateDocument(request);
} | [
"public",
"final",
"Document",
"updateDocument",
"(",
"Document",
"document",
",",
"DocumentMask",
"updateMask",
")",
"{",
"UpdateDocumentRequest",
"request",
"=",
"UpdateDocumentRequest",
".",
"newBuilder",
"(",
")",
".",
"setDocument",
"(",
"document",
")",
".",
... | Updates or inserts a document.
<p>Sample code:
<pre><code>
try (FirestoreClient firestoreClient = FirestoreClient.create()) {
Document document = Document.newBuilder().build();
DocumentMask updateMask = DocumentMask.newBuilder().build();
Document response = firestoreClient.updateDocument(document, updateMask);
}
</co... | [
"Updates",
"or",
"inserts",
"a",
"document",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java#L405-L410 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java | DssatXFileOutput.readSWData | private ArrayList readSWData(HashMap expData, String key) {
"""
Get soil/weather data from data holder
@param expData The experiment data holder
@param key The key name for soil/weather section
@return the list of data holder
"""
ArrayList ret;
Object soil = expData.get(key);
if (s... | java | private ArrayList readSWData(HashMap expData, String key) {
ArrayList ret;
Object soil = expData.get(key);
if (soil != null) {
if (soil instanceof ArrayList) {
ret = (ArrayList) soil;
} else {
ret = new ArrayList();
ret.add(... | [
"private",
"ArrayList",
"readSWData",
"(",
"HashMap",
"expData",
",",
"String",
"key",
")",
"{",
"ArrayList",
"ret",
";",
"Object",
"soil",
"=",
"expData",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"soil",
"!=",
"null",
")",
"{",
"if",
"(",
"soil"... | Get soil/weather data from data holder
@param expData The experiment data holder
@param key The key name for soil/weather section
@return the list of data holder | [
"Get",
"soil",
"/",
"weather",
"data",
"from",
"data",
"holder"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1593-L1608 |
liferay/com-liferay-commerce | commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java | CommerceVirtualOrderItemPersistenceImpl.findByUUID_G | @Override
public CommerceVirtualOrderItem findByUUID_G(String uuid, long groupId)
throws NoSuchVirtualOrderItemException {
"""
Returns the commerce virtual order item where uuid = ? and groupId = ? or throws a {@link NoSuchVirtualOrderItemException} if it could not be found.
@param uuid the uuid
@pa... | java | @Override
public CommerceVirtualOrderItem findByUUID_G(String uuid, long groupId)
throws NoSuchVirtualOrderItemException {
CommerceVirtualOrderItem commerceVirtualOrderItem = fetchByUUID_G(uuid,
groupId);
if (commerceVirtualOrderItem == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO... | [
"@",
"Override",
"public",
"CommerceVirtualOrderItem",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchVirtualOrderItemException",
"{",
"CommerceVirtualOrderItem",
"commerceVirtualOrderItem",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"gr... | Returns the commerce virtual order item where uuid = ? and groupId = ? or throws a {@link NoSuchVirtualOrderItemException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce virtual order item
@throws NoSuchVirtualOrderItemException if a matching commerce v... | [
"Returns",
"the",
"commerce",
"virtual",
"order",
"item",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchVirtualOrderItemException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java#L670-L697 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/yoko/ORBConfigAdapter.java | ORBConfigAdapter.createClientORB | @Override
public ORB createClientORB(Map<String, Object> clientProps, Collection<SubsystemFactory> subsystemFactories) throws ConfigException {
"""
Create an ORB for a CSSBean client context.
@return An ORB instance configured for this client access.
@exception ConfigException
"""
return create... | java | @Override
public ORB createClientORB(Map<String, Object> clientProps, Collection<SubsystemFactory> subsystemFactories) throws ConfigException {
return createORB(translateToClientArgs(clientProps, subsystemFactories), translateToClientProps(clientProps, subsystemFactories));
} | [
"@",
"Override",
"public",
"ORB",
"createClientORB",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"clientProps",
",",
"Collection",
"<",
"SubsystemFactory",
">",
"subsystemFactories",
")",
"throws",
"ConfigException",
"{",
"return",
"createORB",
"(",
"translateT... | Create an ORB for a CSSBean client context.
@return An ORB instance configured for this client access.
@exception ConfigException | [
"Create",
"an",
"ORB",
"for",
"a",
"CSSBean",
"client",
"context",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/yoko/ORBConfigAdapter.java#L63-L66 |
graknlabs/grakn | server/src/server/exception/TransactionException.java | TransactionException.loopCreated | public static TransactionException loopCreated(SchemaConcept type, SchemaConcept superElement) {
"""
Thrown when setting {@code superType} as the super type of {@code type} and a loop is created
"""
return create(ErrorMessage.SUPER_LOOP_DETECTED.getMessage(type.label(), superElement.label()));
} | java | public static TransactionException loopCreated(SchemaConcept type, SchemaConcept superElement) {
return create(ErrorMessage.SUPER_LOOP_DETECTED.getMessage(type.label(), superElement.label()));
} | [
"public",
"static",
"TransactionException",
"loopCreated",
"(",
"SchemaConcept",
"type",
",",
"SchemaConcept",
"superElement",
")",
"{",
"return",
"create",
"(",
"ErrorMessage",
".",
"SUPER_LOOP_DETECTED",
".",
"getMessage",
"(",
"type",
".",
"label",
"(",
")",
",... | Thrown when setting {@code superType} as the super type of {@code type} and a loop is created | [
"Thrown",
"when",
"setting",
"{"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/TransactionException.java#L143-L145 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/checker/NodeRemover.java | NodeRemover.validateIfRequiredByParent | private void validateIfRequiredByParent(JDBCStorageConnection conn, ResultSet resultSet) throws RepositoryException,
SQLException, IllegalNameException {
"""
Validates if node represented by instance of {@link ResultSet} is mandatory
for parent node. It means should not be removed. Throws {@link SQLExceptio... | java | private void validateIfRequiredByParent(JDBCStorageConnection conn, ResultSet resultSet) throws RepositoryException,
SQLException, IllegalNameException
{
String parentId = getIdentifier(resultSet, DBConstants.COLUMN_PARENTID);
InternalQName nodeName = InternalQName.parse(resultSet.getString(DBConst... | [
"private",
"void",
"validateIfRequiredByParent",
"(",
"JDBCStorageConnection",
"conn",
",",
"ResultSet",
"resultSet",
")",
"throws",
"RepositoryException",
",",
"SQLException",
",",
"IllegalNameException",
"{",
"String",
"parentId",
"=",
"getIdentifier",
"(",
"resultSet",... | Validates if node represented by instance of {@link ResultSet} is mandatory
for parent node. It means should not be removed. Throws {@link SQLException}
in this case with appropriate message. | [
"Validates",
"if",
"node",
"represented",
"by",
"instance",
"of",
"{"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/checker/NodeRemover.java#L117-L147 |
larsga/Duke | duke-core/src/main/java/no/priv/garshol/duke/ConfigurationImpl.java | ConfigurationImpl.addDataSource | public void addDataSource(int groupno, DataSource datasource) {
"""
Adds a data source to the configuration. If in deduplication mode
groupno == 0, otherwise it gives the number of the group to which
the data source belongs.
"""
// the loader takes care of validation
if (groupno == 0)
datasourc... | java | public void addDataSource(int groupno, DataSource datasource) {
// the loader takes care of validation
if (groupno == 0)
datasources.add(datasource);
else if (groupno == 1)
group1.add(datasource);
else if (groupno == 2)
group2.add(datasource);
} | [
"public",
"void",
"addDataSource",
"(",
"int",
"groupno",
",",
"DataSource",
"datasource",
")",
"{",
"// the loader takes care of validation",
"if",
"(",
"groupno",
"==",
"0",
")",
"datasources",
".",
"add",
"(",
"datasource",
")",
";",
"else",
"if",
"(",
"gro... | Adds a data source to the configuration. If in deduplication mode
groupno == 0, otherwise it gives the number of the group to which
the data source belongs. | [
"Adds",
"a",
"data",
"source",
"to",
"the",
"configuration",
".",
"If",
"in",
"deduplication",
"mode",
"groupno",
"==",
"0",
"otherwise",
"it",
"gives",
"the",
"number",
"of",
"the",
"group",
"to",
"which",
"the",
"data",
"source",
"belongs",
"."
] | train | https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/ConfigurationImpl.java#L73-L81 |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogramLogReader.java | AbstractHistogramLogReader.nextAbsoluteIntervalHistogram | public EncodableHistogram nextAbsoluteIntervalHistogram(final Double absoluteStartTimeSec,
final Double absoluteEndTimeSec) {
"""
Read the next interval histogram from the log, if interval falls within an absolute time range
<p>
Returns a histogram object if an ... | java | public EncodableHistogram nextAbsoluteIntervalHistogram(final Double absoluteStartTimeSec,
final Double absoluteEndTimeSec) {
return nextIntervalHistogram(absoluteStartTimeSec, absoluteEndTimeSec, true);
} | [
"public",
"EncodableHistogram",
"nextAbsoluteIntervalHistogram",
"(",
"final",
"Double",
"absoluteStartTimeSec",
",",
"final",
"Double",
"absoluteEndTimeSec",
")",
"{",
"return",
"nextIntervalHistogram",
"(",
"absoluteStartTimeSec",
",",
"absoluteEndTimeSec",
",",
"true",
"... | Read the next interval histogram from the log, if interval falls within an absolute time range
<p>
Returns a histogram object if an interval line was found with an
associated absolute start timestamp value that falls between
absoluteStartTimeSec and absoluteEndTimeSec, or null if no such
interval line is found.
<p>
Tim... | [
"Read",
"the",
"next",
"interval",
"histogram",
"from",
"the",
"log",
"if",
"interval",
"falls",
"within",
"an",
"absolute",
"time",
"range",
"<p",
">",
"Returns",
"a",
"histogram",
"object",
"if",
"an",
"interval",
"line",
"was",
"found",
"with",
"an",
"a... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/AbstractHistogramLogReader.java#L135-L138 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.toBufferedImage | public static BufferedImage toBufferedImage(Image image, String imageType) {
"""
{@link Image} 转 {@link BufferedImage}<br>
如果源图片的RGB模式与目标模式一致,则直接转换,否则重新绘制
@param image {@link Image}
@param imageType 目标图片类型
@return {@link BufferedImage}
@since 4.3.2
"""
BufferedImage bufferedImage;
if (false == ima... | java | public static BufferedImage toBufferedImage(Image image, String imageType) {
BufferedImage bufferedImage;
if (false == imageType.equalsIgnoreCase(IMAGE_TYPE_PNG)) {
// 当目标为非PNG类图片时,源图片统一转换为RGB格式
if (image instanceof BufferedImage) {
bufferedImage = (BufferedImage) image;
if (BufferedImage.TYPE_I... | [
"public",
"static",
"BufferedImage",
"toBufferedImage",
"(",
"Image",
"image",
",",
"String",
"imageType",
")",
"{",
"BufferedImage",
"bufferedImage",
";",
"if",
"(",
"false",
"==",
"imageType",
".",
"equalsIgnoreCase",
"(",
"IMAGE_TYPE_PNG",
")",
")",
"{",
"// ... | {@link Image} 转 {@link BufferedImage}<br>
如果源图片的RGB模式与目标模式一致,则直接转换,否则重新绘制
@param image {@link Image}
@param imageType 目标图片类型
@return {@link BufferedImage}
@since 4.3.2 | [
"{",
"@link",
"Image",
"}",
"转",
"{",
"@link",
"BufferedImage",
"}",
"<br",
">",
"如果源图片的RGB模式与目标模式一致,则直接转换,否则重新绘制"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1175-L1191 |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.compileBatch | void compileBatch(String []files, boolean isMake)
throws ClassNotFoundException {
"""
Compile the Java source. Compile errors are encapsulated in a
ClassNotFound wrapper.
"""
try {
JavaCompilerUtil compiler = JavaCompilerUtil.create(getClassLoader());
compiler.setClassDir(_classDir);
... | java | void compileBatch(String []files, boolean isMake)
throws ClassNotFoundException
{
try {
JavaCompilerUtil compiler = JavaCompilerUtil.create(getClassLoader());
compiler.setClassDir(_classDir);
compiler.setSourceDir(_sourceDir);
if (_encoding != null)
compiler.setEncoding(_encodi... | [
"void",
"compileBatch",
"(",
"String",
"[",
"]",
"files",
",",
"boolean",
"isMake",
")",
"throws",
"ClassNotFoundException",
"{",
"try",
"{",
"JavaCompilerUtil",
"compiler",
"=",
"JavaCompilerUtil",
".",
"create",
"(",
"getClassLoader",
"(",
")",
")",
";",
"co... | Compile the Java source. Compile errors are encapsulated in a
ClassNotFound wrapper. | [
"Compile",
"the",
"Java",
"source",
".",
"Compile",
"errors",
"are",
"encapsulated",
"in",
"a",
"ClassNotFound",
"wrapper",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L681-L708 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/ProtoUtils.java | ProtoUtils.getBuilderMethod | private static MethodRef getBuilderMethod(Descriptor descriptor) {
"""
Returns the {@link MethodRef} for the generated newBuilder method.
"""
TypeInfo message = messageRuntimeType(descriptor);
TypeInfo builder = builderRuntimeType(descriptor);
return MethodRef.createStaticMethod(
messag... | java | private static MethodRef getBuilderMethod(Descriptor descriptor) {
TypeInfo message = messageRuntimeType(descriptor);
TypeInfo builder = builderRuntimeType(descriptor);
return MethodRef.createStaticMethod(
message, new Method("newBuilder", builder.type(), NO_METHOD_ARGS))
.asNonNullable(... | [
"private",
"static",
"MethodRef",
"getBuilderMethod",
"(",
"Descriptor",
"descriptor",
")",
"{",
"TypeInfo",
"message",
"=",
"messageRuntimeType",
"(",
"descriptor",
")",
";",
"TypeInfo",
"builder",
"=",
"builderRuntimeType",
"(",
"descriptor",
")",
";",
"return",
... | Returns the {@link MethodRef} for the generated newBuilder method. | [
"Returns",
"the",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/ProtoUtils.java#L1244-L1250 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/dependency/EvidenceCollection.java | EvidenceCollection.removeEvidence | public synchronized void removeEvidence(EvidenceType type, Evidence e) {
"""
Removes evidence from the collection.
@param type the type of evidence (vendor, product, version)
@param e Evidence.
"""
if (null != type) {
switch (type) {
case VENDOR:
vend... | java | public synchronized void removeEvidence(EvidenceType type, Evidence e) {
if (null != type) {
switch (type) {
case VENDOR:
vendors.remove(e);
break;
case PRODUCT:
products.remove(e);
break;... | [
"public",
"synchronized",
"void",
"removeEvidence",
"(",
"EvidenceType",
"type",
",",
"Evidence",
"e",
")",
"{",
"if",
"(",
"null",
"!=",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"VENDOR",
":",
"vendors",
".",
"remove",
"(",
"e",
")",... | Removes evidence from the collection.
@param type the type of evidence (vendor, product, version)
@param e Evidence. | [
"Removes",
"evidence",
"from",
"the",
"collection",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/EvidenceCollection.java#L172-L188 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.normP | public static double normP(DMatrixRMaj A , double p ) {
"""
Computes either the vector p-norm or the induced matrix p-norm depending on A
being a vector or a matrix respectively.
@param A Vector or matrix whose norm is to be computed.
@param p The p value of the p-norm.
@return The computed norm.
"""
... | java | public static double normP(DMatrixRMaj A , double p ) {
if( p == 1 ) {
return normP1(A);
} else if( p == 2 ) {
return normP2(A);
} else if( Double.isInfinite(p)) {
return normPInf(A);
}
if( MatrixFeatures_DDRM.isVector(A) ) {
return... | [
"public",
"static",
"double",
"normP",
"(",
"DMatrixRMaj",
"A",
",",
"double",
"p",
")",
"{",
"if",
"(",
"p",
"==",
"1",
")",
"{",
"return",
"normP1",
"(",
"A",
")",
";",
"}",
"else",
"if",
"(",
"p",
"==",
"2",
")",
"{",
"return",
"normP2",
"("... | Computes either the vector p-norm or the induced matrix p-norm depending on A
being a vector or a matrix respectively.
@param A Vector or matrix whose norm is to be computed.
@param p The p value of the p-norm.
@return The computed norm. | [
"Computes",
"either",
"the",
"vector",
"p",
"-",
"norm",
"or",
"the",
"induced",
"matrix",
"p",
"-",
"norm",
"depending",
"on",
"A",
"being",
"a",
"vector",
"or",
"a",
"matrix",
"respectively",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L285-L298 |
openbase/jul | storage/src/main/java/org/openbase/jul/storage/registry/FileSynchronizedRegistryImpl.java | FileSynchronizedRegistryImpl.activateVersionControl | public void activateVersionControl(final String entryType, final Package converterPackage) throws CouldNotPerformException {
"""
This method activates the version control unit of the underlying registry
db. The version check and db upgrade is automatically performed during
the registry db loading phrase. The db ... | java | public void activateVersionControl(final String entryType, final Package converterPackage) throws CouldNotPerformException {
if (!isEmpty()) {
throw new CouldNotPerformException("Could not activate version control because registry already loaded! Please activate version control before loading the re... | [
"public",
"void",
"activateVersionControl",
"(",
"final",
"String",
"entryType",
",",
"final",
"Package",
"converterPackage",
")",
"throws",
"CouldNotPerformException",
"{",
"if",
"(",
"!",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"CouldNotPerformException",
... | This method activates the version control unit of the underlying registry
db. The version check and db upgrade is automatically performed during
the registry db loading phrase. The db will be upgraded to the latest db
format provided by the given converter package. The converter package
should contain only classes impl... | [
"This",
"method",
"activates",
"the",
"version",
"control",
"unit",
"of",
"the",
"underlying",
"registry",
"db",
".",
"The",
"version",
"check",
"and",
"db",
"upgrade",
"is",
"automatically",
"performed",
"during",
"the",
"registry",
"db",
"loading",
"phrase",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/storage/src/main/java/org/openbase/jul/storage/registry/FileSynchronizedRegistryImpl.java#L147-L152 |
kiswanij/jk-util | src/main/java/com/jk/util/xml/JKXmlHandler.java | JKXmlHandler.toXml | public void toXml(Object object, OutputStream out, Class<?>... clas) {
"""
To xml.
@param object the object
@param out the out
@param clas the clas
"""
try {
JAXBContext jaxbContext = JAXBContext.newInstance(clas);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
// output prett... | java | public void toXml(Object object, OutputStream out, Class<?>... clas) {
try {
JAXBContext jaxbContext = JAXBContext.newInstance(clas);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
// output pretty printed
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxbMarshaller.m... | [
"public",
"void",
"toXml",
"(",
"Object",
"object",
",",
"OutputStream",
"out",
",",
"Class",
"<",
"?",
">",
"...",
"clas",
")",
"{",
"try",
"{",
"JAXBContext",
"jaxbContext",
"=",
"JAXBContext",
".",
"newInstance",
"(",
"clas",
")",
";",
"Marshaller",
"... | To xml.
@param object the object
@param out the out
@param clas the clas | [
"To",
"xml",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/xml/JKXmlHandler.java#L79-L89 |
datasift/datasift-java | src/main/java/com/datasift/client/accounts/DataSiftAccount.java | DataSiftAccount.createLimit | public FutureData<Limit> createLimit(String identity, String service, Long allowance) {
"""
/*
Create a Limit
@param identity ID of the identity to store the limit in
@param service service to set the limit for
@param allowance allowance to store in the limit
@return Created limit
"""
if (identi... | java | public FutureData<Limit> createLimit(String identity, String service, Long allowance) {
if (identity == null || identity.isEmpty()) {
throw new IllegalArgumentException("An identity is required");
}
if (service == null || service.isEmpty()) {
throw new IllegalArgumentExce... | [
"public",
"FutureData",
"<",
"Limit",
">",
"createLimit",
"(",
"String",
"identity",
",",
"String",
"service",
",",
"Long",
"allowance",
")",
"{",
"if",
"(",
"identity",
"==",
"null",
"||",
"identity",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
... | /*
Create a Limit
@param identity ID of the identity to store the limit in
@param service service to set the limit for
@param allowance allowance to store in the limit
@return Created limit | [
"/",
"*",
"Create",
"a",
"Limit"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/accounts/DataSiftAccount.java#L325-L346 |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/sparse/AbstractIterativeSolver.java | AbstractIterativeSolver.checkSizes | protected void checkSizes(Matrix A, Vector b, Vector x) {
"""
Checks sizes of input data for {@link #solve(Matrix, Vector, Vector)}.
Throws an exception if the sizes does not match.
"""
if (!A.isSquare())
throw new IllegalArgumentException("!A.isSquare()");
if (b.size() != A.numRow... | java | protected void checkSizes(Matrix A, Vector b, Vector x) {
if (!A.isSquare())
throw new IllegalArgumentException("!A.isSquare()");
if (b.size() != A.numRows())
throw new IllegalArgumentException("b.size() != A.numRows()");
if (b.size() != x.size())
throw new Il... | [
"protected",
"void",
"checkSizes",
"(",
"Matrix",
"A",
",",
"Vector",
"b",
",",
"Vector",
"x",
")",
"{",
"if",
"(",
"!",
"A",
".",
"isSquare",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"!A.isSquare()\"",
")",
";",
"if",
"(",
"b"... | Checks sizes of input data for {@link #solve(Matrix, Vector, Vector)}.
Throws an exception if the sizes does not match. | [
"Checks",
"sizes",
"of",
"input",
"data",
"for",
"{"
] | train | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/sparse/AbstractIterativeSolver.java#L70-L77 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsAddDialogTypeHelper.java | CmsAddDialogTypeHelper.precomputeTypeLists | public void precomputeTypeLists(
CmsObject cms,
String folderRootPath,
String checkViewableReferenceUri,
List<CmsElementView> views,
I_CmsResourceTypeEnabledCheck check) {
"""
Precomputes type lists for multiple views.<p>
@param cms the CMS context
@param folderRootPath ... | java | public void precomputeTypeLists(
CmsObject cms,
String folderRootPath,
String checkViewableReferenceUri,
List<CmsElementView> views,
I_CmsResourceTypeEnabledCheck check) {
Multimap<CmsUUID, CmsResourceTypeBean> result = ArrayListMultimap.create();
// Sort list t... | [
"public",
"void",
"precomputeTypeLists",
"(",
"CmsObject",
"cms",
",",
"String",
"folderRootPath",
",",
"String",
"checkViewableReferenceUri",
",",
"List",
"<",
"CmsElementView",
">",
"views",
",",
"I_CmsResourceTypeEnabledCheck",
"check",
")",
"{",
"Multimap",
"<",
... | Precomputes type lists for multiple views.<p>
@param cms the CMS context
@param folderRootPath the current folder
@param checkViewableReferenceUri the reference uri to use for viewability check
@param views the views for which to generate the type lists
@param check object to check whether resource types should be ena... | [
"Precomputes",
"type",
"lists",
"for",
"multiple",
"views",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsAddDialogTypeHelper.java#L181-L210 |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductPartitionTreeImpl.java | ProductPartitionTreeImpl.createAdGroupTree | static ProductPartitionTreeImpl createAdGroupTree(AdWordsServicesInterface services,
AdWordsSession session, Long adGroupId) throws ApiException, RemoteException {
"""
Returns a new instance of this class by retrieving the product partitions of the
specified ad group. All parameters are required.
"""
... | java | static ProductPartitionTreeImpl createAdGroupTree(AdWordsServicesInterface services,
AdWordsSession session, Long adGroupId) throws ApiException, RemoteException {
// Get the AdGroupCriterionService.
AdGroupCriterionServiceInterface criterionService =
services.get(session, AdGroupCriterionServiceI... | [
"static",
"ProductPartitionTreeImpl",
"createAdGroupTree",
"(",
"AdWordsServicesInterface",
"services",
",",
"AdWordsSession",
"session",
",",
"Long",
"adGroupId",
")",
"throws",
"ApiException",
",",
"RemoteException",
"{",
"// Get the AdGroupCriterionService.",
"AdGroupCriteri... | Returns a new instance of this class by retrieving the product partitions of the
specified ad group. All parameters are required. | [
"Returns",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"retrieving",
"the",
"product",
"partitions",
"of",
"the",
"specified",
"ad",
"group",
".",
"All",
"parameters",
"are",
"required",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductPartitionTreeImpl.java#L185-L230 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_instanceId_interface_POST | public OvhInterface project_serviceName_instance_instanceId_interface_POST(String serviceName, String instanceId, String ip, String networkId) throws IOException {
"""
Create interface on an instance and attached it to a network
REST: POST /cloud/project/{serviceName}/instance/{instanceId}/interface
@param ins... | java | public OvhInterface project_serviceName_instance_instanceId_interface_POST(String serviceName, String instanceId, String ip, String networkId) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/interface";
StringBuilder sb = path(qPath, serviceName, instanceId);
HashMap<String... | [
"public",
"OvhInterface",
"project_serviceName_instance_instanceId_interface_POST",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
",",
"String",
"ip",
",",
"String",
"networkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{se... | Create interface on an instance and attached it to a network
REST: POST /cloud/project/{serviceName}/instance/{instanceId}/interface
@param instanceId [required] Instance id
@param ip [required] Static ip (Can only be defined for private networks)
@param networkId [required] Network id
@param serviceName [required] Se... | [
"Create",
"interface",
"on",
"an",
"instance",
"and",
"attached",
"it",
"to",
"a",
"network"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1941-L1949 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsCreateModeSelectionDialog.java | CmsCreateModeSelectionDialog.createButton | protected CmsPushButton createButton(String text, ButtonColor color, final String result) {
"""
Creates a button used to select a create mode.<p>
@param text the button text
@param color the button color
@param result the create mode selected by the button
@return the newly created button
"""
... | java | protected CmsPushButton createButton(String text, ButtonColor color, final String result) {
CmsPushButton button = new CmsPushButton();
button = new CmsPushButton();
button.setText(text);
button.setUseMinWidth(true);
button.setButtonStyle(ButtonStyle.TEXT, color);
button... | [
"protected",
"CmsPushButton",
"createButton",
"(",
"String",
"text",
",",
"ButtonColor",
"color",
",",
"final",
"String",
"result",
")",
"{",
"CmsPushButton",
"button",
"=",
"new",
"CmsPushButton",
"(",
")",
";",
"button",
"=",
"new",
"CmsPushButton",
"(",
")"... | Creates a button used to select a create mode.<p>
@param text the button text
@param color the button color
@param result the create mode selected by the button
@return the newly created button | [
"Creates",
"a",
"button",
"used",
"to",
"select",
"a",
"create",
"mode",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsCreateModeSelectionDialog.java#L176-L193 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/WebDialog.java | WebDialog.getScaledSize | private int getScaledSize(int screenSize, float density, int noPaddingSize, int maxPaddingSize) {
"""
Returns a scaled size (either width or height) based on the parameters passed.
@param screenSize a pixel dimension of the screen (either width or height)
@param density density of the screen
@param noPaddingSiz... | java | private int getScaledSize(int screenSize, float density, int noPaddingSize, int maxPaddingSize) {
int scaledSize = (int) ((float) screenSize / density);
double scaleFactor;
if (scaledSize <= noPaddingSize) {
scaleFactor = 1.0;
} else if (scaledSize >= maxPaddingSize) {
... | [
"private",
"int",
"getScaledSize",
"(",
"int",
"screenSize",
",",
"float",
"density",
",",
"int",
"noPaddingSize",
",",
"int",
"maxPaddingSize",
")",
"{",
"int",
"scaledSize",
"=",
"(",
"int",
")",
"(",
"(",
"float",
")",
"screenSize",
"/",
"density",
")",... | Returns a scaled size (either width or height) based on the parameters passed.
@param screenSize a pixel dimension of the screen (either width or height)
@param density density of the screen
@param noPaddingSize the size at which there's no padding for the dialog
@param maxPaddingSize the size at which to apply maximum... | [
"Returns",
"a",
"scaled",
"size",
"(",
"either",
"width",
"or",
"height",
")",
"based",
"on",
"the",
"parameters",
"passed",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/WebDialog.java#L277-L293 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/loader/instrument/Envelope.java | Envelope.updatePosition | public int updatePosition(int p, boolean keyOff) {
"""
Get the new position
@since 19.06.2006
@param p
@param keyOff
@return
"""
p++;
if (loop && p>=position[loopEndPoint]) p=position[loopStartPoint];
if (sustain && p>=position[sustainEndPoint] && !keyOff) p=position[sustainStartPoint];
return p;
... | java | public int updatePosition(int p, boolean keyOff)
{
p++;
if (loop && p>=position[loopEndPoint]) p=position[loopStartPoint];
if (sustain && p>=position[sustainEndPoint] && !keyOff) p=position[sustainStartPoint];
return p;
} | [
"public",
"int",
"updatePosition",
"(",
"int",
"p",
",",
"boolean",
"keyOff",
")",
"{",
"p",
"++",
";",
"if",
"(",
"loop",
"&&",
"p",
">=",
"position",
"[",
"loopEndPoint",
"]",
")",
"p",
"=",
"position",
"[",
"loopStartPoint",
"]",
";",
"if",
"(",
... | Get the new position
@since 19.06.2006
@param p
@param keyOff
@return | [
"Get",
"the",
"new",
"position"
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/loader/instrument/Envelope.java#L57-L63 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/SpScheduler.java | SpScheduler.doLocalInitiateOffer | private void doLocalInitiateOffer(Iv2InitiateTaskMessage msg) {
"""
Do the work necessary to turn the Iv2InitiateTaskMessage into a
TransactionTask which can be queued to the TransactionTaskQueue.
This is reused by both the normal message handling path and the repair
path, and assumes that the caller has dealt ... | java | private void doLocalInitiateOffer(Iv2InitiateTaskMessage msg)
{
final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPI);
if (traceLog != null) {
final String threadName = Thread.currentThread().getName(); // Thread name has to be materialized here
tra... | [
"private",
"void",
"doLocalInitiateOffer",
"(",
"Iv2InitiateTaskMessage",
"msg",
")",
"{",
"final",
"VoltTrace",
".",
"TraceEventBatch",
"traceLog",
"=",
"VoltTrace",
".",
"log",
"(",
"VoltTrace",
".",
"Category",
".",
"SPI",
")",
";",
"if",
"(",
"traceLog",
"... | Do the work necessary to turn the Iv2InitiateTaskMessage into a
TransactionTask which can be queued to the TransactionTaskQueue.
This is reused by both the normal message handling path and the repair
path, and assumes that the caller has dealt with or ensured that the
necessary ID, SpHandles, and replication issues are... | [
"Do",
"the",
"work",
"necessary",
"to",
"turn",
"the",
"Iv2InitiateTaskMessage",
"into",
"a",
"TransactionTask",
"which",
"can",
"be",
"queued",
"to",
"the",
"TransactionTaskQueue",
".",
"This",
"is",
"reused",
"by",
"both",
"the",
"normal",
"message",
"handling... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/SpScheduler.java#L650-L688 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getPageIdsNotContainingTemplateNames | public List<Integer> getPageIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException {
"""
Returns a list containing the ids of all pages that do not contain a template
the name of which equals any of the given Strings.
@param templateNames
the names of the template that we want to ma... | java | public List<Integer> getPageIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPageIds(templateNames, false);
} | [
"public",
"List",
"<",
"Integer",
">",
"getPageIdsNotContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredPageIds",
"(",
"templateNames",
",",
"false",
")",
";",
"}"
] | Returns a list containing the ids of all pages that do not contain a template
the name of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return A list with the ids of all pages that do not contain any of the the
specified templates
@throws WikiApiException
... | [
"Returns",
"a",
"list",
"containing",
"the",
"ids",
"of",
"all",
"pages",
"that",
"do",
"not",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"any",
"of",
"the",
"given",
"Strings",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L990-L992 |
mfornos/humanize | humanize-icu/src/main/java/humanize/ICUHumanize.java | ICUHumanize.smartDateFormat | public static String smartDateFormat(final Date value, final String skeleton) {
"""
<p>
Guesses the best locale-dependent pattern to format the date/time fields
that the skeleton specifies.
</p>
@param value
The date to be formatted
@param skeleton
A pattern containing only the variable fields. For exampl... | java | public static String smartDateFormat(final Date value, final String skeleton)
{
return formatDate(value, context.get().getBestPattern(skeleton));
} | [
"public",
"static",
"String",
"smartDateFormat",
"(",
"final",
"Date",
"value",
",",
"final",
"String",
"skeleton",
")",
"{",
"return",
"formatDate",
"(",
"value",
",",
"context",
".",
"get",
"(",
")",
".",
"getBestPattern",
"(",
"skeleton",
")",
")",
";",... | <p>
Guesses the best locale-dependent pattern to format the date/time fields
that the skeleton specifies.
</p>
@param value
The date to be formatted
@param skeleton
A pattern containing only the variable fields. For example,
"MMMdd" and "mmhh" are skeletons.
@return A string with a text representation of the date | [
"<p",
">",
"Guesses",
"the",
"best",
"locale",
"-",
"dependent",
"pattern",
"to",
"format",
"the",
"date",
"/",
"time",
"fields",
"that",
"the",
"skeleton",
"specifies",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-icu/src/main/java/humanize/ICUHumanize.java#L1584-L1587 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java | ThinTableModel.getValueAt | public Object getValueAt(int iRowIndex, int iColumnIndex) {
"""
Get the value at this location.
@param iRowIndex The row.
@param iColumnIndex The column.
@return The raw data at this location.
"""
int iEditMode = Constants.EDIT_NONE;
try {
if (iRowIndex >= 0)
{
... | java | public Object getValueAt(int iRowIndex, int iColumnIndex)
{
int iEditMode = Constants.EDIT_NONE;
try {
if (iRowIndex >= 0)
{
FieldList fieldList = this.makeRowCurrent(iRowIndex, false);
if (fieldList != null)
iEditMode = f... | [
"public",
"Object",
"getValueAt",
"(",
"int",
"iRowIndex",
",",
"int",
"iColumnIndex",
")",
"{",
"int",
"iEditMode",
"=",
"Constants",
".",
"EDIT_NONE",
";",
"try",
"{",
"if",
"(",
"iRowIndex",
">=",
"0",
")",
"{",
"FieldList",
"fieldList",
"=",
"this",
... | Get the value at this location.
@param iRowIndex The row.
@param iColumnIndex The column.
@return The raw data at this location. | [
"Get",
"the",
"value",
"at",
"this",
"location",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java#L315-L329 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java | SoyExpression.unboxAsMessage | public Expression unboxAsMessage() {
"""
Unboxes this to a {@link SoyExpression} with a Message runtime type.
<p>This method is appropriate when you know (likely via inspection of the {@link #soyType()},
or other means) that the value does have the appropriate type but you prefer to interact with
it as its un... | java | public Expression unboxAsMessage() {
if (soyType().getKind() == Kind.NULL) {
// If this is a null literal, return a Messaged-typed null literal.
return BytecodeUtils.constantNull(BytecodeUtils.MESSAGE_TYPE);
}
// Attempting to unbox an unboxed proto
// (We compare the non-nullable type becau... | [
"public",
"Expression",
"unboxAsMessage",
"(",
")",
"{",
"if",
"(",
"soyType",
"(",
")",
".",
"getKind",
"(",
")",
"==",
"Kind",
".",
"NULL",
")",
"{",
"// If this is a null literal, return a Messaged-typed null literal.",
"return",
"BytecodeUtils",
".",
"constantNu... | Unboxes this to a {@link SoyExpression} with a Message runtime type.
<p>This method is appropriate when you know (likely via inspection of the {@link #soyType()},
or other means) that the value does have the appropriate type but you prefer to interact with
it as its unboxed representation. | [
"Unboxes",
"this",
"to",
"a",
"{",
"@link",
"SoyExpression",
"}",
"with",
"a",
"Message",
"runtime",
"type",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/SoyExpression.java#L562-L587 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoScheme.java | ContentCryptoScheme.createCipherLite | CipherLite createCipherLite(SecretKey cek, byte[] iv, int cipherMode,
Provider provider, boolean alwaysUseProvider) {
"""
Creates and initializes a {@link CipherLite} for content
encrypt/decryption.
@param cek
content encrypting key
@param iv
initialization vector
@param cipherMode
such as {@l... | java | CipherLite createCipherLite(SecretKey cek, byte[] iv, int cipherMode,
Provider provider, boolean alwaysUseProvider) {
try {
Cipher cipher = createCipher(provider, alwaysUseProvider);
cipher.init(cipherMode, cek, new IvParameterSpec(iv));
return newCipherLite(ciph... | [
"CipherLite",
"createCipherLite",
"(",
"SecretKey",
"cek",
",",
"byte",
"[",
"]",
"iv",
",",
"int",
"cipherMode",
",",
"Provider",
"provider",
",",
"boolean",
"alwaysUseProvider",
")",
"{",
"try",
"{",
"Cipher",
"cipher",
"=",
"createCipher",
"(",
"provider",
... | Creates and initializes a {@link CipherLite} for content
encrypt/decryption.
@param cek
content encrypting key
@param iv
initialization vector
@param cipherMode
such as {@link Cipher#ENCRYPT_MODE}
@param provider
the security provider the user specified. For backwards
compatibility, if this scheme defines a preferred ... | [
"Creates",
"and",
"initializes",
"a",
"{",
"@link",
"CipherLite",
"}",
"for",
"content",
"encrypt",
"/",
"decryption",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoScheme.java#L182-L199 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/DBService.java | DBService.getAllColumns | public Iterable<DColumn> getAllColumns(String storeName, String rowKey) {
"""
Get all columns for the row with the given key in the given store. Columns are
returned as an Iterator of {@link DColumn}s. If no row is found with the given key,
the iterator's hasNext() will be false.
@param storeName Name of stor... | java | public Iterable<DColumn> getAllColumns(String storeName, String rowKey) {
return getColumnSlice(storeName, rowKey, null, null);
} | [
"public",
"Iterable",
"<",
"DColumn",
">",
"getAllColumns",
"(",
"String",
"storeName",
",",
"String",
"rowKey",
")",
"{",
"return",
"getColumnSlice",
"(",
"storeName",
",",
"rowKey",
",",
"null",
",",
"null",
")",
";",
"}"
] | Get all columns for the row with the given key in the given store. Columns are
returned as an Iterator of {@link DColumn}s. If no row is found with the given key,
the iterator's hasNext() will be false.
@param storeName Name of store to query.
@param rowKey Key of row to fetch.
@return Iterator of {@link D... | [
"Get",
"all",
"columns",
"for",
"the",
"row",
"with",
"the",
"given",
"key",
"in",
"the",
"given",
"store",
".",
"Columns",
"are",
"returned",
"as",
"an",
"Iterator",
"of",
"{",
"@link",
"DColumn",
"}",
"s",
".",
"If",
"no",
"row",
"is",
"found",
"wi... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBService.java#L241-L243 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepExecutionsInner.java | JobStepExecutionsInner.listByJobExecutionWithServiceResponseAsync | public Observable<ServiceResponse<Page<JobExecutionInner>>> listByJobExecutionWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId) {
"""
Lists the step executions of a job execution.
@param resourceGroupName... | java | public Observable<ServiceResponse<Page<JobExecutionInner>>> listByJobExecutionWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final UUID jobExecutionId) {
return listByJobExecutionSinglePageAsync(resourceGroupName, serverName, jo... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"JobExecutionInner",
">",
">",
">",
"listByJobExecutionWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"jobAgentName",... | Lists the step executions of a job execution.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@param jobName The name... | [
"Lists",
"the",
"step",
"executions",
"of",
"a",
"job",
"execution",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepExecutionsInner.java#L155-L167 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGraphicsUnmapResources | public static int cuGraphicsUnmapResources( int count, CUgraphicsResource resources[], CUstream hStream) {
"""
Unmap graphics resources.
<pre>
CUresult cuGraphicsUnmapResources (
unsigned int count,
CUgraphicsResource* resources,
CUstream hStream )
</pre>
<div>
<p>Unmap graphics resources. Unmaps the
... | java | public static int cuGraphicsUnmapResources( int count, CUgraphicsResource resources[], CUstream hStream)
{
return checkResult(cuGraphicsUnmapResourcesNative(count, resources, hStream));
} | [
"public",
"static",
"int",
"cuGraphicsUnmapResources",
"(",
"int",
"count",
",",
"CUgraphicsResource",
"resources",
"[",
"]",
",",
"CUstream",
"hStream",
")",
"{",
"return",
"checkResult",
"(",
"cuGraphicsUnmapResourcesNative",
"(",
"count",
",",
"resources",
",",
... | Unmap graphics resources.
<pre>
CUresult cuGraphicsUnmapResources (
unsigned int count,
CUgraphicsResource* resources,
CUstream hStream )
</pre>
<div>
<p>Unmap graphics resources. Unmaps the
<tt>count</tt> graphics resources in <tt>resources</tt>.
</p>
<p>Once unmapped, the resources in <tt>resources</tt> may not be... | [
"Unmap",
"graphics",
"resources",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L16147-L16150 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.headTail | public <R> StreamEx<R> headTail(BiFunction<? super T, ? super StreamEx<T>, ? extends Stream<R>> mapper) {
"""
Creates a new Stream which is the result of applying of the mapper
{@code BiFunction} to the first element of the current stream (head) and
the stream containing the rest elements (tail). The mapper may ... | java | public <R> StreamEx<R> headTail(BiFunction<? super T, ? super StreamEx<T>, ? extends Stream<R>> mapper) {
return headTail(mapper, () -> null);
} | [
"public",
"<",
"R",
">",
"StreamEx",
"<",
"R",
">",
"headTail",
"(",
"BiFunction",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"StreamEx",
"<",
"T",
">",
",",
"?",
"extends",
"Stream",
"<",
"R",
">",
">",
"mapper",
")",
"{",
"return",
"headTail",
... | Creates a new Stream which is the result of applying of the mapper
{@code BiFunction} to the first element of the current stream (head) and
the stream containing the rest elements (tail). The mapper may return
{@code null} instead of empty stream.
<p>
This is a <a href="package-summary.html#StreamOps">quasi-intermedia... | [
"Creates",
"a",
"new",
"Stream",
"which",
"is",
"the",
"result",
"of",
"applying",
"of",
"the",
"mapper",
"{",
"@code",
"BiFunction",
"}",
"to",
"the",
"first",
"element",
"of",
"the",
"current",
"stream",
"(",
"head",
")",
"and",
"the",
"stream",
"conta... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L2004-L2006 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java | MapComposedElement.containsPoint | @Pure
public boolean containsPoint(Point2D<?, ?> point) {
"""
Check if point p is contained in this coordinates collections.
@param point the point to compare with this coordinates
@return true if p is already part of coordinates
"""
if (point == null) {
return false;
}
for (int i = 0; i < getPoi... | java | @Pure
public boolean containsPoint(Point2D<?, ?> point) {
if (point == null) {
return false;
}
for (int i = 0; i < getPointCount(); ++i) {
final Point2d cur = getPointAt(i);
if (cur.epsilonEquals(point, MapElementConstants.POINT_FUSION_DISTANCE)) {
return true;
}
}
return false;
} | [
"@",
"Pure",
"public",
"boolean",
"containsPoint",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
")",
"{",
"if",
"(",
"point",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getPointCoun... | Check if point p is contained in this coordinates collections.
@param point the point to compare with this coordinates
@return true if p is already part of coordinates | [
"Check",
"if",
"point",
"p",
"is",
"contained",
"in",
"this",
"coordinates",
"collections",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java#L275-L287 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java | Printer.visitTypes | public String visitTypes(List<Type> ts, Locale locale) {
"""
Get a localized string representation for all the types in the input list.
@param ts types to be displayed
@param locale the locale in which the string is to be rendered
@return localized string representation
"""
ListBuffer<String> sbuf... | java | public String visitTypes(List<Type> ts, Locale locale) {
ListBuffer<String> sbuf = new ListBuffer<>();
for (Type t : ts) {
sbuf.append(visit(t, locale));
}
return sbuf.toList().toString();
} | [
"public",
"String",
"visitTypes",
"(",
"List",
"<",
"Type",
">",
"ts",
",",
"Locale",
"locale",
")",
"{",
"ListBuffer",
"<",
"String",
">",
"sbuf",
"=",
"new",
"ListBuffer",
"<>",
"(",
")",
";",
"for",
"(",
"Type",
"t",
":",
"ts",
")",
"{",
"sbuf",... | Get a localized string representation for all the types in the input list.
@param ts types to be displayed
@param locale the locale in which the string is to be rendered
@return localized string representation | [
"Get",
"a",
"localized",
"string",
"representation",
"for",
"all",
"the",
"types",
"in",
"the",
"input",
"list",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Printer.java#L105-L111 |
weld/core | impl/src/main/java/org/jboss/weld/util/Proxies.java | Proxies.isTypesProxyable | public static boolean isTypesProxyable(Iterable<? extends Type> types, ServiceRegistry services) {
"""
Indicates if a set of types are all proxyable
@param types The types to test
@return True if proxyable, false otherwise
"""
return getUnproxyableTypesException(types, services) == null;
} | java | public static boolean isTypesProxyable(Iterable<? extends Type> types, ServiceRegistry services) {
return getUnproxyableTypesException(types, services) == null;
} | [
"public",
"static",
"boolean",
"isTypesProxyable",
"(",
"Iterable",
"<",
"?",
"extends",
"Type",
">",
"types",
",",
"ServiceRegistry",
"services",
")",
"{",
"return",
"getUnproxyableTypesException",
"(",
"types",
",",
"services",
")",
"==",
"null",
";",
"}"
] | Indicates if a set of types are all proxyable
@param types The types to test
@return True if proxyable, false otherwise | [
"Indicates",
"if",
"a",
"set",
"of",
"types",
"are",
"all",
"proxyable"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Proxies.java#L160-L162 |
mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyHeaderItemMoved | public void notifyHeaderItemMoved(int fromPosition, int toPosition) {
"""
Notifies that an existing header item is moved to another position.
@param fromPosition the original position.
@param toPosition the new position.
"""
if (fromPosition < 0 || toPosition < 0 || fromPosition >= headerItemCoun... | java | public void notifyHeaderItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= headerItemCount || toPosition >= headerItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition + " or toPosition " + toPosition + " is not... | [
"public",
"void",
"notifyHeaderItemMoved",
"(",
"int",
"fromPosition",
",",
"int",
"toPosition",
")",
"{",
"if",
"(",
"fromPosition",
"<",
"0",
"||",
"toPosition",
"<",
"0",
"||",
"fromPosition",
">=",
"headerItemCount",
"||",
"toPosition",
">=",
"headerItemCoun... | Notifies that an existing header item is moved to another position.
@param fromPosition the original position.
@param toPosition the new position. | [
"Notifies",
"that",
"an",
"existing",
"header",
"item",
"is",
"moved",
"to",
"another",
"position",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L172-L177 |
xiancloud/xian | xian-dao/xian-daocore/src/main/java/info/xiancloud/dao/core/units/DaoUnit.java | DaoUnit.isTransactional | private boolean isTransactional(SqlAction[] sqlActions, XianTransaction transaction) {
"""
judge whether we need to begin the transaction.
If there are more than one non-query sql actions in this dao unit, a new transaction will be begun.
if a transaction is already begun, a nested transaction will be begun.
El... | java | private boolean isTransactional(SqlAction[] sqlActions, XianTransaction transaction) {
int count = 0;
for (SqlAction sqlAction : sqlActions) {
if (!(sqlAction instanceof ISelect)) {
count++;
}
}
return count > 1 || transaction.isBegun();
} | [
"private",
"boolean",
"isTransactional",
"(",
"SqlAction",
"[",
"]",
"sqlActions",
",",
"XianTransaction",
"transaction",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"SqlAction",
"sqlAction",
":",
"sqlActions",
")",
"{",
"if",
"(",
"!",
"(",
"sqlA... | judge whether we need to begin the transaction.
If there are more than one non-query sql actions in this dao unit, a new transaction will be begun.
if a transaction is already begun, a nested transaction will be begun.
Else no transaction will be begun.
@return true if this unit is transacitonal false otherwise. | [
"judge",
"whether",
"we",
"need",
"to",
"begin",
"the",
"transaction",
".",
"If",
"there",
"are",
"more",
"than",
"one",
"non",
"-",
"query",
"sql",
"actions",
"in",
"this",
"dao",
"unit",
"a",
"new",
"transaction",
"will",
"be",
"begun",
".",
"if",
"a... | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-dao/xian-daocore/src/main/java/info/xiancloud/dao/core/units/DaoUnit.java#L137-L145 |
radkovo/CSSBox | src/main/java/org/fit/cssbox/demo/ImageRenderer.java | ImageRenderer.writeSVG | protected void writeSVG(Viewport vp, Writer out) throws IOException {
"""
Renders the viewport using an SVGRenderer to the given output writer.
@param vp
@param out
@throws IOException
"""
//obtain the viewport bounds depending on whether we are clipping to viewport size or using the whole page
... | java | protected void writeSVG(Viewport vp, Writer out) throws IOException
{
//obtain the viewport bounds depending on whether we are clipping to viewport size or using the whole page
int w = vp.getClippedContentBounds().width;
int h = vp.getClippedContentBounds().height;
SVGRender... | [
"protected",
"void",
"writeSVG",
"(",
"Viewport",
"vp",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"//obtain the viewport bounds depending on whether we are clipping to viewport size or using the whole page",
"int",
"w",
"=",
"vp",
".",
"getClippedContentBounds",
... | Renders the viewport using an SVGRenderer to the given output writer.
@param vp
@param out
@throws IOException | [
"Renders",
"the",
"viewport",
"using",
"an",
"SVGRenderer",
"to",
"the",
"given",
"output",
"writer",
"."
] | train | https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/demo/ImageRenderer.java#L164-L173 |
ontop/ontop | binding/owlapi/src/main/java/it/unibz/inf/ontop/owlapi/impl/QuestOWL.java | QuestOWL.extractVersion | private static Version extractVersion() {
"""
extract version from {@link it.unibz.inf.ontop.utils.VersionInfo}, which is from the file {@code version.properties}
"""
VersionInfo versionInfo = VersionInfo.getVersionInfo();
String versionString = versionInfo.getVersion();
String[] splits = versionString.s... | java | private static Version extractVersion() {
VersionInfo versionInfo = VersionInfo.getVersionInfo();
String versionString = versionInfo.getVersion();
String[] splits = versionString.split("\\.");
int major = 0;
int minor = 0;
int patch = 0;
int build = 0;
try {
major = Integer.parseInt(splits[0]);
mi... | [
"private",
"static",
"Version",
"extractVersion",
"(",
")",
"{",
"VersionInfo",
"versionInfo",
"=",
"VersionInfo",
".",
"getVersionInfo",
"(",
")",
";",
"String",
"versionString",
"=",
"versionInfo",
".",
"getVersion",
"(",
")",
";",
"String",
"[",
"]",
"split... | extract version from {@link it.unibz.inf.ontop.utils.VersionInfo}, which is from the file {@code version.properties} | [
"extract",
"version",
"from",
"{"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/binding/owlapi/src/main/java/it/unibz/inf/ontop/owlapi/impl/QuestOWL.java#L158-L175 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/JCellCheckBox.java | JCellCheckBox.getTableCellEditorComponent | public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
"""
Get the editor for this location in the table.
From the TableCellEditor interface.
Sets the value of this control and returns this.
@return this.
"""
this.setControlValue(value);
... | java | public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
{
this.setControlValue(value);
return this;
} | [
"public",
"Component",
"getTableCellEditorComponent",
"(",
"JTable",
"table",
",",
"Object",
"value",
",",
"boolean",
"isSelected",
",",
"int",
"row",
",",
"int",
"column",
")",
"{",
"this",
".",
"setControlValue",
"(",
"value",
")",
";",
"return",
"this",
"... | Get the editor for this location in the table.
From the TableCellEditor interface.
Sets the value of this control and returns this.
@return this. | [
"Get",
"the",
"editor",
"for",
"this",
"location",
"in",
"the",
"table",
".",
"From",
"the",
"TableCellEditor",
"interface",
".",
"Sets",
"the",
"value",
"of",
"this",
"control",
"and",
"returns",
"this",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/JCellCheckBox.java#L105-L109 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosCommentsApi.java | PhotosCommentsApi.addComment | public Comment addComment(String photoId, String commentText) throws JinxException {
"""
Add comment to a photo as the currently authenticated user.
<br>
This method requires authentication with 'write' permission.
@param photoId (Required) The id of the photo to add a comment to.
@param commentText (Req... | java | public Comment addComment(String photoId, String commentText) throws JinxException {
JinxUtils.validateParams(photoId, commentText);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.comments.addComment");
params.put("photo_id", photoId);
params.put("comment_text", co... | [
"public",
"Comment",
"addComment",
"(",
"String",
"photoId",
",",
"String",
"commentText",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photoId",
",",
"commentText",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params"... | Add comment to a photo as the currently authenticated user.
<br>
This method requires authentication with 'write' permission.
@param photoId (Required) The id of the photo to add a comment to.
@param commentText (Required) Text of the comment.
@return object containing information about the newly added comment.
@t... | [
"Add",
"comment",
"to",
"a",
"photo",
"as",
"the",
"currently",
"authenticated",
"user",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosCommentsApi.java#L58-L65 |
adyliu/jafka | src/main/java/io/jafka/utils/Utils.java | Utils.getString | public static String getString(Properties props, String name, String defaultValue) {
"""
Get a string property, or, if no such property is defined, return
the given default value
@param props the properties
@param name the key in the properties
@param defaultValue the default value if the key ... | java | public static String getString(Properties props, String name, String defaultValue) {
return props.containsKey(name) ? props.getProperty(name) : defaultValue;
} | [
"public",
"static",
"String",
"getString",
"(",
"Properties",
"props",
",",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"props",
".",
"containsKey",
"(",
"name",
")",
"?",
"props",
".",
"getProperty",
"(",
"name",
")",
":",
"defaul... | Get a string property, or, if no such property is defined, return
the given default value
@param props the properties
@param name the key in the properties
@param defaultValue the default value if the key not exists
@return value in the props or defaultValue while name not exist | [
"Get",
"a",
"string",
"property",
"or",
"if",
"no",
"such",
"property",
"is",
"defined",
"return",
"the",
"given",
"default",
"value"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/Utils.java#L95-L97 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosetsApi.java | PhotosetsApi.editMeta | public Response editMeta(String photosetId, String title, String description) throws JinxException {
"""
Modify the meta-data for a photoset.
<br>
This method requires authentication with 'write' permission.
<br>
This method has no specific response - It returns an empty success response if it completes withou... | java | public Response editMeta(String photosetId, String title, String description) throws JinxException {
JinxUtils.validateParams(photosetId, title);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photosets.editMeta");
params.put("photoset_id", photosetId);
params.put("title"... | [
"public",
"Response",
"editMeta",
"(",
"String",
"photosetId",
",",
"String",
"title",
",",
"String",
"description",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photosetId",
",",
"title",
")",
";",
"Map",
"<",
"String",
",",
... | Modify the meta-data for a photoset.
<br>
This method requires authentication with 'write' permission.
<br>
This method has no specific response - It returns an empty success response if it completes without error.
@param photosetId id of the photoset to modify. Required.
@param title new title for the photoset... | [
"Modify",
"the",
"meta",
"-",
"data",
"for",
"a",
"photoset",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
".",
"<br",
">",
"This",
"method",
"has",
"no",
"specific",
"response",
"-",
"It",
"returns",
"an"... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosetsApi.java#L136-L146 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java | AssemblyAnalyzer.isDotnetPath | private boolean isDotnetPath() {
"""
Tests to see if a file is in the system path.
@return <code>true</code> if dotnet could be found in the path; otherwise
<code>false</code>
"""
final String[] args = new String[2];
args[0] = "dotnet";
args[1] = "--version";
final ProcessBu... | java | private boolean isDotnetPath() {
final String[] args = new String[2];
args[0] = "dotnet";
args[1] = "--version";
final ProcessBuilder pb = new ProcessBuilder(args);
try {
final Process proc = pb.start();
final int retCode = proc.waitFor();
if (... | [
"private",
"boolean",
"isDotnetPath",
"(",
")",
"{",
"final",
"String",
"[",
"]",
"args",
"=",
"new",
"String",
"[",
"2",
"]",
";",
"args",
"[",
"0",
"]",
"=",
"\"dotnet\"",
";",
"args",
"[",
"1",
"]",
"=",
"\"--version\"",
";",
"final",
"ProcessBuil... | Tests to see if a file is in the system path.
@return <code>true</code> if dotnet could be found in the path; otherwise
<code>false</code> | [
"Tests",
"to",
"see",
"if",
"a",
"file",
"is",
"in",
"the",
"system",
"path",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java#L444-L467 |
m-m-m/util | event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java | AbstractEventBus.getEventDispatcher | @SuppressWarnings( {
"""
Gets or creates the {@link EventDispatcher} for the given {@code eventType}.
@param eventType is the {@link Class} reflecting the {@link net.sf.mmm.util.event.api.Event event}.
@param createIfNotExists - if {@code true} the requested {@link EventDispatcher} will be created if it does n... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
private EventDispatcher getEventDispatcher(Class<?> eventType, boolean createIfNotExists) {
EventDispatcher<?> dispatcher = this.eventType2dispatcherMap.get(eventType);
if (dispatcher == null) {
Class<?> parentType = eventType.getSuperclass();
if (cr... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"private",
"EventDispatcher",
"getEventDispatcher",
"(",
"Class",
"<",
"?",
">",
"eventType",
",",
"boolean",
"createIfNotExists",
")",
"{",
"EventDispatcher",
"<",
"?",
">",
"dis... | Gets or creates the {@link EventDispatcher} for the given {@code eventType}.
@param eventType is the {@link Class} reflecting the {@link net.sf.mmm.util.event.api.Event event}.
@param createIfNotExists - if {@code true} the requested {@link EventDispatcher} will be created if it does not
exists, if {@code false} this ... | [
"Gets",
"or",
"creates",
"the",
"{",
"@link",
"EventDispatcher",
"}",
"for",
"the",
"given",
"{",
"@code",
"eventType",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java#L209-L230 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSONObject.java | JSONObject.putValue | public JSONObject putValue(String key, long value) {
"""
Add a {@link JSONLong} representing the supplied {@code long} to the {@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPointerExceptio... | java | public JSONObject putValue(String key, long value) {
put(key, JSONLong.valueOf(value));
return this;
} | [
"public",
"JSONObject",
"putValue",
"(",
"String",
"key",
",",
"long",
"value",
")",
"{",
"put",
"(",
"key",
",",
"JSONLong",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add a {@link JSONLong} representing the supplied {@code long} to the {@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPointerException if key is {@code null} | [
"Add",
"a",
"{",
"@link",
"JSONLong",
"}",
"representing",
"the",
"supplied",
"{",
"@code",
"long",
"}",
"to",
"the",
"{",
"@code",
"JSONObject",
"}",
"."
] | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSONObject.java#L130-L133 |
AzureAD/azure-activedirectory-library-for-java | src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java | JSONHelper.convertJSONObjectToDirectoryObject | public static <T> void convertJSONObjectToDirectoryObject(JSONObject jsonObject, T destObject) throws Exception {
"""
This is a generic method that copies the simple attribute values from an
argument jsonObject to an argument generic object.
@param jsonObject
The jsonObject from where the attributes are to be... | java | public static <T> void convertJSONObjectToDirectoryObject(JSONObject jsonObject, T destObject) throws Exception {
// Get the list of all the field names.
Field[] fieldList = destObject.getClass().getDeclaredFields();
// For all the declared field.
for (int i = 0; i < fieldList.le... | [
"public",
"static",
"<",
"T",
">",
"void",
"convertJSONObjectToDirectoryObject",
"(",
"JSONObject",
"jsonObject",
",",
"T",
"destObject",
")",
"throws",
"Exception",
"{",
"// Get the list of all the field names.\r",
"Field",
"[",
"]",
"fieldList",
"=",
"destObject",
"... | This is a generic method that copies the simple attribute values from an
argument jsonObject to an argument generic object.
@param jsonObject
The jsonObject from where the attributes are to be copied.
@param destObject
The object where the attributes should be copied into.
@throws Exception
Throws a Exception when the... | [
"This",
"is",
"a",
"generic",
"method",
"that",
"copies",
"the",
"simple",
"attribute",
"values",
"from",
"an",
"argument",
"jsonObject",
"to",
"an",
"argument",
"generic",
"object",
"."
] | train | https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/samples/web-app-samples-for-adal4j/src/main/java/com/microsoft/aad/adal4jsample/JSONHelper.java#L207-L226 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/TagsApi.java | TagsApi.getTag | public Tag getTag(Object projectIdOrPath, String tagName) throws GitLabApiException {
"""
Get a specific repository tag determined by its name.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/tags/:tagName</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the... | java | public Tag getTag(Object projectIdOrPath, String tagName) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "repository", "tags", tagName);
return (response.readEntity(Tag.class));
} | [
"public",
"Tag",
"getTag",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"tagName",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
"getProjectId... | Get a specific repository tag determined by its name.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/tags/:tagName</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param tagName the name of the tag to fetch the info for
@return a Tag instance... | [
"Get",
"a",
"specific",
"repository",
"tag",
"determined",
"by",
"its",
"name",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/TagsApi.java#L96-L99 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/template/AbstractProfileProfileAligner.java | AbstractProfileProfileAligner.setTarget | public void setTarget(Profile<S, C> target) {
"""
Sets the target {@link Profile}.
@param target the second {@link Profile} of the pair to align
"""
this.target = target;
targetFuture = null;
reset();
} | java | public void setTarget(Profile<S, C> target) {
this.target = target;
targetFuture = null;
reset();
} | [
"public",
"void",
"setTarget",
"(",
"Profile",
"<",
"S",
",",
"C",
">",
"target",
")",
"{",
"this",
".",
"target",
"=",
"target",
";",
"targetFuture",
"=",
"null",
";",
"reset",
"(",
")",
";",
"}"
] | Sets the target {@link Profile}.
@param target the second {@link Profile} of the pair to align | [
"Sets",
"the",
"target",
"{",
"@link",
"Profile",
"}",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/template/AbstractProfileProfileAligner.java#L154-L158 |
FINRAOS/DataGenerator | dg-core/src/main/java/org/finra/datagenerator/distributor/multithreaded/QueueResultsProcessing.java | QueueResultsProcessing.processOutput | @Override
public void processOutput(Map<String, String> resultsMap) {
"""
Stores the output from a Frontier into the queue, pausing and waiting if the given queue is too large
@param resultsMap map of String and String representing the output of a Frontier's DFS
"""
queue.add(resultsMap);
... | java | @Override
public void processOutput(Map<String, String> resultsMap) {
queue.add(resultsMap);
if (queue.size() > 10000) {
log.info("Queue size " + queue.size() + ", waiting");
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
... | [
"@",
"Override",
"public",
"void",
"processOutput",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"resultsMap",
")",
"{",
"queue",
".",
"add",
"(",
"resultsMap",
")",
";",
"if",
"(",
"queue",
".",
"size",
"(",
")",
">",
"10000",
")",
"{",
"log",
"... | Stores the output from a Frontier into the queue, pausing and waiting if the given queue is too large
@param resultsMap map of String and String representing the output of a Frontier's DFS | [
"Stores",
"the",
"output",
"from",
"a",
"Frontier",
"into",
"the",
"queue",
"pausing",
"and",
"waiting",
"if",
"the",
"given",
"queue",
"is",
"too",
"large"
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/distributor/multithreaded/QueueResultsProcessing.java#L49-L61 |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/PortletsRESTController.java | PortletsRESTController.getManageablePortlets | @RequestMapping(value = "/portlets.json", method = RequestMethod.GET)
public ModelAndView getManageablePortlets(
HttpServletRequest request, HttpServletResponse response) throws Exception {
"""
Provides information about all portlets in the portlet registry. NOTE: The response is
governed by the <... | java | @RequestMapping(value = "/portlets.json", method = RequestMethod.GET)
public ModelAndView getManageablePortlets(
HttpServletRequest request, HttpServletResponse response) throws Exception {
// get a list of all channels
List<IPortletDefinition> allPortlets = portletDefinitionRegistry.get... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/portlets.json\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ModelAndView",
"getManageablePortlets",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"Excep... | Provides information about all portlets in the portlet registry. NOTE: The response is
governed by the <code>IPermission.PORTLET_MANAGER_xyz</code> series of permissions. The
actual level of permission required is based on the current lifecycle state of the portlet. | [
"Provides",
"information",
"about",
"all",
"portlets",
"in",
"the",
"portlet",
"registry",
".",
"NOTE",
":",
"The",
"response",
"is",
"governed",
"by",
"the",
"<code",
">",
"IPermission",
".",
"PORTLET_MANAGER_xyz<",
"/",
"code",
">",
"series",
"of",
"permissi... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/rest/PortletsRESTController.java#L77-L92 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdServiceImpl.java | MessageBirdServiceImpl.getConnection | public <P> HttpURLConnection getConnection(final String serviceUrl, final P postData, final String requestType) throws IOException {
"""
Create a HttpURLConnection connection object
@param serviceUrl URL that needs to be requested
@param postData PostDATA, must be not null for requestType is POST
@param r... | java | public <P> HttpURLConnection getConnection(final String serviceUrl, final P postData, final String requestType) throws IOException {
if (requestType == null || !REQUEST_METHODS.contains(requestType)) {
throw new IllegalArgumentException(String.format(REQUEST_METHOD_NOT_ALLOWED, requestType));
... | [
"public",
"<",
"P",
">",
"HttpURLConnection",
"getConnection",
"(",
"final",
"String",
"serviceUrl",
",",
"final",
"P",
"postData",
",",
"final",
"String",
"requestType",
")",
"throws",
"IOException",
"{",
"if",
"(",
"requestType",
"==",
"null",
"||",
"!",
"... | Create a HttpURLConnection connection object
@param serviceUrl URL that needs to be requested
@param postData PostDATA, must be not null for requestType is POST
@param requestType Request type POST requests without a payload will generate a exception
@return base class
@throws IOException io exception | [
"Create",
"a",
"HttpURLConnection",
"connection",
"object"
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L347-L398 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexResponse.java | CmsFlexResponse.initStream | private void initStream() throws IOException {
"""
Initializes the current responses output stream
and the corresponding print writer.<p>
@throws IOException in case something goes wrong while initializing
"""
if (m_out == null) {
if (!m_writeOnlyToBuffer) {
// we can u... | java | private void initStream() throws IOException {
if (m_out == null) {
if (!m_writeOnlyToBuffer) {
// we can use the parents output stream
if (m_cachingRequired || (m_controller.getResponseStackSize() > 1)) {
// we are allowed to cache our results (p... | [
"private",
"void",
"initStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"m_out",
"==",
"null",
")",
"{",
"if",
"(",
"!",
"m_writeOnlyToBuffer",
")",
"{",
"// we can use the parents output stream",
"if",
"(",
"m_cachingRequired",
"||",
"(",
"m_control... | Initializes the current responses output stream
and the corresponding print writer.<p>
@throws IOException in case something goes wrong while initializing | [
"Initializes",
"the",
"current",
"responses",
"output",
"stream",
"and",
"the",
"corresponding",
"print",
"writer",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexResponse.java#L1083-L1104 |
yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/CollectionUtils.java | CollectionUtils.mergeArrayIntoCollection | @SuppressWarnings("unchecked")
public static <E> void mergeArrayIntoCollection(Object array, Collection<E> collection) {
"""
Merge the given array into the given Collection.
@param array the array to merge (may be {@code null}).
@param collection the target Collection to merge the array into.
"""
... | java | @SuppressWarnings("unchecked")
public static <E> void mergeArrayIntoCollection(Object array, Collection<E> collection) {
if (collection == null) {
throw new IllegalArgumentException("Collection must not be null");
}
Object[] arr = ObjectUtils.toObjectArray(array);
for (Ob... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
">",
"void",
"mergeArrayIntoCollection",
"(",
"Object",
"array",
",",
"Collection",
"<",
"E",
">",
"collection",
")",
"{",
"if",
"(",
"collection",
"==",
"null",
")",
"{",
"t... | Merge the given array into the given Collection.
@param array the array to merge (may be {@code null}).
@param collection the target Collection to merge the array into. | [
"Merge",
"the",
"given",
"array",
"into",
"the",
"given",
"Collection",
"."
] | train | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/CollectionUtils.java#L83-L92 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/Resources.java | Resources.getResource | @Pure
public static URL getResource(Class<?> classname, String path) {
"""
Replies the URL of a resource.
<p>You may use Unix-like syntax to write the resource path, ie.
you may use slashes to separate filenames.
<p>The name of {@code classname} is translated into a resource
path (by remove the name of th... | java | @Pure
public static URL getResource(Class<?> classname, String path) {
if (classname == null) {
return null;
}
URL u = getResource(classname.getClassLoader(), classname.getPackage(), path);
if (u == null) {
u = getResource(classname.getClassLoader(), path);
}
return u;
} | [
"@",
"Pure",
"public",
"static",
"URL",
"getResource",
"(",
"Class",
"<",
"?",
">",
"classname",
",",
"String",
"path",
")",
"{",
"if",
"(",
"classname",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"URL",
"u",
"=",
"getResource",
"(",
"classn... | Replies the URL of a resource.
<p>You may use Unix-like syntax to write the resource path, ie.
you may use slashes to separate filenames.
<p>The name of {@code classname} is translated into a resource
path (by remove the name of the class and replacing the dots by slashes) and the given path
is append to. For example... | [
"Replies",
"the",
"URL",
"of",
"a",
"resource",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/Resources.java#L164-L174 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/ChangeObjects.java | ChangeObjects.produceMonomerNotationUnitWithOtherID | public final static MonomerNotationUnit produceMonomerNotationUnitWithOtherID(MonomerNotation monomerNotation,
String newID) throws NotationException {
"""
method to replace the MonomerNotationUnit having the MonomerID with the
new MonomerID
@param monomerNotation
given monomer notation
@param newID
new... | java | public final static MonomerNotationUnit produceMonomerNotationUnitWithOtherID(MonomerNotation monomerNotation,
String newID) throws NotationException {
MonomerNotationUnit result = new MonomerNotationUnit(newID, monomerNotation.getType());
if (monomerNotation.isAnnotationTrue()) {
result.setAnnotation(mon... | [
"public",
"final",
"static",
"MonomerNotationUnit",
"produceMonomerNotationUnitWithOtherID",
"(",
"MonomerNotation",
"monomerNotation",
",",
"String",
"newID",
")",
"throws",
"NotationException",
"{",
"MonomerNotationUnit",
"result",
"=",
"new",
"MonomerNotationUnit",
"(",
... | method to replace the MonomerNotationUnit having the MonomerID with the
new MonomerID
@param monomerNotation
given monomer notation
@param newID
new monomer id
@return MonomerNotationUnit
@throws NotationException
if new id is not valid | [
"method",
"to",
"replace",
"the",
"MonomerNotationUnit",
"having",
"the",
"MonomerID",
"with",
"the",
"new",
"MonomerID"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/ChangeObjects.java#L582-L590 |
litsec/eidas-opensaml | opensaml2/src/main/java/se/litsec/eidas/opensaml2/ext/attributes/impl/CurrentAddressTypeUnmarshaller.java | CurrentAddressTypeUnmarshaller.getNamespaceBindings | private static void getNamespaceBindings(Element element, Map<String, String> namespaceMap) {
"""
Helper method to {@link #getNamespaceBindings(Element)}
@param element
the element to parse
@param namespaceMap
the map to fill
"""
if (element == null) {
return;
}
NamedNodeMap attrs = ele... | java | private static void getNamespaceBindings(Element element, Map<String, String> namespaceMap) {
if (element == null) {
return;
}
NamedNodeMap attrs = element.getAttributes();
for (int i = 0; i < attrs.getLength(); i++) {
Node node = attrs.item(i);
String name = node.getNodeName();
... | [
"private",
"static",
"void",
"getNamespaceBindings",
"(",
"Element",
"element",
",",
"Map",
"<",
"String",
",",
"String",
">",
"namespaceMap",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"return",
";",
"}",
"NamedNodeMap",
"attrs",
"=",
"elemen... | Helper method to {@link #getNamespaceBindings(Element)}
@param element
the element to parse
@param namespaceMap
the map to fill | [
"Helper",
"method",
"to",
"{",
"@link",
"#getNamespaceBindings",
"(",
"Element",
")",
"}"
] | train | https://github.com/litsec/eidas-opensaml/blob/522ba6dba433a9524cb8a02464cc3b087b47a2b7/opensaml2/src/main/java/se/litsec/eidas/opensaml2/ext/attributes/impl/CurrentAddressTypeUnmarshaller.java#L172-L188 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/encryption/SessionManagerActor.java | SessionManagerActor.pickSession | public Promise<PeerSession> pickSession(final int uid,
final int keyGroupId,
final long ownKeyId,
final long theirKeyId) {
"""
Pick session for specific keys
@param uid User... | java | public Promise<PeerSession> pickSession(final int uid,
final int keyGroupId,
final long ownKeyId,
final long theirKeyId) {
return pickCachedSession(uid, keyGroupId, ownKeyId, thei... | [
"public",
"Promise",
"<",
"PeerSession",
">",
"pickSession",
"(",
"final",
"int",
"uid",
",",
"final",
"int",
"keyGroupId",
",",
"final",
"long",
"ownKeyId",
",",
"final",
"long",
"theirKeyId",
")",
"{",
"return",
"pickCachedSession",
"(",
"uid",
",",
"keyGr... | Pick session for specific keys
@param uid User's id
@param keyGroupId User's key group
@param ownKeyId Own Pre Key id
@param theirKeyId Their Pre Key id | [
"Pick",
"session",
"for",
"specific",
"keys"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/encryption/SessionManagerActor.java#L126-L159 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/URLConnectionFactory.java | URLConnectionFactory.createHttpURLConnection | public HttpURLConnection createHttpURLConnection(URL url, boolean proxy) throws URLConnectionFailureException {
"""
Utility method to create an HttpURLConnection. The use of a proxy here is
optional as there may be cases where a proxy is configured but we don't
want to use it (for example, if there's an internal... | java | public HttpURLConnection createHttpURLConnection(URL url, boolean proxy) throws URLConnectionFailureException {
if (proxy) {
return createHttpURLConnection(url);
}
HttpURLConnection conn = null;
try {
conn = (HttpURLConnection) url.openConnection();
fi... | [
"public",
"HttpURLConnection",
"createHttpURLConnection",
"(",
"URL",
"url",
",",
"boolean",
"proxy",
")",
"throws",
"URLConnectionFailureException",
"{",
"if",
"(",
"proxy",
")",
"{",
"return",
"createHttpURLConnection",
"(",
"url",
")",
";",
"}",
"HttpURLConnectio... | Utility method to create an HttpURLConnection. The use of a proxy here is
optional as there may be cases where a proxy is configured but we don't
want to use it (for example, if there's an internal repository
configured)
@param url the URL to connect to
@param proxy whether to use the proxy (if configured)
@return a n... | [
"Utility",
"method",
"to",
"create",
"an",
"HttpURLConnection",
".",
"The",
"use",
"of",
"a",
"proxy",
"here",
"is",
"optional",
"as",
"there",
"may",
"be",
"cases",
"where",
"a",
"proxy",
"is",
"configured",
"but",
"we",
"don",
"t",
"want",
"to",
"use",... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/URLConnectionFactory.java#L188-L203 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationradiusaction.java | authenticationradiusaction.get | public static authenticationradiusaction get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch authenticationradiusaction resource of given name .
"""
authenticationradiusaction obj = new authenticationradiusaction();
obj.set_name(name);
authenticationradiusaction response ... | java | public static authenticationradiusaction get(nitro_service service, String name) throws Exception{
authenticationradiusaction obj = new authenticationradiusaction();
obj.set_name(name);
authenticationradiusaction response = (authenticationradiusaction) obj.get_resource(service);
return response;
} | [
"public",
"static",
"authenticationradiusaction",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"authenticationradiusaction",
"obj",
"=",
"new",
"authenticationradiusaction",
"(",
")",
";",
"obj",
".",
"set_name",
"(... | Use this API to fetch authenticationradiusaction resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"authenticationradiusaction",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationradiusaction.java#L785-L790 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRowExample.java | WRowExample.createRow | private WRow createRow(final int hgap, final int[] colWidths) {
"""
Creates a row containing columns with the given widths.
@param hgap the horizontal gap between columns, in pixels.
@param colWidths the percentage widths for each column.
@return a WRow containing columns with the given widths.
"""
WRow... | java | private WRow createRow(final int hgap, final int[] colWidths) {
WRow row = new WRow(hgap);
for (int i = 0; i < colWidths.length; i++) {
WColumn col = new WColumn(colWidths[i]);
WPanel box = new WPanel(WPanel.Type.BOX);
box.add(new WText(colWidths[i] + "%"));
col.add(box);
row.add(col);
}
return... | [
"private",
"WRow",
"createRow",
"(",
"final",
"int",
"hgap",
",",
"final",
"int",
"[",
"]",
"colWidths",
")",
"{",
"WRow",
"row",
"=",
"new",
"WRow",
"(",
"hgap",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"colWidths",
".",
"lengt... | Creates a row containing columns with the given widths.
@param hgap the horizontal gap between columns, in pixels.
@param colWidths the percentage widths for each column.
@return a WRow containing columns with the given widths. | [
"Creates",
"a",
"row",
"containing",
"columns",
"with",
"the",
"given",
"widths",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRowExample.java#L121-L133 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java | Constraints.ifTrue | public PropertyConstraint ifTrue(PropertyConstraint ifConstraint, PropertyConstraint[] thenConstraints) {
"""
Returns a ConditionalPropertyConstraint: one property will trigger the
validation of another.
@see ConditionalPropertyConstraint
"""
return new ConditionalPropertyConstraint(ifConstraint, new Com... | java | public PropertyConstraint ifTrue(PropertyConstraint ifConstraint, PropertyConstraint[] thenConstraints) {
return new ConditionalPropertyConstraint(ifConstraint, new CompoundPropertyConstraint(new And(thenConstraints)));
} | [
"public",
"PropertyConstraint",
"ifTrue",
"(",
"PropertyConstraint",
"ifConstraint",
",",
"PropertyConstraint",
"[",
"]",
"thenConstraints",
")",
"{",
"return",
"new",
"ConditionalPropertyConstraint",
"(",
"ifConstraint",
",",
"new",
"CompoundPropertyConstraint",
"(",
"ne... | Returns a ConditionalPropertyConstraint: one property will trigger the
validation of another.
@see ConditionalPropertyConstraint | [
"Returns",
"a",
"ConditionalPropertyConstraint",
":",
"one",
"property",
"will",
"trigger",
"the",
"validation",
"of",
"another",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L350-L352 |
code4everything/util | src/main/java/com/zhazhapan/util/BeanUtils.java | BeanUtils.jsonPutIn | public static void jsonPutIn(JSONObject jsonObject, Object object) throws IllegalAccessException {
"""
将JOSNObject转换为Bean
@param jsonObject {@link JSONObject}
@param object {@link Object}
@throws IllegalAccessException 异常
@deprecated 请使用 {@link JSONObject#toJavaObject(JSON, Class)}
"""
Field[] ... | java | public static void jsonPutIn(JSONObject jsonObject, Object object) throws IllegalAccessException {
Field[] fields = object.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
field.set(object, TypeUtils.castToJavaBean(jsonObject.get(field.getNa... | [
"public",
"static",
"void",
"jsonPutIn",
"(",
"JSONObject",
"jsonObject",
",",
"Object",
"object",
")",
"throws",
"IllegalAccessException",
"{",
"Field",
"[",
"]",
"fields",
"=",
"object",
".",
"getClass",
"(",
")",
".",
"getDeclaredFields",
"(",
")",
";",
"... | 将JOSNObject转换为Bean
@param jsonObject {@link JSONObject}
@param object {@link Object}
@throws IllegalAccessException 异常
@deprecated 请使用 {@link JSONObject#toJavaObject(JSON, Class)} | [
"将JOSNObject转换为Bean"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/BeanUtils.java#L228-L234 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/convolve/Kernel2D_F32.java | Kernel2D_F32.wrap | public static Kernel2D_F32 wrap(float data[], int width, int offset) {
"""
Creates a kernel whose elements are the specified data array and has
the specified width.
@param data The array who will be the kernel's data. Reference is saved.
@param width The kernel's width.
@param offset Kernel origin's offset... | java | public static Kernel2D_F32 wrap(float data[], int width, int offset) {
if (width % 2 == 0 && width <= 0 && width * width > data.length)
throw new IllegalArgumentException("invalid width");
Kernel2D_F32 ret = new Kernel2D_F32();
ret.data = data;
ret.width = width;
ret.offset = offset;
return ret;
} | [
"public",
"static",
"Kernel2D_F32",
"wrap",
"(",
"float",
"data",
"[",
"]",
",",
"int",
"width",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"width",
"%",
"2",
"==",
"0",
"&&",
"width",
"<=",
"0",
"&&",
"width",
"*",
"width",
">",
"data",
".",
"le... | Creates a kernel whose elements are the specified data array and has
the specified width.
@param data The array who will be the kernel's data. Reference is saved.
@param width The kernel's width.
@param offset Kernel origin's offset from element 0.
@return A new kernel. | [
"Creates",
"a",
"kernel",
"whose",
"elements",
"are",
"the",
"specified",
"data",
"array",
"and",
"has",
"the",
"specified",
"width",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/convolve/Kernel2D_F32.java#L87-L97 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageContentHelper.java | PageContentHelper.addJsHeadlines | public static void addJsHeadlines(final PrintWriter writer, final List jsHeadlines) {
"""
Add a list of javascript headline entries intended to be added only once to the page.
@param writer the writer to write to.
@param jsHeadlines a list of javascript entries to be added to the page as a whole.
"""
if ... | java | public static void addJsHeadlines(final PrintWriter writer, final List jsHeadlines) {
if (jsHeadlines == null || jsHeadlines.isEmpty()) {
return;
}
writer.println();
writer.write("\n<!-- Start javascript headlines -->"
+ OPEN_JAVASCRIPT);
for (Iterator iter = jsHeadlines.iterator(); iter.hasNext();) ... | [
"public",
"static",
"void",
"addJsHeadlines",
"(",
"final",
"PrintWriter",
"writer",
",",
"final",
"List",
"jsHeadlines",
")",
"{",
"if",
"(",
"jsHeadlines",
"==",
"null",
"||",
"jsHeadlines",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"writer... | Add a list of javascript headline entries intended to be added only once to the page.
@param writer the writer to write to.
@param jsHeadlines a list of javascript entries to be added to the page as a whole. | [
"Add",
"a",
"list",
"of",
"javascript",
"headline",
"entries",
"intended",
"to",
"be",
"added",
"only",
"once",
"to",
"the",
"page",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageContentHelper.java#L67-L83 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/Debug.java | Debug.printMiddleResults | public static void printMiddleResults(ArrayList<ArrayList<TextPiece>> wordsByPage,
ArrayList<ArrayList<TextPiece>> linesByPage, String outputDirPath, File pdfFile) {
"""
For testing purpose. The function of this method is to display the middle-stage text combination results.
E.g., combined texts in the Word or ... | java | public static void printMiddleResults(ArrayList<ArrayList<TextPiece>> wordsByPage,
ArrayList<ArrayList<TextPiece>> linesByPage, String outputDirPath, File pdfFile) {
try {
/**
* Creates the middle-result directory if it does not exist
*/
File middleDir = new Fil... | [
"public",
"static",
"void",
"printMiddleResults",
"(",
"ArrayList",
"<",
"ArrayList",
"<",
"TextPiece",
">",
">",
"wordsByPage",
",",
"ArrayList",
"<",
"ArrayList",
"<",
"TextPiece",
">",
">",
"linesByPage",
",",
"String",
"outputDirPath",
",",
"File",
"pdfFile"... | For testing purpose. The function of this method is to display the middle-stage text combination results.
E.g., combined texts in the Word or Line level. The results will be printed into files "pdfFile"
in path "outputDirPath" in the directory of the PDF documents
@param wordsByPage
the word list of a PDF document pag... | [
"For",
"testing",
"purpose",
".",
"The",
"function",
"of",
"this",
"method",
"is",
"to",
"display",
"the",
"middle",
"-",
"stage",
"text",
"combination",
"results",
".",
"E",
".",
"g",
".",
"combined",
"texts",
"in",
"the",
"Word",
"or",
"Line",
"level",... | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/edu/psu/seersuite/extractors/tableextractor/Debug.java#L42-L101 |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol/RequestHttpBase.java | RequestHttpBase.getHeaderBuffers | public void getHeaderBuffers(String name, ArrayList<CharSegment> resultList) {
"""
Fills the result with a list of the header values as
CharSegment values. Most implementations will
implement this directly.
@param name the header name
@param resultList the resulting buffer
"""
String value = header(... | java | public void getHeaderBuffers(String name, ArrayList<CharSegment> resultList)
{
String value = header(name);
if (value != null)
resultList.add(new CharBuffer(value));
} | [
"public",
"void",
"getHeaderBuffers",
"(",
"String",
"name",
",",
"ArrayList",
"<",
"CharSegment",
">",
"resultList",
")",
"{",
"String",
"value",
"=",
"header",
"(",
"name",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"resultList",
".",
"add",
"(",... | Fills the result with a list of the header values as
CharSegment values. Most implementations will
implement this directly.
@param name the header name
@param resultList the resulting buffer | [
"Fills",
"the",
"result",
"with",
"a",
"list",
"of",
"the",
"header",
"values",
"as",
"CharSegment",
"values",
".",
"Most",
"implementations",
"will",
"implement",
"this",
"directly",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttpBase.java#L973-L979 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLACStreamController.java | FLACStreamController.closeFLACStream | public void closeFLACStream(byte[] md5Hash, StreamConfiguration streamConfig)
throws IOException {
"""
Close the current FLAC stream. Updates the stream header information.
If called on a closed stream, operation is undefined. Do not do this.
"""
//reset position in output stream to beginning.
/... | java | public void closeFLACStream(byte[] md5Hash, StreamConfiguration streamConfig)
throws IOException {
//reset position in output stream to beginning.
//re-write the updated stream info.
streamLock.lock();
try {
if(!flacStreamIsOpen)
throw new IllegalStateException("Error. Cannot close a... | [
"public",
"void",
"closeFLACStream",
"(",
"byte",
"[",
"]",
"md5Hash",
",",
"StreamConfiguration",
"streamConfig",
")",
"throws",
"IOException",
"{",
"//reset position in output stream to beginning.",
"//re-write the updated stream info.",
"streamLock",
".",
"lock",
"(",
")... | Close the current FLAC stream. Updates the stream header information.
If called on a closed stream, operation is undefined. Do not do this. | [
"Close",
"the",
"current",
"FLAC",
"stream",
".",
"Updates",
"the",
"stream",
"header",
"information",
".",
"If",
"called",
"on",
"a",
"closed",
"stream",
"operation",
"is",
"undefined",
".",
"Do",
"not",
"do",
"this",
"."
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLACStreamController.java#L94-L116 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java | EnvironmentsInner.createOrUpdateAsync | public Observable<EnvironmentInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentInner environment) {
"""
Create or replace an existing Environment.
@param resourceGroupName The name of the resource group.
... | java | public Observable<EnvironmentInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName, EnvironmentInner environment) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSet... | [
"public",
"Observable",
"<",
"EnvironmentInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"String",
"environmentName",
",",
"EnvironmentInner",
... | Create or replace an existing Environment.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting.
@param environmentName The name of the environment.
@param enviro... | [
"Create",
"or",
"replace",
"an",
"existing",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java#L680-L687 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/providers/cloudme/CMFolder.java | CMFolder.addChild | public CMFolder addChild( String id, String name ) {
"""
Adds a child folder
@param id id of the child folder
@param name name of the child folder
@return the added folder
"""
CMFolder childFolder = new CMFolder( id, name );
childFolder.parent = this;
this.children.put( name, child... | java | public CMFolder addChild( String id, String name )
{
CMFolder childFolder = new CMFolder( id, name );
childFolder.parent = this;
this.children.put( name, childFolder );
return childFolder;
} | [
"public",
"CMFolder",
"addChild",
"(",
"String",
"id",
",",
"String",
"name",
")",
"{",
"CMFolder",
"childFolder",
"=",
"new",
"CMFolder",
"(",
"id",
",",
"name",
")",
";",
"childFolder",
".",
"parent",
"=",
"this",
";",
"this",
".",
"children",
".",
"... | Adds a child folder
@param id id of the child folder
@param name name of the child folder
@return the added folder | [
"Adds",
"a",
"child",
"folder"
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/providers/cloudme/CMFolder.java#L64-L70 |
apache/incubator-heron | heron/schedulers/src/java/org/apache/heron/scheduler/nomad/NomadScheduler.java | NomadScheduler.getTaskSpecDockerDriver | Task getTaskSpecDockerDriver(Task task, String taskName, int containerIndex) {
"""
Get the task spec for using the docker driver in Nomad
In docker mode, Heron will be use in docker containers
"""
String executorBinary = Context.executorBinary(this.clusterConfig);
// get arguments for heron executor ... | java | Task getTaskSpecDockerDriver(Task task, String taskName, int containerIndex) {
String executorBinary = Context.executorBinary(this.clusterConfig);
// get arguments for heron executor command
String[] executorArgs = SchedulerUtils.executorCommandArgs(
this.clusterConfig, this.runtimeConfig, NomadCon... | [
"Task",
"getTaskSpecDockerDriver",
"(",
"Task",
"task",
",",
"String",
"taskName",
",",
"int",
"containerIndex",
")",
"{",
"String",
"executorBinary",
"=",
"Context",
".",
"executorBinary",
"(",
"this",
".",
"clusterConfig",
")",
";",
"// get arguments for heron exe... | Get the task spec for using the docker driver in Nomad
In docker mode, Heron will be use in docker containers | [
"Get",
"the",
"task",
"spec",
"for",
"using",
"the",
"docker",
"driver",
"in",
"Nomad",
"In",
"docker",
"mode",
"Heron",
"will",
"be",
"use",
"in",
"docker",
"containers"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/schedulers/src/java/org/apache/heron/scheduler/nomad/NomadScheduler.java#L333-L371 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.A | public static HtmlTree A(String ref, Content body) {
"""
Generates an HTML anchor tag.
@param ref reference url for the anchor tag
@param body content for the anchor tag
@return an HtmlTree object
"""
HtmlTree htmltree = new HtmlTree(HtmlTag.A, nullCheck(body));
htmltree.addAttr(HtmlAttr.H... | java | public static HtmlTree A(String ref, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.A, nullCheck(body));
htmltree.addAttr(HtmlAttr.HREF, encodeURL(ref));
return htmltree;
} | [
"public",
"static",
"HtmlTree",
"A",
"(",
"String",
"ref",
",",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"A",
",",
"nullCheck",
"(",
"body",
")",
")",
";",
"htmltree",
".",
"addAttr",
"(",
"HtmlA... | Generates an HTML anchor tag.
@param ref reference url for the anchor tag
@param body content for the anchor tag
@return an HtmlTree object | [
"Generates",
"an",
"HTML",
"anchor",
"tag",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L229-L233 |
mojohaus/webstart | webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/AbstractBaseJnlpMojo.java | AbstractBaseJnlpMojo.removeExistingSignatures | private int removeExistingSignatures( File workDirectory )
throws MojoExecutionException {
"""
Removes the signature of the files in the specified directory which satisfy the
specified filter.
@param workDirectory working directory used to unsign jars
@return the number of unsigned jars
@throws M... | java | private int removeExistingSignatures( File workDirectory )
throws MojoExecutionException
{
getLog().info( "-- Remove existing signatures" );
// cleanup tempDir if exists
File tempDir = new File( workDirectory, "temp_extracted_jars" );
ioUtil.removeDirectory( tempDir );
... | [
"private",
"int",
"removeExistingSignatures",
"(",
"File",
"workDirectory",
")",
"throws",
"MojoExecutionException",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"-- Remove existing signatures\"",
")",
";",
"// cleanup tempDir if exists",
"File",
"tempDir",
"=",
"new",
... | Removes the signature of the files in the specified directory which satisfy the
specified filter.
@param workDirectory working directory used to unsign jars
@return the number of unsigned jars
@throws MojoExecutionException if could not remove signatures | [
"Removes",
"the",
"signature",
"of",
"the",
"files",
"in",
"the",
"specified",
"directory",
"which",
"satisfy",
"the",
"specified",
"filter",
"."
] | train | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/AbstractBaseJnlpMojo.java#L982-L1023 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.containsAny | public static boolean containsAny(final CharSequence cs, final CharSequence searchChars) {
"""
<p>
Checks if the CharSequence contains any character in the given set of characters.
</p>
<p>
A {@code null} CharSequence will return {@code false}. A {@code null} search CharSequence will return
{@code false}.
... | java | public static boolean containsAny(final CharSequence cs, final CharSequence searchChars) {
if (searchChars == null) {
return false;
}
return containsAny(cs, CharSequenceUtils.toCharArray(searchChars));
} | [
"public",
"static",
"boolean",
"containsAny",
"(",
"final",
"CharSequence",
"cs",
",",
"final",
"CharSequence",
"searchChars",
")",
"{",
"if",
"(",
"searchChars",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"containsAny",
"(",
"cs",
",",
... | <p>
Checks if the CharSequence contains any character in the given set of characters.
</p>
<p>
A {@code null} CharSequence will return {@code false}. A {@code null} search CharSequence will return
{@code false}.
</p>
<pre>
StringUtils.containsAny(null, *) = false
StringUtils.containsAny("", *) ... | [
"<p",
">",
"Checks",
"if",
"the",
"CharSequence",
"contains",
"any",
"character",
"in",
"the",
"given",
"set",
"of",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L2217-L2222 |
Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.subscribe | public boolean subscribe(IConsumer consumer, Map<String, Object> paramMap) {
"""
Connect consumer to this pipe. Doesn't allow to connect one consumer twice. Does register event listeners if instance of IPipeConnectionListener is given.
@param consumer
Consumer
@param paramMap
Parameters passed with connectio... | java | public boolean subscribe(IConsumer consumer, Map<String, Object> paramMap) {
// pipe is possibly used by dozens of threads at once (like many subscribers for one server stream)
boolean success = consumers.addIfAbsent(consumer);
// if consumer is listener object register it as listener and consum... | [
"public",
"boolean",
"subscribe",
"(",
"IConsumer",
"consumer",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"// pipe is possibly used by dozens of threads at once (like many subscribers for one server stream)",
"boolean",
"success",
"=",
"consumers",
... | Connect consumer to this pipe. Doesn't allow to connect one consumer twice. Does register event listeners if instance of IPipeConnectionListener is given.
@param consumer
Consumer
@param paramMap
Parameters passed with connection, used in concrete pipe implementations
@return true if consumer was added, false otherwis... | [
"Connect",
"consumer",
"to",
"this",
"pipe",
".",
"Doesn",
"t",
"allow",
"to",
"connect",
"one",
"consumer",
"twice",
".",
"Does",
"register",
"event",
"listeners",
"if",
"instance",
"of",
"IPipeConnectionListener",
"is",
"given",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L73-L81 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java | PacketParserUtils.parseContentDepth | public static CharSequence parseContentDepth(XmlPullParser parser, int depth, boolean fullNamespaces) throws XmlPullParserException, IOException {
"""
Returns the content from the current position of the parser up to the closing tag of the
given depth. Note that only the outermost namespace attributes ("xmlns") w... | java | public static CharSequence parseContentDepth(XmlPullParser parser, int depth, boolean fullNamespaces) throws XmlPullParserException, IOException {
if (parser.getFeature(FEATURE_XML_ROUNDTRIP)) {
return parseContentDepthWithRoundtrip(parser, depth, fullNamespaces);
} else {
return... | [
"public",
"static",
"CharSequence",
"parseContentDepth",
"(",
"XmlPullParser",
"parser",
",",
"int",
"depth",
",",
"boolean",
"fullNamespaces",
")",
"throws",
"XmlPullParserException",
",",
"IOException",
"{",
"if",
"(",
"parser",
".",
"getFeature",
"(",
"FEATURE_XM... | Returns the content from the current position of the parser up to the closing tag of the
given depth. Note that only the outermost namespace attributes ("xmlns") will be returned,
not nested ones, if <code>fullNamespaces</code> is false. If it is true, then namespaces of
parent elements will be added to child elements ... | [
"Returns",
"the",
"content",
"from",
"the",
"current",
"position",
"of",
"the",
"parser",
"up",
"to",
"the",
"closing",
"tag",
"of",
"the",
"given",
"depth",
".",
"Note",
"that",
"only",
"the",
"outermost",
"namespace",
"attributes",
"(",
"xmlns",
")",
"wi... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java#L421-L427 |
canoo/open-dolphin | subprojects/server/src/main/groovy/org/opendolphin/server/adapter/DolphinServlet.java | DolphinServlet.writeOutput | protected void writeOutput(HttpServletResponse response, String output) throws ServletException, IOException {
"""
Writes the encoded outgoing commands to the {@code response}.
@param response - an HttpServletResponse object that contains the response the servlet sends to the client
@param output - the enco... | java | protected void writeOutput(HttpServletResponse response, String output) throws ServletException, IOException {
response.getWriter().print(output);
response.getWriter().flush();
} | [
"protected",
"void",
"writeOutput",
"(",
"HttpServletResponse",
"response",
",",
"String",
"output",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"response",
".",
"getWriter",
"(",
")",
".",
"print",
"(",
"output",
")",
";",
"response",
".",
"ge... | Writes the encoded outgoing commands to the {@code response}.
@param response - an HttpServletResponse object that contains the response the servlet sends to the client
@param output - the encoded collection of commands to be sent back to the client
@throws IOException - if an input or output error is detecte... | [
"Writes",
"the",
"encoded",
"outgoing",
"commands",
"to",
"the",
"{",
"@code",
"response",
"}",
"."
] | train | https://github.com/canoo/open-dolphin/blob/50166defc3ef2de473d7a7246c32dc04304d80ef/subprojects/server/src/main/groovy/org/opendolphin/server/adapter/DolphinServlet.java#L237-L240 |
samskivert/samskivert | src/main/java/com/samskivert/swing/RadialLabelSausage.java | RadialLabelSausage.drawBase | @Override
protected void drawBase (Graphics2D gfx, int x, int y) {
"""
Draw the base circle or sausage within which all the other
decorations are added.
"""
if (_active) {
// render the sausage
super.drawBase(gfx, x, y);
} else {
// render the circle
... | java | @Override
protected void drawBase (Graphics2D gfx, int x, int y)
{
if (_active) {
// render the sausage
super.drawBase(gfx, x, y);
} else {
// render the circle
gfx.fillOval(x, y, closedBounds.width - 1, closedBounds.height - 1);
}
} | [
"@",
"Override",
"protected",
"void",
"drawBase",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"_active",
")",
"{",
"// render the sausage",
"super",
".",
"drawBase",
"(",
"gfx",
",",
"x",
",",
"y",
")",
";",
"}",
... | Draw the base circle or sausage within which all the other
decorations are added. | [
"Draw",
"the",
"base",
"circle",
"or",
"sausage",
"within",
"which",
"all",
"the",
"other",
"decorations",
"are",
"added",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialLabelSausage.java#L162-L173 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java | WriteChannelConfiguration.of | public static WriteChannelConfiguration of(TableId destinationTable, FormatOptions format) {
"""
Returns a BigQuery Load Configuration for the given destination table and format.
"""
return newBuilder(destinationTable).setFormatOptions(format).build();
} | java | public static WriteChannelConfiguration of(TableId destinationTable, FormatOptions format) {
return newBuilder(destinationTable).setFormatOptions(format).build();
} | [
"public",
"static",
"WriteChannelConfiguration",
"of",
"(",
"TableId",
"destinationTable",
",",
"FormatOptions",
"format",
")",
"{",
"return",
"newBuilder",
"(",
"destinationTable",
")",
".",
"setFormatOptions",
"(",
"format",
")",
".",
"build",
"(",
")",
";",
"... | Returns a BigQuery Load Configuration for the given destination table and format. | [
"Returns",
"a",
"BigQuery",
"Load",
"Configuration",
"for",
"the",
"given",
"destination",
"table",
"and",
"format",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java#L499-L501 |
overturetool/overture | core/ast/src/main/java/org/overture/ast/preview/GraphViz.java | GraphViz.writeGraphToFile | public int writeGraphToFile(byte[] img, String file) {
"""
Writes the graph's image in a file.
@param img
A byte array containing the image of the graph.
@param file
Name of the file to where we want to write.
@return Success: 1, Failure: -1
"""
File to = new File(file);
return writeGraphToFile(img,... | java | public int writeGraphToFile(byte[] img, String file)
{
File to = new File(file);
return writeGraphToFile(img, to);
} | [
"public",
"int",
"writeGraphToFile",
"(",
"byte",
"[",
"]",
"img",
",",
"String",
"file",
")",
"{",
"File",
"to",
"=",
"new",
"File",
"(",
"file",
")",
";",
"return",
"writeGraphToFile",
"(",
"img",
",",
"to",
")",
";",
"}"
] | Writes the graph's image in a file.
@param img
A byte array containing the image of the graph.
@param file
Name of the file to where we want to write.
@return Success: 1, Failure: -1 | [
"Writes",
"the",
"graph",
"s",
"image",
"in",
"a",
"file",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/ast/src/main/java/org/overture/ast/preview/GraphViz.java#L171-L175 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/actions/ClearMarkersAction.java | ClearMarkersAction.work | @Override
protected void work(final IWorkbenchPart part, IResource resource, final List<WorkItem> resources) {
"""
Clear the FindBugs markers on each project in the given selection,
displaying a progress monitor.
"""
FindBugsJob clearMarkersJob = new ClearMarkersJob(resource, resources);
c... | java | @Override
protected void work(final IWorkbenchPart part, IResource resource, final List<WorkItem> resources) {
FindBugsJob clearMarkersJob = new ClearMarkersJob(resource, resources);
clearMarkersJob.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJob... | [
"@",
"Override",
"protected",
"void",
"work",
"(",
"final",
"IWorkbenchPart",
"part",
",",
"IResource",
"resource",
",",
"final",
"List",
"<",
"WorkItem",
">",
"resources",
")",
"{",
"FindBugsJob",
"clearMarkersJob",
"=",
"new",
"ClearMarkersJob",
"(",
"resource... | Clear the FindBugs markers on each project in the given selection,
displaying a progress monitor. | [
"Clear",
"the",
"FindBugs",
"markers",
"on",
"each",
"project",
"in",
"the",
"given",
"selection",
"displaying",
"a",
"progress",
"monitor",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/ClearMarkersAction.java#L49-L59 |
dadoonet/fscrawler | elasticsearch-client/elasticsearch-client-v6/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v6/ElasticsearchClientV6.java | ElasticsearchClientV6.deleteByQuery | public void deleteByQuery(String index, String type) throws IOException {
"""
Fully removes a type from an index (removes data)
@param index index name
@param type type
@throws IOException In case of error
"""
logger.debug("deleteByQuery [{}]/[{}]", index, type);
String deleteByQuery = "{\n... | java | public void deleteByQuery(String index, String type) throws IOException {
logger.debug("deleteByQuery [{}]/[{}]", index, type);
String deleteByQuery = "{\n" +
" \"query\": {\n" +
" \"match_all\": {}\n" +
" }\n" +
"}";
Request... | [
"public",
"void",
"deleteByQuery",
"(",
"String",
"index",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"deleteByQuery [{}]/[{}]\"",
",",
"index",
",",
"type",
")",
";",
"String",
"deleteByQuery",
"=",
"\"{\\n\"",
"+... | Fully removes a type from an index (removes data)
@param index index name
@param type type
@throws IOException In case of error | [
"Fully",
"removes",
"a",
"type",
"from",
"an",
"index",
"(",
"removes",
"data",
")"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/elasticsearch-client/elasticsearch-client-v6/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v6/ElasticsearchClientV6.java#L349-L363 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/caching/support/CachingTemplate.java | CachingTemplate.withCacheEvict | @SuppressWarnings("unchecked")
public <T extends VALUE> T withCacheEvict(KEY key, Supplier<VALUE> cacheableOperation) {
"""
This caching data access operation invokes the supplied {@link Supplier cacheable operation} and then evicts
the entry in the {@link Cache} identified with the given {@link KEY key} if pre... | java | @SuppressWarnings("unchecked")
public <T extends VALUE> T withCacheEvict(KEY key, Supplier<VALUE> cacheableOperation) {
Assert.notNull(cacheableOperation, "Supplier is required");
VALUE result = cacheableOperation.get();
evict(getLock(), key);
return (T) result;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"VALUE",
">",
"T",
"withCacheEvict",
"(",
"KEY",
"key",
",",
"Supplier",
"<",
"VALUE",
">",
"cacheableOperation",
")",
"{",
"Assert",
".",
"notNull",
"(",
"cacheableOperation",
... | This caching data access operation invokes the supplied {@link Supplier cacheable operation} and then evicts
the entry in the {@link Cache} identified with the given {@link KEY key} if present, but only if
the {@link Supplier cacheable operation} completes successfully.
@param <T> {@link Class type} of the return {@li... | [
"This",
"caching",
"data",
"access",
"operation",
"invokes",
"the",
"supplied",
"{",
"@link",
"Supplier",
"cacheable",
"operation",
"}",
"and",
"then",
"evicts",
"the",
"entry",
"in",
"the",
"{",
"@link",
"Cache",
"}",
"identified",
"with",
"the",
"given",
"... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/caching/support/CachingTemplate.java#L318-L328 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java | ArrayHelper.newArray | @Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> ELEMENTTYPE [] newArray (@Nullable final Collection <? extends ELEMENTTYPE> aCollection,
@Nonnull final Class <ELEMENTTYPE> aClass) {
"""
Create a new array with the elements in the passed collection... | java | @Nonnull
@ReturnsMutableCopy
public static <ELEMENTTYPE> ELEMENTTYPE [] newArray (@Nullable final Collection <? extends ELEMENTTYPE> aCollection,
@Nonnull final Class <ELEMENTTYPE> aClass)
{
ValueEnforcer.notNull (aClass, "class");
if (CollectionHelp... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"ELEMENTTYPE",
"[",
"]",
"newArray",
"(",
"@",
"Nullable",
"final",
"Collection",
"<",
"?",
"extends",
"ELEMENTTYPE",
">",
"aCollection",
",",
"@",
"Nonnull",
"final",
"Cla... | Create a new array with the elements in the passed collection..
@param <ELEMENTTYPE>
Type of element
@param aCollection
The collection to be converted to an array. May be <code>null</code>
.
@param aClass
The class of the elements inside the collection. May not be
<code>null</code>.
@return <code>null</code> if the pa... | [
"Create",
"a",
"new",
"array",
"with",
"the",
"elements",
"in",
"the",
"passed",
"collection",
".."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java#L3892-L3904 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRuleAssetCategoryRelPersistenceImpl.java | CPRuleAssetCategoryRelPersistenceImpl.findAll | @Override
public List<CPRuleAssetCategoryRel> findAll(int start, int end) {
"""
Returns a range of all the cp rule asset category rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in... | java | @Override
public List<CPRuleAssetCategoryRel> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRuleAssetCategoryRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp rule asset category rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"rule",
"asset",
"category",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRuleAssetCategoryRelPersistenceImpl.java#L1682-L1685 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroData.java | SynchroData.readTableHeader | private SynchroTable readTableHeader(byte[] header) {
"""
Read the header data for a single file.
@param header header data
@return SynchroTable instance
"""
SynchroTable result = null;
String tableName = DatatypeConverter.getSimpleString(header, 0);
if (!tableName.isEmpty())
{
... | java | private SynchroTable readTableHeader(byte[] header)
{
SynchroTable result = null;
String tableName = DatatypeConverter.getSimpleString(header, 0);
if (!tableName.isEmpty())
{
int offset = DatatypeConverter.getInt(header, 40);
result = new SynchroTable(tableName, offset);
... | [
"private",
"SynchroTable",
"readTableHeader",
"(",
"byte",
"[",
"]",
"header",
")",
"{",
"SynchroTable",
"result",
"=",
"null",
";",
"String",
"tableName",
"=",
"DatatypeConverter",
".",
"getSimpleString",
"(",
"header",
",",
"0",
")",
";",
"if",
"(",
"!",
... | Read the header data for a single file.
@param header header data
@return SynchroTable instance | [
"Read",
"the",
"header",
"data",
"for",
"a",
"single",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroData.java#L140-L150 |
tango-controls/JTango | server/src/main/java/org/tango/server/ServerManager.java | ServerManager.configureNoDBFile | private void configureNoDBFile(final String argv[], final String arg, final List<String> noDbDevices)
throws DevFailed {
"""
Configure {@link DatabaseFactory} without a tango db and a file for
properties
@param argv
@param arg
@param noDbDevices
@throws DevFailed
"""
if (!ArrayUtils.... | java | private void configureNoDBFile(final String argv[], final String arg, final List<String> noDbDevices)
throws DevFailed {
if (!ArrayUtils.contains(argv, NODB)) {
throw DevFailedUtils.newDevFailed(INIT_ERROR, getUsage());
} else {
final String name = arg.split("=")[1];
... | [
"private",
"void",
"configureNoDBFile",
"(",
"final",
"String",
"argv",
"[",
"]",
",",
"final",
"String",
"arg",
",",
"final",
"List",
"<",
"String",
">",
"noDbDevices",
")",
"throws",
"DevFailed",
"{",
"if",
"(",
"!",
"ArrayUtils",
".",
"contains",
"(",
... | Configure {@link DatabaseFactory} without a tango db and a file for
properties
@param argv
@param arg
@param noDbDevices
@throws DevFailed | [
"Configure",
"{",
"@link",
"DatabaseFactory",
"}",
"without",
"a",
"tango",
"db",
"and",
"a",
"file",
"for",
"properties"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/ServerManager.java#L390-L404 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteDetectorsAsync | public Observable<Page<DetectorDefinitionInner>> listSiteDetectorsAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) {
"""
Get Detectors.
Get Detectors.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@par... | java | public Observable<Page<DetectorDefinitionInner>> listSiteDetectorsAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) {
return listSiteDetectorsWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory)
.map(new Func1<ServiceResponse<Page<Dete... | [
"public",
"Observable",
"<",
"Page",
"<",
"DetectorDefinitionInner",
">",
">",
"listSiteDetectorsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"String",
"diagnosticCategory",
")",
"{",
"return",
"listSiteDetecto... | Get Detectors.
Get Detectors.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<DetectorDefinitio... | [
"Get",
"Detectors",
".",
"Get",
"Detectors",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L896-L904 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DateUtil.java | DateUtil.addYears | public static <T extends java.util.Date> T addYears(final T date, final int amount) {
"""
Adds a number of years to a date returning a new object.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to add, may be negative
@return the new {@code Date} with the am... | java | public static <T extends java.util.Date> T addYears(final T date, final int amount) {
return roll(date, amount, CalendarUnit.YEAR);
} | [
"public",
"static",
"<",
"T",
"extends",
"java",
".",
"util",
".",
"Date",
">",
"T",
"addYears",
"(",
"final",
"T",
"date",
",",
"final",
"int",
"amount",
")",
"{",
"return",
"roll",
"(",
"date",
",",
"amount",
",",
"CalendarUnit",
".",
"YEAR",
")",
... | Adds a number of years to a date returning a new object.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to add, may be negative
@return the new {@code Date} with the amount added
@throws IllegalArgumentException if the date is null | [
"Adds",
"a",
"number",
"of",
"years",
"to",
"a",
"date",
"returning",
"a",
"new",
"object",
".",
"The",
"original",
"{",
"@code",
"Date",
"}",
"is",
"unchanged",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L951-L953 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RBBIDataWrapper.java | RBBIDataWrapper.dumpTable | private void dumpTable(java.io.PrintStream out, short table[]) {
"""
Dump a state table. (A full set of RBBI rules has 4 state tables.)
"""
if (table == null) {
out.println(" -- null -- ");
} else {
int n;
int state;
StringBuilder header = new... | java | private void dumpTable(java.io.PrintStream out, short table[]) {
if (table == null) {
out.println(" -- null -- ");
} else {
int n;
int state;
StringBuilder header = new StringBuilder(" Row Acc Look Tag");
for (n=0; n<fHeader.fCatCount; n++... | [
"private",
"void",
"dumpTable",
"(",
"java",
".",
"io",
".",
"PrintStream",
"out",
",",
"short",
"table",
"[",
"]",
")",
"{",
"if",
"(",
"table",
"==",
"null",
")",
"{",
"out",
".",
"println",
"(",
"\" -- null -- \"",
")",
";",
"}",
"else",
"{",
"... | Dump a state table. (A full set of RBBI rules has 4 state tables.) | [
"Dump",
"a",
"state",
"table",
".",
"(",
"A",
"full",
"set",
"of",
"RBBI",
"rules",
"has",
"4",
"state",
"tables",
".",
")"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RBBIDataWrapper.java#L395-L415 |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/PreDeployMojo.java | PreDeployMojo.getProjectArchiveFolder | static File getProjectArchiveFolder(File rootArchiveFolder, MavenProject project) {
"""
Returns the unique archive folder for this specific project (containing folders with groupId
and artifactId)
@param rootArchiveFolder
@param project
@return
"""
return new File(new File(new File(rootArchiveFolder,... | java | static File getProjectArchiveFolder(File rootArchiveFolder, MavenProject project)
{
return new File(new File(new File(rootArchiveFolder, "artifacts"), project.getGroupId()), project.getArtifactId());
} | [
"static",
"File",
"getProjectArchiveFolder",
"(",
"File",
"rootArchiveFolder",
",",
"MavenProject",
"project",
")",
"{",
"return",
"new",
"File",
"(",
"new",
"File",
"(",
"new",
"File",
"(",
"rootArchiveFolder",
",",
"\"artifacts\"",
")",
",",
"project",
".",
... | Returns the unique archive folder for this specific project (containing folders with groupId
and artifactId)
@param rootArchiveFolder
@param project
@return | [
"Returns",
"the",
"unique",
"archive",
"folder",
"for",
"this",
"specific",
"project",
"(",
"containing",
"folders",
"with",
"groupId",
"and",
"artifactId",
")"
] | train | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/PreDeployMojo.java#L65-L68 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/capacity/CapacityFactory.java | CapacityFactory.loadIncrementer | private static CapacityIncrementer loadIncrementer(Extension incrementer, ClassLoaderPlugin classLoaderPlugin) {
"""
Load the incrementer
@param incrementer The incrementer metadata to load as class instance
@param classLoaderPlugin class loader plugin to use to load class
@return The incrementer
"""
... | java | private static CapacityIncrementer loadIncrementer(Extension incrementer, ClassLoaderPlugin classLoaderPlugin)
{
Object result = loadExtension(incrementer, classLoaderPlugin);
if (result != null && result instanceof CapacityIncrementer)
{
return (CapacityIncrementer)result;
}
... | [
"private",
"static",
"CapacityIncrementer",
"loadIncrementer",
"(",
"Extension",
"incrementer",
",",
"ClassLoaderPlugin",
"classLoaderPlugin",
")",
"{",
"Object",
"result",
"=",
"loadExtension",
"(",
"incrementer",
",",
"classLoaderPlugin",
")",
";",
"if",
"(",
"resul... | Load the incrementer
@param incrementer The incrementer metadata to load as class instance
@param classLoaderPlugin class loader plugin to use to load class
@return The incrementer | [
"Load",
"the",
"incrementer"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/capacity/CapacityFactory.java#L149-L161 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.