repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Ordinastie/MalisisCore | src/main/java/net/malisis/core/asm/AsmUtils.java | AsmUtils.changeFieldAccess | public static Field changeFieldAccess(Class<?> clazz, String fieldName, String srgName, boolean silenced) {
"""
Changes the access level for the specified field for a class.
@param clazz the clazz
@param fieldName the field name
@param srgName the srg name
@param silenced the silenced
@return the field
... | java | public static Field changeFieldAccess(Class<?> clazz, String fieldName, String srgName, boolean silenced)
{
try
{
Field f = clazz.getDeclaredField(MalisisCore.isObfEnv ? srgName : fieldName);
f.setAccessible(true);
Field modifiers = Field.class.getDeclaredField("modifiers");
modifiers.setAccessible(tru... | [
"public",
"static",
"Field",
"changeFieldAccess",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
",",
"String",
"srgName",
",",
"boolean",
"silenced",
")",
"{",
"try",
"{",
"Field",
"f",
"=",
"clazz",
".",
"getDeclaredField",
"(",
"Malis... | Changes the access level for the specified field for a class.
@param clazz the clazz
@param fieldName the field name
@param srgName the srg name
@param silenced the silenced
@return the field | [
"Changes",
"the",
"access",
"level",
"for",
"the",
"specified",
"field",
"for",
"a",
"class",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/asm/AsmUtils.java#L339-L359 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/user/custom/UserCustomTableReader.java | UserCustomTableReader.readTable | public static UserCustomTable readTable(GeoPackageConnection connection,
String tableName) {
"""
Read the table
@param connection
GeoPackage connection
@param tableName
table name
@return table
"""
UserCustomConnection userDb = new UserCustomConnection(connection);
return readTable(userDb, tableN... | java | public static UserCustomTable readTable(GeoPackageConnection connection,
String tableName) {
UserCustomConnection userDb = new UserCustomConnection(connection);
return readTable(userDb, tableName);
} | [
"public",
"static",
"UserCustomTable",
"readTable",
"(",
"GeoPackageConnection",
"connection",
",",
"String",
"tableName",
")",
"{",
"UserCustomConnection",
"userDb",
"=",
"new",
"UserCustomConnection",
"(",
"connection",
")",
";",
"return",
"readTable",
"(",
"userDb"... | Read the table
@param connection
GeoPackage connection
@param tableName
table name
@return table | [
"Read",
"the",
"table"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/user/custom/UserCustomTableReader.java#L65-L69 |
micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java | JacksonConfiguration.constructType | public static <T> JavaType constructType(@Nonnull Argument<T> type, @Nonnull TypeFactory typeFactory) {
"""
Constructors a JavaType for the given argument and type factory.
@param type The type
@param typeFactory The type factory
@param <T> The generic type
@return The JavaType
"""
ArgumentUtils.re... | java | public static <T> JavaType constructType(@Nonnull Argument<T> type, @Nonnull TypeFactory typeFactory) {
ArgumentUtils.requireNonNull("type", type);
ArgumentUtils.requireNonNull("typeFactory", typeFactory);
Map<String, Argument<?>> typeVariables = type.getTypeVariables();
JavaType[] objec... | [
"public",
"static",
"<",
"T",
">",
"JavaType",
"constructType",
"(",
"@",
"Nonnull",
"Argument",
"<",
"T",
">",
"type",
",",
"@",
"Nonnull",
"TypeFactory",
"typeFactory",
")",
"{",
"ArgumentUtils",
".",
"requireNonNull",
"(",
"\"type\"",
",",
"type",
")",
... | Constructors a JavaType for the given argument and type factory.
@param type The type
@param typeFactory The type factory
@param <T> The generic type
@return The JavaType | [
"Constructors",
"a",
"JavaType",
"for",
"the",
"given",
"argument",
"and",
"type",
"factory",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/jackson/JacksonConfiguration.java#L317-L347 |
j-a-w-r/jawr-main-repo | jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java | BundleProcessor.initClassLoader | protected ClassLoader initClassLoader(String baseDirPath)
throws MalformedURLException {
"""
Initialize the classloader
@param baseDirPath
the base directory path
@return the class loader
@throws MalformedURLException
"""
File webAppClasses = new File(baseDirPath + WEB_INF_CLASSES_DIR_PATH);
File[... | java | protected ClassLoader initClassLoader(String baseDirPath)
throws MalformedURLException {
File webAppClasses = new File(baseDirPath + WEB_INF_CLASSES_DIR_PATH);
File[] webAppLibs = new File(baseDirPath + WEB_INF_LIB_DIR_PATH)
.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) ... | [
"protected",
"ClassLoader",
"initClassLoader",
"(",
"String",
"baseDirPath",
")",
"throws",
"MalformedURLException",
"{",
"File",
"webAppClasses",
"=",
"new",
"File",
"(",
"baseDirPath",
"+",
"WEB_INF_CLASSES_DIR_PATH",
")",
";",
"File",
"[",
"]",
"webAppLibs",
"=",... | Initialize the classloader
@param baseDirPath
the base directory path
@return the class loader
@throws MalformedURLException | [
"Initialize",
"the",
"classloader"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java#L324-L348 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics/src/main/java/org/apache/gobblin/metrics/GobblinMetricsRegistry.java | GobblinMetricsRegistry.getOrDefault | public GobblinMetrics getOrDefault(String id, Callable<? extends GobblinMetrics> valueLoader) {
"""
Get the {@link GobblinMetrics} instance associated with a given ID. If the ID is not found this method returns the
{@link GobblinMetrics} returned by the given {@link Callable}, and creates a mapping between the sp... | java | public GobblinMetrics getOrDefault(String id, Callable<? extends GobblinMetrics> valueLoader) {
try {
return this.metricsCache.get(id, valueLoader);
} catch (ExecutionException ee) {
throw Throwables.propagate(ee);
}
} | [
"public",
"GobblinMetrics",
"getOrDefault",
"(",
"String",
"id",
",",
"Callable",
"<",
"?",
"extends",
"GobblinMetrics",
">",
"valueLoader",
")",
"{",
"try",
"{",
"return",
"this",
".",
"metricsCache",
".",
"get",
"(",
"id",
",",
"valueLoader",
")",
";",
"... | Get the {@link GobblinMetrics} instance associated with a given ID. If the ID is not found this method returns the
{@link GobblinMetrics} returned by the given {@link Callable}, and creates a mapping between the specified ID
and the {@link GobblinMetrics} instance returned by the {@link Callable}.
@param id the given ... | [
"Get",
"the",
"{",
"@link",
"GobblinMetrics",
"}",
"instance",
"associated",
"with",
"a",
"given",
"ID",
".",
"If",
"the",
"ID",
"is",
"not",
"found",
"this",
"method",
"returns",
"the",
"{",
"@link",
"GobblinMetrics",
"}",
"returned",
"by",
"the",
"given"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics/src/main/java/org/apache/gobblin/metrics/GobblinMetricsRegistry.java#L90-L96 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java | MavenModelScannerPlugin.addDevelopers | private void addDevelopers(MavenPomDescriptor pomDescriptor, Model model, Store store) {
"""
Adds information about developers.
@param pomDescriptor
The descriptor for the current POM.
@param model
The Maven Model.
@param store
The database.
"""
List<Developer> developers = model.getDevelopers(... | java | private void addDevelopers(MavenPomDescriptor pomDescriptor, Model model, Store store) {
List<Developer> developers = model.getDevelopers();
for (Developer developer : developers) {
MavenDeveloperDescriptor developerDescriptor = store.create(MavenDeveloperDescriptor.class);
devel... | [
"private",
"void",
"addDevelopers",
"(",
"MavenPomDescriptor",
"pomDescriptor",
",",
"Model",
"model",
",",
"Store",
"store",
")",
"{",
"List",
"<",
"Developer",
">",
"developers",
"=",
"model",
".",
"getDevelopers",
"(",
")",
";",
"for",
"(",
"Developer",
"... | Adds information about developers.
@param pomDescriptor
The descriptor for the current POM.
@param model
The Maven Model.
@param store
The database. | [
"Adds",
"information",
"about",
"developers",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L361-L371 |
twitter/scalding | scalding-serialization/src/main/java/com/twitter/scalding/serialization/Undeprecated.java | Undeprecated.getAsciiBytes | @SuppressWarnings("deprecation")
public static void getAsciiBytes(String element, int charStart, int charLen, byte[] bytes, int byteOffset) {
"""
This method is faster for ASCII data, but unsafe otherwise
it is used by our macros AFTER checking that the string is ASCII
following a pattern seen in Kryo, which b... | java | @SuppressWarnings("deprecation")
public static void getAsciiBytes(String element, int charStart, int charLen, byte[] bytes, int byteOffset) {
element.getBytes(charStart, charLen, bytes, byteOffset);
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"void",
"getAsciiBytes",
"(",
"String",
"element",
",",
"int",
"charStart",
",",
"int",
"charLen",
",",
"byte",
"[",
"]",
"bytes",
",",
"int",
"byteOffset",
")",
"{",
"element",
".",
... | This method is faster for ASCII data, but unsafe otherwise
it is used by our macros AFTER checking that the string is ASCII
following a pattern seen in Kryo, which benchmarking showed helped.
Scala cannot supress warnings like this so we do it here | [
"This",
"method",
"is",
"faster",
"for",
"ASCII",
"data",
"but",
"unsafe",
"otherwise",
"it",
"is",
"used",
"by",
"our",
"macros",
"AFTER",
"checking",
"that",
"the",
"string",
"is",
"ASCII",
"following",
"a",
"pattern",
"seen",
"in",
"Kryo",
"which",
"ben... | train | https://github.com/twitter/scalding/blob/428b5507279655676e507d52c669c3cbc7812dc0/scalding-serialization/src/main/java/com/twitter/scalding/serialization/Undeprecated.java#L25-L28 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java | RandomUtil.randomDouble | public static double randomDouble(double min, double max, int scale, RoundingMode roundingMode) {
"""
获得指定范围内的随机数
@param min 最小数(包含)
@param max 最大数(不包含)
@param scale 保留小数位数
@param roundingMode 保留小数的模式 {@link RoundingMode}
@return 随机数
@since 4.0.8
"""
return NumberUtil.round(randomDouble(min, max), s... | java | public static double randomDouble(double min, double max, int scale, RoundingMode roundingMode) {
return NumberUtil.round(randomDouble(min, max), scale, roundingMode).doubleValue();
} | [
"public",
"static",
"double",
"randomDouble",
"(",
"double",
"min",
",",
"double",
"max",
",",
"int",
"scale",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"NumberUtil",
".",
"round",
"(",
"randomDouble",
"(",
"min",
",",
"max",
")",
",",
"scal... | 获得指定范围内的随机数
@param min 最小数(包含)
@param max 最大数(不包含)
@param scale 保留小数位数
@param roundingMode 保留小数的模式 {@link RoundingMode}
@return 随机数
@since 4.0.8 | [
"获得指定范围内的随机数"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java#L160-L162 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/TimePickerSettings.java | TimePickerSettings.zApplyMinimumSpinnerButtonWidthInPixels | void zApplyMinimumSpinnerButtonWidthInPixels() {
"""
zApplyMinimumSpinnerButtonWidthInPixels, The applies the specified setting to the time
picker.
"""
if (parent == null) {
return;
}
Dimension decreaseButtonPreferredSize = parent.getComponentDecreaseSpinnerButton().getPref... | java | void zApplyMinimumSpinnerButtonWidthInPixels() {
if (parent == null) {
return;
}
Dimension decreaseButtonPreferredSize = parent.getComponentDecreaseSpinnerButton().getPreferredSize();
Dimension increaseButtonPreferredSize = parent.getComponentIncreaseSpinnerButton().getPrefer... | [
"void",
"zApplyMinimumSpinnerButtonWidthInPixels",
"(",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Dimension",
"decreaseButtonPreferredSize",
"=",
"parent",
".",
"getComponentDecreaseSpinnerButton",
"(",
")",
".",
"getPreferredSize",
... | zApplyMinimumSpinnerButtonWidthInPixels, The applies the specified setting to the time
picker. | [
"zApplyMinimumSpinnerButtonWidthInPixels",
"The",
"applies",
"the",
"specified",
"setting",
"to",
"the",
"time",
"picker",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/TimePickerSettings.java#L961-L974 |
Waikato/moa | moa/src/main/java/moa/classifiers/meta/DACC.java | DACC.updateEvaluationWindow | protected double updateEvaluationWindow(int index,int val) {
"""
Updates the evaluation window of a classifier and returns the
updated weight value.
@param index the index of the classifier in the ensemble
@param val the last evaluation record of the classifier
@return the updated weight value of the classifie... | java | protected double updateEvaluationWindow(int index,int val){
int[] newEnsembleWindows = new int[this.ensembleWindows[index].length];
int wsize = (int)Math.min(this.evaluationSizeOption.getValue(),this.ensembleAges[index]+1);
int sum = 0;
for (int i = 0; i < wsize-1 ; i++){
... | [
"protected",
"double",
"updateEvaluationWindow",
"(",
"int",
"index",
",",
"int",
"val",
")",
"{",
"int",
"[",
"]",
"newEnsembleWindows",
"=",
"new",
"int",
"[",
"this",
".",
"ensembleWindows",
"[",
"index",
"]",
".",
"length",
"]",
";",
"int",
"wsize",
... | Updates the evaluation window of a classifier and returns the
updated weight value.
@param index the index of the classifier in the ensemble
@param val the last evaluation record of the classifier
@return the updated weight value of the classifier | [
"Updates",
"the",
"evaluation",
"window",
"of",
"a",
"classifier",
"and",
"returns",
"the",
"updated",
"weight",
"value",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/meta/DACC.java#L245-L265 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/ServerSetup.java | ServerSetup.configureJavaMailSessionProperties | public Properties configureJavaMailSessionProperties(Properties properties, boolean debug) {
"""
Creates default properties for a JavaMail session.
Concrete server implementations can add protocol specific settings.
<p/>
For details see
<ul>
<li>http://docs.oracle.com/javaee/6/api/javax/mail/package-summary.h... | java | public Properties configureJavaMailSessionProperties(Properties properties, boolean debug) {
Properties props = new Properties();
if (debug) {
props.setProperty("mail.debug", "true");
// System.setProperty("mail.socket.debug", "true");
}
// Set local host... | [
"public",
"Properties",
"configureJavaMailSessionProperties",
"(",
"Properties",
"properties",
",",
"boolean",
"debug",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"if",
"(",
"debug",
")",
"{",
"props",
".",
"setProperty",
"(",
"\... | Creates default properties for a JavaMail session.
Concrete server implementations can add protocol specific settings.
<p/>
For details see
<ul>
<li>http://docs.oracle.com/javaee/6/api/javax/mail/package-summary.html for some general settings</li>
<li>https://javamail.java.net/nonav/docs/api/com/sun/mail/smtp/package-s... | [
"Creates",
"default",
"properties",
"for",
"a",
"JavaMail",
"session",
".",
"Concrete",
"server",
"implementations",
"can",
"add",
"protocol",
"specific",
"settings",
".",
"<p",
"/",
">",
"For",
"details",
"see",
"<ul",
">",
"<li",
">",
"http",
":",
"//",
... | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/ServerSetup.java#L195-L240 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.getJob | public CloudJob getJob(String jobId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Gets the specified {@link CloudJob}.
@param jobId The ID of the job to get.
@param detailLevel A {@link DetailLevel} used for controlling which properti... | java | public CloudJob getJob(String jobId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
JobGetOptions getJobOptions = new JobGetOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
... | [
"public",
"CloudJob",
"getJob",
"(",
"String",
"jobId",
",",
"DetailLevel",
"detailLevel",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"JobGetOptions",
"getJobOptions",
"=",
"n... | Gets the specified {@link CloudJob}.
@param jobId The ID of the job to get.
@param detailLevel A {@link DetailLevel} used for controlling which properties are retrieved from the service.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
@ret... | [
"Gets",
"the",
"specified",
"{",
"@link",
"CloudJob",
"}",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L141-L149 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/SmartTable.java | SmartTable.addText | public int addText (Object text, int colSpan, String... styles) {
"""
Adds text to the bottom row of this table in column zero, with the specified column span and
style.
@param text an object whose string value will be displayed.
@return the row to which the text was added.
"""
int row = getRowC... | java | public int addText (Object text, int colSpan, String... styles)
{
int row = getRowCount();
setText(row, 0, text, colSpan, styles);
return row;
} | [
"public",
"int",
"addText",
"(",
"Object",
"text",
",",
"int",
"colSpan",
",",
"String",
"...",
"styles",
")",
"{",
"int",
"row",
"=",
"getRowCount",
"(",
")",
";",
"setText",
"(",
"row",
",",
"0",
",",
"text",
",",
"colSpan",
",",
"styles",
")",
"... | Adds text to the bottom row of this table in column zero, with the specified column span and
style.
@param text an object whose string value will be displayed.
@return the row to which the text was added. | [
"Adds",
"text",
"to",
"the",
"bottom",
"row",
"of",
"this",
"table",
"in",
"column",
"zero",
"with",
"the",
"specified",
"column",
"span",
"and",
"style",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/SmartTable.java#L311-L316 |
deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java | ModelParameterServer.configure | public void configure(@NonNull VoidConfiguration configuration, @NonNull Transport transport, boolean isMasterNode) {
"""
This method stores provided entities for MPS internal use
@param configuration
@param transport
@param isMasterNode
"""
this.transport = transport;
this.masterMode = is... | java | public void configure(@NonNull VoidConfiguration configuration, @NonNull Transport transport, boolean isMasterNode) {
this.transport = transport;
this.masterMode = isMasterNode;
this.configuration = configuration;
} | [
"public",
"void",
"configure",
"(",
"@",
"NonNull",
"VoidConfiguration",
"configuration",
",",
"@",
"NonNull",
"Transport",
"transport",
",",
"boolean",
"isMasterNode",
")",
"{",
"this",
".",
"transport",
"=",
"transport",
";",
"this",
".",
"masterMode",
"=",
... | This method stores provided entities for MPS internal use
@param configuration
@param transport
@param isMasterNode | [
"This",
"method",
"stores",
"provided",
"entities",
"for",
"MPS",
"internal",
"use"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java#L153-L157 |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java | HandlerManager.processEndOfScope | public void processEndOfScope(Scope scopeEnding, Iterable<Object> handlerInstances) throws Exception {
"""
Scope is ending, perform the required processing on the supplied handlers.
"""
for (Object handler : handlerInstances) {
Handler handlerAnnotation = handler.getClass().getAnnotation(Ha... | java | public void processEndOfScope(Scope scopeEnding, Iterable<Object> handlerInstances) throws Exception {
for (Object handler : handlerInstances) {
Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
Scope scope = handlerAnnotation.scope();
runLifecycle... | [
"public",
"void",
"processEndOfScope",
"(",
"Scope",
"scopeEnding",
",",
"Iterable",
"<",
"Object",
">",
"handlerInstances",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Object",
"handler",
":",
"handlerInstances",
")",
"{",
"Handler",
"handlerAnnotation",
"=",
... | Scope is ending, perform the required processing on the supplied handlers. | [
"Scope",
"is",
"ending",
"perform",
"the",
"required",
"processing",
"on",
"the",
"supplied",
"handlers",
"."
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java#L149-L161 |
Canadensys/canadensys-core | src/main/java/net/canadensys/utils/LangUtils.java | LangUtils.getClassAnnotationValue | public static <T, A extends Annotation> String getClassAnnotationValue(Class<T> classType, Class<A> annotationType, String attributeName) {
"""
Get the value of a Annotation in a class declaration.
@param classType
@param annotationType
@param attributeName
@return the value of the annotation as String or null... | java | public static <T, A extends Annotation> String getClassAnnotationValue(Class<T> classType, Class<A> annotationType, String attributeName) {
String value = null;
Annotation annotation = classType.getAnnotation(annotationType);
if (annotation != null) {
try {
value = (String) annotation.annotationType().getM... | [
"public",
"static",
"<",
"T",
",",
"A",
"extends",
"Annotation",
">",
"String",
"getClassAnnotationValue",
"(",
"Class",
"<",
"T",
">",
"classType",
",",
"Class",
"<",
"A",
">",
"annotationType",
",",
"String",
"attributeName",
")",
"{",
"String",
"value",
... | Get the value of a Annotation in a class declaration.
@param classType
@param annotationType
@param attributeName
@return the value of the annotation as String or null if something goes wrong | [
"Get",
"the",
"value",
"of",
"a",
"Annotation",
"in",
"a",
"class",
"declaration",
"."
] | train | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/LangUtils.java#L19-L28 |
ksclarke/vertx-pairtree | src/main/java/info/freelibrary/pairtree/PairtreeFactory.java | PairtreeFactory.getPrefixedPairtree | public Pairtree getPrefixedPairtree(final String aPrefix, final File aDirectory) throws PairtreeException {
"""
Gets a file system based Pairtree using the supplied directory as the Pairtree root and the supplied prefix as
the Pairtree prefix.
@param aPrefix A Pairtree prefix
@param aDirectory A directory to ... | java | public Pairtree getPrefixedPairtree(final String aPrefix, final File aDirectory) throws PairtreeException {
return new FsPairtree(aPrefix, myVertx, getDirPath(aDirectory));
} | [
"public",
"Pairtree",
"getPrefixedPairtree",
"(",
"final",
"String",
"aPrefix",
",",
"final",
"File",
"aDirectory",
")",
"throws",
"PairtreeException",
"{",
"return",
"new",
"FsPairtree",
"(",
"aPrefix",
",",
"myVertx",
",",
"getDirPath",
"(",
"aDirectory",
")",
... | Gets a file system based Pairtree using the supplied directory as the Pairtree root and the supplied prefix as
the Pairtree prefix.
@param aPrefix A Pairtree prefix
@param aDirectory A directory to use for the Pairtree root
@return A Pairtree root
@throws PairtreeException If there is trouble creating the Pairtree | [
"Gets",
"a",
"file",
"system",
"based",
"Pairtree",
"using",
"the",
"supplied",
"directory",
"as",
"the",
"Pairtree",
"root",
"and",
"the",
"supplied",
"prefix",
"as",
"the",
"Pairtree",
"prefix",
"."
] | train | https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/PairtreeFactory.java#L83-L85 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.setStatic | public MethodHandle setStatic(MethodHandles.Lookup lookup, Class<?> target, String name) throws NoSuchFieldException, IllegalAccessException {
"""
Apply the chain of transforms and bind them to an object field assignment specified
using the end signature plus the given class and name. The end signature must take
... | java | public MethodHandle setStatic(MethodHandles.Lookup lookup, Class<?> target, String name) throws NoSuchFieldException, IllegalAccessException {
return invoke(lookup.findStaticSetter(target, name, type().parameterType(0)));
} | [
"public",
"MethodHandle",
"setStatic",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"Class",
"<",
"?",
">",
"target",
",",
"String",
"name",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalAccessException",
"{",
"return",
"invoke",
"(",
"lookup",
".",... | Apply the chain of transforms and bind them to an object field assignment specified
using the end signature plus the given class and name. The end signature must take
the target class or a subclass and the field's type as its arguments, and its return
type must be compatible with void.
If the final handle's type does ... | [
"Apply",
"the",
"chain",
"of",
"transforms",
"and",
"bind",
"them",
"to",
"an",
"object",
"field",
"assignment",
"specified",
"using",
"the",
"end",
"signature",
"plus",
"the",
"given",
"class",
"and",
"name",
".",
"The",
"end",
"signature",
"must",
"take",
... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1519-L1521 |
google/gson | gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java | ISO8601Utils.indexOfNonDigit | private static int indexOfNonDigit(String string, int offset) {
"""
Returns the index of the first character in the string that is not a digit, starting at offset.
"""
for (int i = offset; i < string.length(); i++) {
char c = string.charAt(i);
if (c < '0' || c > '9') return i;
... | java | private static int indexOfNonDigit(String string, int offset) {
for (int i = offset; i < string.length(); i++) {
char c = string.charAt(i);
if (c < '0' || c > '9') return i;
}
return string.length();
} | [
"private",
"static",
"int",
"indexOfNonDigit",
"(",
"String",
"string",
",",
"int",
"offset",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"offset",
";",
"i",
"<",
"string",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"char",
"c",
"=",
"string",
... | Returns the index of the first character in the string that is not a digit, starting at offset. | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"character",
"in",
"the",
"string",
"that",
"is",
"not",
"a",
"digit",
"starting",
"at",
"offset",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java#L344-L350 |
HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/etc/BitmapUtils.java | BitmapUtils.getBitmapBySize | public static Bitmap getBitmapBySize(String path, int width, int height) {
"""
将指定的图片压缩成需要的尺寸
@param path 图片的路径
@param width 要压缩成的图片的宽度
@param height 要压缩成的图片的高度
"""
BitmapFactory.Options option = new BitmapFactory.Options();
option.inJustDecodeBounds = true;
BitmapFactory.decode... | java | public static Bitmap getBitmapBySize(String path, int width, int height) {
BitmapFactory.Options option = new BitmapFactory.Options();
option.inJustDecodeBounds = true;
BitmapFactory.decodeFile(path, option);
option.inSampleSize = computeSampleSize(option, -1, width * height);
o... | [
"public",
"static",
"Bitmap",
"getBitmapBySize",
"(",
"String",
"path",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"BitmapFactory",
".",
"Options",
"option",
"=",
"new",
"BitmapFactory",
".",
"Options",
"(",
")",
";",
"option",
".",
"inJustDecodeBo... | 将指定的图片压缩成需要的尺寸
@param path 图片的路径
@param width 要压缩成的图片的宽度
@param height 要压缩成的图片的高度 | [
"将指定的图片压缩成需要的尺寸"
] | train | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/etc/BitmapUtils.java#L26-L40 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/utilities/StringUtility.java | StringUtility.prettyPrint | public static String prettyPrint(String in, int lineLength, String delim) {
"""
Method that attempts to break a string up into lines no longer than the
specified line length.
<p>The string is assumed to consist of tokens separated by a delimeter.
The default delimiter is a space. If the last token to be added... | java | public static String prettyPrint(String in, int lineLength, String delim) {
// make a guess about resulting length to minimize copying
StringBuilder sb = new StringBuilder(in.length() + in.length()/lineLength);
if (delim == null) {
delim = " ";
}
StringTokenizer st = ... | [
"public",
"static",
"String",
"prettyPrint",
"(",
"String",
"in",
",",
"int",
"lineLength",
",",
"String",
"delim",
")",
"{",
"// make a guess about resulting length to minimize copying",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"in",
".",
"length",
... | Method that attempts to break a string up into lines no longer than the
specified line length.
<p>The string is assumed to consist of tokens separated by a delimeter.
The default delimiter is a space. If the last token to be added to a
line exceeds the specified line length, it is written on the next line
so actual li... | [
"Method",
"that",
"attempts",
"to",
"break",
"a",
"string",
"up",
"into",
"lines",
"no",
"longer",
"than",
"the",
"specified",
"line",
"length",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/utilities/StringUtility.java#L42-L65 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/JavaBean.java | JavaBean.populate | public static void populate(Map<?,?> aValues, Object bean, PropertyConverter<Object, Object> valueConverter) {
"""
Support nested map objects
@param aValues the key/value properties
@param bean the object to write to
@param valueConverter the value converter strategy object
"""
Object key = null;
... | java | public static void populate(Map<?,?> aValues, Object bean, PropertyConverter<Object, Object> valueConverter)
{
Object key = null;
Object keyValue;
try
{
for(Map.Entry<?, ?> entry : aValues.entrySet())
{
key = entry.getKey();
keyValue = entry.getV... | [
"public",
"static",
"void",
"populate",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"aValues",
",",
"Object",
"bean",
",",
"PropertyConverter",
"<",
"Object",
",",
"Object",
">",
"valueConverter",
")",
"{",
"Object",
"key",
"=",
"null",
";",
"Object",
"keyValue... | Support nested map objects
@param aValues the key/value properties
@param bean the object to write to
@param valueConverter the value converter strategy object | [
"Support",
"nested",
"map",
"objects",
"@param",
"aValues",
"the",
"key",
"/",
"value",
"properties",
"@param",
"bean",
"the",
"object",
"to",
"write",
"to",
"@param",
"valueConverter",
"the",
"value",
"converter",
"strategy",
"object"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/JavaBean.java#L95-L131 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java | Hdf5Archive.getDataSets | public List<String> getDataSets(String... groups) {
"""
Get list of data sets from group path.
@param groups Array of zero or more ancestor groups from root to parent.
@return List of HDF5 data set names
"""
synchronized (Hdf5Archive.LOCK_OBJECT) {
if (groups.length == 0)
... | java | public List<String> getDataSets(String... groups) {
synchronized (Hdf5Archive.LOCK_OBJECT) {
if (groups.length == 0)
return getObjects(this.file, H5O_TYPE_DATASET);
Group[] groupArray = openGroups(groups);
List<String> ls = getObjects(groupArray[groupArray.len... | [
"public",
"List",
"<",
"String",
">",
"getDataSets",
"(",
"String",
"...",
"groups",
")",
"{",
"synchronized",
"(",
"Hdf5Archive",
".",
"LOCK_OBJECT",
")",
"{",
"if",
"(",
"groups",
".",
"length",
"==",
"0",
")",
"return",
"getObjects",
"(",
"this",
".",... | Get list of data sets from group path.
@param groups Array of zero or more ancestor groups from root to parent.
@return List of HDF5 data set names | [
"Get",
"list",
"of",
"data",
"sets",
"from",
"group",
"path",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java#L194-L203 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java | ManagedInstancesInner.beginCreateOrUpdate | public ManagedInstanceInner beginCreateOrUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) {
"""
Creates or updates a managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resourc... | java | public ManagedInstanceInner beginCreateOrUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).toBlocking().single().body();
} | [
"public",
"ManagedInstanceInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"ManagedInstanceInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"manag... | Creates or updates a managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param parameters The requested managed instance resource ... | [
"Creates",
"or",
"updates",
"a",
"managed",
"instance",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java#L511-L513 |
SG-O/miIO | src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java | Vacuum.setTimezone | public boolean setTimezone(TimeZone zone) throws CommandExecutionException {
"""
Set the vacuums timezone
@param zone The new timezone to set.
@return True if the command has been received successfully.
@throws CommandExecutionException When there has been a error during the communication or the response was in... | java | public boolean setTimezone(TimeZone zone) throws CommandExecutionException {
if (zone == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
JSONArray tz = new JSONArray();
tz.put(zone.getID());
return sendOk("set_timezone", tz);
} | [
"public",
"boolean",
"setTimezone",
"(",
"TimeZone",
"zone",
")",
"throws",
"CommandExecutionException",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"throw",
"new",
"CommandExecutionException",
"(",
"CommandExecutionException",
".",
"Error",
".",
"INVALID_PARAMETERS",
... | Set the vacuums timezone
@param zone The new timezone to set.
@return True if the command has been received successfully.
@throws CommandExecutionException When there has been a error during the communication or the response was invalid. | [
"Set",
"the",
"vacuums",
"timezone"
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java#L74-L79 |
netty/netty | common/src/main/java/io/netty/util/internal/NativeLibraryUtil.java | NativeLibraryUtil.loadLibrary | public static void loadLibrary(String libName, boolean absolute) {
"""
Delegate the calling to {@link System#load(String)} or {@link System#loadLibrary(String)}.
@param libName - The native library path or name
@param absolute - Whether the native library will be loaded by path or by name
"""
if (abs... | java | public static void loadLibrary(String libName, boolean absolute) {
if (absolute) {
System.load(libName);
} else {
System.loadLibrary(libName);
}
} | [
"public",
"static",
"void",
"loadLibrary",
"(",
"String",
"libName",
",",
"boolean",
"absolute",
")",
"{",
"if",
"(",
"absolute",
")",
"{",
"System",
".",
"load",
"(",
"libName",
")",
";",
"}",
"else",
"{",
"System",
".",
"loadLibrary",
"(",
"libName",
... | Delegate the calling to {@link System#load(String)} or {@link System#loadLibrary(String)}.
@param libName - The native library path or name
@param absolute - Whether the native library will be loaded by path or by name | [
"Delegate",
"the",
"calling",
"to",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/NativeLibraryUtil.java#L34-L40 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatter.java | DateTimeFormatter.printTo | public void printTo(Appendable appendable, ReadablePartial partial) throws IOException {
"""
Prints a ReadablePartial.
<p>
Neither the override chronology nor the override zone are used
by this method.
@param appendable the destination to format to, not null
@param partial partial to format
@since 2.0
... | java | public void printTo(Appendable appendable, ReadablePartial partial) throws IOException {
InternalPrinter printer = requirePrinter();
if (partial == null) {
throw new IllegalArgumentException("The partial must not be null");
}
printer.printTo(appendable, partial, iLocale);
... | [
"public",
"void",
"printTo",
"(",
"Appendable",
"appendable",
",",
"ReadablePartial",
"partial",
")",
"throws",
"IOException",
"{",
"InternalPrinter",
"printer",
"=",
"requirePrinter",
"(",
")",
";",
"if",
"(",
"partial",
"==",
"null",
")",
"{",
"throw",
"new"... | Prints a ReadablePartial.
<p>
Neither the override chronology nor the override zone are used
by this method.
@param appendable the destination to format to, not null
@param partial partial to format
@since 2.0 | [
"Prints",
"a",
"ReadablePartial",
".",
"<p",
">",
"Neither",
"the",
"override",
"chronology",
"nor",
"the",
"override",
"zone",
"are",
"used",
"by",
"this",
"method",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L650-L656 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/distance/impl/DistanceBetweenSolutionAndKNearestNeighbors.java | DistanceBetweenSolutionAndKNearestNeighbors.getDistance | @Override
public double getDistance(S solution, L solutionList) {
"""
Computes the knn distance. If the solution list size is lower than k, then k = size in the computation
@param solution
@param solutionList
@return
"""
List<Double> listOfDistances = knnDistances(solution, solutionList) ;
listOfD... | java | @Override
public double getDistance(S solution, L solutionList) {
List<Double> listOfDistances = knnDistances(solution, solutionList) ;
listOfDistances.sort(Comparator.naturalOrder());
int limit = Math.min(k, listOfDistances.size()) ;
double result ;
if (limit == 0) {
result = 0.0 ;
} ... | [
"@",
"Override",
"public",
"double",
"getDistance",
"(",
"S",
"solution",
",",
"L",
"solutionList",
")",
"{",
"List",
"<",
"Double",
">",
"listOfDistances",
"=",
"knnDistances",
"(",
"solution",
",",
"solutionList",
")",
";",
"listOfDistances",
".",
"sort",
... | Computes the knn distance. If the solution list size is lower than k, then k = size in the computation
@param solution
@param solutionList
@return | [
"Computes",
"the",
"knn",
"distance",
".",
"If",
"the",
"solution",
"list",
"size",
"is",
"lower",
"than",
"k",
"then",
"k",
"=",
"size",
"in",
"the",
"computation"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/distance/impl/DistanceBetweenSolutionAndKNearestNeighbors.java#L37-L55 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageContentHelper.java | PageContentHelper.addAllHeadlines | public static void addAllHeadlines(final PrintWriter writer, final Headers headers) {
"""
Shortcut method for adding all the headline entries stored in the WHeaders.
@param writer the writer to write to.
@param headers contains all the headline entries.
"""
PageContentHelper.addHeadlines(writer, headers.... | java | public static void addAllHeadlines(final PrintWriter writer, final Headers headers) {
PageContentHelper.addHeadlines(writer, headers.getHeadLines());
PageContentHelper.addJsHeadlines(writer, headers.getHeadLines(Headers.JAVASCRIPT_HEADLINE));
PageContentHelper.addCssHeadlines(writer, headers.getHeadLines(Headers.... | [
"public",
"static",
"void",
"addAllHeadlines",
"(",
"final",
"PrintWriter",
"writer",
",",
"final",
"Headers",
"headers",
")",
"{",
"PageContentHelper",
".",
"addHeadlines",
"(",
"writer",
",",
"headers",
".",
"getHeadLines",
"(",
")",
")",
";",
"PageContentHelp... | Shortcut method for adding all the headline entries stored in the WHeaders.
@param writer the writer to write to.
@param headers contains all the headline entries. | [
"Shortcut",
"method",
"for",
"adding",
"all",
"the",
"headline",
"entries",
"stored",
"in",
"the",
"WHeaders",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/PageContentHelper.java#L33-L37 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.printToFile | public static void printToFile(String filename, String message) {
"""
Prints to a file. If the file does not exist, rewrites the file;
does not append.
"""
printToFile(new File(filename), message, false);
} | java | public static void printToFile(String filename, String message) {
printToFile(new File(filename), message, false);
} | [
"public",
"static",
"void",
"printToFile",
"(",
"String",
"filename",
",",
"String",
"message",
")",
"{",
"printToFile",
"(",
"new",
"File",
"(",
"filename",
")",
",",
"message",
",",
"false",
")",
";",
"}"
] | Prints to a file. If the file does not exist, rewrites the file;
does not append. | [
"Prints",
"to",
"a",
"file",
".",
"If",
"the",
"file",
"does",
"not",
"exist",
"rewrites",
"the",
"file",
";",
"does",
"not",
"append",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L977-L979 |
kohsuke/com4j | runtime/src/main/java/com4j/COM4J.java | COM4J.getActiveObject | public static <T extends Com4jObject> T getActiveObject(Class<T> primaryInterface, String clsid ) {
"""
Gets an already object from the running object table.
@param <T> the type of the return value and the type parameter of the class object of primaryInterface
@param primaryInterface The returned COM object ... | java | public static <T extends Com4jObject> T getActiveObject(Class<T> primaryInterface, String clsid ) {
return getActiveObject(primaryInterface,new GUID(clsid));
} | [
"public",
"static",
"<",
"T",
"extends",
"Com4jObject",
">",
"T",
"getActiveObject",
"(",
"Class",
"<",
"T",
">",
"primaryInterface",
",",
"String",
"clsid",
")",
"{",
"return",
"getActiveObject",
"(",
"primaryInterface",
",",
"new",
"GUID",
"(",
"clsid",
")... | Gets an already object from the running object table.
@param <T> the type of the return value and the type parameter of the class object of primaryInterface
@param primaryInterface The returned COM object is returned as this interface.
Must be non-null. Passing in {@link Com4jObject} allows
the caller to create a new... | [
"Gets",
"an",
"already",
"object",
"from",
"the",
"running",
"object",
"table",
"."
] | train | https://github.com/kohsuke/com4j/blob/1e690b805fb0e4e9ef61560e20a56335aecb0b24/runtime/src/main/java/com4j/COM4J.java#L185-L187 |
molgenis/molgenis | molgenis-one-click-importer/src/main/java/org/molgenis/oneclickimporter/service/impl/CsvServiceImpl.java | CsvServiceImpl.validateCsvFile | private void validateCsvFile(List<String[]> content, String fileName) {
"""
Validates CSV file content.
<p>Checks that the content is not empty. Checks that at least one data row is present. Checks
that data row lengths are consistent with the header row length.
@param content content of CSV-file
@param fi... | java | private void validateCsvFile(List<String[]> content, String fileName) {
if (content.isEmpty()) {
throw new MolgenisDataException(format("CSV-file: [{0}] is empty", fileName));
}
if (content.size() == 1) {
throw new MolgenisDataException(
format("Header was found, but no data is presen... | [
"private",
"void",
"validateCsvFile",
"(",
"List",
"<",
"String",
"[",
"]",
">",
"content",
",",
"String",
"fileName",
")",
"{",
"if",
"(",
"content",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"MolgenisDataException",
"(",
"format",
"(",
"\"CSV... | Validates CSV file content.
<p>Checks that the content is not empty. Checks that at least one data row is present. Checks
that data row lengths are consistent with the header row length.
@param content content of CSV-file
@param fileName the name of the file that is validated
@throws MolgenisDataException if the vali... | [
"Validates",
"CSV",
"file",
"content",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-one-click-importer/src/main/java/org/molgenis/oneclickimporter/service/impl/CsvServiceImpl.java#L69-L87 |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/markdown/MarkdownParser.java | MarkdownParser.transformURLAnchor | @SuppressWarnings("static-method")
protected String transformURLAnchor(File file, String anchor, ReferenceContext references) {
"""
Transform the anchor of an URL from Markdown format to HTML format.
@param file the linked file.
@param anchor the anchor to transform.
@param references the set of references f... | java | @SuppressWarnings("static-method")
protected String transformURLAnchor(File file, String anchor, ReferenceContext references) {
String anc = anchor;
if (references != null) {
anc = references.validateAnchor(anc);
}
return anc;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"String",
"transformURLAnchor",
"(",
"File",
"file",
",",
"String",
"anchor",
",",
"ReferenceContext",
"references",
")",
"{",
"String",
"anc",
"=",
"anchor",
";",
"if",
"(",
"references",
"!="... | Transform the anchor of an URL from Markdown format to HTML format.
@param file the linked file.
@param anchor the anchor to transform.
@param references the set of references from the local document, or {@code null}.
@return the result of the transformation.
@since 0.7 | [
"Transform",
"the",
"anchor",
"of",
"an",
"URL",
"from",
"Markdown",
"format",
"to",
"HTML",
"format",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/markdown/MarkdownParser.java#L719-L726 |
apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/BigDecParser.java | BigDecParser.parseField | public static final BigDecimal parseField(byte[] bytes, int startPos, int length, char delimiter) {
"""
Static utility to parse a field of type BigDecimal from a byte sequence that represents text
characters
(such as when read from a file stream).
@param bytes The bytes containing the text data that shoul... | java | public static final BigDecimal parseField(byte[] bytes, int startPos, int length, char delimiter) {
if (length <= 0) {
throw new NumberFormatException("Invalid input: Empty string");
}
int i = 0;
final byte delByte = (byte) delimiter;
while (i < length && bytes[startPos + i] != delByte) {
i++;
}
i... | [
"public",
"static",
"final",
"BigDecimal",
"parseField",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"length",
",",
"char",
"delimiter",
")",
"{",
"if",
"(",
"length",
"<=",
"0",
")",
"{",
"throw",
"new",
"NumberFormatException",
... | Static utility to parse a field of type BigDecimal from a byte sequence that represents text
characters
(such as when read from a file stream).
@param bytes The bytes containing the text data that should be parsed.
@param startPos The offset to start the parsing.
@param length The length of the byte sequence (... | [
"Static",
"utility",
"to",
"parse",
"a",
"field",
"of",
"type",
"BigDecimal",
"from",
"a",
"byte",
"sequence",
"that",
"represents",
"text",
"characters",
"(",
"such",
"as",
"when",
"read",
"from",
"a",
"file",
"stream",
")",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/BigDecParser.java#L104-L129 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspImageBean.java | CmsJspImageBean.checkCropRegionContainsFocalPoint | private static boolean checkCropRegionContainsFocalPoint(CmsImageScaler scaler, CmsPoint focalPoint) {
"""
Helper method to check whether the focal point in the scaler is contained in the scaler's crop region.<p>
If the scaler has no crop region, true is returned.
@param scaler the scaler
@param focalPoint ... | java | private static boolean checkCropRegionContainsFocalPoint(CmsImageScaler scaler, CmsPoint focalPoint) {
if (!scaler.isCropping()) {
return true;
}
double x = focalPoint.getX();
double y = focalPoint.getY();
return (scaler.getCropX() <= x)
&& (x < (scaler.g... | [
"private",
"static",
"boolean",
"checkCropRegionContainsFocalPoint",
"(",
"CmsImageScaler",
"scaler",
",",
"CmsPoint",
"focalPoint",
")",
"{",
"if",
"(",
"!",
"scaler",
".",
"isCropping",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"double",
"x",
"=",
"f... | Helper method to check whether the focal point in the scaler is contained in the scaler's crop region.<p>
If the scaler has no crop region, true is returned.
@param scaler the scaler
@param focalPoint the focal point to check
@return true if the scaler's crop region contains the focal point | [
"Helper",
"method",
"to",
"check",
"whether",
"the",
"focal",
"point",
"in",
"the",
"scaler",
"is",
"contained",
"in",
"the",
"scaler",
"s",
"crop",
"region",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspImageBean.java#L344-L355 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java | ExtraLanguagePreferenceAccess.getString | public String getString(String preferenceContainerID, IProject project, String preferenceName) {
"""
Replies the preference value.
<p>This function takes care of the specific options that are associated to the given project.
If the given project is {@code null} or has no specific options, according to
{@link ... | java | public String getString(String preferenceContainerID, IProject project, String preferenceName) {
final IProject prj = ifSpecificConfiguration(preferenceContainerID, project);
final IPreferenceStore store = getPreferenceStore(prj);
return getString(store, preferenceContainerID, preferenceName);
} | [
"public",
"String",
"getString",
"(",
"String",
"preferenceContainerID",
",",
"IProject",
"project",
",",
"String",
"preferenceName",
")",
"{",
"final",
"IProject",
"prj",
"=",
"ifSpecificConfiguration",
"(",
"preferenceContainerID",
",",
"project",
")",
";",
"final... | Replies the preference value.
<p>This function takes care of the specific options that are associated to the given project.
If the given project is {@code null} or has no specific options, according to
{@link #ifSpecificConfiguration(String, IProject)}, then the global preferences are used.
@param preferenceContainer... | [
"Replies",
"the",
"preference",
"value",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java#L138-L142 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.sendInstantiationProposal | public Collection<ProposalResponse> sendInstantiationProposal(InstantiateProposalRequest instantiateProposalRequest,
Collection<Peer> peers) throws InvalidArgumentException, ProposalException {
"""
Send instantiate request to the channel. Chaincode ... | java | public Collection<ProposalResponse> sendInstantiationProposal(InstantiateProposalRequest instantiateProposalRequest,
Collection<Peer> peers) throws InvalidArgumentException, ProposalException {
checkChannelState();
if (null == instantiate... | [
"public",
"Collection",
"<",
"ProposalResponse",
">",
"sendInstantiationProposal",
"(",
"InstantiateProposalRequest",
"instantiateProposalRequest",
",",
"Collection",
"<",
"Peer",
">",
"peers",
")",
"throws",
"InvalidArgumentException",
",",
"ProposalException",
"{",
"check... | Send instantiate request to the channel. Chaincode is created and initialized.
@param instantiateProposalRequest
@param peers
@return responses from peers.
@throws InvalidArgumentException
@throws ProposalException
@deprecated See new lifecycle chaincode management. {@link LifecycleInstallChaincodeRequest} | [
"Send",
"instantiate",
"request",
"to",
"the",
"channel",
".",
"Chaincode",
"is",
"created",
"and",
"initialized",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L2445-L2477 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.deleteJob | public void deleteJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Deletes the specified job.
@param jobId The ID of the job.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service ... | java | public void deleteJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
JobDeleteOptions options = new JobDeleteOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
bhMgr.applyRequestBehavior... | [
"public",
"void",
"deleteJob",
"(",
"String",
"jobId",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"JobDeleteOptions",
"options",
"=",
"new",
"JobDeleteOptions",
"(",
")",
";... | Deletes the specified job.
@param jobId The ID of the job.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOException Exceptio... | [
"Deletes",
"the",
"specified",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L343-L349 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/message/SQSMessage.java | SQSMessage.setStringProperty | @Override
public void setStringProperty(String name, String value) throws JMSException {
"""
Sets a <code>String</code> property value with the specified name into
the message.
@param name
The name of the property to set.
@param value
The <code>String</code> value of the property to set.
@throws JMSExc... | java | @Override
public void setStringProperty(String name, String value) throws JMSException {
setObjectProperty(name, value);
} | [
"@",
"Override",
"public",
"void",
"setStringProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"JMSException",
"{",
"setObjectProperty",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Sets a <code>String</code> property value with the specified name into
the message.
@param name
The name of the property to set.
@param value
The <code>String</code> value of the property to set.
@throws JMSException
On internal error.
@throws IllegalArgumentException
If the name or value is null or empty string.
@thr... | [
"Sets",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"property",
"value",
"with",
"the",
"specified",
"name",
"into",
"the",
"message",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/message/SQSMessage.java#L877-L880 |
rterp/GMapsFX | GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptRuntime.java | JavascriptRuntime.getFunction | @Override
public String getFunction(String function, Object... args) {
"""
Gets a function as a String, which then can be passed to the execute()
method.
@param function The function to invoke
@param args Arguments the function requires
@return A string which can be passed to the JavaScript environment t... | java | @Override
public String getFunction(String function, Object... args) {
if (args == null) {
return function + "();";
}
StringBuilder sb = new StringBuilder();
sb.append(function).append("(");
for (Object arg : args) {
sb.append(getArgString(arg)).append... | [
"@",
"Override",
"public",
"String",
"getFunction",
"(",
"String",
"function",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"args",
"==",
"null",
")",
"{",
"return",
"function",
"+",
"\"();\"",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBu... | Gets a function as a String, which then can be passed to the execute()
method.
@param function The function to invoke
@param args Arguments the function requires
@return A string which can be passed to the JavaScript environment to
invoke the function | [
"Gets",
"a",
"function",
"as",
"a",
"String",
"which",
"then",
"can",
"be",
"passed",
"to",
"the",
"execute",
"()",
"method",
"."
] | train | https://github.com/rterp/GMapsFX/blob/4623d3f768e8ad78fc50ee32dd204d236e01059f/GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptRuntime.java#L123-L136 |
santhosh-tekuri/jlibs | swing/src/main/java/jlibs/swing/SwingUtil.java | SwingUtil.setInitialFocus | public static void setInitialFocus(Window window, final Component comp) {
"""
sets intial focus in window to the specified component
@param window window on which focus has to be set
@param comp component which need to have initial focus
"""
window.addWindowFocusListener(new WindowAdapter()... | java | public static void setInitialFocus(Window window, final Component comp){
window.addWindowFocusListener(new WindowAdapter(){
@Override
public void windowGainedFocus(WindowEvent we){
comp.requestFocusInWindow();
we.getWindow().removeWindowFocusListener(this)... | [
"public",
"static",
"void",
"setInitialFocus",
"(",
"Window",
"window",
",",
"final",
"Component",
"comp",
")",
"{",
"window",
".",
"addWindowFocusListener",
"(",
"new",
"WindowAdapter",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"windowGainedFocus",
"(",... | sets intial focus in window to the specified component
@param window window on which focus has to be set
@param comp component which need to have initial focus | [
"sets",
"intial",
"focus",
"in",
"window",
"to",
"the",
"specified",
"component"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/swing/src/main/java/jlibs/swing/SwingUtil.java#L40-L48 |
molgenis/molgenis | molgenis-data/src/main/java/org/molgenis/data/meta/model/Attribute.java | Attribute.getRange | public Range getRange() {
"""
For int and long fields, the value must be between min and max (included) of the range
@return attribute value range
"""
Long rangeMin = getRangeMin();
Long rangeMax = getRangeMax();
return rangeMin != null || rangeMax != null ? new Range(rangeMin, rangeMax) : null;... | java | public Range getRange() {
Long rangeMin = getRangeMin();
Long rangeMax = getRangeMax();
return rangeMin != null || rangeMax != null ? new Range(rangeMin, rangeMax) : null;
} | [
"public",
"Range",
"getRange",
"(",
")",
"{",
"Long",
"rangeMin",
"=",
"getRangeMin",
"(",
")",
";",
"Long",
"rangeMax",
"=",
"getRangeMax",
"(",
")",
";",
"return",
"rangeMin",
"!=",
"null",
"||",
"rangeMax",
"!=",
"null",
"?",
"new",
"Range",
"(",
"r... | For int and long fields, the value must be between min and max (included) of the range
@return attribute value range | [
"For",
"int",
"and",
"long",
"fields",
"the",
"value",
"must",
"be",
"between",
"min",
"and",
"max",
"(",
"included",
")",
"of",
"the",
"range"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data/src/main/java/org/molgenis/data/meta/model/Attribute.java#L609-L613 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/widgets/CmsDisplayTypeSelectWidget.java | CmsDisplayTypeSelectWidget.replaceItems | private void replaceItems(Map<String, String> items) {
"""
Replaces the select items with the given items.<p>
@param items the select items
"""
String oldValue = m_selectBox.getFormValueAsString();
//set value and option to the combo box.
m_selectBox.setItems(items);
if (ite... | java | private void replaceItems(Map<String, String> items) {
String oldValue = m_selectBox.getFormValueAsString();
//set value and option to the combo box.
m_selectBox.setItems(items);
if (items.containsKey(oldValue)) {
m_selectBox.setFormValueAsString(oldValue);
}
} | [
"private",
"void",
"replaceItems",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"items",
")",
"{",
"String",
"oldValue",
"=",
"m_selectBox",
".",
"getFormValueAsString",
"(",
")",
";",
"//set value and option to the combo box.",
"m_selectBox",
".",
"setItems",
"... | Replaces the select items with the given items.<p>
@param items the select items | [
"Replaces",
"the",
"select",
"items",
"with",
"the",
"given",
"items",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/CmsDisplayTypeSelectWidget.java#L307-L315 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.pingTxnBody | CompletableFuture<PingTxnStatus> pingTxnBody(final String scope,
final String stream,
final UUID txnId,
final long lease,
fi... | java | CompletableFuture<PingTxnStatus> pingTxnBody(final String scope,
final String stream,
final UUID txnId,
final long lease,
fi... | [
"CompletableFuture",
"<",
"PingTxnStatus",
">",
"pingTxnBody",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"UUID",
"txnId",
",",
"final",
"long",
"lease",
",",
"final",
"OperationContext",
"ctx",
")",
"{",
"if",
"(",
"!",... | Ping a txn thereby updating its timeout to current time + lease.
Post-condition:
1. If ping request completes successfully, then
(a) txn timeout is set to lease + current time in timeout service,
(b) txn version in timeout service equals version of txn node in store,
(c) if txn's timeout was not previously tracked in ... | [
"Ping",
"a",
"txn",
"thereby",
"updating",
"its",
"timeout",
"to",
"current",
"time",
"+",
"lease",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L418-L429 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CertSelector.java | X509CertSelector.setNameConstraints | public void setNameConstraints(byte[] bytes) throws IOException {
"""
Sets the name constraints criterion. The {@code X509Certificate}
must have subject and subject alternative names that
meet the specified name constraints.
<p>
The name constraints are specified as a byte array. This byte array
should contai... | java | public void setNameConstraints(byte[] bytes) throws IOException {
if (bytes == null) {
ncBytes = null;
nc = null;
} else {
ncBytes = bytes.clone();
nc = new NameConstraintsExtension(FALSE, bytes);
}
} | [
"public",
"void",
"setNameConstraints",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"{",
"ncBytes",
"=",
"null",
";",
"nc",
"=",
"null",
";",
"}",
"else",
"{",
"ncBytes",
"=",
"bytes",
"."... | Sets the name constraints criterion. The {@code X509Certificate}
must have subject and subject alternative names that
meet the specified name constraints.
<p>
The name constraints are specified as a byte array. This byte array
should contain the DER encoded form of the name constraints, as they
would appear in the Name... | [
"Sets",
"the",
"name",
"constraints",
"criterion",
".",
"The",
"{",
"@code",
"X509Certificate",
"}",
"must",
"have",
"subject",
"and",
"subject",
"alternative",
"names",
"that",
"meet",
"the",
"specified",
"name",
"constraints",
".",
"<p",
">",
"The",
"name",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CertSelector.java#L1040-L1048 |
hdecarne/java-default | src/main/java/de/carne/util/Strings.java | Strings.encodeHtml | public static StringBuilder encodeHtml(StringBuilder buffer, CharSequence chars) {
"""
Encodes a {@linkplain CharSequence} to a HTML conform representation by quoting special characters.
@param buffer the {@linkplain StringBuilder} to encode into.
@param chars the {@linkplain CharSequence} to encode.
@return ... | java | public static StringBuilder encodeHtml(StringBuilder buffer, CharSequence chars) {
chars.chars().forEach(c -> {
switch (c) {
case '<':
buffer.append("<");
break;
case '>':
buffer.append(">");
break;
case '&':
buffer.append("&");
break;
case '"':
buffer.append("&quo... | [
"public",
"static",
"StringBuilder",
"encodeHtml",
"(",
"StringBuilder",
"buffer",
",",
"CharSequence",
"chars",
")",
"{",
"chars",
".",
"chars",
"(",
")",
".",
"forEach",
"(",
"c",
"->",
"{",
"switch",
"(",
"c",
")",
"{",
"case",
"'",
"'",
":",
"buffe... | Encodes a {@linkplain CharSequence} to a HTML conform representation by quoting special characters.
@param buffer the {@linkplain StringBuilder} to encode into.
@param chars the {@linkplain CharSequence} to encode.
@return the encoded characters. | [
"Encodes",
"a",
"{",
"@linkplain",
"CharSequence",
"}",
"to",
"a",
"HTML",
"conform",
"representation",
"by",
"quoting",
"special",
"characters",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/util/Strings.java#L424-L451 |
killbill/killbill | profiles/killbill/src/main/java/org/killbill/billing/server/log/obfuscators/Obfuscator.java | Obfuscator.obfuscateConfidentialData | @VisibleForTesting
String obfuscateConfidentialData(final CharSequence confidentialSequence, @Nullable final CharSequence unmasked) {
"""
Get a mask string for masking the given `confidentialSequence`.
@param confidentialSequence the string to be obfuscated
@param unmasked the section of `confi... | java | @VisibleForTesting
String obfuscateConfidentialData(final CharSequence confidentialSequence, @Nullable final CharSequence unmasked) {
final int maskedLength = unmasked == null ? confidentialSequence.length() : confidentialSequence.length() - unmasked.length();
return new String(new char[maskedLength... | [
"@",
"VisibleForTesting",
"String",
"obfuscateConfidentialData",
"(",
"final",
"CharSequence",
"confidentialSequence",
",",
"@",
"Nullable",
"final",
"CharSequence",
"unmasked",
")",
"{",
"final",
"int",
"maskedLength",
"=",
"unmasked",
"==",
"null",
"?",
"confidentia... | Get a mask string for masking the given `confidentialSequence`.
@param confidentialSequence the string to be obfuscated
@param unmasked the section of `confidentialSequence` to be left unmasked
@return a mask string | [
"Get",
"a",
"mask",
"string",
"for",
"masking",
"the",
"given",
"confidentialSequence",
"."
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/profiles/killbill/src/main/java/org/killbill/billing/server/log/obfuscators/Obfuscator.java#L101-L105 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.minLimit | private int minLimit(int input, int min) {
"""
Return the larger value of either the input int or the minimum
limit.
@param input
@param min
@return int
"""
if (input < min) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Config: " + ... | java | private int minLimit(int input, int min) {
if (input < min) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Config: " + input + " too small.");
}
return min;
}
return input;
} | [
"private",
"int",
"minLimit",
"(",
"int",
"input",
",",
"int",
"min",
")",
"{",
"if",
"(",
"input",
"<",
"min",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
... | Return the larger value of either the input int or the minimum
limit.
@param input
@param min
@return int | [
"Return",
"the",
"larger",
"value",
"of",
"either",
"the",
"input",
"int",
"or",
"the",
"minimum",
"limit",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L1510-L1518 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/mojo/RamlCompilerMojo.java | RamlCompilerMojo.controllerParsed | @Override
public void controllerParsed(File source, ControllerModel<Raml> model) throws WatchingException {
"""
Generate the raml file from a given controller source file.
@param source The controller source file.
@param model The controller model
@throws WatchingException If there is a problem while cre... | java | @Override
public void controllerParsed(File source, ControllerModel<Raml> model) throws WatchingException {
Raml raml = new Raml(); //Create a new raml file
raml.setBaseUri(baseUri); //set the base uri
raml.setVersion(project().getVersion());
//Visit the controller model to populate... | [
"@",
"Override",
"public",
"void",
"controllerParsed",
"(",
"File",
"source",
",",
"ControllerModel",
"<",
"Raml",
">",
"model",
")",
"throws",
"WatchingException",
"{",
"Raml",
"raml",
"=",
"new",
"Raml",
"(",
")",
";",
"//Create a new raml file",
"raml",
"."... | Generate the raml file from a given controller source file.
@param source The controller source file.
@param model The controller model
@throws WatchingException If there is a problem while creating the raml file. | [
"Generate",
"the",
"raml",
"file",
"from",
"a",
"given",
"controller",
"source",
"file",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/mojo/RamlCompilerMojo.java#L85-L106 |
rzwitserloot/lombok | src/core/lombok/javac/handlers/JavacHandlerUtil.java | JavacHandlerUtil.fieldExists | public static MemberExistsResult fieldExists(String fieldName, JavacNode node) {
"""
Checks if there is a field with the provided name.
@param fieldName the field name to check for.
@param node Any node that represents the Type (JCClassDecl) to look in, or any child node thereof.
"""
node = upToTypeNode(... | java | public static MemberExistsResult fieldExists(String fieldName, JavacNode node) {
node = upToTypeNode(node);
if (node != null && node.get() instanceof JCClassDecl) {
for (JCTree def : ((JCClassDecl)node.get()).defs) {
if (def instanceof JCVariableDecl) {
if (((JCVariableDecl)def).name.contentEquals(fi... | [
"public",
"static",
"MemberExistsResult",
"fieldExists",
"(",
"String",
"fieldName",
",",
"JavacNode",
"node",
")",
"{",
"node",
"=",
"upToTypeNode",
"(",
"node",
")",
";",
"if",
"(",
"node",
"!=",
"null",
"&&",
"node",
".",
"get",
"(",
")",
"instanceof",
... | Checks if there is a field with the provided name.
@param fieldName the field name to check for.
@param node Any node that represents the Type (JCClassDecl) to look in, or any child node thereof. | [
"Checks",
"if",
"there",
"is",
"a",
"field",
"with",
"the",
"provided",
"name",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/handlers/JavacHandlerUtil.java#L705-L719 |
jtmelton/appsensor | analysis-engines/appsensor-analysis-rules/src/main/java/org/owasp/appsensor/analysis/AggregateEventAnalysisEngine.java | AggregateEventAnalysisEngine.getQueueInterval | public Interval getQueueInterval(Queue<Event> queue, Event tailEvent) {
"""
Determines the time between the {@link Event} at the head of the queue and the
{@link Event} at the tail of the queue.
@param queue a queue of {@link Event}s
@param tailEvent the {@link Event} at the tail of the queue
@return the dur... | java | public Interval getQueueInterval(Queue<Event> queue, Event tailEvent) {
DateTime endTime = DateUtils.fromString(tailEvent.getTimestamp());
DateTime startTime = DateUtils.fromString(queue.peek().getTimestamp());
return new Interval((int)endTime.minus(startTime.getMillis()).getMillis(), "milliseconds");
} | [
"public",
"Interval",
"getQueueInterval",
"(",
"Queue",
"<",
"Event",
">",
"queue",
",",
"Event",
"tailEvent",
")",
"{",
"DateTime",
"endTime",
"=",
"DateUtils",
".",
"fromString",
"(",
"tailEvent",
".",
"getTimestamp",
"(",
")",
")",
";",
"DateTime",
"start... | Determines the time between the {@link Event} at the head of the queue and the
{@link Event} at the tail of the queue.
@param queue a queue of {@link Event}s
@param tailEvent the {@link Event} at the tail of the queue
@return the duration of the queue as an {@link Interval} | [
"Determines",
"the",
"time",
"between",
"the",
"{",
"@link",
"Event",
"}",
"at",
"the",
"head",
"of",
"the",
"queue",
"and",
"the",
"{",
"@link",
"Event",
"}",
"at",
"the",
"tail",
"of",
"the",
"queue",
"."
] | train | https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/analysis-engines/appsensor-analysis-rules/src/main/java/org/owasp/appsensor/analysis/AggregateEventAnalysisEngine.java#L241-L246 |
beangle/beangle3 | struts/s2/src/main/java/org/beangle/struts2/view/component/Component.java | Component.findValue | protected Object findValue(String expr, String field, String errorMsg) {
"""
Evaluates the OGNL stack to find an Object value.
<p/>
Function just like <code>findValue(String)</code> except that if the given expression is
<tt>null</tt/> a error is logged and a <code>RuntimeException</code> is thrown constructed ... | java | protected Object findValue(String expr, String field, String errorMsg) {
if (expr == null) {
throw fieldError(field, errorMsg, null);
} else {
Object value = null;
Exception problem = null;
try {
value = findValue(expr);
} catch (Exception e) {
problem = e;
}
... | [
"protected",
"Object",
"findValue",
"(",
"String",
"expr",
",",
"String",
"field",
",",
"String",
"errorMsg",
")",
"{",
"if",
"(",
"expr",
"==",
"null",
")",
"{",
"throw",
"fieldError",
"(",
"field",
",",
"errorMsg",
",",
"null",
")",
";",
"}",
"else",... | Evaluates the OGNL stack to find an Object value.
<p/>
Function just like <code>findValue(String)</code> except that if the given expression is
<tt>null</tt/> a error is logged and a <code>RuntimeException</code> is thrown constructed with
a messaged based on the given field and errorMsg paramter.
@param expr
OGNL exp... | [
"Evaluates",
"the",
"OGNL",
"stack",
"to",
"find",
"an",
"Object",
"value",
".",
"<p",
"/",
">",
"Function",
"just",
"like",
"<code",
">",
"findValue",
"(",
"String",
")",
"<",
"/",
"code",
">",
"except",
"that",
"if",
"the",
"given",
"expression",
"is... | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/struts/s2/src/main/java/org/beangle/struts2/view/component/Component.java#L328-L344 |
undertow-io/undertow | core/src/main/java/io/undertow/util/ETagUtils.java | ETagUtils.handleIfNoneMatch | public static boolean handleIfNoneMatch(final HttpServerExchange exchange, final ETag etag, boolean allowWeak) {
"""
Handles the if-none-match header. returns true if the request should proceed, false otherwise
@param exchange the exchange
@param etag The etags
@return
"""
return handleIfNoneMa... | java | public static boolean handleIfNoneMatch(final HttpServerExchange exchange, final ETag etag, boolean allowWeak) {
return handleIfNoneMatch(exchange, Collections.singletonList(etag), allowWeak);
} | [
"public",
"static",
"boolean",
"handleIfNoneMatch",
"(",
"final",
"HttpServerExchange",
"exchange",
",",
"final",
"ETag",
"etag",
",",
"boolean",
"allowWeak",
")",
"{",
"return",
"handleIfNoneMatch",
"(",
"exchange",
",",
"Collections",
".",
"singletonList",
"(",
... | Handles the if-none-match header. returns true if the request should proceed, false otherwise
@param exchange the exchange
@param etag The etags
@return | [
"Handles",
"the",
"if",
"-",
"none",
"-",
"match",
"header",
".",
"returns",
"true",
"if",
"the",
"request",
"should",
"proceed",
"false",
"otherwise"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/ETagUtils.java#L111-L113 |
dasein-cloud/dasein-cloud-aws | src/main/java/org/dasein/cloud/aws/platform/RDS.java | RDS.getWindowString | private String getWindowString(TimeWindow window, boolean includeDays) {
"""
Formats a time window as hh24:mi-hh24:mi or ddd:hh24:mi-ddd:hh24:mi
@param window
@param includeDays must be false for PreferredBackupWindow parameter
@return formatted time window text representation
"""
StringBuilder str ... | java | private String getWindowString(TimeWindow window, boolean includeDays) {
StringBuilder str = new StringBuilder();
if( includeDays ) {
if( window.getStartDayOfWeek() == null ) {
str.append("*");
}
else {
str.append(window.getStartDayOfWe... | [
"private",
"String",
"getWindowString",
"(",
"TimeWindow",
"window",
",",
"boolean",
"includeDays",
")",
"{",
"StringBuilder",
"str",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"includeDays",
")",
"{",
"if",
"(",
"window",
".",
"getStartDayOfWeek",... | Formats a time window as hh24:mi-hh24:mi or ddd:hh24:mi-ddd:hh24:mi
@param window
@param includeDays must be false for PreferredBackupWindow parameter
@return formatted time window text representation | [
"Formats",
"a",
"time",
"window",
"as",
"hh24",
":",
"mi",
"-",
"hh24",
":",
"mi",
"or",
"ddd",
":",
"hh24",
":",
"mi",
"-",
"ddd",
":",
"hh24",
":",
"mi"
] | train | https://github.com/dasein-cloud/dasein-cloud-aws/blob/05098574197a1f573f77447cadc39a76bf00b99d/src/main/java/org/dasein/cloud/aws/platform/RDS.java#L173-L197 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionHandler.java | SuppressionHandler.endElement | @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
"""
Handles the end element event.
@param uri the URI of the element
@param localName the local name of the element
@param qName the qName of the element
@throws SAXException thrown if there is an exception... | java | @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (null != qName) {
switch (qName) {
case SUPPRESS:
if (rule.getUntil() != null && rule.getUntil().before(Calendar.getInstance())) {
LOG... | [
"@",
"Override",
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"null",
"!=",
"qName",
")",
"{",
"switch",
"(",
"qName",
")",
"{",
"case",
"SUPPRESS... | Handles the end element event.
@param uri the URI of the element
@param localName the local name of the element
@param qName the qName of the element
@throws SAXException thrown if there is an exception processing | [
"Handles",
"the",
"end",
"element",
"event",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionHandler.java#L150-L191 |
jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/Server.java | Server.getEnvironment | @JsonIgnore
public ImmutableMap<String, ?> getEnvironment() {
"""
Generates the proper username/password environment for JMX connections.
"""
if (getProtocolProviderPackages() != null && getProtocolProviderPackages().contains("weblogic")) {
ImmutableMap.Builder<String, String> environment = ImmutableMap.... | java | @JsonIgnore
public ImmutableMap<String, ?> getEnvironment() {
if (getProtocolProviderPackages() != null && getProtocolProviderPackages().contains("weblogic")) {
ImmutableMap.Builder<String, String> environment = ImmutableMap.builder();
if ((username != null) && (password != null)) {
environment.put(PROTOCO... | [
"@",
"JsonIgnore",
"public",
"ImmutableMap",
"<",
"String",
",",
"?",
">",
"getEnvironment",
"(",
")",
"{",
"if",
"(",
"getProtocolProviderPackages",
"(",
")",
"!=",
"null",
"&&",
"getProtocolProviderPackages",
"(",
")",
".",
"contains",
"(",
"\"weblogic\"",
"... | Generates the proper username/password environment for JMX connections. | [
"Generates",
"the",
"proper",
"username",
"/",
"password",
"environment",
"for",
"JMX",
"connections",
"."
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/Server.java#L305-L337 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/roles/PassiveRole.java | PassiveRole.completeAppend | protected boolean completeAppend(boolean succeeded, long lastLogIndex, CompletableFuture<AppendResponse> future) {
"""
Returns a successful append response.
@param succeeded whether the append succeeded
@param lastLogIndex the last log index
@param future the append response future
@return the appen... | java | protected boolean completeAppend(boolean succeeded, long lastLogIndex, CompletableFuture<AppendResponse> future) {
future.complete(logResponse(AppendResponse.builder()
.withStatus(RaftResponse.Status.OK)
.withTerm(raft.getTerm())
.withSucceeded(succeeded)
.withLastLogIndex(lastLogInd... | [
"protected",
"boolean",
"completeAppend",
"(",
"boolean",
"succeeded",
",",
"long",
"lastLogIndex",
",",
"CompletableFuture",
"<",
"AppendResponse",
">",
"future",
")",
"{",
"future",
".",
"complete",
"(",
"logResponse",
"(",
"AppendResponse",
".",
"builder",
"(",... | Returns a successful append response.
@param succeeded whether the append succeeded
@param lastLogIndex the last log index
@param future the append response future
@return the append response status | [
"Returns",
"a",
"successful",
"append",
"response",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/PassiveRole.java#L362-L370 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FSInputChecker.java | FSInputChecker.read1 | private int read1(byte b[], int off, int len)
throws IOException {
"""
/*
Read characters into a portion of an array, reading from the underlying
stream at most once if necessary.
"""
int avail = count-pos;
if( avail <= 0 ) {
if(len>=buf.length) {
// read a chunk to user buffer direct... | java | private int read1(byte b[], int off, int len)
throws IOException {
int avail = count-pos;
if( avail <= 0 ) {
if(len>=buf.length) {
// read a chunk to user buffer directly; avoid one copy
int nread = readChecksumChunk(b, off, len);
return nread;
} else {
// read a ch... | [
"private",
"int",
"read1",
"(",
"byte",
"b",
"[",
"]",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"avail",
"=",
"count",
"-",
"pos",
";",
"if",
"(",
"avail",
"<=",
"0",
")",
"{",
"if",
"(",
"len",
">=",
"buf... | /*
Read characters into a portion of an array, reading from the underlying
stream at most once if necessary. | [
"/",
"*",
"Read",
"characters",
"into",
"a",
"portion",
"of",
"an",
"array",
"reading",
"from",
"the",
"underlying",
"stream",
"at",
"most",
"once",
"if",
"necessary",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FSInputChecker.java#L183-L207 |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/oreilly/multipart/FilePart.java | FilePart.writeTo | public long writeTo(File fileOrDirectory) throws IOException {
"""
Write this file part to a file or directory. If the user
supplied a file, we write it to that file, and if they supplied
a directory, we write it to that directory with the filename
that accompanied it. If this part doesn't contain a file this
... | java | public long writeTo(File fileOrDirectory) throws IOException {
long written = 0;
OutputStream fileOut = null;
try {
// Only do something if this part contains a file
if (fileName != null) {
// Check if user supplied directory
File file;
if (fileOrDirectory.isDirector... | [
"public",
"long",
"writeTo",
"(",
"File",
"fileOrDirectory",
")",
"throws",
"IOException",
"{",
"long",
"written",
"=",
"0",
";",
"OutputStream",
"fileOut",
"=",
"null",
";",
"try",
"{",
"// Only do something if this part contains a file",
"if",
"(",
"fileName",
"... | Write this file part to a file or directory. If the user
supplied a file, we write it to that file, and if they supplied
a directory, we write it to that directory with the filename
that accompanied it. If this part doesn't contain a file this
method does nothing.
@return number of bytes written
@exception IOException... | [
"Write",
"this",
"file",
"part",
"to",
"a",
"file",
"or",
"directory",
".",
"If",
"the",
"user",
"supplied",
"a",
"file",
"we",
"write",
"it",
"to",
"that",
"file",
"and",
"if",
"they",
"supplied",
"a",
"directory",
"we",
"write",
"it",
"to",
"that",
... | train | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/oreilly/multipart/FilePart.java#L143-L174 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/Timebase.java | Timebase.resample | public long resample(final long samples, final Timebase oldRate, boolean failOnPrecisionLoss) throws ResamplingException {
"""
Convert a sample count from one timebase to another<br />
Note that this may result in data loss due to rounding.
@param samples
@param oldRate
@param failOnPrecisionLoss
if true, p... | java | public long resample(final long samples, final Timebase oldRate, boolean failOnPrecisionLoss) throws ResamplingException
{
final double resampled = resample((double) samples, oldRate);
final double rounded = Math.round(resampled);
// Warn about significant loss of precision
if (resampled != rounded && Math.ab... | [
"public",
"long",
"resample",
"(",
"final",
"long",
"samples",
",",
"final",
"Timebase",
"oldRate",
",",
"boolean",
"failOnPrecisionLoss",
")",
"throws",
"ResamplingException",
"{",
"final",
"double",
"resampled",
"=",
"resample",
"(",
"(",
"double",
")",
"sampl... | Convert a sample count from one timebase to another<br />
Note that this may result in data loss due to rounding.
@param samples
@param oldRate
@param failOnPrecisionLoss
if true, precision losing operations will fail by throwing a PrecisionLostException
@return | [
"Convert",
"a",
"sample",
"count",
"from",
"one",
"timebase",
"to",
"another<br",
"/",
">",
"Note",
"that",
"this",
"may",
"result",
"in",
"data",
"loss",
"due",
"to",
"rounding",
"."
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/Timebase.java#L200-L236 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.removeBlank | public static <T extends CharSequence> T[] removeBlank(T[] array) {
"""
去除{@code null}或者""或者空白字符串 元素
@param array 数组
@return 处理后的数组
@since 3.2.2
"""
return filter(array, new Filter<T>() {
@Override
public boolean accept(T t) {
return false == StrUtil.isBlank(t);
}
});
} | java | public static <T extends CharSequence> T[] removeBlank(T[] array) {
return filter(array, new Filter<T>() {
@Override
public boolean accept(T t) {
return false == StrUtil.isBlank(t);
}
});
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"[",
"]",
"removeBlank",
"(",
"T",
"[",
"]",
"array",
")",
"{",
"return",
"filter",
"(",
"array",
",",
"new",
"Filter",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boo... | 去除{@code null}或者""或者空白字符串 元素
@param array 数组
@return 处理后的数组
@since 3.2.2 | [
"去除",
"{",
"@code",
"null",
"}",
"或者",
"或者空白字符串",
"元素"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L814-L821 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/store/SQLiteViewStore.java | SQLiteViewStore.groupKey | public static Object groupKey(Object key, int groupLevel) {
"""
Returns the prefix of the key to use in the result row, at this groupLevel
"""
if (groupLevel > 0 && (key instanceof List) && (((List<Object>) key).size() > groupLevel)) {
return ((List<Object>) key).subList(0, groupLevel);
... | java | public static Object groupKey(Object key, int groupLevel) {
if (groupLevel > 0 && (key instanceof List) && (((List<Object>) key).size() > groupLevel)) {
return ((List<Object>) key).subList(0, groupLevel);
} else {
return key;
}
} | [
"public",
"static",
"Object",
"groupKey",
"(",
"Object",
"key",
",",
"int",
"groupLevel",
")",
"{",
"if",
"(",
"groupLevel",
">",
"0",
"&&",
"(",
"key",
"instanceof",
"List",
")",
"&&",
"(",
"(",
"(",
"List",
"<",
"Object",
">",
")",
"key",
")",
".... | Returns the prefix of the key to use in the result row, at this groupLevel | [
"Returns",
"the",
"prefix",
"of",
"the",
"key",
"to",
"use",
"in",
"the",
"result",
"row",
"at",
"this",
"groupLevel"
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/store/SQLiteViewStore.java#L1138-L1144 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.toHexBytes | public static String toHexBytes(byte[] bytes, int offset, int length) {
"""
Converts the given bytes into a hexadecimal representation. bytes[offset] through
bytes[offset + length - 1] are converted, although the given array's length is
never exceeded.
@param offset Index of first byte to convert.
@param ... | java | public static String toHexBytes(byte[] bytes, int offset, int length) {
StringBuilder builder = new StringBuilder();
for (int index = offset; index < bytes.length && index < (offset + length); index++) {
byte b = bytes[index];
int first = (b >> 4) & 15;
int secon... | [
"public",
"static",
"String",
"toHexBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"index",
"=",
"offset",
";",
"i... | Converts the given bytes into a hexadecimal representation. bytes[offset] through
bytes[offset + length - 1] are converted, although the given array's length is
never exceeded.
@param offset Index of first byte to convert.
@param length Number of bytes to convert.
@param bytes Source bytes.
@return ... | [
"Converts",
"the",
"given",
"bytes",
"into",
"a",
"hexadecimal",
"representation",
".",
"bytes",
"[",
"offset",
"]",
"through",
"bytes",
"[",
"offset",
"+",
"length",
"-",
"1",
"]",
"are",
"converted",
"although",
"the",
"given",
"array",
"s",
"length",
"i... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L673-L682 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/help/ExtensionHelp.java | ExtensionHelp.enableHelpKey | public static void enableHelpKey (Component component, String id) {
"""
Enables the help for the given component using the given help page ID.
<p>
The help page is shown when the help keyboard shortcut (F1) is pressed, while the component is focused.
@param component the component that will have a help page a... | java | public static void enableHelpKey (Component component, String id) {
if (component instanceof JComponent) {
JComponent jComponent = (JComponent) component;
if (componentsWithHelp == null) {
componentsWithHelp = new WeakHashMap<>();
}
componentsWithHelp.put(jComponent, id);
}
if (hb != null) {
h... | [
"public",
"static",
"void",
"enableHelpKey",
"(",
"Component",
"component",
",",
"String",
"id",
")",
"{",
"if",
"(",
"component",
"instanceof",
"JComponent",
")",
"{",
"JComponent",
"jComponent",
"=",
"(",
"JComponent",
")",
"component",
";",
"if",
"(",
"co... | Enables the help for the given component using the given help page ID.
<p>
The help page is shown when the help keyboard shortcut (F1) is pressed, while the component is focused.
@param component the component that will have a help page assigned
@param id the ID of the help page | [
"Enables",
"the",
"help",
"for",
"the",
"given",
"component",
"using",
"the",
"given",
"help",
"page",
"ID",
".",
"<p",
">",
"The",
"help",
"page",
"is",
"shown",
"when",
"the",
"help",
"keyboard",
"shortcut",
"(",
"F1",
")",
"is",
"pressed",
"while",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/help/ExtensionHelp.java#L383-L395 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getLegendInfo | public void getLegendInfo(String[] ids, Callback<List<Legend>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on legends API go <a href="https://wiki.guildwars2.com/wiki/API:2/legends">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Call... | java | public void getLegendInfo(String[] ids, Callback<List<Legend>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getLegendInfo(processIds(ids)).enqueue(callback);
} | [
"public",
"void",
"getLegendInfo",
"(",
"String",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Legend",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids"... | For more info on legends API go <a href="https://wiki.guildwars2.com/wiki/API:2/legends">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of legend id
@param callback callback that is g... | [
"For",
"more",
"info",
"on",
"legends",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"legends",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1747-L1750 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/UtilColor.java | UtilColor.getWeightedColor | public static ColorRgba getWeightedColor(ImageBuffer surface, int sx, int sy, int width, int height) {
"""
Get the weighted color of an area.
@param surface The surface reference (must not be <code>null</code>).
@param sx The starting horizontal location.
@param sy The starting vertical location.
@param widt... | java | public static ColorRgba getWeightedColor(ImageBuffer surface, int sx, int sy, int width, int height)
{
Check.notNull(surface);
int r = 0;
int g = 0;
int b = 0;
int count = 0;
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; ... | [
"public",
"static",
"ColorRgba",
"getWeightedColor",
"(",
"ImageBuffer",
"surface",
",",
"int",
"sx",
",",
"int",
"sy",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Check",
".",
"notNull",
"(",
"surface",
")",
";",
"int",
"r",
"=",
"0",
";",
... | Get the weighted color of an area.
@param surface The surface reference (must not be <code>null</code>).
@param sx The starting horizontal location.
@param sy The starting vertical location.
@param width The area width.
@param height The area height.
@return The weighted color. | [
"Get",
"the",
"weighted",
"color",
"of",
"an",
"area",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/UtilColor.java#L119-L148 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.passwordlessWithSMS | @SuppressWarnings("WeakerAccess")
public ParameterizableRequest<Void, AuthenticationException> passwordlessWithSMS(@NonNull String phoneNumber, @NonNull PasswordlessType passwordlessType) {
"""
Start a passwordless flow with a <a href="https://auth0.com/docs/api/authentication#get-code-or-link">SMS</a>
By def... | java | @SuppressWarnings("WeakerAccess")
public ParameterizableRequest<Void, AuthenticationException> passwordlessWithSMS(@NonNull String phoneNumber, @NonNull PasswordlessType passwordlessType) {
return passwordlessWithSMS(phoneNumber, passwordlessType, SMS_CONNECTION);
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"ParameterizableRequest",
"<",
"Void",
",",
"AuthenticationException",
">",
"passwordlessWithSMS",
"(",
"@",
"NonNull",
"String",
"phoneNumber",
",",
"@",
"NonNull",
"PasswordlessType",
"passwordlessType",
... | Start a passwordless flow with a <a href="https://auth0.com/docs/api/authentication#get-code-or-link">SMS</a>
By default it will try to authenticate using the "sms" connection.
Requires your Application to have the <b>Resource Owner</b> Legacy Grant Type enabled. See <a href="https://auth0.com/docs/clients/client-grant... | [
"Start",
"a",
"passwordless",
"flow",
"with",
"a",
"<a",
"href",
"=",
"https",
":",
"//",
"auth0",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"authentication#get",
"-",
"code",
"-",
"or",
"-",
"link",
">",
"SMS<",
"/",
"a",
">",
"By",
"default",
"it... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L946-L949 |
rythmengine/rythmengine | src/main/java/org/rythmengine/toString/ToStringStyle.java | ToStringStyle.appendSummarySize | protected void appendSummarySize(StringBuilder buffer, String fieldName, int size) {
"""
<p>Append to the <code>toString</code> a size summary.</p>
<p/>
<p>The size summary is used to summarize the contents of
<code>Collections</code>, <code>Maps</code> and arrays.</p>
<p/>
<p>The output consists of a prefix,... | java | protected void appendSummarySize(StringBuilder buffer, String fieldName, int size) {
buffer.append(sizeStartText);
buffer.append(size);
buffer.append(sizeEndText);
} | [
"protected",
"void",
"appendSummarySize",
"(",
"StringBuilder",
"buffer",
",",
"String",
"fieldName",
",",
"int",
"size",
")",
"{",
"buffer",
".",
"append",
"(",
"sizeStartText",
")",
";",
"buffer",
".",
"append",
"(",
"size",
")",
";",
"buffer",
".",
"app... | <p>Append to the <code>toString</code> a size summary.</p>
<p/>
<p>The size summary is used to summarize the contents of
<code>Collections</code>, <code>Maps</code> and arrays.</p>
<p/>
<p>The output consists of a prefix, the passed in size
and a suffix.</p>
<p/>
<p>The default format is <code>'<size=n>'<code>.</... | [
"<p",
">",
"Append",
"to",
"the",
"<code",
">",
"toString<",
"/",
"code",
">",
"a",
"size",
"summary",
".",
"<",
"/",
"p",
">",
"<p",
"/",
">",
"<p",
">",
"The",
"size",
"summary",
"is",
"used",
"to",
"summarize",
"the",
"contents",
"of",
"<code",
... | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L1550-L1554 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.setParameter | public void setParameter(String name, Object value) {
"""
Set a parameter for the transformation.
@param name The name of the parameter,
which may have a namespace URI.
@param value The value object. This can be any valid Java object
-- it's up to the processor to provide the proper
coersion to the object,... | java | public void setParameter(String name, Object value)
{
if (value == null) {
throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_SET_PARAM_VALUE, new Object[]{name}));
}
StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
try
{
... | [
"public",
"void",
"setParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"XSLMessages",
".",
"createMessage",
"(",
"XSLTErrorResources",
".",
"ER_INV... | Set a parameter for the transformation.
@param name The name of the parameter,
which may have a namespace URI.
@param value The value object. This can be any valid Java object
-- it's up to the processor to provide the proper
coersion to the object, or simply pass it on for use
in extensions. | [
"Set",
"a",
"parameter",
"for",
"the",
"transformation",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1416-L1452 |
ironjacamar/ironjacamar | deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java | AbstractResourceAdapterDeployer.findAdminObject | private String findAdminObject(String className, Connector connector) {
"""
Find the AdminObject class
@param className The initial class name
@param connector The metadata
@return The AdminObject
"""
for (org.ironjacamar.common.api.metadata.spec.AdminObject ao :
connector.getResourceada... | java | private String findAdminObject(String className, Connector connector)
{
for (org.ironjacamar.common.api.metadata.spec.AdminObject ao :
connector.getResourceadapter().getAdminObjects())
{
if (className.equals(ao.getAdminobjectClass().getValue()) ||
className.equals(ao.g... | [
"private",
"String",
"findAdminObject",
"(",
"String",
"className",
",",
"Connector",
"connector",
")",
"{",
"for",
"(",
"org",
".",
"ironjacamar",
".",
"common",
".",
"api",
".",
"metadata",
".",
"spec",
".",
"AdminObject",
"ao",
":",
"connector",
".",
"g... | Find the AdminObject class
@param className The initial class name
@param connector The metadata
@return The AdminObject | [
"Find",
"the",
"AdminObject",
"class"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java#L672-L682 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getGuildLogInfo | public void getGuildLogInfo(String id, String api, Callback<List<GuildLog>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on guild log API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/log">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Respo... | java | public void getGuildLogInfo(String id, String api, Callback<List<GuildLog>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api));
gw2API.getGuildLogInfo(id, api).enqueue(callback);
} | [
"public",
"void",
"getGuildLogInfo",
"(",
"String",
"id",
",",
"String",
"api",
",",
"Callback",
"<",
"List",
"<",
"GuildLog",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker... | For more info on guild log API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/log">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions<br/>
@param id guild id
@param api Guild leader's... | [
"For",
"more",
"info",
"on",
"guild",
"log",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"guild",
"/",
":",
"id",
"/",
"log",
">",
"here<",
"/",
"a",
">",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1468-L1471 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/webapp/resources/ArtifactResource.java | ArtifactResource.getVersions | @GET
@Produces( {
"""
Returns the list of available versions of an artifact
This method is call via GET <grapes_url>/artifact/<gavc>/versions
@param gavc String
@return Response a list of versions in JSON or in HTML
"""MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path("/{gavc}" + ServerAPI.G... | java | @GET
@Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path("/{gavc}" + ServerAPI.GET_VERSIONS)
public Response getVersions(@PathParam("gavc") final String gavc){
if(LOG.isInfoEnabled()) {
LOG.info(String.format("Got a get artifact versions request [%s]", gavc));
}
... | [
"@",
"GET",
"@",
"Produces",
"(",
"{",
"MediaType",
".",
"TEXT_HTML",
",",
"MediaType",
".",
"APPLICATION_JSON",
"}",
")",
"@",
"Path",
"(",
"\"/{gavc}\"",
"+",
"ServerAPI",
".",
"GET_VERSIONS",
")",
"public",
"Response",
"getVersions",
"(",
"@",
"PathParam"... | Returns the list of available versions of an artifact
This method is call via GET <grapes_url>/artifact/<gavc>/versions
@param gavc String
@return Response a list of versions in JSON or in HTML | [
"Returns",
"the",
"list",
"of",
"available",
"versions",
"of",
"an",
"artifact",
"This",
"method",
"is",
"call",
"via",
"GET",
"<grapes_url",
">",
"/",
"artifact",
"/",
"<gavc",
">",
"/",
"versions"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/ArtifactResource.java#L167-L182 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/FloatField.java | FloatField.doSetData | public int doSetData(Object data, boolean bDisplayOption, int iMoveMode) {
"""
Move this physical binary data to this field.
@param data The physical data to move to this field (must be Float raw data class).
@param bDisplayOption If true, display after setting the data.
@param iMoveMode The type of move.
@ret... | java | public int doSetData(Object data, boolean bDisplayOption, int iMoveMode)
{
if ((data != null) && (!(data instanceof Float)))
return DBConstants.ERROR_RETURN;
return super.doSetData(data, bDisplayOption, iMoveMode);
} | [
"public",
"int",
"doSetData",
"(",
"Object",
"data",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"(",
"data",
"!=",
"null",
")",
"&&",
"(",
"!",
"(",
"data",
"instanceof",
"Float",
")",
")",
")",
"return",
"DBConstan... | Move this physical binary data to this field.
@param data The physical data to move to this field (must be Float raw data class).
@param bDisplayOption If true, display after setting the data.
@param iMoveMode The type of move.
@return an error code (0 if success). | [
"Move",
"this",
"physical",
"binary",
"data",
"to",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/FloatField.java#L263-L268 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseBlockComment | public static int parseBlockComment(final char[] query, int offset) {
"""
Test if the <tt>/</tt> character at <tt>offset</tt> starts a block comment, and return the
position of the last <tt>/</tt> character.
@param query query
@param offset start offset
@return position of the last <tt>/</tt> character
... | java | public static int parseBlockComment(final char[] query, int offset) {
if (offset + 1 < query.length && query[offset + 1] == '*') {
// /* /* */ */ nest, according to SQL spec
int level = 1;
for (offset += 2; offset < query.length; ++offset) {
switch (query[offset - 1]) {
case '*':... | [
"public",
"static",
"int",
"parseBlockComment",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"offset",
"+",
"1",
"<",
"query",
".",
"length",
"&&",
"query",
"[",
"offset",
"+",
"1",
"]",
"==",
"'",
"'",
")",
... | Test if the <tt>/</tt> character at <tt>offset</tt> starts a block comment, and return the
position of the last <tt>/</tt> character.
@param query query
@param offset start offset
@return position of the last <tt>/</tt> character | [
"Test",
"if",
"the",
"<tt",
">",
"/",
"<",
"/",
"tt",
">",
"character",
"at",
"<tt",
">",
"offset<",
"/",
"tt",
">",
"starts",
"a",
"block",
"comment",
"and",
"return",
"the",
"position",
"of",
"the",
"last",
"<tt",
">",
"/",
"<",
"/",
"tt",
">",... | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L523-L552 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/PixelMath.java | PixelMath.boundImage | public static void boundImage( GrayS16 img , int min , int max ) {
"""
Bounds image pixels to be between these two values
@param img Image
@param min minimum value.
@param max maximum value.
"""
ImplPixelMath.boundImage(img,min,max);
} | java | public static void boundImage( GrayS16 img , int min , int max ) {
ImplPixelMath.boundImage(img,min,max);
} | [
"public",
"static",
"void",
"boundImage",
"(",
"GrayS16",
"img",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"ImplPixelMath",
".",
"boundImage",
"(",
"img",
",",
"min",
",",
"max",
")",
";",
"}"
] | Bounds image pixels to be between these two values
@param img Image
@param min minimum value.
@param max maximum value. | [
"Bounds",
"image",
"pixels",
"to",
"be",
"between",
"these",
"two",
"values"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/PixelMath.java#L4391-L4393 |
tomgibara/bits | src/main/java/com/tomgibara/bits/LongBitStore.java | LongBitStore.writeBits | static void writeBits(WriteStream writer, long bits, int count) {
"""
not does not mask off the supplied long - that is responsibility of caller
"""
for (int i = (count - 1) & ~7; i >= 0; i -= 8) {
writer.writeByte((byte) (bits >>> i));
}
} | java | static void writeBits(WriteStream writer, long bits, int count) {
for (int i = (count - 1) & ~7; i >= 0; i -= 8) {
writer.writeByte((byte) (bits >>> i));
}
} | [
"static",
"void",
"writeBits",
"(",
"WriteStream",
"writer",
",",
"long",
"bits",
",",
"int",
"count",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"(",
"count",
"-",
"1",
")",
"&",
"~",
"7",
";",
"i",
">=",
"0",
";",
"i",
"-=",
"8",
")",
"{",
"wri... | not does not mask off the supplied long - that is responsibility of caller | [
"not",
"does",
"not",
"mask",
"off",
"the",
"supplied",
"long",
"-",
"that",
"is",
"responsibility",
"of",
"caller"
] | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/LongBitStore.java#L58-L62 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java | XBaseGridScreen.printControlStartForm | public void printControlStartForm(PrintWriter out, int iPrintOptions) {
"""
Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes.
"""
super.printControlStartForm(out, iPrintOptions);
BasePanel scrHeading = ((BaseGridScre... | java | public void printControlStartForm(PrintWriter out, int iPrintOptions)
{
super.printControlStartForm(out, iPrintOptions);
BasePanel scrHeading = ((BaseGridScreen)this.getScreenField()).getReportHeading();
if (scrHeading != null)
{
out.println(Utility.startTag(XMLT... | [
"public",
"void",
"printControlStartForm",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"super",
".",
"printControlStartForm",
"(",
"out",
",",
"iPrintOptions",
")",
";",
"BasePanel",
"scrHeading",
"=",
"(",
"(",
"BaseGridScreen",
")",
"this... | Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes. | [
"Display",
"the",
"start",
"form",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java#L91-L111 |
spring-projects/spring-social-facebook | spring-social-facebook/src/main/java/org/springframework/social/facebook/api/FqlResult.java | FqlResult.getTime | public Date getTime(String fieldName) {
"""
Returns the value of the identified field as a Date.
Time fields returned from an FQL query are expressed in terms of seconds since midnight, January 1, 1970 UTC.
@param fieldName the name of the field
@return the value of the field as a Date
@throws FqlException if ... | java | public Date getTime(String fieldName) {
try {
if (hasValue(fieldName)) {
return new Date(Long.valueOf(String.valueOf(resultMap.get(fieldName))) * 1000);
} else {
return null;
}
} catch (NumberFormatException e) {
throw new FqlException("Field '" + fieldName +"' is not a time.", e);
}
} | [
"public",
"Date",
"getTime",
"(",
"String",
"fieldName",
")",
"{",
"try",
"{",
"if",
"(",
"hasValue",
"(",
"fieldName",
")",
")",
"{",
"return",
"new",
"Date",
"(",
"Long",
".",
"valueOf",
"(",
"String",
".",
"valueOf",
"(",
"resultMap",
".",
"get",
... | Returns the value of the identified field as a Date.
Time fields returned from an FQL query are expressed in terms of seconds since midnight, January 1, 1970 UTC.
@param fieldName the name of the field
@return the value of the field as a Date
@throws FqlException if the field's value cannot be expressed as a long value... | [
"Returns",
"the",
"value",
"of",
"the",
"identified",
"field",
"as",
"a",
"Date",
".",
"Time",
"fields",
"returned",
"from",
"an",
"FQL",
"query",
"are",
"expressed",
"in",
"terms",
"of",
"seconds",
"since",
"midnight",
"January",
"1",
"1970",
"UTC",
"."
] | train | https://github.com/spring-projects/spring-social-facebook/blob/ae2234d94367eaa3adbba251ec7790d5ba7ffa41/spring-social-facebook/src/main/java/org/springframework/social/facebook/api/FqlResult.java#L107-L117 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedInputStream.java | BufferedInputStream.read1 | private int read1(byte[] b, int off, int len) throws IOException {
"""
Read characters into a portion of an array, reading from the underlying
stream at most once if necessary.
"""
int avail = count - pos;
if (avail <= 0) {
/* If the requested length is at least as large as the buf... | java | private int read1(byte[] b, int off, int len) throws IOException {
int avail = count - pos;
if (avail <= 0) {
/* If the requested length is at least as large as the buffer, and
if there is no mark/reset activity, do not bother to copy the
bytes into the local bu... | [
"private",
"int",
"read1",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"avail",
"=",
"count",
"-",
"pos",
";",
"if",
"(",
"avail",
"<=",
"0",
")",
"{",
"/* If the requested length is at le... | Read characters into a portion of an array, reading from the underlying
stream at most once if necessary. | [
"Read",
"characters",
"into",
"a",
"portion",
"of",
"an",
"array",
"reading",
"from",
"the",
"underlying",
"stream",
"at",
"most",
"once",
"if",
"necessary",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/BufferedInputStream.java#L283-L301 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/JaspiServletFilter.java | JaspiServletFilter.doFilter | @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
"""
/*
If a JASPI provider returned request/response wrappers in the MessageInfo object then
use those wrappers instead of the original request/response objects for web r... | java | @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequestWrapper reqestWrapper =
(HttpServletRequestWrapper) request.getAttribute("com.ibm.ws.security.jaspi.servlet.request.wrapper");... | [
"@",
"Override",
"public",
"void",
"doFilter",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
",",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"HttpServletRequestWrapper",
"reqestWrapper",
"=",
"(",
"HttpS... | /*
If a JASPI provider returned request/response wrappers in the MessageInfo object then
use those wrappers instead of the original request/response objects for web request.
@see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) | [
"/",
"*",
"If",
"a",
"JASPI",
"provider",
"returned",
"request",
"/",
"response",
"wrappers",
"in",
"the",
"MessageInfo",
"object",
"then",
"use",
"those",
"wrappers",
"instead",
"of",
"the",
"original",
"request",
"/",
"response",
"objects",
"for",
"web",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/JaspiServletFilter.java#L47-L57 |
alkacon/opencms-core | src/org/opencms/jsp/Messages.java | Messages.getLocalizedMessage | public static String getLocalizedMessage(CmsMessageContainer container, PageContext context) {
"""
Returns the String for the given CmsMessageContainer localized to the current user's locale
if available or to the default locale else.
<p>
This method is needed for localization of non- {@link org.opencms.main.... | java | public static String getLocalizedMessage(CmsMessageContainer container, PageContext context) {
return Messages.getLocalizedMessage(container, context.getRequest());
} | [
"public",
"static",
"String",
"getLocalizedMessage",
"(",
"CmsMessageContainer",
"container",
",",
"PageContext",
"context",
")",
"{",
"return",
"Messages",
".",
"getLocalizedMessage",
"(",
"container",
",",
"context",
".",
"getRequest",
"(",
")",
")",
";",
"}"
] | Returns the String for the given CmsMessageContainer localized to the current user's locale
if available or to the default locale else.
<p>
This method is needed for localization of non- {@link org.opencms.main.CmsException}
instances that have to be thrown here due to API constraints (javax.servlet.jsp).
<p>
@param ... | [
"Returns",
"the",
"String",
"for",
"the",
"given",
"CmsMessageContainer",
"localized",
"to",
"the",
"current",
"user",
"s",
"locale",
"if",
"available",
"or",
"to",
"the",
"default",
"locale",
"else",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/Messages.java#L315-L318 |
windup/windup | rules-base/api/src/main/java/org/jboss/windup/rules/files/condition/FileContent.java | FileContent.fromInput | private void fromInput(List<FileModel> vertices, GraphRewrite event) {
"""
Generating the input vertices is quite complex. Therefore there are multiple methods that handles the input vertices based on the attribute
specified in specific order. This method handles the {@link FileContent#from(String)} attribute.
... | java | private void fromInput(List<FileModel> vertices, GraphRewrite event)
{
if (vertices.isEmpty() && StringUtils.isNotBlank(getInputVariablesName()))
{
for (WindupVertexFrame windupVertexFrame : Variables.instance(event).findVariable(getInputVariablesName()))
{
if... | [
"private",
"void",
"fromInput",
"(",
"List",
"<",
"FileModel",
">",
"vertices",
",",
"GraphRewrite",
"event",
")",
"{",
"if",
"(",
"vertices",
".",
"isEmpty",
"(",
")",
"&&",
"StringUtils",
".",
"isNotBlank",
"(",
"getInputVariablesName",
"(",
")",
")",
")... | Generating the input vertices is quite complex. Therefore there are multiple methods that handles the input vertices based on the attribute
specified in specific order. This method handles the {@link FileContent#from(String)} attribute. | [
"Generating",
"the",
"input",
"vertices",
"is",
"quite",
"complex",
".",
"Therefore",
"there",
"are",
"multiple",
"methods",
"that",
"handles",
"the",
"input",
"vertices",
"based",
"on",
"the",
"attribute",
"specified",
"in",
"specific",
"order",
".",
"This",
... | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-base/api/src/main/java/org/jboss/windup/rules/files/condition/FileContent.java#L285-L297 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/jar/JarVerifier.java | JarVerifier.mapSignersToCodeSource | private synchronized CodeSource mapSignersToCodeSource(URL url, CodeSigner[] signers) {
"""
/*
Create a unique mapping from codeSigner cache entries to CodeSource.
In theory, multiple URLs origins could map to a single locally cached
and shared JAR file although in practice there will be a single URL in use.
... | java | private synchronized CodeSource mapSignersToCodeSource(URL url, CodeSigner[] signers) {
Map map;
if (url == lastURL) {
map = lastURLMap;
} else {
map = (Map) urlToCodeSourceMap.get(url);
if (map == null) {
map = new HashMap();
u... | [
"private",
"synchronized",
"CodeSource",
"mapSignersToCodeSource",
"(",
"URL",
"url",
",",
"CodeSigner",
"[",
"]",
"signers",
")",
"{",
"Map",
"map",
";",
"if",
"(",
"url",
"==",
"lastURL",
")",
"{",
"map",
"=",
"lastURLMap",
";",
"}",
"else",
"{",
"map"... | /*
Create a unique mapping from codeSigner cache entries to CodeSource.
In theory, multiple URLs origins could map to a single locally cached
and shared JAR file although in practice there will be a single URL in use. | [
"/",
"*",
"Create",
"a",
"unique",
"mapping",
"from",
"codeSigner",
"cache",
"entries",
"to",
"CodeSource",
".",
"In",
"theory",
"multiple",
"URLs",
"origins",
"could",
"map",
"to",
"a",
"single",
"locally",
"cached",
"and",
"shared",
"JAR",
"file",
"althoug... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/jar/JarVerifier.java#L528-L547 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/PhoneNumberUtil.java | PhoneNumberUtil.formatMs | public final String formatMs(final String pphoneNumber, final String pcountryCode) {
"""
format phone number in Microsoft canonical address format.
@param pphoneNumber phone number to format
@param pcountryCode iso code of country
@return formated phone number as String
"""
return this.formatMs(this.p... | java | public final String formatMs(final String pphoneNumber, final String pcountryCode) {
return this.formatMs(this.parsePhoneNumber(pphoneNumber, pcountryCode));
} | [
"public",
"final",
"String",
"formatMs",
"(",
"final",
"String",
"pphoneNumber",
",",
"final",
"String",
"pcountryCode",
")",
"{",
"return",
"this",
".",
"formatMs",
"(",
"this",
".",
"parsePhoneNumber",
"(",
"pphoneNumber",
",",
"pcountryCode",
")",
")",
";",... | format phone number in Microsoft canonical address format.
@param pphoneNumber phone number to format
@param pcountryCode iso code of country
@return formated phone number as String | [
"format",
"phone",
"number",
"in",
"Microsoft",
"canonical",
"address",
"format",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/PhoneNumberUtil.java#L1171-L1173 |
eurekaclinical/datastore | src/main/java/org/eurekaclinical/datastore/bdb/BdbStoreFactory.java | BdbStoreFactory.createEnvironment | private Environment createEnvironment() {
"""
Creates a Berkeley DB database environment from the provided environment
configuration.
@return an environment instance.
@throws SecurityException if the directory for storing the databases
could not be created.
@throws EnvironmentNotFoundException if the envi... | java | private Environment createEnvironment() {
EnvironmentConfig envConf = createEnvConfig();
if (!envFile.exists()) {
envFile.mkdirs();
}
LOGGER.log(Level.INFO,
"Initialized BerkeleyDB cache environment at {0}",
envFile.getAbsolutePath());
... | [
"private",
"Environment",
"createEnvironment",
"(",
")",
"{",
"EnvironmentConfig",
"envConf",
"=",
"createEnvConfig",
"(",
")",
";",
"if",
"(",
"!",
"envFile",
".",
"exists",
"(",
")",
")",
"{",
"envFile",
".",
"mkdirs",
"(",
")",
";",
"}",
"LOGGER",
"."... | Creates a Berkeley DB database environment from the provided environment
configuration.
@return an environment instance.
@throws SecurityException if the directory for storing the databases
could not be created.
@throws EnvironmentNotFoundException if the environment does not exist
(does not contain at least one log ... | [
"Creates",
"a",
"Berkeley",
"DB",
"database",
"environment",
"from",
"the",
"provided",
"environment",
"configuration",
"."
] | train | https://github.com/eurekaclinical/datastore/blob/a03a70819bb562ba45eac66ca49f778035ee45e0/src/main/java/org/eurekaclinical/datastore/bdb/BdbStoreFactory.java#L244-L254 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyPabx_serviceName_PUT | public void billingAccount_easyPabx_serviceName_PUT(String billingAccount, String serviceName, OvhEasyPabx body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/easyPabx/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The ... | java | public void billingAccount_easyPabx_serviceName_PUT(String billingAccount, String serviceName, OvhEasyPabx body) throws IOException {
String qPath = "/telephony/{billingAccount}/easyPabx/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_easyPabx_serviceName_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhEasyPabx",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/easyPabx/{serviceName}\"",
";",
... | Alter this object properties
REST: PUT /telephony/{billingAccount}/easyPabx/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3649-L3653 |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/astar/AStar.java | AStar.solve | protected GP solve(AStarNode<ST, PT> startPoint, PT endPoint) {
"""
Run the A* algorithm assuming that the graph is oriented is
an orientation tool was passed to the constructor.
<p>The orientation of the graph may also be overridden by the implementations
of the {@link AStarNode A* nodes}.
@param startPoi... | java | protected GP solve(AStarNode<ST, PT> startPoint, PT endPoint) {
final List<AStarNode<ST, PT>> closeList;
fireAlgorithmStart(startPoint, endPoint);
// Run A*
closeList = findPath(startPoint, endPoint);
if (closeList == null || closeList.isEmpty()) {
return null;
}
fireAlgorithmEnd(closeList);
// C... | [
"protected",
"GP",
"solve",
"(",
"AStarNode",
"<",
"ST",
",",
"PT",
">",
"startPoint",
",",
"PT",
"endPoint",
")",
"{",
"final",
"List",
"<",
"AStarNode",
"<",
"ST",
",",
"PT",
">",
">",
"closeList",
";",
"fireAlgorithmStart",
"(",
"startPoint",
",",
"... | Run the A* algorithm assuming that the graph is oriented is
an orientation tool was passed to the constructor.
<p>The orientation of the graph may also be overridden by the implementations
of the {@link AStarNode A* nodes}.
@param startPoint is the starting point.
@param endPoint is the point to reach.
@return the fo... | [
"Run",
"the",
"A",
"*",
"algorithm",
"assuming",
"that",
"the",
"graph",
"is",
"oriented",
"is",
"an",
"orientation",
"tool",
"was",
"passed",
"to",
"the",
"constructor",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/astar/AStar.java#L433-L448 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_mitigation_ipOnMitigation_PUT | public void ip_mitigation_ipOnMitigation_PUT(String ip, String ipOnMitigation, OvhMitigationIp body) throws IOException {
"""
Alter this object properties
REST: PUT /ip/{ip}/mitigation/{ipOnMitigation}
@param body [required] New object properties
@param ip [required]
@param ipOnMitigation [required]
"""
... | java | public void ip_mitigation_ipOnMitigation_PUT(String ip, String ipOnMitigation, OvhMitigationIp body) throws IOException {
String qPath = "/ip/{ip}/mitigation/{ipOnMitigation}";
StringBuilder sb = path(qPath, ip, ipOnMitigation);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"ip_mitigation_ipOnMitigation_PUT",
"(",
"String",
"ip",
",",
"String",
"ipOnMitigation",
",",
"OvhMitigationIp",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/mitigation/{ipOnMitigation}\"",
";",
"StringBuilder",
"sb",
... | Alter this object properties
REST: PUT /ip/{ip}/mitigation/{ipOnMitigation}
@param body [required] New object properties
@param ip [required]
@param ipOnMitigation [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L711-L715 |
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.deleteSubList | public OperationStatus deleteSubList(UUID appId, String versionId, UUID clEntityId, int subListId) {
"""
Deletes a sublist of a specific closed list model.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extractor ID.
@param subListId The sublist ID.... | java | public OperationStatus deleteSubList(UUID appId, String versionId, UUID clEntityId, int subListId) {
return deleteSubListWithServiceResponseAsync(appId, versionId, clEntityId, subListId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteSubList",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
",",
"int",
"subListId",
")",
"{",
"return",
"deleteSubListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"clEntityId",
",",
... | Deletes a sublist of a specific closed list model.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extractor ID.
@param subListId The sublist ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if... | [
"Deletes",
"a",
"sublist",
"of",
"a",
"specific",
"closed",
"list",
"model",
"."
] | 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#L4872-L4874 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_antiSpams_ip_GET | public OvhAntiSpam serviceName_antiSpams_ip_GET(String serviceName, String ip) throws IOException {
"""
Get this object properties
REST: GET /xdsl/{serviceName}/antiSpams/{ip}
@param serviceName [required] The internal name of your XDSL offer
@param ip [required] IP which spam
"""
String qPath = "/xdsl/... | java | public OvhAntiSpam serviceName_antiSpams_ip_GET(String serviceName, String ip) throws IOException {
String qPath = "/xdsl/{serviceName}/antiSpams/{ip}";
StringBuilder sb = path(qPath, serviceName, ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhAntiSpam.class);
} | [
"public",
"OvhAntiSpam",
"serviceName_antiSpams_ip_GET",
"(",
"String",
"serviceName",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/antiSpams/{ip}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",... | Get this object properties
REST: GET /xdsl/{serviceName}/antiSpams/{ip}
@param serviceName [required] The internal name of your XDSL offer
@param ip [required] IP which spam | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1520-L1525 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java | PoolOperations.createPool | public void createPool(String poolId, String virtualMachineSize,
CloudServiceConfiguration cloudServiceConfiguration, int targetDedicatedNodes)
throws BatchErrorException, IOException {
"""
Adds a pool to the Batch account.
@param poolId
The ID of the pool.
@param virtua... | java | public void createPool(String poolId, String virtualMachineSize,
CloudServiceConfiguration cloudServiceConfiguration, int targetDedicatedNodes)
throws BatchErrorException, IOException {
createPool(poolId, virtualMachineSize, cloudServiceConfiguration, targetDedicatedNodes,... | [
"public",
"void",
"createPool",
"(",
"String",
"poolId",
",",
"String",
"virtualMachineSize",
",",
"CloudServiceConfiguration",
"cloudServiceConfiguration",
",",
"int",
"targetDedicatedNodes",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"createPool",
"(... | Adds a pool to the Batch account.
@param poolId
The ID of the pool.
@param virtualMachineSize
The size of virtual machines in the pool. See <a href=
"https://azure.microsoft.com/documentation/articles/virtual-machines-size-specs/">https://azure.microsoft.com/documentation/articles/virtual-machines-size-specs/</a>
for ... | [
"Adds",
"a",
"pool",
"to",
"the",
"Batch",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L288-L292 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/bucket/hashfunction/util/RangeHashSorter.java | RangeHashSorter.insertionSort | private void insertionSort(int left, int right) {
"""
Internal insertion sort routine for subarrays of ranges that is used by quicksort.
@param left
the left-most index of the subarray.
@param right
the right-most index of the subarray.
"""
for (int p = left + 1; p <= right; p++) {
by... | java | private void insertionSort(int left, int right) {
for (int p = left + 1; p <= right; p++) {
byte[] tmpRange = ranges[p];
String tmpFilename = filenames[p];
int j;
for (j = p; j > left && KeyUtils.compareKey(tmpRange, ranges[j - 1]) < 0; j--) {
ran... | [
"private",
"void",
"insertionSort",
"(",
"int",
"left",
",",
"int",
"right",
")",
"{",
"for",
"(",
"int",
"p",
"=",
"left",
"+",
"1",
";",
"p",
"<=",
"right",
";",
"p",
"++",
")",
"{",
"byte",
"[",
"]",
"tmpRange",
"=",
"ranges",
"[",
"p",
"]",... | Internal insertion sort routine for subarrays of ranges that is used by quicksort.
@param left
the left-most index of the subarray.
@param right
the right-most index of the subarray. | [
"Internal",
"insertion",
"sort",
"routine",
"for",
"subarrays",
"of",
"ranges",
"that",
"is",
"used",
"by",
"quicksort",
"."
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/bucket/hashfunction/util/RangeHashSorter.java#L118-L131 |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/utils/Utils.java | Utils.printField | public static final void printField (final StringBuilder sb, final String fieldName, final String fieldValue, final int indent) {
"""
This methods creates an easy to use interface to print out a logging message of a specific variable.
@param sb StringBuilder to directly write the logging messages in.
@param fi... | java | public static final void printField (final StringBuilder sb, final String fieldName, final String fieldValue, final int indent) {
indent(sb, indent);
sb.append(fieldName);
sb.append(": ");
sb.append(fieldValue);
sb.append("\n");
} | [
"public",
"static",
"final",
"void",
"printField",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"String",
"fieldName",
",",
"final",
"String",
"fieldValue",
",",
"final",
"int",
"indent",
")",
"{",
"indent",
"(",
"sb",
",",
"indent",
")",
";",
"sb",
... | This methods creates an easy to use interface to print out a logging message of a specific variable.
@param sb StringBuilder to directly write the logging messages in.
@param fieldName The name of the variable.
@param fieldValue The value of the given variable.
@param indent The level of indention. | [
"This",
"methods",
"creates",
"an",
"easy",
"to",
"use",
"interface",
"to",
"print",
"out",
"a",
"logging",
"message",
"of",
"a",
"specific",
"variable",
"."
] | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/utils/Utils.java#L111-L118 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java | Validator.validateNull | public void validateNull(Object object, String name, String message) {
"""
Validates a given object to be null
@param object The object to check
@param name The name of the field to display the error message
@param message A custom error message instead of the default one
"""
if (object != null) {... | java | public void validateNull(Object object, String name, String message) {
if (object != null) {
addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.NULL_KEY.name(), name)));
}
} | [
"public",
"void",
"validateNull",
"(",
"Object",
"object",
",",
"String",
"name",
",",
"String",
"message",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"addError",
"(",
"name",
",",
"Optional",
".",
"ofNullable",
"(",
"message",
")",
".",
"o... | Validates a given object to be null
@param object The object to check
@param name The name of the field to display the error message
@param message A custom error message instead of the default one | [
"Validates",
"a",
"given",
"object",
"to",
"be",
"null"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L499-L503 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java | DataServiceVisitorJsBuilder.createReturnOcelotPromiseFactory | void createReturnOcelotPromiseFactory(String classname, String methodName, boolean ws, String args, String keys, Writer writer) throws IOException {
"""
Return body js line that return the OcelotPromise
@param classname
@param methodName
@param args
@param keys
@param writer
@throws IOException
"""
St... | java | void createReturnOcelotPromiseFactory(String classname, String methodName, boolean ws, String args, String keys, Writer writer) throws IOException {
String md5 = keyMaker.getMd5(classname + DOT + methodName);
writer.append(TAB3).append("return promiseFactory.create").append(OPENPARENTHESIS).append("_ds").append(C... | [
"void",
"createReturnOcelotPromiseFactory",
"(",
"String",
"classname",
",",
"String",
"methodName",
",",
"boolean",
"ws",
",",
"String",
"args",
",",
"String",
"keys",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"String",
"md5",
"=",
"keyMaker",... | Return body js line that return the OcelotPromise
@param classname
@param methodName
@param args
@param keys
@param writer
@throws IOException | [
"Return",
"body",
"js",
"line",
"that",
"return",
"the",
"OcelotPromise"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java#L239-L247 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jmf/JmfMediaManager.java | JmfMediaManager.setupJMF | public static void setupJMF() {
"""
Runs JMFInit the first time the application is started so that capture
devices are properly detected and initialized by JMF.
"""
// .jmf is the place where we store the jmf.properties file used
// by JMF. if the directory does not exist or it does not contai... | java | public static void setupJMF() {
// .jmf is the place where we store the jmf.properties file used
// by JMF. if the directory does not exist or it does not contain
// a jmf.properties file. or if the jmf.properties file has 0 length
// then this is the first time we're running and should ... | [
"public",
"static",
"void",
"setupJMF",
"(",
")",
"{",
"// .jmf is the place where we store the jmf.properties file used",
"// by JMF. if the directory does not exist or it does not contain",
"// a jmf.properties file. or if the jmf.properties file has 0 length",
"// then this is the first time ... | Runs JMFInit the first time the application is started so that capture
devices are properly detected and initialized by JMF. | [
"Runs",
"JMFInit",
"the",
"first",
"time",
"the",
"application",
"is",
"started",
"so",
"that",
"capture",
"devices",
"are",
"properly",
"detected",
"and",
"initialized",
"by",
"JMF",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jmf/JmfMediaManager.java#L124-L159 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-integrations/valkyrie-rcp-jideoss/src/main/java/org/valkyriercp/component/SearchableInterceptor.java | SearchableInterceptor.processComponent | @Override
public void processComponent(String propertyName, JComponent component) {
"""
Installs a <code>Searchable</code> into the given component.
@param propertyName
the property name.
@param component
the target component.
"""
if (component instanceof JComboBox) {
this.instal... | java | @Override
public void processComponent(String propertyName, JComponent component) {
if (component instanceof JComboBox) {
this.installSearchable((JComboBox) component);
} else if (component instanceof JList) {
this.installSearchable((JList) component);
} else if (com... | [
"@",
"Override",
"public",
"void",
"processComponent",
"(",
"String",
"propertyName",
",",
"JComponent",
"component",
")",
"{",
"if",
"(",
"component",
"instanceof",
"JComboBox",
")",
"{",
"this",
".",
"installSearchable",
"(",
"(",
"JComboBox",
")",
"component"... | Installs a <code>Searchable</code> into the given component.
@param propertyName
the property name.
@param component
the target component. | [
"Installs",
"a",
"<code",
">",
"Searchable<",
"/",
"code",
">",
"into",
"the",
"given",
"component",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jideoss/src/main/java/org/valkyriercp/component/SearchableInterceptor.java#L116-L128 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/bytecode/simulation/MethodSimulator.java | MethodSimulator.mergeElementStore | private void mergeElementStore(final int index, final String type, final Element element) {
"""
Merges a stored element to the local variables.
@param index The index of the variable
@param type The type of the variable or the element (whatever is more specific)
@param element The element to merge
""... | java | private void mergeElementStore(final int index, final String type, final Element element) {
// new element must be created for immutability
final String elementType = type.equals(Types.OBJECT) ? determineLeastSpecificType(element.getTypes().toArray(new String[element.getTypes().size()])) : type;
... | [
"private",
"void",
"mergeElementStore",
"(",
"final",
"int",
"index",
",",
"final",
"String",
"type",
",",
"final",
"Element",
"element",
")",
"{",
"// new element must be created for immutability",
"final",
"String",
"elementType",
"=",
"type",
".",
"equals",
"(",
... | Merges a stored element to the local variables.
@param index The index of the variable
@param type The type of the variable or the element (whatever is more specific)
@param element The element to merge | [
"Merges",
"a",
"stored",
"element",
"to",
"the",
"local",
"variables",
"."
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/bytecode/simulation/MethodSimulator.java#L222-L228 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/executor/BasicRequestExecutor.java | BasicRequestExecutor.fetchResponse | protected HttpResponse fetchResponse(InvocationContext context, HttpRequestBase request) {
"""
<p>Performs the actual request execution with the {@link HttpClient} to be used for the endpoint
(fetched using the {@link HttpClientDirectory}). See {@link HttpClient#execute(HttpUriRequest)}.</p>
<p>If the endpoint... | java | protected HttpResponse fetchResponse(InvocationContext context, HttpRequestBase request) {
try {
Class<?> endpoint = context.getEndpoint();
HttpClient httpClient = HttpClientDirectory.INSTANCE.lookup(endpoint);
return endpoint.isAnnotationPresent(Stateful.class)?
httpClient.execute(request,... | [
"protected",
"HttpResponse",
"fetchResponse",
"(",
"InvocationContext",
"context",
",",
"HttpRequestBase",
"request",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"endpoint",
"=",
"context",
".",
"getEndpoint",
"(",
")",
";",
"HttpClient",
"httpClient",
"=",
... | <p>Performs the actual request execution with the {@link HttpClient} to be used for the endpoint
(fetched using the {@link HttpClientDirectory}). See {@link HttpClient#execute(HttpUriRequest)}.</p>
<p>If the endpoint is annotated with @{@link Stateful}, the relevant {@link HttpContext} from the
{@link HttpContextDirec... | [
"<p",
">",
"Performs",
"the",
"actual",
"request",
"execution",
"with",
"the",
"{",
"@link",
"HttpClient",
"}",
"to",
"be",
"used",
"for",
"the",
"endpoint",
"(",
"fetched",
"using",
"the",
"{",
"@link",
"HttpClientDirectory",
"}",
")",
".",
"See",
"{",
... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/executor/BasicRequestExecutor.java#L82-L98 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleRoles.java | ModuleRoles.fetchOne | public CMARole fetchOne(String spaceId, String roleId) {
"""
Fetches one role by its id from Contentful.
<p>
This method will override the configuration specified through
{@link CMAClient.Builder#setSpaceId(String)} and will ignore
{@link CMAClient.Builder#setEnvironmentId(String)}.
@param spaceId the space... | java | public CMARole fetchOne(String spaceId, String roleId) {
assertNotNull(spaceId, "spaceId");
assertNotNull(roleId, "roleId");
return service.fetchOne(spaceId, roleId).blockingFirst();
} | [
"public",
"CMARole",
"fetchOne",
"(",
"String",
"spaceId",
",",
"String",
"roleId",
")",
"{",
"assertNotNull",
"(",
"spaceId",
",",
"\"spaceId\"",
")",
";",
"assertNotNull",
"(",
"roleId",
",",
"\"roleId\"",
")",
";",
"return",
"service",
".",
"fetchOne",
"(... | Fetches one role by its id from Contentful.
<p>
This method will override the configuration specified through
{@link CMAClient.Builder#setSpaceId(String)} and will ignore
{@link CMAClient.Builder#setEnvironmentId(String)}.
@param spaceId the space this role is hosted by.
@param roleId the id of the role to be found.
... | [
"Fetches",
"one",
"role",
"by",
"its",
"id",
"from",
"Contentful",
".",
"<p",
">",
"This",
"method",
"will",
"override",
"the",
"configuration",
"specified",
"through",
"{",
"@link",
"CMAClient",
".",
"Builder#setSpaceId",
"(",
"String",
")",
"}",
"and",
"wi... | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleRoles.java#L157-L162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.