repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/ServiceInstanceUtils.java | ServiceInstanceUtils.isOptionalFieldValid | public static boolean isOptionalFieldValid(String field, String reg) {
if (field == null || field.length() == 0) {
return true;
}
return Pattern.matches(reg, field);
} | java | public static boolean isOptionalFieldValid(String field, String reg) {
if (field == null || field.length() == 0) {
return true;
}
return Pattern.matches(reg, field);
} | [
"public",
"static",
"boolean",
"isOptionalFieldValid",
"(",
"String",
"field",
",",
"String",
"reg",
")",
"{",
"if",
"(",
"field",
"==",
"null",
"||",
"field",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"true",
";",
"}",
"return",
"Pattern... | Validate the optional field String against regex.
@param field
the field value String.
@param reg
the regex.
@return
true if field is empty of matched the pattern. | [
"Validate",
"the",
"optional",
"field",
"String",
"against",
"regex",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/ServiceInstanceUtils.java#L92-L97 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/visitor/ClassSourceVisitor.java | ClassSourceVisitor.containsClassName | private boolean containsClassName(List<ClassOrInterfaceType> klassList, Set<String> simpleNames) {
for (ClassOrInterfaceType ctype : klassList) {
if (simpleNames.contains(ctype.getName())) {
return true;
}
}
return false;
} | java | private boolean containsClassName(List<ClassOrInterfaceType> klassList, Set<String> simpleNames) {
for (ClassOrInterfaceType ctype : klassList) {
if (simpleNames.contains(ctype.getName())) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"containsClassName",
"(",
"List",
"<",
"ClassOrInterfaceType",
">",
"klassList",
",",
"Set",
"<",
"String",
">",
"simpleNames",
")",
"{",
"for",
"(",
"ClassOrInterfaceType",
"ctype",
":",
"klassList",
")",
"{",
"if",
"(",
"simpleNames",
"... | Check if the list of class or interface contains a class which name is given in the <code>simpleNames</code> set.
@param klassList The list of class or interface
@param simpleNames a set of class simple name.
@return <code>true</code> if the list contains a class or interface which name is present in the
<code>simpl... | [
"Check",
"if",
"the",
"list",
"of",
"class",
"or",
"interface",
"contains",
"a",
"class",
"which",
"name",
"is",
"given",
"in",
"the",
"<code",
">",
"simpleNames<",
"/",
"code",
">",
"set",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/visitor/ClassSourceVisitor.java#L129-L136 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java | Log.printRawLines | public static void printRawLines(PrintWriter writer, String msg) {
int nl;
while ((nl = msg.indexOf('\n')) != -1) {
writer.println(msg.substring(0, nl));
msg = msg.substring(nl+1);
}
if (msg.length() != 0) writer.println(msg);
} | java | public static void printRawLines(PrintWriter writer, String msg) {
int nl;
while ((nl = msg.indexOf('\n')) != -1) {
writer.println(msg.substring(0, nl));
msg = msg.substring(nl+1);
}
if (msg.length() != 0) writer.println(msg);
} | [
"public",
"static",
"void",
"printRawLines",
"(",
"PrintWriter",
"writer",
",",
"String",
"msg",
")",
"{",
"int",
"nl",
";",
"while",
"(",
"(",
"nl",
"=",
"msg",
".",
"indexOf",
"(",
"'",
"'",
")",
")",
"!=",
"-",
"1",
")",
"{",
"writer",
".",
"p... | Print the text of a message, translating newlines appropriately
for the platform. | [
"Print",
"the",
"text",
"of",
"a",
"message",
"translating",
"newlines",
"appropriately",
"for",
"the",
"platform",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java#L615-L622 |
Erudika/para | para-server/src/main/java/com/erudika/para/security/SecurityUtils.java | SecurityUtils.checkIfActive | public static UserAuthentication checkIfActive(UserAuthentication userAuth, User user, boolean throwException) {
if (userAuth == null || user == null || user.getIdentifier() == null) {
if (throwException) {
throw new BadCredentialsException("Bad credentials.");
} else {
logger.debug("Bad credentials. {}... | java | public static UserAuthentication checkIfActive(UserAuthentication userAuth, User user, boolean throwException) {
if (userAuth == null || user == null || user.getIdentifier() == null) {
if (throwException) {
throw new BadCredentialsException("Bad credentials.");
} else {
logger.debug("Bad credentials. {}... | [
"public",
"static",
"UserAuthentication",
"checkIfActive",
"(",
"UserAuthentication",
"userAuth",
",",
"User",
"user",
",",
"boolean",
"throwException",
")",
"{",
"if",
"(",
"userAuth",
"==",
"null",
"||",
"user",
"==",
"null",
"||",
"user",
".",
"getIdentifier"... | Checks if account is active.
@param userAuth user authentication object
@param user user object
@param throwException throw or not
@return the authentication object if {@code user.active == true} | [
"Checks",
"if",
"account",
"is",
"active",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/SecurityUtils.java#L391-L409 |
BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/TokenFelligiSunter.java | TokenFelligiSunter.explainScore | public String explainScore(StringWrapper s, StringWrapper t)
{
BagOfTokens sBag = (BagOfTokens)s;
BagOfTokens tBag = (BagOfTokens)t;
StringBuffer buf = new StringBuffer("");
PrintfFormat fmt = new PrintfFormat("%.3f");
buf.append("Common tokens: ");
for (Iterator i = sBag.tokenIterator(); i.hasNext(); ) {... | java | public String explainScore(StringWrapper s, StringWrapper t)
{
BagOfTokens sBag = (BagOfTokens)s;
BagOfTokens tBag = (BagOfTokens)t;
StringBuffer buf = new StringBuffer("");
PrintfFormat fmt = new PrintfFormat("%.3f");
buf.append("Common tokens: ");
for (Iterator i = sBag.tokenIterator(); i.hasNext(); ) {... | [
"public",
"String",
"explainScore",
"(",
"StringWrapper",
"s",
",",
"StringWrapper",
"t",
")",
"{",
"BagOfTokens",
"sBag",
"=",
"(",
"BagOfTokens",
")",
"s",
";",
"BagOfTokens",
"tBag",
"=",
"(",
"BagOfTokens",
")",
"t",
";",
"StringBuffer",
"buf",
"=",
"n... | Explain how the distance was computed.
In the output, the tokens in S and T are listed, and the
common tokens are marked with an asterisk. | [
"Explain",
"how",
"the",
"distance",
"was",
"computed",
".",
"In",
"the",
"output",
"the",
"tokens",
"in",
"S",
"and",
"T",
"are",
"listed",
"and",
"the",
"common",
"tokens",
"are",
"marked",
"with",
"an",
"asterisk",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/TokenFelligiSunter.java#L75-L91 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.beginUpdateById | public GenericResourceInner beginUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters) {
return beginUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).toBlocking().single().body();
} | java | public GenericResourceInner beginUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters) {
return beginUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).toBlocking().single().body();
} | [
"public",
"GenericResourceInner",
"beginUpdateById",
"(",
"String",
"resourceId",
",",
"String",
"apiVersion",
",",
"GenericResourceInner",
"parameters",
")",
"{",
"return",
"beginUpdateByIdWithServiceResponseAsync",
"(",
"resourceId",
",",
"apiVersion",
",",
"parameters",
... | Updates a resource by ID.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
@param apiVersion The API version to use for the op... | [
"Updates",
"a",
"resource",
"by",
"ID",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L2302-L2304 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.appendPrettyHexDump | public static void appendPrettyHexDump(StringBuilder dump, ByteBuf buf, int offset, int length) {
HexUtil.appendPrettyHexDump(dump, buf, offset, length);
} | java | public static void appendPrettyHexDump(StringBuilder dump, ByteBuf buf, int offset, int length) {
HexUtil.appendPrettyHexDump(dump, buf, offset, length);
} | [
"public",
"static",
"void",
"appendPrettyHexDump",
"(",
"StringBuilder",
"dump",
",",
"ByteBuf",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"HexUtil",
".",
"appendPrettyHexDump",
"(",
"dump",
",",
"buf",
",",
"offset",
",",
"length",
")",
... | Appends the prettified multi-line hexadecimal dump of the specified {@link ByteBuf} to the specified
{@link StringBuilder} that is easy to read by humans, starting at the given {@code offset} using
the given {@code length}. | [
"Appends",
"the",
"prettified",
"multi",
"-",
"line",
"hexadecimal",
"dump",
"of",
"the",
"specified",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L935-L937 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionRangeConfig.java | CollisionRangeConfig.imports | public static CollisionRange imports(XmlReader node)
{
Check.notNull(node);
final String axisName = node.readString(ATT_AXIS);
try
{
final Axis axis = Axis.valueOf(axisName);
final int minX = node.readInteger(ATT_MIN_X);
final int maxX = ... | java | public static CollisionRange imports(XmlReader node)
{
Check.notNull(node);
final String axisName = node.readString(ATT_AXIS);
try
{
final Axis axis = Axis.valueOf(axisName);
final int minX = node.readInteger(ATT_MIN_X);
final int maxX = ... | [
"public",
"static",
"CollisionRange",
"imports",
"(",
"XmlReader",
"node",
")",
"{",
"Check",
".",
"notNull",
"(",
"node",
")",
";",
"final",
"String",
"axisName",
"=",
"node",
".",
"readString",
"(",
"ATT_AXIS",
")",
";",
"try",
"{",
"final",
"Axis",
"a... | Create the collision range data from a node.
@param node The node reference (must not be <code>null</code>).
@return The collision range data.
@throws LionEngineException If error when reading node. | [
"Create",
"the",
"collision",
"range",
"data",
"from",
"a",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionRangeConfig.java#L58-L77 |
cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java | MolecularFormula.setProperties | @Override
public void setProperties(Map<Object, Object> properties) {
Iterator<Object> keys = properties.keySet().iterator();
while (keys.hasNext()) {
Object key = keys.next();
lazyProperties().put(key, properties.get(key));
}
} | java | @Override
public void setProperties(Map<Object, Object> properties) {
Iterator<Object> keys = properties.keySet().iterator();
while (keys.hasNext()) {
Object key = keys.next();
lazyProperties().put(key, properties.get(key));
}
} | [
"@",
"Override",
"public",
"void",
"setProperties",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"properties",
")",
"{",
"Iterator",
"<",
"Object",
">",
"keys",
"=",
"properties",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",... | Sets the properties of this object.
@param properties a Hashtable specifying the property values
@see #getProperties | [
"Sets",
"the",
"properties",
"of",
"this",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java#L357-L365 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java | OracleNoSQLClient.addDiscriminatorColumn | private void addDiscriminatorColumn(Row row, EntityType entityType, Table schemaTable)
{
String discrColumn = ((AbstractManagedType) entityType).getDiscriminatorColumn();
String discrValue = ((AbstractManagedType) entityType).getDiscriminatorValue();
// No need to check for empty or blank, ... | java | private void addDiscriminatorColumn(Row row, EntityType entityType, Table schemaTable)
{
String discrColumn = ((AbstractManagedType) entityType).getDiscriminatorColumn();
String discrValue = ((AbstractManagedType) entityType).getDiscriminatorValue();
// No need to check for empty or blank, ... | [
"private",
"void",
"addDiscriminatorColumn",
"(",
"Row",
"row",
",",
"EntityType",
"entityType",
",",
"Table",
"schemaTable",
")",
"{",
"String",
"discrColumn",
"=",
"(",
"(",
"AbstractManagedType",
")",
"entityType",
")",
".",
"getDiscriminatorColumn",
"(",
")",
... | Process discriminator columns.
@param row
kv row object.
@param entityType
metamodel attribute.
@param schemaTable
the schema table | [
"Process",
"discriminator",
"columns",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java#L1143-L1159 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java | JobInfo.of | public static JobInfo of(JobId jobId, JobConfiguration configuration) {
return newBuilder(configuration).setJobId(jobId).build();
} | java | public static JobInfo of(JobId jobId, JobConfiguration configuration) {
return newBuilder(configuration).setJobId(jobId).build();
} | [
"public",
"static",
"JobInfo",
"of",
"(",
"JobId",
"jobId",
",",
"JobConfiguration",
"configuration",
")",
"{",
"return",
"newBuilder",
"(",
"configuration",
")",
".",
"setJobId",
"(",
"jobId",
")",
".",
"build",
"(",
")",
";",
"}"
] | Returns a builder for a {@code JobInfo} object given the job identity and configuration. Use
{@link CopyJobConfiguration} for a job that copies an existing table. Use {@link
ExtractJobConfiguration} for a job that exports a table to Google Cloud Storage. Use {@link
LoadJobConfiguration} for a job that loads data from G... | [
"Returns",
"a",
"builder",
"for",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java#L365-L367 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/builder/LazyBeanMappingFactory.java | LazyBeanMappingFactory.buildColumnMappingList | @Override
protected <T> void buildColumnMappingList(final BeanMapping<T> beanMapping, final Class<T> beanType, final Class<?>[] groups) {
final List<ColumnMapping> columnMappingList = new ArrayList<>();
for(Field field : beanType.getDeclaredFields()) {
final C... | java | @Override
protected <T> void buildColumnMappingList(final BeanMapping<T> beanMapping, final Class<T> beanType, final Class<?>[] groups) {
final List<ColumnMapping> columnMappingList = new ArrayList<>();
for(Field field : beanType.getDeclaredFields()) {
final C... | [
"@",
"Override",
"protected",
"<",
"T",
">",
"void",
"buildColumnMappingList",
"(",
"final",
"BeanMapping",
"<",
"T",
">",
"beanMapping",
",",
"final",
"Class",
"<",
"T",
">",
"beanType",
",",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"groups",
")",
"... | アノテーション{@link CsvColumn}を元に、カラムのマッピング情報を組み立てる。
<p>カラム番号の検証や、部分的なカラムのカラムの組み立てはスキップ。</p>
@param beanMapping Beanのマッピング情報
@param beanType Beanのクラスタイプ
@param groups グループ情報 | [
"アノテーション",
"{"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/builder/LazyBeanMappingFactory.java#L82-L97 |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java | SystemInputJson.asVarDef | private static IVarDef asVarDef( String varName, String varType, Annotated groupAnnotations, JsonObject json)
{
try
{
validIdentifier( varName);
AbstractVarDef varDef =
json.containsKey( MEMBERS_KEY)
? new VarSet( varName)
: new VarDef( varName);
varDef.setType(... | java | private static IVarDef asVarDef( String varName, String varType, Annotated groupAnnotations, JsonObject json)
{
try
{
validIdentifier( varName);
AbstractVarDef varDef =
json.containsKey( MEMBERS_KEY)
? new VarSet( varName)
: new VarDef( varName);
varDef.setType(... | [
"private",
"static",
"IVarDef",
"asVarDef",
"(",
"String",
"varName",
",",
"String",
"varType",
",",
"Annotated",
"groupAnnotations",
",",
"JsonObject",
"json",
")",
"{",
"try",
"{",
"validIdentifier",
"(",
"varName",
")",
";",
"AbstractVarDef",
"varDef",
"=",
... | Returns the variable definition represented by the given JSON object. | [
"Returns",
"the",
"variable",
"definition",
"represented",
"by",
"the",
"given",
"JSON",
"object",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/SystemInputJson.java#L274-L327 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookDialog.java | FacebookDialog.canPresentOpenGraphActionDialog | public static boolean canPresentOpenGraphActionDialog(Context context, OpenGraphActionDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(OpenGraphActionDialogFeature.OG_ACTION_DIALOG, features));
} | java | public static boolean canPresentOpenGraphActionDialog(Context context, OpenGraphActionDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(OpenGraphActionDialogFeature.OG_ACTION_DIALOG, features));
} | [
"public",
"static",
"boolean",
"canPresentOpenGraphActionDialog",
"(",
"Context",
"context",
",",
"OpenGraphActionDialogFeature",
"...",
"features",
")",
"{",
"return",
"handleCanPresent",
"(",
"context",
",",
"EnumSet",
".",
"of",
"(",
"OpenGraphActionDialogFeature",
"... | Determines whether the version of the Facebook application installed on the user's device is recent
enough to support specific features of the native Open Graph action dialog, which in turn may be used to
determine which UI, etc., to present to the user.
@param context the calling Context
@param features zero or more... | [
"Determines",
"whether",
"the",
"version",
"of",
"the",
"Facebook",
"application",
"installed",
"on",
"the",
"user",
"s",
"device",
"is",
"recent",
"enough",
"to",
"support",
"specific",
"features",
"of",
"the",
"native",
"Open",
"Graph",
"action",
"dialog",
"... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L399-L401 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLSchemaManager.java | CQLSchemaManager.modifyKeyspace | public void modifyKeyspace(Map<String, String> options) {
if (!options.containsKey("ReplicationFactor")) {
return;
}
String cqlKeyspace = m_dbservice.getKeyspace();
m_logger.info("Modifying keyspace: {}", cqlKeyspace);
StringBuilder cql = new StringBuilder();
... | java | public void modifyKeyspace(Map<String, String> options) {
if (!options.containsKey("ReplicationFactor")) {
return;
}
String cqlKeyspace = m_dbservice.getKeyspace();
m_logger.info("Modifying keyspace: {}", cqlKeyspace);
StringBuilder cql = new StringBuilder();
... | [
"public",
"void",
"modifyKeyspace",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"if",
"(",
"!",
"options",
".",
"containsKey",
"(",
"\"ReplicationFactor\"",
")",
")",
"{",
"return",
";",
"}",
"String",
"cqlKeyspace",
"=",
"m_dbservi... | Modify the keyspace with the given name with the given options. The only option
that can be modified is ReplicationFactor. If it is present, the keyspace is
altered with the following CQL command:
<pre>
ALTER KEYSPACE "<i>keyspace</i>" WITH REPLICATION = {'class':'SimpleStrategy',
'replication_factor' : <i>replication... | [
"Modify",
"the",
"keyspace",
"with",
"the",
"given",
"name",
"with",
"the",
"given",
"options",
".",
"The",
"only",
"option",
"that",
"can",
"be",
"modified",
"is",
"ReplicationFactor",
".",
"If",
"it",
"is",
"present",
"the",
"keyspace",
"is",
"altered",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLSchemaManager.java#L72-L92 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getKeyAsync | public ServiceFuture<KeyBundle> getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion), serviceCallback);
} | java | public ServiceFuture<KeyBundle> getKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(getKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"KeyBundle",
">",
"getKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"final",
"ServiceCallback",
"<",
"KeyBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
"... | Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param keyNa... | [
"Gets",
"the",
"public",
"part",
"of",
"a",
"stored",
"key",
".",
"The",
"get",
"key",
"operation",
"is",
"applicable",
"to",
"all",
"key",
"types",
".",
"If",
"the",
"requested",
"key",
"is",
"symmetric",
"then",
"no",
"key",
"material",
"is",
"released... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L1400-L1402 |
carewebframework/carewebframework-vista | org.carewebframework.vista.ui-parent/org.carewebframework.vista.ui.core/src/main/java/org/carewebframework/vista/ui/mbroker/AsyncRPCEventDispatcher.java | AsyncRPCEventDispatcher.callRPCAsync | public int callRPCAsync(String rpcName, Object... args) {
abort();
this.rpcName = rpcName;
asyncHandle = broker.callRPCAsync(rpcName, this, args);
return asyncHandle;
} | java | public int callRPCAsync(String rpcName, Object... args) {
abort();
this.rpcName = rpcName;
asyncHandle = broker.callRPCAsync(rpcName, this, args);
return asyncHandle;
} | [
"public",
"int",
"callRPCAsync",
"(",
"String",
"rpcName",
",",
"Object",
"...",
"args",
")",
"{",
"abort",
"(",
")",
";",
"this",
".",
"rpcName",
"=",
"rpcName",
";",
"asyncHandle",
"=",
"broker",
".",
"callRPCAsync",
"(",
"rpcName",
",",
"this",
",",
... | Make an asynchronous call.
@param rpcName The RPC name.
@param args The RPC arguments.
@return The async handle. | [
"Make",
"an",
"asynchronous",
"call",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.ui-parent/org.carewebframework.vista.ui.core/src/main/java/org/carewebframework/vista/ui/mbroker/AsyncRPCEventDispatcher.java#L66-L71 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/list/EditableComboBoxAutoCompletion.java | EditableComboBoxAutoCompletion.startsWithIgnoreCase | private boolean startsWithIgnoreCase(String str1, String str2) {
return str1 != null && str2 != null && str1.toUpperCase().startsWith(str2.toUpperCase());
} | java | private boolean startsWithIgnoreCase(String str1, String str2) {
return str1 != null && str2 != null && str1.toUpperCase().startsWith(str2.toUpperCase());
} | [
"private",
"boolean",
"startsWithIgnoreCase",
"(",
"String",
"str1",
",",
"String",
"str2",
")",
"{",
"return",
"str1",
"!=",
"null",
"&&",
"str2",
"!=",
"null",
"&&",
"str1",
".",
"toUpperCase",
"(",
")",
".",
"startsWith",
"(",
"str2",
".",
"toUpperCase"... | See if one string begins with another, ignoring case.
@param str1 The string to test
@param str2 The prefix to test for
@return true if str1 starts with str2, ingnoring case | [
"See",
"if",
"one",
"string",
"begins",
"with",
"another",
"ignoring",
"case",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/list/EditableComboBoxAutoCompletion.java#L98-L100 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/ArrayMap.java | ArrayMap.putAll | public void putAll(ArrayMap<? extends K, ? extends V> array) {
final int N = array.mSize;
ensureCapacity(mSize + N);
if (mSize == 0) {
if (N > 0) {
System.arraycopy(array.mHashes, 0, mHashes, 0, N);
System.arraycopy(array.mArray, 0, mArray, 0, N<<1);
... | java | public void putAll(ArrayMap<? extends K, ? extends V> array) {
final int N = array.mSize;
ensureCapacity(mSize + N);
if (mSize == 0) {
if (N > 0) {
System.arraycopy(array.mHashes, 0, mHashes, 0, N);
System.arraycopy(array.mArray, 0, mArray, 0, N<<1);
... | [
"public",
"void",
"putAll",
"(",
"ArrayMap",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"array",
")",
"{",
"final",
"int",
"N",
"=",
"array",
".",
"mSize",
";",
"ensureCapacity",
"(",
"mSize",
"+",
"N",
")",
";",
"if",
"(",
"mSize",
... | Perform a {@link #put(Object, Object)} of all key/value pairs in <var>array</var>
@param array The array whose contents are to be retrieved. | [
"Perform",
"a",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/ArrayMap.java#L502-L516 |
jayantk/jklol | src/com/jayantkrish/jklol/util/HeapUtils.java | HeapUtils.removeMin | public static final void removeMin(long[] heapKeys, double[] heapValues, int heapSize) {
heapValues[0] = heapValues[heapSize - 1];
heapKeys[0] = heapKeys[heapSize - 1];
int curIndex = 0;
int leftIndex, rightIndex, minIndex;
boolean done = false;
while (!done) {
done = true;
leftInde... | java | public static final void removeMin(long[] heapKeys, double[] heapValues, int heapSize) {
heapValues[0] = heapValues[heapSize - 1];
heapKeys[0] = heapKeys[heapSize - 1];
int curIndex = 0;
int leftIndex, rightIndex, minIndex;
boolean done = false;
while (!done) {
done = true;
leftInde... | [
"public",
"static",
"final",
"void",
"removeMin",
"(",
"long",
"[",
"]",
"heapKeys",
",",
"double",
"[",
"]",
"heapValues",
",",
"int",
"heapSize",
")",
"{",
"heapValues",
"[",
"0",
"]",
"=",
"heapValues",
"[",
"heapSize",
"-",
"1",
"]",
";",
"heapKeys... | Removes the smallest key/value pair from the heap represented by
{@code heapKeys} and {@code heapValues}. After calling this method, the
size of the heap shrinks by 1.
@param heapKeys
@param heapValues
@param heapSize | [
"Removes",
"the",
"smallest",
"key",
"/",
"value",
"pair",
"from",
"the",
"heap",
"represented",
"by",
"{",
"@code",
"heapKeys",
"}",
"and",
"{",
"@code",
"heapValues",
"}",
".",
"After",
"calling",
"this",
"method",
"the",
"size",
"of",
"the",
"heap",
"... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/HeapUtils.java#L75-L100 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/ParameterUtils.java | ParameterUtils.parametersCompatible | public static boolean parametersCompatible(Parameter[] source, Parameter[] target) {
return parametersMatch(source, target,
t -> ClassHelper.getWrapper(t.getV2()).getTypeClass()
.isAssignableFrom(ClassHelper.getWrapper(t.getV1()).getTypeClass())
);
} | java | public static boolean parametersCompatible(Parameter[] source, Parameter[] target) {
return parametersMatch(source, target,
t -> ClassHelper.getWrapper(t.getV2()).getTypeClass()
.isAssignableFrom(ClassHelper.getWrapper(t.getV1()).getTypeClass())
);
} | [
"public",
"static",
"boolean",
"parametersCompatible",
"(",
"Parameter",
"[",
"]",
"source",
",",
"Parameter",
"[",
"]",
"target",
")",
"{",
"return",
"parametersMatch",
"(",
"source",
",",
"target",
",",
"t",
"->",
"ClassHelper",
".",
"getWrapper",
"(",
"t"... | check whether parameters type are compatible
each parameter should match the following condition:
{@code targetParameter.getType().getTypeClass().isAssignableFrom(sourceParameter.getType().getTypeClass())}
@param source source parameters
@param target target parameters
@return the check result
@since 3.0.0 | [
"check",
"whether",
"parameters",
"type",
"are",
"compatible"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/ParameterUtils.java#L51-L56 |
esigate/esigate | esigate-core/src/main/java/org/esigate/http/HttpResponseUtils.java | HttpResponseUtils.getFirstHeader | public static String getFirstHeader(String headerName, HttpResponse httpResponse) {
Header header = httpResponse.getFirstHeader(headerName);
if (header != null) {
return header.getValue();
}
return null;
} | java | public static String getFirstHeader(String headerName, HttpResponse httpResponse) {
Header header = httpResponse.getFirstHeader(headerName);
if (header != null) {
return header.getValue();
}
return null;
} | [
"public",
"static",
"String",
"getFirstHeader",
"(",
"String",
"headerName",
",",
"HttpResponse",
"httpResponse",
")",
"{",
"Header",
"header",
"=",
"httpResponse",
".",
"getFirstHeader",
"(",
"headerName",
")",
";",
"if",
"(",
"header",
"!=",
"null",
")",
"{"... | Get the value of the first header matching "headerName".
@param headerName
@param httpResponse
@return value of the first header or null if it doesn't exist. | [
"Get",
"the",
"value",
"of",
"the",
"first",
"header",
"matching",
"headerName",
"."
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/http/HttpResponseUtils.java#L82-L88 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/schema/WsdlXsdSchema.java | WsdlXsdSchema.getWsdlDefinition | private Definition getWsdlDefinition(Resource wsdl) {
try {
Definition definition;
if (wsdl.getURI().toString().startsWith("jar:")) {
// Locate WSDL imports in Jar files
definition = WSDLFactory.newInstance().newWSDLReader().readWSDL(new JarWSDLLocator(wsd... | java | private Definition getWsdlDefinition(Resource wsdl) {
try {
Definition definition;
if (wsdl.getURI().toString().startsWith("jar:")) {
// Locate WSDL imports in Jar files
definition = WSDLFactory.newInstance().newWSDLReader().readWSDL(new JarWSDLLocator(wsd... | [
"private",
"Definition",
"getWsdlDefinition",
"(",
"Resource",
"wsdl",
")",
"{",
"try",
"{",
"Definition",
"definition",
";",
"if",
"(",
"wsdl",
".",
"getURI",
"(",
")",
".",
"toString",
"(",
")",
".",
"startsWith",
"(",
"\"jar:\"",
")",
")",
"{",
"// Lo... | Reads WSDL definition from resource.
@param wsdl
@return
@throws IOException
@throws WSDLException | [
"Reads",
"WSDL",
"definition",
"from",
"resource",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/schema/WsdlXsdSchema.java#L185-L201 |
beanshell/beanshell | src/main/java/bsh/NameSpace.java | NameSpace.getNameResolver | Name getNameResolver(final String ambigname) {
if (!this.names.containsKey(ambigname))
this.names.put(ambigname, new Name(this, ambigname));
return this.names.get(ambigname);
} | java | Name getNameResolver(final String ambigname) {
if (!this.names.containsKey(ambigname))
this.names.put(ambigname, new Name(this, ambigname));
return this.names.get(ambigname);
} | [
"Name",
"getNameResolver",
"(",
"final",
"String",
"ambigname",
")",
"{",
"if",
"(",
"!",
"this",
".",
"names",
".",
"containsKey",
"(",
"ambigname",
")",
")",
"this",
".",
"names",
".",
"put",
"(",
"ambigname",
",",
"new",
"Name",
"(",
"this",
",",
... | This is the factory for Name objects which resolve names within this
namespace (e.g. toObject(), toClass(), toLHS()).
<p>
This was intended to support name resolver caching, allowing Name objects
to cache info about the resolution of names for performance reasons.
However this not proven useful yet.
<p>
We'll leave the... | [
"This",
"is",
"the",
"factory",
"for",
"Name",
"objects",
"which",
"resolve",
"names",
"within",
"this",
"namespace",
"(",
"e",
".",
"g",
".",
"toObject",
"()",
"toClass",
"()",
"toLHS",
"()",
")",
".",
"<p",
">",
"This",
"was",
"intended",
"to",
"supp... | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1277-L1281 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/StringUtils.java | StringUtils.tokenizeToStringArray | @SuppressWarnings({"unchecked"})
public static String[] tokenizeToStringArray(
String str, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens) {
if (str == null) {
return null;
}
StringTokenizer st = new StringTokenizer(str, delimiters);
List<String... | java | @SuppressWarnings({"unchecked"})
public static String[] tokenizeToStringArray(
String str, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens) {
if (str == null) {
return null;
}
StringTokenizer st = new StringTokenizer(str, delimiters);
List<String... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"String",
"[",
"]",
"tokenizeToStringArray",
"(",
"String",
"str",
",",
"String",
"delimiters",
",",
"boolean",
"trimTokens",
",",
"boolean",
"ignoreEmptyTokens",
")",
"{",
"if",
... | Tokenize the given String into a String array via a StringTokenizer.
<p>The given delimiters string is supposed to consist of any number of
delimiter characters. Each of those characters can be used to separate
tokens. A delimiter is always a single character; for multi-character
delimiters, consider using <code>delimi... | [
"Tokenize",
"the",
"given",
"String",
"into",
"a",
"String",
"array",
"via",
"a",
"StringTokenizer",
".",
"<p",
">",
"The",
"given",
"delimiters",
"string",
"is",
"supposed",
"to",
"consist",
"of",
"any",
"number",
"of",
"delimiter",
"characters",
".",
"Each... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StringUtils.java#L194-L213 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.getEpisodeAccountState | public MediaState getEpisodeAccountState(int tvID, int seasonNumber, int episodeNumber, String sessionID) throws MovieDbException {
return tmdbEpisodes.getEpisodeAccountState(tvID, seasonNumber, episodeNumber, sessionID);
} | java | public MediaState getEpisodeAccountState(int tvID, int seasonNumber, int episodeNumber, String sessionID) throws MovieDbException {
return tmdbEpisodes.getEpisodeAccountState(tvID, seasonNumber, episodeNumber, sessionID);
} | [
"public",
"MediaState",
"getEpisodeAccountState",
"(",
"int",
"tvID",
",",
"int",
"seasonNumber",
",",
"int",
"episodeNumber",
",",
"String",
"sessionID",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbEpisodes",
".",
"getEpisodeAccountState",
"(",
"tvID",
"... | This method lets users get the status of whether or not the TV episode
has been rated.
A valid session id is required.
@param tvID tvID
@param seasonNumber seasonNumber
@param episodeNumber episodeNumber
@param sessionID sessionID
@return
@throws MovieDbException exception | [
"This",
"method",
"lets",
"users",
"get",
"the",
"status",
"of",
"whether",
"or",
"not",
"the",
"TV",
"episode",
"has",
"been",
"rated",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L1802-L1804 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/Topic.java | Topic.setScores | public void setScores(int i, double v) {
if (Topic_Type.featOkTst && ((Topic_Type)jcasType).casFeat_scores == null)
jcasType.jcas.throwFeatMissing("scores", "ch.epfl.bbp.uima.types.Topic");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Topic_Type)jcasType).casFeatCode_scores), i);... | java | public void setScores(int i, double v) {
if (Topic_Type.featOkTst && ((Topic_Type)jcasType).casFeat_scores == null)
jcasType.jcas.throwFeatMissing("scores", "ch.epfl.bbp.uima.types.Topic");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Topic_Type)jcasType).casFeatCode_scores), i);... | [
"public",
"void",
"setScores",
"(",
"int",
"i",
",",
"double",
"v",
")",
"{",
"if",
"(",
"Topic_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Topic_Type",
")",
"jcasType",
")",
".",
"casFeat_scores",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwF... | indexed setter for scores - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"scores",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/Topic.java#L117-L121 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/HighlightOptions.java | HighlightOptions.addHighlightParameter | public HighlightOptions addHighlightParameter(String parameterName, Object value) {
return addHighlightParameter(new HighlightParameter(parameterName, value));
} | java | public HighlightOptions addHighlightParameter(String parameterName, Object value) {
return addHighlightParameter(new HighlightParameter(parameterName, value));
} | [
"public",
"HighlightOptions",
"addHighlightParameter",
"(",
"String",
"parameterName",
",",
"Object",
"value",
")",
"{",
"return",
"addHighlightParameter",
"(",
"new",
"HighlightParameter",
"(",
"parameterName",
",",
"value",
")",
")",
";",
"}"
] | Add parameter by name
@param parameterName must not be null
@param value
@return | [
"Add",
"parameter",
"by",
"name"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/HighlightOptions.java#L224-L226 |
jtablesaw/tablesaw | html/src/main/java/tech/tablesaw/io/html/HtmlReadOptions.java | HtmlReadOptions.builder | public static Builder builder(Reader reader, String tableName) {
Builder builder = new Builder(reader);
return builder.tableName(tableName);
} | java | public static Builder builder(Reader reader, String tableName) {
Builder builder = new Builder(reader);
return builder.tableName(tableName);
} | [
"public",
"static",
"Builder",
"builder",
"(",
"Reader",
"reader",
",",
"String",
"tableName",
")",
"{",
"Builder",
"builder",
"=",
"new",
"Builder",
"(",
"reader",
")",
";",
"return",
"builder",
".",
"tableName",
"(",
"tableName",
")",
";",
"}"
] | This method may cause tablesaw to buffer the entire InputStream.
<p>
If you have a large amount of data, you can do one of the following:
1. Use the method taking a File instead of a reader, or
2. Provide the array of column types as an option. If you provide the columnType array,
we skip type detection and can avoid ... | [
"This",
"method",
"may",
"cause",
"tablesaw",
"to",
"buffer",
"the",
"entire",
"InputStream",
"."
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/html/src/main/java/tech/tablesaw/io/html/HtmlReadOptions.java#L70-L73 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/util/ReflectionUtil.java | ReflectionUtil.inspectRecursively | private static void inspectRecursively(Class<?> c, List<Method> s, Class<? extends Annotation> annotationType) {
for (Method m : c.getDeclaredMethods()) {
// don't bother if this method has already been overridden by a subclass
if (notFound(m, s) && m.isAnnotationPresent(annotationType)) {
... | java | private static void inspectRecursively(Class<?> c, List<Method> s, Class<? extends Annotation> annotationType) {
for (Method m : c.getDeclaredMethods()) {
// don't bother if this method has already been overridden by a subclass
if (notFound(m, s) && m.isAnnotationPresent(annotationType)) {
... | [
"private",
"static",
"void",
"inspectRecursively",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"List",
"<",
"Method",
">",
"s",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
")",
"{",
"for",
"(",
"Method",
"m",
":",
"c",
".",
"ge... | Inspects a class and its superclasses (all the way to {@link Object} for method instances that contain a given
annotation. This even identifies private, package and protected methods, not just public ones. | [
"Inspects",
"a",
"class",
"and",
"its",
"superclasses",
"(",
"all",
"the",
"way",
"to",
"{"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/ReflectionUtil.java#L115-L130 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.betweenMonth | public static long betweenMonth(Date beginDate, Date endDate, boolean isReset) {
return new DateBetween(beginDate, endDate).betweenMonth(isReset);
} | java | public static long betweenMonth(Date beginDate, Date endDate, boolean isReset) {
return new DateBetween(beginDate, endDate).betweenMonth(isReset);
} | [
"public",
"static",
"long",
"betweenMonth",
"(",
"Date",
"beginDate",
",",
"Date",
"endDate",
",",
"boolean",
"isReset",
")",
"{",
"return",
"new",
"DateBetween",
"(",
"beginDate",
",",
"endDate",
")",
".",
"betweenMonth",
"(",
"isReset",
")",
";",
"}"
] | 计算两个日期相差月数<br>
在非重置情况下,如果起始日期的天小于结束日期的天,月数要少算1(不足1个月)
@param beginDate 起始日期
@param endDate 结束日期
@param isReset 是否重置时间为起始时间(重置天时分秒)
@return 相差月数
@since 3.0.8 | [
"计算两个日期相差月数<br",
">",
"在非重置情况下,如果起始日期的天小于结束日期的天,月数要少算1(不足1个月)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1292-L1294 |
Netflix/conductor | es6-persistence/src/main/java/com/netflix/conductor/dao/es6/index/ElasticSearchRestDAOV6.java | ElasticSearchRestDAOV6.addMappingToIndex | private void addMappingToIndex(final String index, final String mappingType, final String mappingFilename) throws IOException {
logger.info("Adding '{}' mapping to index '{}'...", mappingType, index);
String resourcePath = "/" + index + "/_mapping/" + mappingType;
if (doesResourceNotExist(res... | java | private void addMappingToIndex(final String index, final String mappingType, final String mappingFilename) throws IOException {
logger.info("Adding '{}' mapping to index '{}'...", mappingType, index);
String resourcePath = "/" + index + "/_mapping/" + mappingType;
if (doesResourceNotExist(res... | [
"private",
"void",
"addMappingToIndex",
"(",
"final",
"String",
"index",
",",
"final",
"String",
"mappingType",
",",
"final",
"String",
"mappingFilename",
")",
"throws",
"IOException",
"{",
"logger",
".",
"info",
"(",
"\"Adding '{}' mapping to index '{}'...\"",
",",
... | Adds a mapping type to an index if it does not exist.
@param index The name of the index.
@param mappingType The name of the mapping type.
@param mappingFilename The name of the mapping file to use to add the mapping if it does not exist.
@throws IOException If an error occurred during requests to ES. | [
"Adds",
"a",
"mapping",
"type",
"to",
"an",
"index",
"if",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/es6-persistence/src/main/java/com/netflix/conductor/dao/es6/index/ElasticSearchRestDAOV6.java#L310-L323 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/Trash.java | Trash.safeFsMkdir | private boolean safeFsMkdir(FileSystem fs, Path f, FsPermission permission) throws IOException {
try {
return fs.mkdirs(f, permission);
} catch (IOException e) {
// To handle the case when trash folder is created by other threads
// The case is rare and we don't put synchronized keywords for p... | java | private boolean safeFsMkdir(FileSystem fs, Path f, FsPermission permission) throws IOException {
try {
return fs.mkdirs(f, permission);
} catch (IOException e) {
// To handle the case when trash folder is created by other threads
// The case is rare and we don't put synchronized keywords for p... | [
"private",
"boolean",
"safeFsMkdir",
"(",
"FileSystem",
"fs",
",",
"Path",
"f",
",",
"FsPermission",
"permission",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"fs",
".",
"mkdirs",
"(",
"f",
",",
"permission",
")",
";",
"}",
"catch",
"(",
"IO... | Safe creation of trash folder to ensure thread-safe.
@throws IOException | [
"Safe",
"creation",
"of",
"trash",
"folder",
"to",
"ensure",
"thread",
"-",
"safe",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/Trash.java#L287-L300 |
buschmais/jqa-java-plugin | src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java | VisitorHelper.addReads | void addReads(MethodDescriptor methodDescriptor, final Integer lineNumber, FieldDescriptor fieldDescriptor) {
ReadsDescriptor readsDescriptor = scannerContext.getStore().create(methodDescriptor, ReadsDescriptor.class, fieldDescriptor);
readsDescriptor.setLineNumber(lineNumber);
} | java | void addReads(MethodDescriptor methodDescriptor, final Integer lineNumber, FieldDescriptor fieldDescriptor) {
ReadsDescriptor readsDescriptor = scannerContext.getStore().create(methodDescriptor, ReadsDescriptor.class, fieldDescriptor);
readsDescriptor.setLineNumber(lineNumber);
} | [
"void",
"addReads",
"(",
"MethodDescriptor",
"methodDescriptor",
",",
"final",
"Integer",
"lineNumber",
",",
"FieldDescriptor",
"fieldDescriptor",
")",
"{",
"ReadsDescriptor",
"readsDescriptor",
"=",
"scannerContext",
".",
"getStore",
"(",
")",
".",
"create",
"(",
"... | Add a reads relation between a method and a field.
@param methodDescriptor
The method.
@param lineNumber
The line number.
@param fieldDescriptor
The field. | [
"Add",
"a",
"reads",
"relation",
"between",
"a",
"method",
"and",
"a",
"field",
"."
] | train | https://github.com/buschmais/jqa-java-plugin/blob/4c050943e9c28cf1c4a08aa962d5b5bf03c4fe54/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java#L151-L154 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/model/MultiPartContentProvider.java | MultiPartContentProvider.addFilePart | public void addFilePart(String name, String fileName, ContentProvider content, HttpFields fields) {
addPart(new Part(name, fileName, "application/octet-stream", content, fields));
} | java | public void addFilePart(String name, String fileName, ContentProvider content, HttpFields fields) {
addPart(new Part(name, fileName, "application/octet-stream", content, fields));
} | [
"public",
"void",
"addFilePart",
"(",
"String",
"name",
",",
"String",
"fileName",
",",
"ContentProvider",
"content",
",",
"HttpFields",
"fields",
")",
"{",
"addPart",
"(",
"new",
"Part",
"(",
"name",
",",
"fileName",
",",
"\"application/octet-stream\"",
",",
... | <p>Adds a file part with the given {@code name} as field name, the given
{@code fileName} as file name, and the given {@code content} as part content.</p>
@param name the part name
@param fileName the file name associated to this part
@param content the part content
@param fields the headers associated with thi... | [
"<p",
">",
"Adds",
"a",
"file",
"part",
"with",
"the",
"given",
"{",
"@code",
"name",
"}",
"as",
"field",
"name",
"the",
"given",
"{",
"@code",
"fileName",
"}",
"as",
"file",
"name",
"and",
"the",
"given",
"{",
"@code",
"content",
"}",
"as",
"part",
... | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/MultiPartContentProvider.java#L83-L85 |
nemerosa/ontrack | ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/TemplateDefinition.java | TemplateDefinition.templateInstanceExecution | public TemplateInstanceExecution templateInstanceExecution(String sourceName, ExpressionEngine expressionEngine) {
// Transforms each parameter in a name/value pair, using only the source name as input
Map<String, String> sourceNameInput = Collections.singletonMap("sourceName", sourceName);
Map<... | java | public TemplateInstanceExecution templateInstanceExecution(String sourceName, ExpressionEngine expressionEngine) {
// Transforms each parameter in a name/value pair, using only the source name as input
Map<String, String> sourceNameInput = Collections.singletonMap("sourceName", sourceName);
Map<... | [
"public",
"TemplateInstanceExecution",
"templateInstanceExecution",
"(",
"String",
"sourceName",
",",
"ExpressionEngine",
"expressionEngine",
")",
"{",
"// Transforms each parameter in a name/value pair, using only the source name as input",
"Map",
"<",
"String",
",",
"String",
">"... | Gets the execution context for the creation of a template instance.
@param sourceName Input for the expression
@param expressionEngine Expression engine to use
@return Transformed string | [
"Gets",
"the",
"execution",
"context",
"for",
"the",
"creation",
"of",
"a",
"template",
"instance",
"."
] | train | https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/TemplateDefinition.java#L53-L71 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.setCustomForDefaultClient | protected static boolean setCustomForDefaultClient(String profileName, String pathName, Boolean isResponse, String customData) {
try {
Client client = new Client(profileName, false);
client.toggleProfile(true);
client.setCustom(isResponse, pathName, customData);
i... | java | protected static boolean setCustomForDefaultClient(String profileName, String pathName, Boolean isResponse, String customData) {
try {
Client client = new Client(profileName, false);
client.toggleProfile(true);
client.setCustom(isResponse, pathName, customData);
i... | [
"protected",
"static",
"boolean",
"setCustomForDefaultClient",
"(",
"String",
"profileName",
",",
"String",
"pathName",
",",
"Boolean",
"isResponse",
",",
"String",
"customData",
")",
"{",
"try",
"{",
"Client",
"client",
"=",
"new",
"Client",
"(",
"profileName",
... | set custom response or request for a profile's default client, ensures profile and path are enabled
@param profileName profileName to modift, default client is used
@param pathName friendly name of path
@param isResponse true if response, false for request
@param customData custom response/request data
@return true if... | [
"set",
"custom",
"response",
"or",
"request",
"for",
"a",
"profile",
"s",
"default",
"client",
"ensures",
"profile",
"and",
"path",
"are",
"enabled"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L793-L808 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/property/A_CmsPropertyEditor.java | A_CmsPropertyEditor.checkWidgetRequirements | public static void checkWidgetRequirements(String key, I_CmsFormWidget widget) {
if (widget instanceof CmsTinyMCEWidget) {
return;
}
if (!((widget instanceof I_CmsHasGhostValue) && (widget instanceof HasValueChangeHandlers<?>))) {
throw new CmsWidgetNotSupportedException... | java | public static void checkWidgetRequirements(String key, I_CmsFormWidget widget) {
if (widget instanceof CmsTinyMCEWidget) {
return;
}
if (!((widget instanceof I_CmsHasGhostValue) && (widget instanceof HasValueChangeHandlers<?>))) {
throw new CmsWidgetNotSupportedException... | [
"public",
"static",
"void",
"checkWidgetRequirements",
"(",
"String",
"key",
",",
"I_CmsFormWidget",
"widget",
")",
"{",
"if",
"(",
"widget",
"instanceof",
"CmsTinyMCEWidget",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"(",
"(",
"widget",
"instanceof",
"I... | Checks whether a widget can be used in the sitemap entry editor, and throws an exception otherwise.<p>
@param key the widget key
@param widget the created widget | [
"Checks",
"whether",
"a",
"widget",
"can",
"be",
"used",
"in",
"the",
"sitemap",
"entry",
"editor",
"and",
"throws",
"an",
"exception",
"otherwise",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/property/A_CmsPropertyEditor.java#L115-L123 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addPreQualifiedClassLink | public void addPreQualifiedClassLink(LinkInfoImpl.Kind context,
TypeElement typeElement, boolean isStrong, Content contentTree) {
PackageElement pkg = utils.containingPackage(typeElement);
if(pkg != null && ! configuration.shouldExcludeQualifier(pkg.getSimpleName().toString())) {
... | java | public void addPreQualifiedClassLink(LinkInfoImpl.Kind context,
TypeElement typeElement, boolean isStrong, Content contentTree) {
PackageElement pkg = utils.containingPackage(typeElement);
if(pkg != null && ! configuration.shouldExcludeQualifier(pkg.getSimpleName().toString())) {
... | [
"public",
"void",
"addPreQualifiedClassLink",
"(",
"LinkInfoImpl",
".",
"Kind",
"context",
",",
"TypeElement",
"typeElement",
",",
"boolean",
"isStrong",
",",
"Content",
"contentTree",
")",
"{",
"PackageElement",
"pkg",
"=",
"utils",
".",
"containingPackage",
"(",
... | Add the class link with the package portion of the label in
plain text. If the qualifier is excluded, it will not be included in the
link label.
@param context the id of the context where the link will be added
@param typeElement the class to link to
@param isStrong true if the link should be strong
@param contentTree... | [
"Add",
"the",
"class",
"link",
"with",
"the",
"package",
"portion",
"of",
"the",
"label",
"in",
"plain",
"text",
".",
"If",
"the",
"qualifier",
"is",
"excluded",
"it",
"will",
"not",
"be",
"included",
"in",
"the",
"link",
"label",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1318-L1329 |
buschmais/jqa-core-framework | scanner/src/main/java/com/buschmais/jqassistant/core/scanner/impl/ScannerImpl.java | ScannerImpl.popDescriptor | private <D extends Descriptor> void popDescriptor(Class<D> type, D descriptor) {
if (descriptor != null) {
scannerContext.setCurrentDescriptor(null);
scannerContext.pop(type);
}
} | java | private <D extends Descriptor> void popDescriptor(Class<D> type, D descriptor) {
if (descriptor != null) {
scannerContext.setCurrentDescriptor(null);
scannerContext.pop(type);
}
} | [
"private",
"<",
"D",
"extends",
"Descriptor",
">",
"void",
"popDescriptor",
"(",
"Class",
"<",
"D",
">",
"type",
",",
"D",
"descriptor",
")",
"{",
"if",
"(",
"descriptor",
"!=",
"null",
")",
"{",
"scannerContext",
".",
"setCurrentDescriptor",
"(",
"null",
... | Pop the given descriptor from the context.
@param descriptor
The descriptor.
@param <D>
The descriptor type. | [
"Pop",
"the",
"given",
"descriptor",
"from",
"the",
"context",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/scanner/src/main/java/com/buschmais/jqassistant/core/scanner/impl/ScannerImpl.java#L201-L206 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/PrettyPrinter.java | PrettyPrinter.formatArgTo | private static void formatArgTo(List<Dependency> path, StringBuilder builder) {
if (path.isEmpty()) {
return;
}
builder.append("\n");
boolean first = true;
Key<?> previousTarget = null; // For sanity-checking.
for (Dependency dependency : path) {
Key<?> source = dependency.getSource... | java | private static void formatArgTo(List<Dependency> path, StringBuilder builder) {
if (path.isEmpty()) {
return;
}
builder.append("\n");
boolean first = true;
Key<?> previousTarget = null; // For sanity-checking.
for (Dependency dependency : path) {
Key<?> source = dependency.getSource... | [
"private",
"static",
"void",
"formatArgTo",
"(",
"List",
"<",
"Dependency",
">",
"path",
",",
"StringBuilder",
"builder",
")",
"{",
"if",
"(",
"path",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"builder",
".",
"append",
"(",
"\"\\n\"",
")"... | Formats a list of dependencies as a dependency path; see the class
comments. | [
"Formats",
"a",
"list",
"of",
"dependencies",
"as",
"a",
"dependency",
"path",
";",
"see",
"the",
"class",
"comments",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/PrettyPrinter.java#L146-L197 |
facebook/fresco | samples/gestures/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java | MultiPointerGestureDetector.getPressedPointerIndex | private int getPressedPointerIndex(MotionEvent event, int i) {
final int count = event.getPointerCount();
final int action = event.getActionMasked();
final int index = event.getActionIndex();
if (action == MotionEvent.ACTION_UP ||
action == MotionEvent.ACTION_POINTER_UP) {
if (i >= index) ... | java | private int getPressedPointerIndex(MotionEvent event, int i) {
final int count = event.getPointerCount();
final int action = event.getActionMasked();
final int index = event.getActionIndex();
if (action == MotionEvent.ACTION_UP ||
action == MotionEvent.ACTION_POINTER_UP) {
if (i >= index) ... | [
"private",
"int",
"getPressedPointerIndex",
"(",
"MotionEvent",
"event",
",",
"int",
"i",
")",
"{",
"final",
"int",
"count",
"=",
"event",
".",
"getPointerCount",
"(",
")",
";",
"final",
"int",
"action",
"=",
"event",
".",
"getActionMasked",
"(",
")",
";",... | Gets the index of the i-th pressed pointer.
Normally, the index will be equal to i, except in the case when the pointer is released.
@return index of the specified pointer or -1 if not found (i.e. not enough pointers are down) | [
"Gets",
"the",
"index",
"of",
"the",
"i",
"-",
"th",
"pressed",
"pointer",
".",
"Normally",
"the",
"index",
"will",
"be",
"equal",
"to",
"i",
"except",
"in",
"the",
"case",
"when",
"the",
"pointer",
"is",
"released",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/samples/gestures/src/main/java/com/facebook/samples/gestures/MultiPointerGestureDetector.java#L116-L127 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.appendStringInto | public static void appendStringInto( String s, File outputFile ) throws IOException {
OutputStreamWriter fw = null;
try {
fw = new OutputStreamWriter( new FileOutputStream( outputFile, true ), StandardCharsets.UTF_8 );
fw.append( s );
} finally {
Utils.closeQuietly( fw );
}
} | java | public static void appendStringInto( String s, File outputFile ) throws IOException {
OutputStreamWriter fw = null;
try {
fw = new OutputStreamWriter( new FileOutputStream( outputFile, true ), StandardCharsets.UTF_8 );
fw.append( s );
} finally {
Utils.closeQuietly( fw );
}
} | [
"public",
"static",
"void",
"appendStringInto",
"(",
"String",
"s",
",",
"File",
"outputFile",
")",
"throws",
"IOException",
"{",
"OutputStreamWriter",
"fw",
"=",
"null",
";",
"try",
"{",
"fw",
"=",
"new",
"OutputStreamWriter",
"(",
"new",
"FileOutputStream",
... | Appends a string into a file.
@param s the string to write (not null)
@param outputFile the file to write into
@throws IOException if something went wrong | [
"Appends",
"a",
"string",
"into",
"a",
"file",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L418-L428 |
Alluxio/alluxio | job/server/src/main/java/alluxio/job/util/JobUtils.java | JobUtils.loadBlock | public static void loadBlock(FileSystem fs, FileSystemContext context, String path, long blockId)
throws AlluxioException, IOException {
AlluxioBlockStore blockStore = AlluxioBlockStore.create(context);
String localHostName = NetworkAddressUtils.getConnectHost(ServiceType.WORKER_RPC,
ServerConfig... | java | public static void loadBlock(FileSystem fs, FileSystemContext context, String path, long blockId)
throws AlluxioException, IOException {
AlluxioBlockStore blockStore = AlluxioBlockStore.create(context);
String localHostName = NetworkAddressUtils.getConnectHost(ServiceType.WORKER_RPC,
ServerConfig... | [
"public",
"static",
"void",
"loadBlock",
"(",
"FileSystem",
"fs",
",",
"FileSystemContext",
"context",
",",
"String",
"path",
",",
"long",
"blockId",
")",
"throws",
"AlluxioException",
",",
"IOException",
"{",
"AlluxioBlockStore",
"blockStore",
"=",
"AlluxioBlockSto... | Loads a block into the local worker. If the block doesn't exist in Alluxio, it will be read
from the UFS.
@param fs the filesystem
@param context filesystem context
@param path the file path of the block to load
@param blockId the id of the block to load | [
"Loads",
"a",
"block",
"into",
"the",
"local",
"worker",
".",
"If",
"the",
"block",
"doesn",
"t",
"exist",
"in",
"Alluxio",
"it",
"will",
"be",
"read",
"from",
"the",
"UFS",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/server/src/main/java/alluxio/job/util/JobUtils.java#L107-L161 |
kiegroup/jbpm | jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/RuntimeEnvironmentBuilder.java | RuntimeEnvironmentBuilder.getDefault | public static RuntimeEnvironmentBuilder getDefault(String groupId, String artifactId, String version) {
return getDefault(groupId, artifactId, version, null, null);
} | java | public static RuntimeEnvironmentBuilder getDefault(String groupId, String artifactId, String version) {
return getDefault(groupId, artifactId, version, null, null);
} | [
"public",
"static",
"RuntimeEnvironmentBuilder",
"getDefault",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
")",
"{",
"return",
"getDefault",
"(",
"groupId",
",",
"artifactId",
",",
"version",
",",
"null",
",",
"null",
")",
... | Provides default configuration of <code>RuntimeEnvironmentBuilder</code> that is based on:
<ul>
<li>DefaultRuntimeEnvironment</li>
</ul>
This one is tailored to works smoothly with kjars as the notion of kbase and ksessions
@param groupId group id of kjar
@param artifactId artifact id of kjar
@param version version num... | [
"Provides",
"default",
"configuration",
"of",
"<code",
">",
"RuntimeEnvironmentBuilder<",
"/",
"code",
">",
"that",
"is",
"based",
"on",
":",
"<ul",
">",
"<li",
">",
"DefaultRuntimeEnvironment<",
"/",
"li",
">",
"<",
"/",
"ul",
">",
"This",
"one",
"is",
"t... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-runtime-manager/src/main/java/org/jbpm/runtime/manager/impl/RuntimeEnvironmentBuilder.java#L144-L146 |
SeaCloudsEU/SeaCloudsPlatform | discoverer/src/main/java/eu/seaclouds/platform/discoverer/crawler/CloudHarmonySPECint.java | CloudHarmonySPECint.getSPECint | public static Integer getSPECint(String providerName, String instanceType) {
String key = providerName + "." + instanceType;
return SPECint.get(key);
} | java | public static Integer getSPECint(String providerName, String instanceType) {
String key = providerName + "." + instanceType;
return SPECint.get(key);
} | [
"public",
"static",
"Integer",
"getSPECint",
"(",
"String",
"providerName",
",",
"String",
"instanceType",
")",
"{",
"String",
"key",
"=",
"providerName",
"+",
"\".\"",
"+",
"instanceType",
";",
"return",
"SPECint",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Gets the SPECint of the specified instance of the specified offerings provider
@param providerName the name of the offerings provider
@param instanceType istance type as specified in the CloudHarmony API
@return SPECint of the specified instance | [
"Gets",
"the",
"SPECint",
"of",
"the",
"specified",
"instance",
"of",
"the",
"specified",
"offerings",
"provider"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/discoverer/src/main/java/eu/seaclouds/platform/discoverer/crawler/CloudHarmonySPECint.java#L79-L82 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/LazyList.java | LazyList.toXml | public String toXml(boolean pretty, boolean declaration, String... attrs) {
String topNode = Inflector.pluralize(Inflector.underscore(metaModel.getModelClass().getSimpleName()));
hydrate();
StringBuilder sb = new StringBuilder();
if(declaration) {
sb.append("<?xml version=\... | java | public String toXml(boolean pretty, boolean declaration, String... attrs) {
String topNode = Inflector.pluralize(Inflector.underscore(metaModel.getModelClass().getSimpleName()));
hydrate();
StringBuilder sb = new StringBuilder();
if(declaration) {
sb.append("<?xml version=\... | [
"public",
"String",
"toXml",
"(",
"boolean",
"pretty",
",",
"boolean",
"declaration",
",",
"String",
"...",
"attrs",
")",
"{",
"String",
"topNode",
"=",
"Inflector",
".",
"pluralize",
"(",
"Inflector",
".",
"underscore",
"(",
"metaModel",
".",
"getModelClass",... | Generates a XML document from content of this list.
@param pretty pretty format (human readable), or one line text.
@param declaration true to include XML declaration at the top
@param attrs list of attributes to include. No arguments == include all attributes.
@return generated XML. | [
"Generates",
"a",
"XML",
"document",
"from",
"content",
"of",
"this",
"list",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/LazyList.java#L203-L221 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/util/MultimapJoiner.java | MultimapJoiner.appendTo | public StringBuilder appendTo(StringBuilder builder, Multimap<?, ?> map) {
return appendTo(builder, map.asMap().entrySet());
} | java | public StringBuilder appendTo(StringBuilder builder, Multimap<?, ?> map) {
return appendTo(builder, map.asMap().entrySet());
} | [
"public",
"StringBuilder",
"appendTo",
"(",
"StringBuilder",
"builder",
",",
"Multimap",
"<",
"?",
",",
"?",
">",
"map",
")",
"{",
"return",
"appendTo",
"(",
"builder",
",",
"map",
".",
"asMap",
"(",
")",
".",
"entrySet",
"(",
")",
")",
";",
"}"
] | Appends the string representation of each entry of {@code map}, using the previously configured separator and
key-value separator, to {@code builder}. Identical to {@link #appendTo(Appendable, Multimap)}, except that it
does not throw {@link IOException}. | [
"Appends",
"the",
"string",
"representation",
"of",
"each",
"entry",
"of",
"{"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/util/MultimapJoiner.java#L62-L64 |
VoltDB/voltdb | src/frontend/org/voltdb/SnapshotDaemon.java | SnapshotDaemon.processScanResponse | private void processScanResponse(ClientResponse response) {
setState(State.WAITING);
if (response.getStatus() != ClientResponse.SUCCESS) {
logFailureResponse("Initial snapshot scan failed", response);
return;
}
final VoltTable results[] = response.getResults();
... | java | private void processScanResponse(ClientResponse response) {
setState(State.WAITING);
if (response.getStatus() != ClientResponse.SUCCESS) {
logFailureResponse("Initial snapshot scan failed", response);
return;
}
final VoltTable results[] = response.getResults();
... | [
"private",
"void",
"processScanResponse",
"(",
"ClientResponse",
"response",
")",
"{",
"setState",
"(",
"State",
".",
"WAITING",
")",
";",
"if",
"(",
"response",
".",
"getStatus",
"(",
")",
"!=",
"ClientResponse",
".",
"SUCCESS",
")",
"{",
"logFailureResponse"... | Process the response to a snapshot scan. Find the snapshots
that are managed by this daemon by path and nonce
and add it the list. Initiate a delete of any that should
not be retained
@param response
@return | [
"Process",
"the",
"response",
"to",
"a",
"snapshot",
"scan",
".",
"Find",
"the",
"snapshots",
"that",
"are",
"managed",
"by",
"this",
"daemon",
"by",
"path",
"and",
"nonce",
"and",
"add",
"it",
"the",
"list",
".",
"Initiate",
"a",
"delete",
"of",
"any",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/SnapshotDaemon.java#L1536-L1574 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/threading/Deadline.java | Deadline.waitFor | public void waitFor(final Object monitor, final boolean ignoreInterrupts)
{
synchronized (monitor)
{
try
{
monitor.wait(this.getTimeLeft(TimeUnit.MILLISECONDS));
}
catch (InterruptedException e)
{
if (!ignoreInterrupts)
return;
}
}
return;
} | java | public void waitFor(final Object monitor, final boolean ignoreInterrupts)
{
synchronized (monitor)
{
try
{
monitor.wait(this.getTimeLeft(TimeUnit.MILLISECONDS));
}
catch (InterruptedException e)
{
if (!ignoreInterrupts)
return;
}
}
return;
} | [
"public",
"void",
"waitFor",
"(",
"final",
"Object",
"monitor",
",",
"final",
"boolean",
"ignoreInterrupts",
")",
"{",
"synchronized",
"(",
"monitor",
")",
"{",
"try",
"{",
"monitor",
".",
"wait",
"(",
"this",
".",
"getTimeLeft",
"(",
"TimeUnit",
".",
"MIL... | Waits on the listed monitor until it returns or until this deadline has expired; if <code>mayInterrupt</code> is true then
an interrupt will cause this method to return true
@param ignoreInterrupts
false if the code should return early in the event of an interrupt, otherwise true if InterruptedExceptions should be
ign... | [
"Waits",
"on",
"the",
"listed",
"monitor",
"until",
"it",
"returns",
"or",
"until",
"this",
"deadline",
"has",
"expired",
";",
"if",
"<code",
">",
"mayInterrupt<",
"/",
"code",
">",
"is",
"true",
"then",
"an",
"interrupt",
"will",
"cause",
"this",
"method"... | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/threading/Deadline.java#L239-L255 |
infinispan/infinispan | server/hotrod/src/main/java/org/infinispan/server/hotrod/transport/ExtendedByteBuf.java | ExtendedByteBuf.readMaybeVInt | public static Optional<Integer> readMaybeVInt(ByteBuf bf) {
if (bf.readableBytes() >= 1) {
byte b = bf.readByte();
return read(bf, b, 7, b & 0x7F, 1);
} else {
bf.resetReaderIndex();
return Optional.empty();
}
} | java | public static Optional<Integer> readMaybeVInt(ByteBuf bf) {
if (bf.readableBytes() >= 1) {
byte b = bf.readByte();
return read(bf, b, 7, b & 0x7F, 1);
} else {
bf.resetReaderIndex();
return Optional.empty();
}
} | [
"public",
"static",
"Optional",
"<",
"Integer",
">",
"readMaybeVInt",
"(",
"ByteBuf",
"bf",
")",
"{",
"if",
"(",
"bf",
".",
"readableBytes",
"(",
")",
">=",
"1",
")",
"{",
"byte",
"b",
"=",
"bf",
".",
"readByte",
"(",
")",
";",
"return",
"read",
"(... | Reads a variable size int if possible. If not present the reader index is reset to the last mark.
@param bf
@return | [
"Reads",
"a",
"variable",
"size",
"int",
"if",
"possible",
".",
"If",
"not",
"present",
"the",
"reader",
"index",
"is",
"reset",
"to",
"the",
"last",
"mark",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/transport/ExtendedByteBuf.java#L145-L153 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/maven/PomTransformer.java | PomTransformer.invoke | public Boolean invoke(File pomFile, VirtualChannel channel) throws IOException, InterruptedException {
org.jfrog.build.extractor.maven.reader.ModuleName current = new org.jfrog.build.extractor.maven.reader.ModuleName(
currentModule.groupId, currentModule.artifactId);
Map<org.jfrog.buil... | java | public Boolean invoke(File pomFile, VirtualChannel channel) throws IOException, InterruptedException {
org.jfrog.build.extractor.maven.reader.ModuleName current = new org.jfrog.build.extractor.maven.reader.ModuleName(
currentModule.groupId, currentModule.artifactId);
Map<org.jfrog.buil... | [
"public",
"Boolean",
"invoke",
"(",
"File",
"pomFile",
",",
"VirtualChannel",
"channel",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"org",
".",
"jfrog",
".",
"build",
".",
"extractor",
".",
"maven",
".",
"reader",
".",
"ModuleName",
"curre... | Performs the transformation.
@return True if the file was modified. | [
"Performs",
"the",
"transformation",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/maven/PomTransformer.java#L61-L77 |
eBay/parallec | src/main/java/io/parallec/core/task/ParallelTaskManager.java | ParallelTaskManager.removeTaskFromWaitQ | public synchronized boolean removeTaskFromWaitQ(ParallelTask taskTobeRemoved) {
boolean removed = false;
for (ParallelTask task : waitQ) {
if (task.getTaskId() == taskTobeRemoved.getTaskId()) {
task.setState(ParallelTaskState.COMPLETED_WITH_ERROR);
task.getTa... | java | public synchronized boolean removeTaskFromWaitQ(ParallelTask taskTobeRemoved) {
boolean removed = false;
for (ParallelTask task : waitQ) {
if (task.getTaskId() == taskTobeRemoved.getTaskId()) {
task.setState(ParallelTaskState.COMPLETED_WITH_ERROR);
task.getTa... | [
"public",
"synchronized",
"boolean",
"removeTaskFromWaitQ",
"(",
"ParallelTask",
"taskTobeRemoved",
")",
"{",
"boolean",
"removed",
"=",
"false",
";",
"for",
"(",
"ParallelTask",
"task",
":",
"waitQ",
")",
"{",
"if",
"(",
"task",
".",
"getTaskId",
"(",
")",
... | Removes the task from wait q.
@param taskTobeRemoved
the task tobe removed
@return true, if successful | [
"Removes",
"the",
"task",
"from",
"wait",
"q",
"."
] | train | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L228-L244 |
NLPchina/elasticsearch-sql | src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java | DefaultQueryAction.handleScriptField | private void handleScriptField(MethodField method) throws SqlParseException {
List<KVValue> params = method.getParams();
if (params.size() == 2) {
String f = params.get(0).value.toString();
fieldNames.add(f);
request.addScriptField(f, new Script(params.get(1).value.toString()));
... | java | private void handleScriptField(MethodField method) throws SqlParseException {
List<KVValue> params = method.getParams();
if (params.size() == 2) {
String f = params.get(0).value.toString();
fieldNames.add(f);
request.addScriptField(f, new Script(params.get(1).value.toString()));
... | [
"private",
"void",
"handleScriptField",
"(",
"MethodField",
"method",
")",
"throws",
"SqlParseException",
"{",
"List",
"<",
"KVValue",
">",
"params",
"=",
"method",
".",
"getParams",
"(",
")",
";",
"if",
"(",
"params",
".",
"size",
"(",
")",
"==",
"2",
"... | zhongshu-comment scripted_field only allows script(name,script) or script(name,lang,script)
@param method
@throws SqlParseException | [
"zhongshu",
"-",
"comment",
"scripted_field",
"only",
"allows",
"script",
"(",
"name",
"script",
")",
"or",
"script",
"(",
"name",
"lang",
"script",
")"
] | train | https://github.com/NLPchina/elasticsearch-sql/blob/eaab70b4bf1729978911b83eb96e816ebcfe6e7f/src/main/java/org/nlpcn/es4sql/query/DefaultQueryAction.java#L166-L186 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/AsyncTableEntryReader.java | AsyncTableEntryReader.readEntryComponents | static DeserializedEntry readEntryComponents(InputStream input, long segmentOffset, EntrySerializer serializer) throws IOException {
val h = serializer.readHeader(input);
long version = getKeyVersion(h, segmentOffset);
byte[] key = StreamHelpers.readAll(input, h.getKeyLength());
byte[] v... | java | static DeserializedEntry readEntryComponents(InputStream input, long segmentOffset, EntrySerializer serializer) throws IOException {
val h = serializer.readHeader(input);
long version = getKeyVersion(h, segmentOffset);
byte[] key = StreamHelpers.readAll(input, h.getKeyLength());
byte[] v... | [
"static",
"DeserializedEntry",
"readEntryComponents",
"(",
"InputStream",
"input",
",",
"long",
"segmentOffset",
",",
"EntrySerializer",
"serializer",
")",
"throws",
"IOException",
"{",
"val",
"h",
"=",
"serializer",
".",
"readHeader",
"(",
"input",
")",
";",
"lon... | Reads a single {@link TableEntry} from the given InputStream. The {@link TableEntry} itself is not constructed,
rather all of its components are returned individually.
@param input An InputStream to read from.
@param segmentOffset The Segment Offset that the first byte of the InputStream maps to. This wll be u... | [
"Reads",
"a",
"single",
"{",
"@link",
"TableEntry",
"}",
"from",
"the",
"given",
"InputStream",
".",
"The",
"{",
"@link",
"TableEntry",
"}",
"itself",
"is",
"not",
"constructed",
"rather",
"all",
"of",
"its",
"components",
"are",
"returned",
"individually",
... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/AsyncTableEntryReader.java#L120-L126 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/configuration/impl/ConfigurationAbstractImpl.java | ConfigurationAbstractImpl.getStrings | public String[] getStrings(String key, String defaultValue, String seperators)
{
StringTokenizer st = new StringTokenizer(getString(key, defaultValue), seperators);
String[] ret = new String[st.countTokens()];
for (int i = 0; i < ret.length; i++)
{
ret[i] = st.nextT... | java | public String[] getStrings(String key, String defaultValue, String seperators)
{
StringTokenizer st = new StringTokenizer(getString(key, defaultValue), seperators);
String[] ret = new String[st.countTokens()];
for (int i = 0; i < ret.length; i++)
{
ret[i] = st.nextT... | [
"public",
"String",
"[",
"]",
"getStrings",
"(",
"String",
"key",
",",
"String",
"defaultValue",
",",
"String",
"seperators",
")",
"{",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"getString",
"(",
"key",
",",
"defaultValue",
")",
",",
"sepe... | Gets an array of Strings from the value of the specified key, seperated
by any key from <code>seperators</code>. If no value for this key
is found the array contained in <code>defaultValue</code> is returned.
@param key the key
@param defaultValue the default Value
@param seperators the seprators to be used
@return th... | [
"Gets",
"an",
"array",
"of",
"Strings",
"from",
"the",
"value",
"of",
"the",
"specified",
"key",
"seperated",
"by",
"any",
"key",
"from",
"<code",
">",
"seperators<",
"/",
"code",
">",
".",
"If",
"no",
"value",
"for",
"this",
"key",
"is",
"found",
"the... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/configuration/impl/ConfigurationAbstractImpl.java#L112-L121 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateRegexEntityRole | public OperationStatus updateRegexEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateRegexEntityRoleOptionalParameter updateRegexEntityRoleOptionalParameter) {
return updateRegexEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, updateRegexEntityRoleOptionalParameter)... | java | public OperationStatus updateRegexEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId, UpdateRegexEntityRoleOptionalParameter updateRegexEntityRoleOptionalParameter) {
return updateRegexEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, updateRegexEntityRoleOptionalParameter)... | [
"public",
"OperationStatus",
"updateRegexEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
",",
"UpdateRegexEntityRoleOptionalParameter",
"updateRegexEntityRoleOptionalParameter",
")",
"{",
"return",
"updateRegexE... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role ID.
@param updateRegexEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArg... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L12051-L12053 |
alkacon/opencms-core | src-modules/org/opencms/workplace/explorer/CmsExplorer.java | CmsExplorer.folderExists | private boolean folderExists(CmsObject cms, String folder) {
try {
CmsFolder test = cms.readFolder(folder, CmsResourceFilter.IGNORE_EXPIRATION);
if (test.isFile()) {
return false;
}
return true;
} catch (Exception e) {
return f... | java | private boolean folderExists(CmsObject cms, String folder) {
try {
CmsFolder test = cms.readFolder(folder, CmsResourceFilter.IGNORE_EXPIRATION);
if (test.isFile()) {
return false;
}
return true;
} catch (Exception e) {
return f... | [
"private",
"boolean",
"folderExists",
"(",
"CmsObject",
"cms",
",",
"String",
"folder",
")",
"{",
"try",
"{",
"CmsFolder",
"test",
"=",
"cms",
".",
"readFolder",
"(",
"folder",
",",
"CmsResourceFilter",
".",
"IGNORE_EXPIRATION",
")",
";",
"if",
"(",
"test",
... | Checks if a folder with a given name exits in the VFS.<p>
@param cms the current cms context
@param folder the folder to check for
@return true if the folder exists in the VFS | [
"Checks",
"if",
"a",
"folder",
"with",
"a",
"given",
"name",
"exits",
"in",
"the",
"VFS",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/explorer/CmsExplorer.java#L805-L816 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/users/ExtensionUserManagement.java | ExtensionUserManagement.getContextPanel | private ContextUsersPanel getContextPanel(int contextId) {
ContextUsersPanel panel = this.userPanelsMap.get(contextId);
if (panel == null) {
panel = new ContextUsersPanel(this, contextId);
this.userPanelsMap.put(contextId, panel);
}
return panel;
} | java | private ContextUsersPanel getContextPanel(int contextId) {
ContextUsersPanel panel = this.userPanelsMap.get(contextId);
if (panel == null) {
panel = new ContextUsersPanel(this, contextId);
this.userPanelsMap.put(contextId, panel);
}
return panel;
} | [
"private",
"ContextUsersPanel",
"getContextPanel",
"(",
"int",
"contextId",
")",
"{",
"ContextUsersPanel",
"panel",
"=",
"this",
".",
"userPanelsMap",
".",
"get",
"(",
"contextId",
")",
";",
"if",
"(",
"panel",
"==",
"null",
")",
"{",
"panel",
"=",
"new",
... | Gets the context panel for a given context.
@param contextId the context id
@return the context panel | [
"Gets",
"the",
"context",
"panel",
"for",
"a",
"given",
"context",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/users/ExtensionUserManagement.java#L184-L191 |
brutusin/commons | src/main/java/org/brutusin/commons/utils/Miscellaneous.java | Miscellaneous.isSymlink | public static boolean isSymlink(File file) throws IOException {
if (file == null) {
throw new NullPointerException("File must not be null");
}
if (File.separatorChar == '\\') {
return false;
}
File fileInCanonicalDir;
if (file.getParent() =... | java | public static boolean isSymlink(File file) throws IOException {
if (file == null) {
throw new NullPointerException("File must not be null");
}
if (File.separatorChar == '\\') {
return false;
}
File fileInCanonicalDir;
if (file.getParent() =... | [
"public",
"static",
"boolean",
"isSymlink",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"File must not be null\"",
")",
";",
"}",
"if",
"(",
"File",
".",
... | Determines whether the specified file is a Symbolic Link rather than an
actual file.
<p>
Will not return true if there is a Symbolic Link anywhere in the path,
only if the specific file is.
<p>
<b>Note:</b> the current implementation always returns {@code false} if
the system is detected as Windows.
Copied from org.ap... | [
"Determines",
"whether",
"the",
"specified",
"file",
"is",
"a",
"Symbolic",
"Link",
"rather",
"than",
"an",
"actual",
"file",
".",
"<p",
">",
"Will",
"not",
"return",
"true",
"if",
"there",
"is",
"a",
"Symbolic",
"Link",
"anywhere",
"in",
"the",
"path",
... | train | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/utils/Miscellaneous.java#L327-L343 |
samskivert/samskivert | src/main/java/com/samskivert/velocity/FormTool.java | FormTool.imageSubmit | public String imageSubmit (String name, String value, String imagePath)
{
return fixedInput("image", name, value, "src=\"" + imagePath + "\"");
} | java | public String imageSubmit (String name, String value, String imagePath)
{
return fixedInput("image", name, value, "src=\"" + imagePath + "\"");
} | [
"public",
"String",
"imageSubmit",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"imagePath",
")",
"{",
"return",
"fixedInput",
"(",
"\"image\"",
",",
"name",
",",
"value",
",",
"\"src=\\\"\"",
"+",
"imagePath",
"+",
"\"\\\"\"",
")",
";",
"... | Constructs a image submit element with the specified parameter name
and image path. | [
"Constructs",
"a",
"image",
"submit",
"element",
"with",
"the",
"specified",
"parameter",
"name",
"and",
"image",
"path",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L194-L197 |
xwiki/xwiki-rendering | xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacro.java | HTMLMacro.renderWikiSyntax | private String renderWikiSyntax(String content, Transformation transformation, MacroTransformationContext context)
throws MacroExecutionException
{
String xhtml;
try {
// Parse the wiki syntax
XDOM xdom = this.contentParser.parse(content, context, false, false);
... | java | private String renderWikiSyntax(String content, Transformation transformation, MacroTransformationContext context)
throws MacroExecutionException
{
String xhtml;
try {
// Parse the wiki syntax
XDOM xdom = this.contentParser.parse(content, context, false, false);
... | [
"private",
"String",
"renderWikiSyntax",
"(",
"String",
"content",
",",
"Transformation",
"transformation",
",",
"MacroTransformationContext",
"context",
")",
"throws",
"MacroExecutionException",
"{",
"String",
"xhtml",
";",
"try",
"{",
"// Parse the wiki syntax",
"XDOM",... | Parse the passed context using a wiki syntax parser and render the result as an XHTML string.
@param content the content to parse
@param transformation the macro transformation to execute macros when wiki is set to true
@param context the context of the macros transformation process
@return the output XHTML as a strin... | [
"Parse",
"the",
"passed",
"context",
"using",
"a",
"wiki",
"syntax",
"parser",
"and",
"render",
"the",
"result",
"as",
"an",
"XHTML",
"string",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacro.java#L242-L295 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskTracker.java | TaskTracker.getMaxActualSlots | int getMaxActualSlots(JobConf conf, int numCpuOnTT, TaskType type) {
return getMaxSlots(conf, numCpuOnTT, type);
} | java | int getMaxActualSlots(JobConf conf, int numCpuOnTT, TaskType type) {
return getMaxSlots(conf, numCpuOnTT, type);
} | [
"int",
"getMaxActualSlots",
"(",
"JobConf",
"conf",
",",
"int",
"numCpuOnTT",
",",
"TaskType",
"type",
")",
"{",
"return",
"getMaxSlots",
"(",
"conf",
",",
"numCpuOnTT",
",",
"type",
")",
";",
"}"
] | Get the actual max number of tasks. This may be different than
get(Max|Reduce)CurrentMapTasks() since that is the number used
for scheduling. This allows the CoronaTaskTracker to return the
real number of resources available.
@param conf Configuration to look for slots
@param numCpuOnTT Number of cpus on TaskTracker... | [
"Get",
"the",
"actual",
"max",
"number",
"of",
"tasks",
".",
"This",
"may",
"be",
"different",
"than",
"get",
"(",
"Max|Reduce",
")",
"CurrentMapTasks",
"()",
"since",
"that",
"is",
"the",
"number",
"used",
"for",
"scheduling",
".",
"This",
"allows",
"the"... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskTracker.java#L4282-L4284 |
google/closure-compiler | src/com/google/javascript/jscomp/DestructuringGlobalNameExtractor.java | DestructuringGlobalNameExtractor.replaceDestructuringAssignment | private static void replaceDestructuringAssignment(Node pattern, Node newLvalue, Node newRvalue) {
Node parent = pattern.getParent();
if (parent.isAssign()) {
Node newAssign = IR.assign(newLvalue, newRvalue).srcref(parent);
parent.replaceWith(newAssign);
} else if (newLvalue.isName()) {
ch... | java | private static void replaceDestructuringAssignment(Node pattern, Node newLvalue, Node newRvalue) {
Node parent = pattern.getParent();
if (parent.isAssign()) {
Node newAssign = IR.assign(newLvalue, newRvalue).srcref(parent);
parent.replaceWith(newAssign);
} else if (newLvalue.isName()) {
ch... | [
"private",
"static",
"void",
"replaceDestructuringAssignment",
"(",
"Node",
"pattern",
",",
"Node",
"newLvalue",
",",
"Node",
"newRvalue",
")",
"{",
"Node",
"parent",
"=",
"pattern",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"parent",
".",
"isAssign",
"(",... | Replaces the given assignment or declaration with the new lvalue/rvalue
@param pattern a destructuring pattern in an ASSIGN or VAR/LET/CONST | [
"Replaces",
"the",
"given",
"assignment",
"or",
"declaration",
"with",
"the",
"new",
"lvalue",
"/",
"rvalue"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DestructuringGlobalNameExtractor.java#L153-L168 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirLongsSketch.java | ReservoirLongsSketch.estimateSubsetSum | public SampleSubsetSummary estimateSubsetSum(final Predicate<Long> predicate) {
if (itemsSeen_ == 0) {
return new SampleSubsetSummary(0.0, 0.0, 0.0, 0.0);
}
final long numSamples = getNumSamples();
final double samplingRate = numSamples / (double) itemsSeen_;
assert samplingRate >= 0.0;
a... | java | public SampleSubsetSummary estimateSubsetSum(final Predicate<Long> predicate) {
if (itemsSeen_ == 0) {
return new SampleSubsetSummary(0.0, 0.0, 0.0, 0.0);
}
final long numSamples = getNumSamples();
final double samplingRate = numSamples / (double) itemsSeen_;
assert samplingRate >= 0.0;
a... | [
"public",
"SampleSubsetSummary",
"estimateSubsetSum",
"(",
"final",
"Predicate",
"<",
"Long",
">",
"predicate",
")",
"{",
"if",
"(",
"itemsSeen_",
"==",
"0",
")",
"{",
"return",
"new",
"SampleSubsetSummary",
"(",
"0.0",
",",
"0.0",
",",
"0.0",
",",
"0.0",
... | Computes an estimated subset sum from the entire stream for objects matching a given
predicate. Provides a lower bound, estimate, and upper bound using a target of 2 standard
deviations.
<p>This is technically a heuristic method, and tries to err on the conservative side.</p>
@param predicate A predicate to use when ... | [
"Computes",
"an",
"estimated",
"subset",
"sum",
"from",
"the",
"entire",
"stream",
"for",
"objects",
"matching",
"a",
"given",
"predicate",
".",
"Provides",
"a",
"lower",
"bound",
"estimate",
"and",
"upper",
"bound",
"using",
"a",
"target",
"of",
"2",
"stand... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirLongsSketch.java#L428-L458 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/VariablesInner.java | VariablesInner.get | public VariableInner get(String resourceGroupName, String automationAccountName, String variableName) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, variableName).toBlocking().single().body();
} | java | public VariableInner get(String resourceGroupName, String automationAccountName, String variableName) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, variableName).toBlocking().single().body();
} | [
"public",
"VariableInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"variableName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
",",
"variableName",
")"... | Retrieve the variable identified by variable name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param variableName The name of variable.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseExceptio... | [
"Retrieve",
"the",
"variable",
"identified",
"by",
"variable",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/VariablesInner.java#L393-L395 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java | ExternalTableDefinition.newBuilder | public static Builder newBuilder(String sourceUri, Schema schema, FormatOptions format) {
return newBuilder(ImmutableList.of(sourceUri), schema, format);
} | java | public static Builder newBuilder(String sourceUri, Schema schema, FormatOptions format) {
return newBuilder(ImmutableList.of(sourceUri), schema, format);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"String",
"sourceUri",
",",
"Schema",
"schema",
",",
"FormatOptions",
"format",
")",
"{",
"return",
"newBuilder",
"(",
"ImmutableList",
".",
"of",
"(",
"sourceUri",
")",
",",
"schema",
",",
"format",
")",
";"... | Creates a builder for an ExternalTableDefinition object.
@param sourceUri a fully-qualified URI that points to your data in Google Cloud Storage. The
URI can contain one '*' wildcard character that must come after the bucket's name. Size
limits related to load jobs apply to external data sources.
@param schema the sch... | [
"Creates",
"a",
"builder",
"for",
"an",
"ExternalTableDefinition",
"object",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java#L297-L299 |
WileyLabs/teasy | src/main/java/com/wiley/elements/conditions/TeasyExpectedConditions.java | TeasyExpectedConditions.visibilityOfFirstElements | public static ExpectedCondition<List<WebElement>> visibilityOfFirstElements(final By locator) {
return new ExpectedCondition<List<WebElement>>() {
@Override
public List<WebElement> apply(final WebDriver driver) {
return getFirstVisibleWebElements(driver, null, locator);
... | java | public static ExpectedCondition<List<WebElement>> visibilityOfFirstElements(final By locator) {
return new ExpectedCondition<List<WebElement>>() {
@Override
public List<WebElement> apply(final WebDriver driver) {
return getFirstVisibleWebElements(driver, null, locator);
... | [
"public",
"static",
"ExpectedCondition",
"<",
"List",
"<",
"WebElement",
">",
">",
"visibilityOfFirstElements",
"(",
"final",
"By",
"locator",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"List",
"<",
"WebElement",
">",
">",
"(",
")",
"{",
"@",
"Over... | Expected condition to look for elements in frames that will return as soon as elements are found in any frame
@param locator
@return | [
"Expected",
"condition",
"to",
"look",
"for",
"elements",
"in",
"frames",
"that",
"will",
"return",
"as",
"soon",
"as",
"elements",
"are",
"found",
"in",
"any",
"frame"
] | train | https://github.com/WileyLabs/teasy/blob/94489ac8e6a6680b52dfa6cdbc9d8535333bef42/src/main/java/com/wiley/elements/conditions/TeasyExpectedConditions.java#L145-L157 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/EntityUtilities.java | EntityUtilities.getTopicRevisionsById | public static RevisionList getTopicRevisionsById(final TopicProvider topicProvider, final Integer csId) {
final List<Revision> results = new ArrayList<Revision>();
CollectionWrapper<TopicWrapper> topicRevisions = topicProvider.getTopic(csId).getRevisions();
// Create the unique array from the r... | java | public static RevisionList getTopicRevisionsById(final TopicProvider topicProvider, final Integer csId) {
final List<Revision> results = new ArrayList<Revision>();
CollectionWrapper<TopicWrapper> topicRevisions = topicProvider.getTopic(csId).getRevisions();
// Create the unique array from the r... | [
"public",
"static",
"RevisionList",
"getTopicRevisionsById",
"(",
"final",
"TopicProvider",
"topicProvider",
",",
"final",
"Integer",
"csId",
")",
"{",
"final",
"List",
"<",
"Revision",
">",
"results",
"=",
"new",
"ArrayList",
"<",
"Revision",
">",
"(",
")",
"... | /*
Gets a list of Revision's from the CSProcessor database for a specific content spec | [
"/",
"*",
"Gets",
"a",
"list",
"of",
"Revision",
"s",
"from",
"the",
"CSProcessor",
"database",
"for",
"a",
"specific",
"content",
"spec"
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/EntityUtilities.java#L319-L339 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkUtils.java | SparkUtils.readStringFromFile | public static String readStringFromFile(String path, SparkContext sc) throws IOException {
FileSystem fileSystem = FileSystem.get(sc.hadoopConfiguration());
try (BufferedInputStream bis = new BufferedInputStream(fileSystem.open(new Path(path)))) {
byte[] asBytes = IOUtils.toByteArray(bis);
... | java | public static String readStringFromFile(String path, SparkContext sc) throws IOException {
FileSystem fileSystem = FileSystem.get(sc.hadoopConfiguration());
try (BufferedInputStream bis = new BufferedInputStream(fileSystem.open(new Path(path)))) {
byte[] asBytes = IOUtils.toByteArray(bis);
... | [
"public",
"static",
"String",
"readStringFromFile",
"(",
"String",
"path",
",",
"SparkContext",
"sc",
")",
"throws",
"IOException",
"{",
"FileSystem",
"fileSystem",
"=",
"FileSystem",
".",
"get",
"(",
"sc",
".",
"hadoopConfiguration",
"(",
")",
")",
";",
"try"... | Read a UTF-8 format String from HDFS (or local)
@param path Path to write the string
@param sc Spark context | [
"Read",
"a",
"UTF",
"-",
"8",
"format",
"String",
"from",
"HDFS",
"(",
"or",
"local",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/SparkUtils.java#L180-L186 |
akarnokd/akarnokd-xml | src/main/java/hu/akarnokd/xml/XNElement.java | XNElement.getLong | public long getLong(String attribute, String namespace, long defaultValue) {
String value = get(attribute, namespace);
if (value == null) {
return defaultValue;
}
return Long.parseLong(value);
} | java | public long getLong(String attribute, String namespace, long defaultValue) {
String value = get(attribute, namespace);
if (value == null) {
return defaultValue;
}
return Long.parseLong(value);
} | [
"public",
"long",
"getLong",
"(",
"String",
"attribute",
",",
"String",
"namespace",
",",
"long",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"attribute",
",",
"namespace",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",... | Retrieve an integer attribute or the default value if not exists.
@param attribute the attribute name
@param namespace the attribute namespace URI
@param defaultValue the default value to return
@return the value | [
"Retrieve",
"an",
"integer",
"attribute",
"or",
"the",
"default",
"value",
"if",
"not",
"exists",
"."
] | train | https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XNElement.java#L882-L888 |
dhemery/hartley | src/main/java/com/dhemery/expressing/ImmediateExpressions.java | ImmediateExpressions.assertThat | public static <S> void assertThat(S subject, Feature<? super S,Boolean> feature) {
assertThat(subject, feature, isQuietlyTrue());
} | java | public static <S> void assertThat(S subject, Feature<? super S,Boolean> feature) {
assertThat(subject, feature, isQuietlyTrue());
} | [
"public",
"static",
"<",
"S",
">",
"void",
"assertThat",
"(",
"S",
"subject",
",",
"Feature",
"<",
"?",
"super",
"S",
",",
"Boolean",
">",
"feature",
")",
"{",
"assertThat",
"(",
"subject",
",",
"feature",
",",
"isQuietlyTrue",
"(",
")",
")",
";",
"}... | Assert that a sample of the feature is {@code true}.
<p>Example:</p>
<pre>
{@code
Page settingsPage = ...;
Feature<Page,Boolean> displayed() { ... }
...
assertThat(settingsPage, is(displayed()));
} | [
"Assert",
"that",
"a",
"sample",
"of",
"the",
"feature",
"is",
"{",
"@code",
"true",
"}",
".",
"<p",
">",
"Example",
":",
"<",
"/",
"p",
">",
"<pre",
">",
"{",
"@code"
] | train | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/expressing/ImmediateExpressions.java#L96-L98 |
jayantk/jklol | src/com/jayantkrish/jklol/inference/JunctionTree.java | JunctionTree.cliqueTreeToMaxMarginalSet | private static MaxMarginalSet cliqueTreeToMaxMarginalSet(CliqueTree cliqueTree,
FactorGraph originalFactorGraph) {
for (int i = 0; i < cliqueTree.numFactors(); i++) {
computeMarginal(cliqueTree, i, false);
}
return new FactorMaxMarginalSet(cliqueTree, originalFactorGraph.getConditionedValues());... | java | private static MaxMarginalSet cliqueTreeToMaxMarginalSet(CliqueTree cliqueTree,
FactorGraph originalFactorGraph) {
for (int i = 0; i < cliqueTree.numFactors(); i++) {
computeMarginal(cliqueTree, i, false);
}
return new FactorMaxMarginalSet(cliqueTree, originalFactorGraph.getConditionedValues());... | [
"private",
"static",
"MaxMarginalSet",
"cliqueTreeToMaxMarginalSet",
"(",
"CliqueTree",
"cliqueTree",
",",
"FactorGraph",
"originalFactorGraph",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cliqueTree",
".",
"numFactors",
"(",
")",
";",
"i",
"++... | Retrieves max marginals from the given clique tree.
@param cliqueTree
@param rootFactorNum
@return | [
"Retrieves",
"max",
"marginals",
"from",
"the",
"given",
"clique",
"tree",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/inference/JunctionTree.java#L309-L315 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java | ElemTemplateElement.excludeResultNSDecl | private boolean excludeResultNSDecl(String prefix, String uri)
throws TransformerException
{
if (uri != null)
{
if (uri.equals(Constants.S_XSLNAMESPACEURL)
|| getStylesheet().containsExtensionElementURI(uri))
return true;
if (containsExcludeResultPrefix(prefix, ur... | java | private boolean excludeResultNSDecl(String prefix, String uri)
throws TransformerException
{
if (uri != null)
{
if (uri.equals(Constants.S_XSLNAMESPACEURL)
|| getStylesheet().containsExtensionElementURI(uri))
return true;
if (containsExcludeResultPrefix(prefix, ur... | [
"private",
"boolean",
"excludeResultNSDecl",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"uri",
"!=",
"null",
")",
"{",
"if",
"(",
"uri",
".",
"equals",
"(",
"Constants",
".",
"S_XSLNAMESPACEURL",
")"... | Tell if the result namespace decl should be excluded. Should be called before
namespace aliasing (I think).
@param prefix non-null reference to prefix.
@param uri reference to namespace that prefix maps to, which is protected
for null, but should really never be passed as null.
@return true if the given namespace sh... | [
"Tell",
"if",
"the",
"result",
"namespace",
"decl",
"should",
"be",
"excluded",
".",
"Should",
"be",
"called",
"before",
"namespace",
"aliasing",
"(",
"I",
"think",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java#L1001-L1016 |
FINRAOS/DataGenerator | dg-common/src/main/java/org/finra/datagenerator/common/SocialNetwork_Example_Java/SocialNetworkUtilities.java | SocialNetworkUtilities.getDistanceBetweenCoordinates | public static Double getDistanceBetweenCoordinates(Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
// sqrt( (x2-x1)^2 + (y2-y2)^2 )
Double xDiff = point1._1() - point2._1();
Double yDiff = point1._2() - point2._2();
return Math.sqrt(xDiff * xDiff + yDiff * yDiff);
... | java | public static Double getDistanceBetweenCoordinates(Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
// sqrt( (x2-x1)^2 + (y2-y2)^2 )
Double xDiff = point1._1() - point2._1();
Double yDiff = point1._2() - point2._2();
return Math.sqrt(xDiff * xDiff + yDiff * yDiff);
... | [
"public",
"static",
"Double",
"getDistanceBetweenCoordinates",
"(",
"Tuple2",
"<",
"Double",
",",
"Double",
">",
"point1",
",",
"Tuple2",
"<",
"Double",
",",
"Double",
">",
"point2",
")",
"{",
"// sqrt( (x2-x1)^2 + (y2-y2)^2 )\r",
"Double",
"xDiff",
"=",
"point1",... | Get distance between geographical coordinates
@param point1 Point1
@param point2 Point2
@return Distance (double) | [
"Get",
"distance",
"between",
"geographical",
"coordinates"
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-common/src/main/java/org/finra/datagenerator/common/SocialNetwork_Example_Java/SocialNetworkUtilities.java#L60-L65 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java | AbstractFlagEncoder.setSpeed | protected void setSpeed(boolean reverse, IntsRef edgeFlags, double speed) {
if (speed < 0 || Double.isNaN(speed))
throw new IllegalArgumentException("Speed cannot be negative or NaN: " + speed + ", flags:" + BitUtil.LITTLE.toBitString(edgeFlags));
if (speed < speedFactor / 2) {
... | java | protected void setSpeed(boolean reverse, IntsRef edgeFlags, double speed) {
if (speed < 0 || Double.isNaN(speed))
throw new IllegalArgumentException("Speed cannot be negative or NaN: " + speed + ", flags:" + BitUtil.LITTLE.toBitString(edgeFlags));
if (speed < speedFactor / 2) {
... | [
"protected",
"void",
"setSpeed",
"(",
"boolean",
"reverse",
",",
"IntsRef",
"edgeFlags",
",",
"double",
"speed",
")",
"{",
"if",
"(",
"speed",
"<",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"speed",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Most use cases do not require this method. Will still keep it accessible so that one can disable it
until the averageSpeedEncodedValue is moved out of the FlagEncoder.
@Deprecated | [
"Most",
"use",
"cases",
"do",
"not",
"require",
"this",
"method",
".",
"Will",
"still",
"keep",
"it",
"accessible",
"so",
"that",
"one",
"can",
"disable",
"it",
"until",
"the",
"averageSpeedEncodedValue",
"is",
"moved",
"out",
"of",
"the",
"FlagEncoder",
"."... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java#L540-L554 |
lucee/Lucee | core/src/main/java/lucee/commons/io/compress/CompressUtil.java | CompressUtil._compressBZip2 | private static void _compressBZip2(InputStream source, OutputStream target) throws IOException {
InputStream is = IOUtil.toBufferedInputStream(source);
OutputStream os = new BZip2CompressorOutputStream(IOUtil.toBufferedOutputStream(target));
IOUtil.copy(is, os, true, true);
} | java | private static void _compressBZip2(InputStream source, OutputStream target) throws IOException {
InputStream is = IOUtil.toBufferedInputStream(source);
OutputStream os = new BZip2CompressorOutputStream(IOUtil.toBufferedOutputStream(target));
IOUtil.copy(is, os, true, true);
} | [
"private",
"static",
"void",
"_compressBZip2",
"(",
"InputStream",
"source",
",",
"OutputStream",
"target",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"IOUtil",
".",
"toBufferedInputStream",
"(",
"source",
")",
";",
"OutputStream",
"os",
"=",
"... | compress a source file to a bzip2 file
@param source
@param target
@throws IOException | [
"compress",
"a",
"source",
"file",
"to",
"a",
"bzip2",
"file"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/compress/CompressUtil.java#L468-L473 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java | Uris.createUri | public static URI createUri(final String url, final boolean strict) {
try {
return newUri(url, strict);
} catch (URISyntaxException e) {
throw new AssertionError("Error creating URI: " + e.getMessage());
}
} | java | public static URI createUri(final String url, final boolean strict) {
try {
return newUri(url, strict);
} catch (URISyntaxException e) {
throw new AssertionError("Error creating URI: " + e.getMessage());
}
} | [
"public",
"static",
"URI",
"createUri",
"(",
"final",
"String",
"url",
",",
"final",
"boolean",
"strict",
")",
"{",
"try",
"{",
"return",
"newUri",
"(",
"url",
",",
"strict",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"throw",
"n... | Creates a new URI based off the given string. This function differs from newUri in that it throws an
AssertionError instead of a URISyntaxException - so it is suitable for use in static locations as long as
you can be sure it is a valid string that is being parsed.
@param url the string to parse
@param strict whether... | [
"Creates",
"a",
"new",
"URI",
"based",
"off",
"the",
"given",
"string",
".",
"This",
"function",
"differs",
"from",
"newUri",
"in",
"that",
"it",
"throws",
"an",
"AssertionError",
"instead",
"of",
"a",
"URISyntaxException",
"-",
"so",
"it",
"is",
"suitable",... | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java#L514-L520 |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/SmbFile.java | SmbFile.getShareSecurity | public ACE[] getShareSecurity(boolean resolveSids) throws IOException {
String p = url.getPath();
MsrpcShareGetInfo rpc;
DcerpcHandle handle;
ACE[] aces;
resolveDfs(null);
String server = getServerWithDfs();
rpc = new MsrpcShareGetInfo(server, tree.share);
... | java | public ACE[] getShareSecurity(boolean resolveSids) throws IOException {
String p = url.getPath();
MsrpcShareGetInfo rpc;
DcerpcHandle handle;
ACE[] aces;
resolveDfs(null);
String server = getServerWithDfs();
rpc = new MsrpcShareGetInfo(server, tree.share);
... | [
"public",
"ACE",
"[",
"]",
"getShareSecurity",
"(",
"boolean",
"resolveSids",
")",
"throws",
"IOException",
"{",
"String",
"p",
"=",
"url",
".",
"getPath",
"(",
")",
";",
"MsrpcShareGetInfo",
"rpc",
";",
"DcerpcHandle",
"handle",
";",
"ACE",
"[",
"]",
"ace... | Return an array of Access Control Entry (ACE) objects representing
the share permissions on the share exporting this file or directory.
If no DACL is present, null is returned. If the DACL is empty, an array with 0 elements is returned.
<p>
Note that this is different from calling <tt>getSecurity</tt> on a
share. There... | [
"Return",
"an",
"array",
"of",
"Access",
"Control",
"Entry",
"(",
"ACE",
")",
"objects",
"representing",
"the",
"share",
"permissions",
"on",
"the",
"share",
"exporting",
"this",
"file",
"or",
"directory",
".",
"If",
"no",
"DACL",
"is",
"present",
"null",
... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/SmbFile.java#L2938-L2967 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/creational/proxy/ObjectProxy.java | ObjectProxy.executeMethod | public static Object executeMethod(Object object, MethodCallFact methodCallFact)
throws Exception
{
if (object == null)
throw new RequiredException("object");
if (methodCallFact == null)
throw new RequiredException("methodCallFact");
return executeMethod(object, methodCallFact.getMethodNam... | java | public static Object executeMethod(Object object, MethodCallFact methodCallFact)
throws Exception
{
if (object == null)
throw new RequiredException("object");
if (methodCallFact == null)
throw new RequiredException("methodCallFact");
return executeMethod(object, methodCallFact.getMethodNam... | [
"public",
"static",
"Object",
"executeMethod",
"(",
"Object",
"object",
",",
"MethodCallFact",
"methodCallFact",
")",
"throws",
"Exception",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"throw",
"new",
"RequiredException",
"(",
"\"object\"",
")",
";",
"if",
"(... | Execute the method call on a object
@param object the target object that contains the method
@param methodCallFact the method call information
@return the return object of the method call
@throws Exception | [
"Execute",
"the",
"method",
"call",
"on",
"a",
"object"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/creational/proxy/ObjectProxy.java#L23-L33 |
voldemort/voldemort | src/java/voldemort/server/VoldemortConfig.java | VoldemortConfig.getDynamicDefaults | private Props getDynamicDefaults(Props userSuppliedConfig) {
// Combined set of configs made up of user supplied configs first, while falling back
// on statically defined defaults when the value is missing from the user supplied ones.
Props combinedConfigs = new Props(userSuppliedConfig, defaul... | java | private Props getDynamicDefaults(Props userSuppliedConfig) {
// Combined set of configs made up of user supplied configs first, while falling back
// on statically defined defaults when the value is missing from the user supplied ones.
Props combinedConfigs = new Props(userSuppliedConfig, defaul... | [
"private",
"Props",
"getDynamicDefaults",
"(",
"Props",
"userSuppliedConfig",
")",
"{",
"// Combined set of configs made up of user supplied configs first, while falling back",
"// on statically defined defaults when the value is missing from the user supplied ones.",
"Props",
"combinedConfigs... | This function returns a set of default configs which cannot be defined statically,
because they (at least potentially) depend on the config values provided by the user. | [
"This",
"function",
"returns",
"a",
"set",
"of",
"default",
"configs",
"which",
"cannot",
"be",
"defined",
"statically",
"because",
"they",
"(",
"at",
"least",
"potentially",
")",
"depend",
"on",
"the",
"config",
"values",
"provided",
"by",
"the",
"user",
".... | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/VoldemortConfig.java#L761-L803 |
molgenis/molgenis | molgenis-js/src/main/java/org/molgenis/js/magma/JsMagmaScriptEvaluator.java | JsMagmaScriptEvaluator.toScriptEngineValueMap | private Object toScriptEngineValueMap(Entity entity, int depth) {
if (entity != null) {
Object idValue = toScriptEngineValue(entity, entity.getEntityType().getIdAttribute(), 0);
if (depth == 0) {
return idValue;
} else {
Map<String, Object> map = Maps.newHashMap();
entity
... | java | private Object toScriptEngineValueMap(Entity entity, int depth) {
if (entity != null) {
Object idValue = toScriptEngineValue(entity, entity.getEntityType().getIdAttribute(), 0);
if (depth == 0) {
return idValue;
} else {
Map<String, Object> map = Maps.newHashMap();
entity
... | [
"private",
"Object",
"toScriptEngineValueMap",
"(",
"Entity",
"entity",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"entity",
"!=",
"null",
")",
"{",
"Object",
"idValue",
"=",
"toScriptEngineValue",
"(",
"entity",
",",
"entity",
".",
"getEntityType",
"(",
")",... | Convert entity to a JavaScript object. Adds "_idValue" as a special key to every level for
quick access to the id value of an entity.
@param entity The entity to be flattened, should start with non null entity
@param depth Represents the number of reference levels being added to the JavaScript object
@return A JavaScr... | [
"Convert",
"entity",
"to",
"a",
"JavaScript",
"object",
".",
"Adds",
"_idValue",
"as",
"a",
"special",
"key",
"to",
"every",
"level",
"for",
"quick",
"access",
"to",
"the",
"id",
"value",
"of",
"an",
"entity",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-js/src/main/java/org/molgenis/js/magma/JsMagmaScriptEvaluator.java#L149-L166 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/ZookeeperBasedJobLock.java | ZookeeperBasedJobLock.tryLock | @Override
public boolean tryLock() throws JobLockException {
try {
return this.lock.acquire(lockAcquireTimeoutMilliseconds, TimeUnit.MILLISECONDS);
} catch (Exception e) {
throw new JobLockException("Failed to acquire lock " + this.lockPath, e);
}
} | java | @Override
public boolean tryLock() throws JobLockException {
try {
return this.lock.acquire(lockAcquireTimeoutMilliseconds, TimeUnit.MILLISECONDS);
} catch (Exception e) {
throw new JobLockException("Failed to acquire lock " + this.lockPath, e);
}
} | [
"@",
"Override",
"public",
"boolean",
"tryLock",
"(",
")",
"throws",
"JobLockException",
"{",
"try",
"{",
"return",
"this",
".",
"lock",
".",
"acquire",
"(",
"lockAcquireTimeoutMilliseconds",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
";",
"}",
"catch",
"(",
... | Try locking the lock.
@return <em>true</em> if the lock is successfully locked,
<em>false</em> if otherwise.
@throws IOException | [
"Try",
"locking",
"the",
"lock",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/ZookeeperBasedJobLock.java#L128-L135 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/function/Actions.java | Actions.toFunc | public static <T1, T2, T3, T4, T5> Func5<T1, T2, T3, T4, T5, Void> toFunc(
final Action5<T1, T2, T3, T4, T5> action) {
return toFunc(action, (Void) null);
} | java | public static <T1, T2, T3, T4, T5> Func5<T1, T2, T3, T4, T5, Void> toFunc(
final Action5<T1, T2, T3, T4, T5> action) {
return toFunc(action, (Void) null);
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
">",
"Func5",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"Void",
">",
"toFunc",
"(",
"final",
"Action5",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",... | Converts an {@link Action5} to a function that calls the action and returns {@code null}.
@param action the {@link Action5} to convert
@return a {@link Func5} that calls {@code action} and returns {@code null} | [
"Converts",
"an",
"{",
"@link",
"Action5",
"}",
"to",
"a",
"function",
"that",
"calls",
"the",
"action",
"and",
"returns",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/function/Actions.java#L135-L138 |
k3po/k3po | specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java | Functions.createServerGSSContext | @Function
public static GSSContext createServerGSSContext() {
System.out.println("createServerGSSContext()...");
try {
final GSSManager manager = GSSManager.getInstance();
//
// Create server credentials to accept kerberos tokens. This should
// make... | java | @Function
public static GSSContext createServerGSSContext() {
System.out.println("createServerGSSContext()...");
try {
final GSSManager manager = GSSManager.getInstance();
//
// Create server credentials to accept kerberos tokens. This should
// make... | [
"@",
"Function",
"public",
"static",
"GSSContext",
"createServerGSSContext",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"createServerGSSContext()...\"",
")",
";",
"try",
"{",
"final",
"GSSManager",
"manager",
"=",
"GSSManager",
".",
"getInstance",... | Create a GSS Context not tied to any server name. Peers acting as a server
create their context this way.
@return the newly created GSS Context | [
"Create",
"a",
"GSS",
"Context",
"not",
"tied",
"to",
"any",
"server",
"name",
".",
"Peers",
"acting",
"as",
"a",
"server",
"create",
"their",
"context",
"this",
"way",
"."
] | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java#L175-L210 |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.cookieMatches | @Override
public void cookieMatches(String cookieName, String expectedCookiePattern) {
cookieMatches(defaultWait, cookieName, expectedCookiePattern);
} | java | @Override
public void cookieMatches(String cookieName, String expectedCookiePattern) {
cookieMatches(defaultWait, cookieName, expectedCookiePattern);
} | [
"@",
"Override",
"public",
"void",
"cookieMatches",
"(",
"String",
"cookieName",
",",
"String",
"expectedCookiePattern",
")",
"{",
"cookieMatches",
"(",
"defaultWait",
",",
"cookieName",
",",
"expectedCookiePattern",
")",
";",
"}"
] | Waits up to the default wait time (5 seconds unless changed) for a cookies with the provided name has a value matching the
expected pattern. This information will be logged and recorded, with a
screenshot for traceability and added debugging support.
@param cookieName the name of the cookie
@param expectedC... | [
"Waits",
"up",
"to",
"the",
"default",
"wait",
"time",
"(",
"5",
"seconds",
"unless",
"changed",
")",
"for",
"a",
"cookies",
"with",
"the",
"provided",
"name",
"has",
"a",
"value",
"matching",
"the",
"expected",
"pattern",
".",
"This",
"information",
"will... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L331-L334 |
google/closure-templates | java/src/com/google/template/soy/data/SoyValueConverter.java | SoyValueConverter.newSoyMapFromJavaMap | private SoyMap newSoyMapFromJavaMap(Map<?, ?> javaMap) {
Map<SoyValue, SoyValueProvider> map = Maps.newHashMapWithExpectedSize(javaMap.size());
for (Map.Entry<?, ?> entry : javaMap.entrySet()) {
map.put(convert(entry.getKey()).resolve(), convertLazy(entry.getValue()));
}
return SoyMapImpl.forProvi... | java | private SoyMap newSoyMapFromJavaMap(Map<?, ?> javaMap) {
Map<SoyValue, SoyValueProvider> map = Maps.newHashMapWithExpectedSize(javaMap.size());
for (Map.Entry<?, ?> entry : javaMap.entrySet()) {
map.put(convert(entry.getKey()).resolve(), convertLazy(entry.getValue()));
}
return SoyMapImpl.forProvi... | [
"private",
"SoyMap",
"newSoyMapFromJavaMap",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"javaMap",
")",
"{",
"Map",
"<",
"SoyValue",
",",
"SoyValueProvider",
">",
"map",
"=",
"Maps",
".",
"newHashMapWithExpectedSize",
"(",
"javaMap",
".",
"size",
"(",
")",
")",
... | Creates a Soy map from a Java map. While this is O(n) in the map's shallow size, the Java
values are converted into Soy values lazily and only once. The keys are converted eagerly. | [
"Creates",
"a",
"Soy",
"map",
"from",
"a",
"Java",
"map",
".",
"While",
"this",
"is",
"O",
"(",
"n",
")",
"in",
"the",
"map",
"s",
"shallow",
"size",
"the",
"Java",
"values",
"are",
"converted",
"into",
"Soy",
"values",
"lazily",
"and",
"only",
"once... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SoyValueConverter.java#L370-L376 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/MonitoringProxyActivator.java | MonitoringProxyActivator.createBootProxyJar | JarFile createBootProxyJar() throws IOException {
File dataFile = bundleContext.getDataFile("boot-proxy.jar");
// Create the file if it doesn't already exist
if (!dataFile.exists()) {
dataFile.createNewFile();
}
// Generate a manifest
Manifest manifest = cre... | java | JarFile createBootProxyJar() throws IOException {
File dataFile = bundleContext.getDataFile("boot-proxy.jar");
// Create the file if it doesn't already exist
if (!dataFile.exists()) {
dataFile.createNewFile();
}
// Generate a manifest
Manifest manifest = cre... | [
"JarFile",
"createBootProxyJar",
"(",
")",
"throws",
"IOException",
"{",
"File",
"dataFile",
"=",
"bundleContext",
".",
"getDataFile",
"(",
"\"boot-proxy.jar\"",
")",
";",
"// Create the file if it doesn't already exist",
"if",
"(",
"!",
"dataFile",
".",
"exists",
"("... | Create a jar file that contains the proxy code that will live in the
boot delegation package.
@return the jar file containing the proxy code to append to the boot
class path
@throws IOException if a file I/O error occurs | [
"Create",
"a",
"jar",
"file",
"that",
"contains",
"the",
"proxy",
"code",
"that",
"will",
"live",
"in",
"the",
"boot",
"delegation",
"package",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/MonitoringProxyActivator.java#L228-L261 |
joniles/mpxj | src/main/java/net/sf/mpxj/planner/PlannerWriter.java | PlannerWriter.processWorkingHours | private void processWorkingHours(ProjectCalendar mpxjCalendar, Sequence uniqueID, Day day, List<OverriddenDayType> typeList)
{
if (isWorkingDay(mpxjCalendar, day))
{
ProjectCalendarHours mpxjHours = mpxjCalendar.getCalendarHours(day);
if (mpxjHours != null)
{
Overri... | java | private void processWorkingHours(ProjectCalendar mpxjCalendar, Sequence uniqueID, Day day, List<OverriddenDayType> typeList)
{
if (isWorkingDay(mpxjCalendar, day))
{
ProjectCalendarHours mpxjHours = mpxjCalendar.getCalendarHours(day);
if (mpxjHours != null)
{
Overri... | [
"private",
"void",
"processWorkingHours",
"(",
"ProjectCalendar",
"mpxjCalendar",
",",
"Sequence",
"uniqueID",
",",
"Day",
"day",
",",
"List",
"<",
"OverriddenDayType",
">",
"typeList",
")",
"{",
"if",
"(",
"isWorkingDay",
"(",
"mpxjCalendar",
",",
"day",
")",
... | Process the standard working hours for a given day.
@param mpxjCalendar MPXJ Calendar instance
@param uniqueID unique ID sequence generation
@param day Day instance
@param typeList Planner list of days | [
"Process",
"the",
"standard",
"working",
"hours",
"for",
"a",
"given",
"day",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/planner/PlannerWriter.java#L295-L321 |
micronaut-projects/micronaut-core | http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java | CorsFilter.handleResponse | protected void handleResponse(HttpRequest<?> request, MutableHttpResponse<?> response) {
HttpHeaders headers = request.getHeaders();
Optional<String> originHeader = headers.getOrigin();
originHeader.ifPresent(requestOrigin -> {
Optional<CorsOriginConfiguration> optionalConfig = getC... | java | protected void handleResponse(HttpRequest<?> request, MutableHttpResponse<?> response) {
HttpHeaders headers = request.getHeaders();
Optional<String> originHeader = headers.getOrigin();
originHeader.ifPresent(requestOrigin -> {
Optional<CorsOriginConfiguration> optionalConfig = getC... | [
"protected",
"void",
"handleResponse",
"(",
"HttpRequest",
"<",
"?",
">",
"request",
",",
"MutableHttpResponse",
"<",
"?",
">",
"response",
")",
"{",
"HttpHeaders",
"headers",
"=",
"request",
".",
"getHeaders",
"(",
")",
";",
"Optional",
"<",
"String",
">",
... | Handles a CORS response.
@param request The {@link HttpRequest} object
@param response The {@link MutableHttpResponse} object | [
"Handles",
"a",
"CORS",
"response",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java#L98-L126 |
STIXProject/java-stix | src/main/java/org/mitre/stix/DocumentUtilities.java | DocumentUtilities.toXMLString | public static String toXMLString(JAXBElement<?> jaxbElement,
boolean prettyPrint) {
Document document = toDocument(jaxbElement);
return toXMLString(document, prettyPrint);
} | java | public static String toXMLString(JAXBElement<?> jaxbElement,
boolean prettyPrint) {
Document document = toDocument(jaxbElement);
return toXMLString(document, prettyPrint);
} | [
"public",
"static",
"String",
"toXMLString",
"(",
"JAXBElement",
"<",
"?",
">",
"jaxbElement",
",",
"boolean",
"prettyPrint",
")",
"{",
"Document",
"document",
"=",
"toDocument",
"(",
"jaxbElement",
")",
";",
"return",
"toXMLString",
"(",
"document",
",",
"pre... | Returns a String for a JAXBElement
@param jaxbElement
JAXB representation of an XML Element to be printed.
@param prettyPrint
True for pretty print, otherwise false
@return String containing the XML mark-up. | [
"Returns",
"a",
"String",
"for",
"a",
"JAXBElement"
] | train | https://github.com/STIXProject/java-stix/blob/796b1314253fac3ebafca347f6eeb2c51ba4b009/src/main/java/org/mitre/stix/DocumentUtilities.java#L177-L184 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonWriter.java | JsonWriter.writeStringField | private void writeStringField(String fieldName, Object value) throws IOException
{
String val = value.toString();
if (!val.isEmpty())
{
m_writer.writeNameValuePair(fieldName, val);
}
} | java | private void writeStringField(String fieldName, Object value) throws IOException
{
String val = value.toString();
if (!val.isEmpty())
{
m_writer.writeNameValuePair(fieldName, val);
}
} | [
"private",
"void",
"writeStringField",
"(",
"String",
"fieldName",
",",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"String",
"val",
"=",
"value",
".",
"toString",
"(",
")",
";",
"if",
"(",
"!",
"val",
".",
"isEmpty",
"(",
")",
")",
"{",
"m_w... | Write a string field to the JSON file.
@param fieldName field name
@param value field value | [
"Write",
"a",
"string",
"field",
"to",
"the",
"JSON",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonWriter.java#L512-L519 |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/cache/CacheEntry.java | CacheEntry.setValue | public void setValue(Object value, long timeout) {
_value = value;
_expiration = System.currentTimeMillis() + timeout;
} | java | public void setValue(Object value, long timeout) {
_value = value;
_expiration = System.currentTimeMillis() + timeout;
} | [
"public",
"void",
"setValue",
"(",
"Object",
"value",
",",
"long",
"timeout",
")",
"{",
"_value",
"=",
"value",
";",
"_expiration",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"timeout",
";",
"}"
] | Sets a new value and extends its expiration.
@param value a new cached value.
@param timeout a expiration timeout in milliseconds. | [
"Sets",
"a",
"new",
"value",
"and",
"extends",
"its",
"expiration",
"."
] | train | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/cache/CacheEntry.java#L48-L51 |
knowm/Yank | src/main/java/org/knowm/yank/Yank.java | Yank.insertSQLKey | public static Long insertSQLKey(String poolName, String sqlKey, Object[] params)
throws SQLStatementNotFoundException, YankSQLException {
String sql = YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
if (sql == null || sql.equalsIgnoreCase("")) {
throw new SQLStatementNotFoundExcepti... | java | public static Long insertSQLKey(String poolName, String sqlKey, Object[] params)
throws SQLStatementNotFoundException, YankSQLException {
String sql = YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
if (sql == null || sql.equalsIgnoreCase("")) {
throw new SQLStatementNotFoundExcepti... | [
"public",
"static",
"Long",
"insertSQLKey",
"(",
"String",
"poolName",
",",
"String",
"sqlKey",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"SQLStatementNotFoundException",
",",
"YankSQLException",
"{",
"String",
"sql",
"=",
"YANK_POOL_MANAGER",
".",
"getMer... | Executes a given INSERT SQL prepared statement matching the sqlKey String in a properties file
loaded via Yank.addSQLStatements(...). Returns the auto-increment id of the inserted row.
@param poolName The name of the connection pool to query against
@param sqlKey The SQL Key found in a properties file corresponding to... | [
"Executes",
"a",
"given",
"INSERT",
"SQL",
"prepared",
"statement",
"matching",
"the",
"sqlKey",
"String",
"in",
"a",
"properties",
"file",
"loaded",
"via",
"Yank",
".",
"addSQLStatements",
"(",
"...",
")",
".",
"Returns",
"the",
"auto",
"-",
"increment",
"i... | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L84-L93 |
JadiraOrg/jadira | cdt/src/main/java/org/jadira/cdt/phonenumber/impl/E164PhoneNumberWithExtension.java | E164PhoneNumberWithExtension.ofPhoneNumberStringAndExtension | public static E164PhoneNumberWithExtension ofPhoneNumberStringAndExtension(String phoneNumber, String extension, CountryCode defaultCountryCode) {
return new E164PhoneNumberWithExtension(phoneNumber, extension, defaultCountryCode);
} | java | public static E164PhoneNumberWithExtension ofPhoneNumberStringAndExtension(String phoneNumber, String extension, CountryCode defaultCountryCode) {
return new E164PhoneNumberWithExtension(phoneNumber, extension, defaultCountryCode);
} | [
"public",
"static",
"E164PhoneNumberWithExtension",
"ofPhoneNumberStringAndExtension",
"(",
"String",
"phoneNumber",
",",
"String",
"extension",
",",
"CountryCode",
"defaultCountryCode",
")",
"{",
"return",
"new",
"E164PhoneNumberWithExtension",
"(",
"phoneNumber",
",",
"ex... | Creates a new E164 Phone Number with the given extension.
@param phoneNumber The phone number in arbitrary parseable format (may be a national format)
@param extension The extension, or null for no extension
@param defaultCountryCode The Country to apply if no country is indicated by the phone number
@return A new inst... | [
"Creates",
"a",
"new",
"E164",
"Phone",
"Number",
"with",
"the",
"given",
"extension",
"."
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cdt/src/main/java/org/jadira/cdt/phonenumber/impl/E164PhoneNumberWithExtension.java#L212-L214 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspNavBuilder.java | CmsJspNavBuilder.getSiteNavigation | public List<CmsJspNavElement> getSiteNavigation(String folder, int endLevel) {
return getSiteNavigation(folder, Visibility.navigation, endLevel);
} | java | public List<CmsJspNavElement> getSiteNavigation(String folder, int endLevel) {
return getSiteNavigation(folder, Visibility.navigation, endLevel);
} | [
"public",
"List",
"<",
"CmsJspNavElement",
">",
"getSiteNavigation",
"(",
"String",
"folder",
",",
"int",
"endLevel",
")",
"{",
"return",
"getSiteNavigation",
"(",
"folder",
",",
"Visibility",
".",
"navigation",
",",
"endLevel",
")",
";",
"}"
] | This method builds a complete navigation tree with entries of all branches
from the specified folder.<p>
@param folder folder the root folder of the navigation tree
@param endLevel the end level of the navigation
@return list of navigation elements, in depth first order | [
"This",
"method",
"builds",
"a",
"complete",
"navigation",
"tree",
"with",
"entries",
"of",
"all",
"branches",
"from",
"the",
"specified",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspNavBuilder.java#L706-L709 |
RestComm/sip-servlets | sip-servlets-examples/alerting-app/sip-servlets/src/main/java/org/mobicents/servlet/sip/alerting/JainSleeSmsAlertServlet.java | JainSleeSmsAlertServlet.doPost | public void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String alertId = request.getParameter("alertId");
String tel = request.getParameter("tel");
String alertText = request.getParameter("alertText");
if(alertTex... | java | public void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String alertId = request.getParameter("alertId");
String tel = request.getParameter("tel");
String alertText = request.getParameter("alertText");
if(alertTex... | [
"public",
"void",
"doPost",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"String",
"alertId",
"=",
"request",
".",
"getParameter",
"(",
"\"alertId\"",
")",
";",
"String",
... | Handle the HTTP POST method on which alert can be sent so that the app sends an sms based on that | [
"Handle",
"the",
"HTTP",
"POST",
"method",
"on",
"which",
"alert",
"can",
"be",
"sent",
"so",
"that",
"the",
"app",
"sends",
"an",
"sms",
"based",
"on",
"that"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/alerting-app/sip-servlets/src/main/java/org/mobicents/servlet/sip/alerting/JainSleeSmsAlertServlet.java#L60-L96 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/ds/LDAP.java | LDAP.authenicate | public Principal authenicate(String uid, char[] password)
throws SecurityException
{
String rootDN = Config.getProperty(ROOT_DN_PROP);
int timeout = Config.getPropertyInteger(TIMEOUT_SECS_PROP).intValue();
Debugger.println(LDAP.class,"timeout="+timeout);
String uid... | java | public Principal authenicate(String uid, char[] password)
throws SecurityException
{
String rootDN = Config.getProperty(ROOT_DN_PROP);
int timeout = Config.getPropertyInteger(TIMEOUT_SECS_PROP).intValue();
Debugger.println(LDAP.class,"timeout="+timeout);
String uid... | [
"public",
"Principal",
"authenicate",
"(",
"String",
"uid",
",",
"char",
"[",
"]",
"password",
")",
"throws",
"SecurityException",
"{",
"String",
"rootDN",
"=",
"Config",
".",
"getProperty",
"(",
"ROOT_DN_PROP",
")",
";",
"int",
"timeout",
"=",
"Config",
"."... | Authenticate user ID and password against the LDAP server
@param uid i.e. greeng
@param password the user password
@return the user principal details
@throws SecurityException when security error occurs | [
"Authenticate",
"user",
"ID",
"and",
"password",
"against",
"the",
"LDAP",
"server"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/ds/LDAP.java#L270-L284 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java | TldTracker.initialize | public void initialize( T image , int x0 , int y0 , int x1 , int y1 ) {
if( imagePyramid == null ||
imagePyramid.getInputWidth() != image.width || imagePyramid.getInputHeight() != image.height ) {
int minSize = (config.trackerFeatureRadius*2+1)*5;
int scales[] = selectPyramidScale(image.width,image.height,... | java | public void initialize( T image , int x0 , int y0 , int x1 , int y1 ) {
if( imagePyramid == null ||
imagePyramid.getInputWidth() != image.width || imagePyramid.getInputHeight() != image.height ) {
int minSize = (config.trackerFeatureRadius*2+1)*5;
int scales[] = selectPyramidScale(image.width,image.height,... | [
"public",
"void",
"initialize",
"(",
"T",
"image",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"if",
"(",
"imagePyramid",
"==",
"null",
"||",
"imagePyramid",
".",
"getInputWidth",
"(",
")",
"!=",
"image",
".",
... | Starts tracking the rectangular region.
@param image First image in the sequence.
@param x0 Top-left corner of rectangle. x-axis
@param y0 Top-left corner of rectangle. y-axis
@param x1 Bottom-right corner of rectangle. x-axis
@param y1 Bottom-right corner of rectangle. y-axis | [
"Starts",
"tracking",
"the",
"rectangular",
"region",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldTracker.java#L148-L175 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/stream/OStreamSerializerAnyRuntime.java | OStreamSerializerAnyRuntime.fromStream | public Object fromStream(final byte[] iStream) throws IOException {
if (iStream == null || iStream.length == 0)
// NULL VALUE
return null;
final ByteArrayInputStream is = new ByteArrayInputStream(iStream);
final ObjectInputStream in = new ObjectInputStream(is);
try {
return in.readObject();
... | java | public Object fromStream(final byte[] iStream) throws IOException {
if (iStream == null || iStream.length == 0)
// NULL VALUE
return null;
final ByteArrayInputStream is = new ByteArrayInputStream(iStream);
final ObjectInputStream in = new ObjectInputStream(is);
try {
return in.readObject();
... | [
"public",
"Object",
"fromStream",
"(",
"final",
"byte",
"[",
"]",
"iStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"iStream",
"==",
"null",
"||",
"iStream",
".",
"length",
"==",
"0",
")",
"// NULL VALUE\r",
"return",
"null",
";",
"final",
"ByteArra... | Re-Create any object if the class has a public constructor that accepts a String as unique parameter. | [
"Re",
"-",
"Create",
"any",
"object",
"if",
"the",
"class",
"has",
"a",
"public",
"constructor",
"that",
"accepts",
"a",
"String",
"as",
"unique",
"parameter",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/stream/OStreamSerializerAnyRuntime.java#L45-L60 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.