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 |
|---|---|---|---|---|---|---|---|---|---|---|
wdtinc/mapbox-vector-tile-java | src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/MvtReader.java | MvtReader.loadMvt | public static JtsMvt loadMvt(File file,
GeometryFactory geomFactory,
ITagConverter tagConverter) throws IOException {
"""
Convenience method for loading MVT from file.
See {@link #loadMvt(InputStream, GeometryFactory, ITagConverter, RingClassifier)... | java | public static JtsMvt loadMvt(File file,
GeometryFactory geomFactory,
ITagConverter tagConverter) throws IOException {
return loadMvt(file, geomFactory, tagConverter, RING_CLASSIFIER_V2_1);
} | [
"public",
"static",
"JtsMvt",
"loadMvt",
"(",
"File",
"file",
",",
"GeometryFactory",
"geomFactory",
",",
"ITagConverter",
"tagConverter",
")",
"throws",
"IOException",
"{",
"return",
"loadMvt",
"(",
"file",
",",
"geomFactory",
",",
"tagConverter",
",",
"RING_CLAS... | Convenience method for loading MVT from file.
See {@link #loadMvt(InputStream, GeometryFactory, ITagConverter, RingClassifier)}.
Uses {@link #RING_CLASSIFIER_V2_1} for forming Polygons and MultiPolygons.
@param file path to the MVT
@param geomFactory allows for JTS geometry creation
@param tagConverter converts MVT fe... | [
"Convenience",
"method",
"for",
"loading",
"MVT",
"from",
"file",
".",
"See",
"{",
"@link",
"#loadMvt",
"(",
"InputStream",
"GeometryFactory",
"ITagConverter",
"RingClassifier",
")",
"}",
".",
"Uses",
"{",
"@link",
"#RING_CLASSIFIER_V2_1",
"}",
"for",
"forming",
... | train | https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/MvtReader.java#L47-L51 |
infinispan/infinispan | remote-query/remote-query-server/src/main/java/org/infinispan/query/remote/impl/indexing/ProtobufValueWrapperSearchWorkCreator.java | ProtobufValueWrapperSearchWorkCreator.discoverMessageType | private void discoverMessageType(ProtobufValueWrapper valueWrapper) {
"""
Discovers the type of the protobuf payload and if it is a message type it sets the descriptor using {@link
ProtobufValueWrapper#setMessageDescriptor}.
@param valueWrapper the wrapper of the protobuf binary payload
"""
try {
... | java | private void discoverMessageType(ProtobufValueWrapper valueWrapper) {
try {
ProtobufParser.INSTANCE.parse(new WrappedMessageTagHandler(valueWrapper, serializationContext), wrapperDescriptor, valueWrapper.getBinary());
} catch (IOException e) {
throw new CacheException(e);
}
} | [
"private",
"void",
"discoverMessageType",
"(",
"ProtobufValueWrapper",
"valueWrapper",
")",
"{",
"try",
"{",
"ProtobufParser",
".",
"INSTANCE",
".",
"parse",
"(",
"new",
"WrappedMessageTagHandler",
"(",
"valueWrapper",
",",
"serializationContext",
")",
",",
"wrapperDe... | Discovers the type of the protobuf payload and if it is a message type it sets the descriptor using {@link
ProtobufValueWrapper#setMessageDescriptor}.
@param valueWrapper the wrapper of the protobuf binary payload | [
"Discovers",
"the",
"type",
"of",
"the",
"protobuf",
"payload",
"and",
"if",
"it",
"is",
"a",
"message",
"type",
"it",
"sets",
"the",
"descriptor",
"using",
"{",
"@link",
"ProtobufValueWrapper#setMessageDescriptor",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/remote-query/remote-query-server/src/main/java/org/infinispan/query/remote/impl/indexing/ProtobufValueWrapperSearchWorkCreator.java#L88-L94 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/reflection/MyReflectionUtils.java | MyReflectionUtils.buildInstanceForMap | public static <T> T buildInstanceForMap(Class<T> clazz, Map<String, Object> values)
throws InstantiationException, IllegalAccessException, IntrospectionException,
IllegalArgumentException, InvocationTargetException {
"""
Builds a instance of the class for a map containing the values, without specifying... | java | public static <T> T buildInstanceForMap(Class<T> clazz, Map<String, Object> values)
throws InstantiationException, IllegalAccessException, IntrospectionException,
IllegalArgumentException, InvocationTargetException {
return buildInstanceForMap(clazz, values, new MyDefaultReflectionDifferenceHandler());
... | [
"public",
"static",
"<",
"T",
">",
"T",
"buildInstanceForMap",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"IntrospectionException",
... | Builds a instance of the class for a map containing the values, without specifying the handler for differences
@param clazz The class to build instance
@param values The values map
@return The instance
@throws InstantiationException Error instantiating
@throws IllegalAccessException Access error
@throws IntrospectionE... | [
"Builds",
"a",
"instance",
"of",
"the",
"class",
"for",
"a",
"map",
"containing",
"the",
"values",
"without",
"specifying",
"the",
"handler",
"for",
"differences"
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/reflection/MyReflectionUtils.java#L48-L52 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/ImpreciseDateTimeField.java | ImpreciseDateTimeField.getDifferenceAsLong | public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
"""
Computes the difference between two instants, as measured in the units
of this field. Any fractional units are dropped from the result. Calling
getDifference reverses the effect of calling add. In the following code:
<pre>
lon... | java | public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
if (minuendInstant < subtrahendInstant) {
return -getDifferenceAsLong(subtrahendInstant, minuendInstant);
}
long difference = (minuendInstant - subtrahendInstant) / iUnitMillis;
if (add(su... | [
"public",
"long",
"getDifferenceAsLong",
"(",
"long",
"minuendInstant",
",",
"long",
"subtrahendInstant",
")",
"{",
"if",
"(",
"minuendInstant",
"<",
"subtrahendInstant",
")",
"{",
"return",
"-",
"getDifferenceAsLong",
"(",
"subtrahendInstant",
",",
"minuendInstant",
... | Computes the difference between two instants, as measured in the units
of this field. Any fractional units are dropped from the result. Calling
getDifference reverses the effect of calling add. In the following code:
<pre>
long instant = ...
long v = ...
long age = getDifferenceAsLong(add(instant, v), instant);
</pre>... | [
"Computes",
"the",
"difference",
"between",
"two",
"instants",
"as",
"measured",
"in",
"the",
"units",
"of",
"this",
"field",
".",
"Any",
"fractional",
"units",
"are",
"dropped",
"from",
"the",
"result",
".",
"Calling",
"getDifference",
"reverses",
"the",
"eff... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/ImpreciseDateTimeField.java#L118-L135 |
nabedge/mixer2 | src/main/java/org/mixer2/xhtml/AbstractJaxb.java | AbstractJaxb.getDescendants | @SuppressWarnings("unchecked")
public <T extends AbstractJaxb> List<T> getDescendants(String clazz,
Class<T> tagType) {
"""
<p>
scan descendant element that is specified tag type having specified class
attribute and return it as List.
</p>
<pre>
// usage:
// get all div objects having "... | java | @SuppressWarnings("unchecked")
public <T extends AbstractJaxb> List<T> getDescendants(String clazz,
Class<T> tagType) {
return GetDescendantsUtil.getDescendants((T) this, new ArrayList<T>(),
clazz, tagType);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"AbstractJaxb",
">",
"List",
"<",
"T",
">",
"getDescendants",
"(",
"String",
"clazz",
",",
"Class",
"<",
"T",
">",
"tagType",
")",
"{",
"return",
"GetDescendantsUtil",
".",
... | <p>
scan descendant element that is specified tag type having specified class
attribute and return it as List.
</p>
<pre>
// usage:
// get all div objects having "foo" class
List<Div> divList = html.getDescendants("foo", Div.class);
// get all Table objects having "bar" class within... | [
"<p",
">",
"scan",
"descendant",
"element",
"that",
"is",
"specified",
"tag",
"type",
"having",
"specified",
"class",
"attribute",
"and",
"return",
"it",
"as",
"List",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/nabedge/mixer2/blob/8c2db27cfcd65bf0b1e0242ef9362ebd8033777c/src/main/java/org/mixer2/xhtml/AbstractJaxb.java#L224-L229 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/image/ShowImages.java | ShowImages.showGrid | public static ImageGridPanel showGrid( int numColumns , String title , BufferedImage ...images ) {
"""
Shows a set of images in a grid pattern.
@param numColumns How many columns are in the grid
@param title Number of the window
@param images List of images to show
@return Display panel
"""
JFrame fram... | java | public static ImageGridPanel showGrid( int numColumns , String title , BufferedImage ...images ) {
JFrame frame = new JFrame(title);
int numRows = images.length/numColumns + images.length%numColumns;
ImageGridPanel panel = new ImageGridPanel(numRows,numColumns,images);
frame.add(panel, BorderLayout.CENTER);
... | [
"public",
"static",
"ImageGridPanel",
"showGrid",
"(",
"int",
"numColumns",
",",
"String",
"title",
",",
"BufferedImage",
"...",
"images",
")",
"{",
"JFrame",
"frame",
"=",
"new",
"JFrame",
"(",
"title",
")",
";",
"int",
"numRows",
"=",
"images",
".",
"len... | Shows a set of images in a grid pattern.
@param numColumns How many columns are in the grid
@param title Number of the window
@param images List of images to show
@return Display panel | [
"Shows",
"a",
"set",
"of",
"images",
"in",
"a",
"grid",
"pattern",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/ShowImages.java#L56-L68 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/ProtectionIntentsInner.java | ProtectionIntentsInner.createOrUpdateAsync | public Observable<ProtectionIntentResourceInner> createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters) {
"""
Create Intent for Enabling backup of an item. This is a synchronous operation.
@param vaultName The name of... | java | public Observable<ProtectionIntentResourceInner> createOrUpdateAsync(String vaultName, String resourceGroupName, String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters) {
return createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName, param... | [
"public",
"Observable",
"<",
"ProtectionIntentResourceInner",
">",
"createOrUpdateAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"fabricName",
",",
"String",
"intentObjectName",
",",
"ProtectionIntentResourceInner",
"parameters",
")",... | Create Intent for Enabling backup of an item. This is a synchronous operation.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param fabricName Fabric name associated with the backup item.
@param intentObje... | [
"Create",
"Intent",
"for",
"Enabling",
"backup",
"of",
"an",
"item",
".",
"This",
"is",
"a",
"synchronous",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/ProtectionIntentsInner.java#L209-L216 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/POIUtils.java | POIUtils.formatCellAddress | public static String formatCellAddress(final Point cellAddress) {
"""
座標をExcelのアドレス形式'A1'になどに変換する。
@param cellAddress セルの位置情報
@return
@throws IllegalArgumentException address == null.
"""
ArgUtils.notNull(cellAddress, "cellAddress");
return formatCellAddress(cellAddress.y, cellAddress.x);
... | java | public static String formatCellAddress(final Point cellAddress) {
ArgUtils.notNull(cellAddress, "cellAddress");
return formatCellAddress(cellAddress.y, cellAddress.x);
} | [
"public",
"static",
"String",
"formatCellAddress",
"(",
"final",
"Point",
"cellAddress",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"cellAddress",
",",
"\"cellAddress\"",
")",
";",
"return",
"formatCellAddress",
"(",
"cellAddress",
".",
"y",
",",
"cellAddress",
... | 座標をExcelのアドレス形式'A1'になどに変換する。
@param cellAddress セルの位置情報
@return
@throws IllegalArgumentException address == null. | [
"座標をExcelのアドレス形式",
"A1",
"になどに変換する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/POIUtils.java#L502-L505 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericInsdcHeaderFormat.java | GenericInsdcHeaderFormat._insdc_feature_position_string | private String _insdc_feature_position_string(Point location, int increment) {
"""
Build a GenBank/EMBL position string (PRIVATE).
@param location
@param increment
"""
StringBuilder sb = new StringBuilder();
Formatter formatter = new Formatter(sb,Locale.US);
formatter.format("%s", location.getPositi... | java | private String _insdc_feature_position_string(Point location, int increment) {
StringBuilder sb = new StringBuilder();
Formatter formatter = new Formatter(sb,Locale.US);
formatter.format("%s", location.getPosition() + increment);
String output = formatter.toString();
formatter.close();
return output;
... | [
"private",
"String",
"_insdc_feature_position_string",
"(",
"Point",
"location",
",",
"int",
"increment",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Formatter",
"formatter",
"=",
"new",
"Formatter",
"(",
"sb",
",",
"Locale",
... | Build a GenBank/EMBL position string (PRIVATE).
@param location
@param increment | [
"Build",
"a",
"GenBank",
"/",
"EMBL",
"position",
"string",
"(",
"PRIVATE",
")",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericInsdcHeaderFormat.java#L301-L331 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/MergePolicyValidator.java | MergePolicyValidator.checkMergePolicy | private static List<Class> checkMergePolicy(SplitBrainMergeTypeProvider mergeTypeProvider, Object mergePolicyInstance) {
"""
Checks if a {@link SplitBrainMergeTypeProvider} provides all required types of a given merge policy instance.
@param mergeTypeProvider the {@link SplitBrainMergeTypeProvider} to retriev... | java | private static List<Class> checkMergePolicy(SplitBrainMergeTypeProvider mergeTypeProvider, Object mergePolicyInstance) {
if (mergePolicyInstance instanceof SplitBrainMergePolicy) {
return checkSplitBrainMergePolicy(mergeTypeProvider, (SplitBrainMergePolicy) mergePolicyInstance);
}
re... | [
"private",
"static",
"List",
"<",
"Class",
">",
"checkMergePolicy",
"(",
"SplitBrainMergeTypeProvider",
"mergeTypeProvider",
",",
"Object",
"mergePolicyInstance",
")",
"{",
"if",
"(",
"mergePolicyInstance",
"instanceof",
"SplitBrainMergePolicy",
")",
"{",
"return",
"che... | Checks if a {@link SplitBrainMergeTypeProvider} provides all required types of a given merge policy instance.
@param mergeTypeProvider the {@link SplitBrainMergeTypeProvider} to retrieve the provided merge types
@param mergePolicyInstance the merge policy instance
@return a list of the required merge types if the me... | [
"Checks",
"if",
"a",
"{",
"@link",
"SplitBrainMergeTypeProvider",
"}",
"provides",
"all",
"required",
"types",
"of",
"a",
"given",
"merge",
"policy",
"instance",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/MergePolicyValidator.java#L206-L211 |
gallandarakhneorg/afc | maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java | AbstractArakhneMojo.resolveArtifact | public final Artifact resolveArtifact(String groupId, String artifactId, String version) throws MojoExecutionException {
"""
Retreive the extended artifact definition of the given artifact id.
@param groupId
is the identifier of the group.
@param artifactId
is the identifier of the artifact.
@param version
... | java | public final Artifact resolveArtifact(String groupId, String artifactId, String version) throws MojoExecutionException {
return resolveArtifact(createArtifact(groupId, artifactId, version));
} | [
"public",
"final",
"Artifact",
"resolveArtifact",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
")",
"throws",
"MojoExecutionException",
"{",
"return",
"resolveArtifact",
"(",
"createArtifact",
"(",
"groupId",
",",
"artifactId",
",... | Retreive the extended artifact definition of the given artifact id.
@param groupId
is the identifier of the group.
@param artifactId
is the identifier of the artifact.
@param version
is the version of the artifact to retreive.
@return the artifact definition.
@throws MojoExecutionException on error. | [
"Retreive",
"the",
"extended",
"artifact",
"definition",
"of",
"the",
"given",
"artifact",
"id",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java#L643-L645 |
dnsjava/dnsjava | org/xbill/DNS/Mnemonic.java | Mnemonic.addAlias | public void
addAlias(int val, String str) {
"""
Defines an additional text representation of a numeric value. This will
be used by getValue(), but not getText().
@param val The numeric value
@param string The text string
"""
check(val);
Integer value = toInteger(val);
str = sanitize(str);
strings.put(s... | java | public void
addAlias(int val, String str) {
check(val);
Integer value = toInteger(val);
str = sanitize(str);
strings.put(str, value);
} | [
"public",
"void",
"addAlias",
"(",
"int",
"val",
",",
"String",
"str",
")",
"{",
"check",
"(",
"val",
")",
";",
"Integer",
"value",
"=",
"toInteger",
"(",
"val",
")",
";",
"str",
"=",
"sanitize",
"(",
"str",
")",
";",
"strings",
".",
"put",
"(",
... | Defines an additional text representation of a numeric value. This will
be used by getValue(), but not getText().
@param val The numeric value
@param string The text string | [
"Defines",
"an",
"additional",
"text",
"representation",
"of",
"a",
"numeric",
"value",
".",
"This",
"will",
"be",
"used",
"by",
"getValue",
"()",
"but",
"not",
"getText",
"()",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Mnemonic.java#L143-L149 |
jbundle/jbundle | model/base/src/main/java/org/jbundle/model/util/Util.java | Util.getImageFilename | public static String getImageFilename(String strFilename, String strSubDirectory) {
"""
Get this image's full filename.
@param filename The filename of this image (if no path, assumes images/buttons; if not ext assumes .gif).
@param strSubDirectory The sub-directory.
@return The full (relative) filename for thi... | java | public static String getImageFilename(String strFilename, String strSubDirectory)
{
if ((strFilename == null) || (strFilename.length() == 0))
return null; // A null will tell a JButton not to load an image
if (strFilename.indexOf('.') == -1)
strFilename += ".gif";
strFil... | [
"public",
"static",
"String",
"getImageFilename",
"(",
"String",
"strFilename",
",",
"String",
"strSubDirectory",
")",
"{",
"if",
"(",
"(",
"strFilename",
"==",
"null",
")",
"||",
"(",
"strFilename",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"return",
... | Get this image's full filename.
@param filename The filename of this image (if no path, assumes images/buttons; if not ext assumes .gif).
@param strSubDirectory The sub-directory.
@return The full (relative) filename for this image. | [
"Get",
"this",
"image",
"s",
"full",
"filename",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/Util.java#L573-L581 |
infinispan/infinispan | query/src/main/java/org/infinispan/query/backend/KeyTransformationHandler.java | KeyTransformationHandler.registerTransformer | public void registerTransformer(Class<?> keyClass, Class<? extends Transformer> transformerClass) {
"""
Registers a {@link org.infinispan.query.Transformer} for the supplied key class.
@param keyClass the key class for which the supplied transformerClass should be used
@param transformerClass the trans... | java | public void registerTransformer(Class<?> keyClass, Class<? extends Transformer> transformerClass) {
transformerTypes.put(keyClass, transformerClass);
} | [
"public",
"void",
"registerTransformer",
"(",
"Class",
"<",
"?",
">",
"keyClass",
",",
"Class",
"<",
"?",
"extends",
"Transformer",
">",
"transformerClass",
")",
"{",
"transformerTypes",
".",
"put",
"(",
"keyClass",
",",
"transformerClass",
")",
";",
"}"
] | Registers a {@link org.infinispan.query.Transformer} for the supplied key class.
@param keyClass the key class for which the supplied transformerClass should be used
@param transformerClass the transformer class to use for the supplied key class | [
"Registers",
"a",
"{",
"@link",
"org",
".",
"infinispan",
".",
"query",
".",
"Transformer",
"}",
"for",
"the",
"supplied",
"key",
"class",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/backend/KeyTransformationHandler.java#L213-L215 |
blackfizz/EazeGraph | EazeGraphLibrary/src/main/java/org/eazegraph/lib/charts/StackedBarChart.java | StackedBarChart.initializeGraph | @Override
protected void initializeGraph() {
"""
This is the main entry point after the graph has been inflated. Used to initialize the graph
and its corresponding members.
"""
super.initializeGraph();
mData = new ArrayList<>();
mSeperatorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
... | java | @Override
protected void initializeGraph() {
super.initializeGraph();
mData = new ArrayList<>();
mSeperatorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mSeperatorPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mSeperatorPaint.setStrokeWidth(mSeparatorWidth);
mSeperatorPain... | [
"@",
"Override",
"protected",
"void",
"initializeGraph",
"(",
")",
"{",
"super",
".",
"initializeGraph",
"(",
")",
";",
"mData",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"mSeperatorPaint",
"=",
"new",
"Paint",
"(",
"Paint",
".",
"ANTI_ALIAS_FLAG",
")"... | This is the main entry point after the graph has been inflated. Used to initialize the graph
and its corresponding members. | [
"This",
"is",
"the",
"main",
"entry",
"point",
"after",
"the",
"graph",
"has",
"been",
"inflated",
".",
"Used",
"to",
"initialize",
"the",
"graph",
"and",
"its",
"corresponding",
"members",
"."
] | train | https://github.com/blackfizz/EazeGraph/blob/ce5e68ecc70e154f83bbb2fcce1a970db125c1e6/EazeGraphLibrary/src/main/java/org/eazegraph/lib/charts/StackedBarChart.java#L183-L213 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithoutPath.java | PactDslRequestWithoutPath.pathFromProviderState | public PactDslRequestWithPath pathFromProviderState(String expression, String example) {
"""
Sets the path to have it's value injected from the provider state
@param expression Expression to be evaluated from the provider state
@param example Example value to use in the consumer test
"""
requestGenerator... | java | public PactDslRequestWithPath pathFromProviderState(String expression, String example) {
requestGenerators.addGenerator(Category.PATH, new ProviderStateGenerator(expression));
return new PactDslRequestWithPath(consumerPactBuilder, consumerName, providerName, pactDslWithState.state,
description, example, r... | [
"public",
"PactDslRequestWithPath",
"pathFromProviderState",
"(",
"String",
"expression",
",",
"String",
"example",
")",
"{",
"requestGenerators",
".",
"addGenerator",
"(",
"Category",
".",
"PATH",
",",
"new",
"ProviderStateGenerator",
"(",
"expression",
")",
")",
"... | Sets the path to have it's value injected from the provider state
@param expression Expression to be evaluated from the provider state
@param example Example value to use in the consumer test | [
"Sets",
"the",
"path",
"to",
"have",
"it",
"s",
"value",
"injected",
"from",
"the",
"provider",
"state"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithoutPath.java#L319-L324 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/panel/PanelRenderer.java | PanelRenderer.decode | @Override
public void decode(FacesContext context, UIComponent component) {
"""
This methods receives and processes input made by the user. More
specifically, it ckecks whether the user has interacted with the current
b:panel. The default implementation simply stores the input value in the
list of submitted va... | java | @Override
public void decode(FacesContext context, UIComponent component) {
Panel panel = (Panel) component;
String clientId = panel.getClientId(context);
String jQueryClientID = clientId.replace(":", "_");
// the panel uses two ids to send requests to the server!
new AJAXRenderer().decode(context, componen... | [
"@",
"Override",
"public",
"void",
"decode",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"{",
"Panel",
"panel",
"=",
"(",
"Panel",
")",
"component",
";",
"String",
"clientId",
"=",
"panel",
".",
"getClientId",
"(",
"context",
")",
... | This methods receives and processes input made by the user. More
specifically, it ckecks whether the user has interacted with the current
b:panel. The default implementation simply stores the input value in the
list of submitted values. If the validation checks are passed, the values
in the <code>submittedValues</code>... | [
"This",
"methods",
"receives",
"and",
"processes",
"input",
"made",
"by",
"the",
"user",
".",
"More",
"specifically",
"it",
"ckecks",
"whether",
"the",
"user",
"has",
"interacted",
"with",
"the",
"current",
"b",
":",
"panel",
".",
"The",
"default",
"implemen... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panel/PanelRenderer.java#L51-L69 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java | JedisUtils.newShardedJedisPool | public static ShardedJedisPool newShardedJedisPool(JedisPoolConfig poolConfig,
String hostsAndPorts, String password, int timeoutMs) {
"""
Create a new {@link ShardedJedisPool}.
@param poolConfig
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@param passwo... | java | public static ShardedJedisPool newShardedJedisPool(JedisPoolConfig poolConfig,
String hostsAndPorts, String password, int timeoutMs) {
List<JedisShardInfo> shards = new ArrayList<>();
String[] hapList = hostsAndPorts.split("[,;\\s]+");
for (String hostAndPort : hapList) {
... | [
"public",
"static",
"ShardedJedisPool",
"newShardedJedisPool",
"(",
"JedisPoolConfig",
"poolConfig",
",",
"String",
"hostsAndPorts",
",",
"String",
"password",
",",
"int",
"timeoutMs",
")",
"{",
"List",
"<",
"JedisShardInfo",
">",
"shards",
"=",
"new",
"ArrayList",
... | Create a new {@link ShardedJedisPool}.
@param poolConfig
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@param password
@param timeoutMs
@return | [
"Create",
"a",
"new",
"{",
"@link",
"ShardedJedisPool",
"}",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java#L438-L453 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/impl/StorageWriter.java | StorageWriter.getIndexStream | private DataOutputStream getIndexStream(int keyLength)
throws IOException {
"""
Get the index stream for the specified keyLength, create it if needed
"""
// Resize array if necessary
if (indexStreams.length <= keyLength) {
indexStreams = Arrays.copyOf(indexStreams, keyLength + 1);
ind... | java | private DataOutputStream getIndexStream(int keyLength)
throws IOException {
// Resize array if necessary
if (indexStreams.length <= keyLength) {
indexStreams = Arrays.copyOf(indexStreams, keyLength + 1);
indexFiles = Arrays.copyOf(indexFiles, keyLength + 1);
keyCounts = Arrays.copyOf(key... | [
"private",
"DataOutputStream",
"getIndexStream",
"(",
"int",
"keyLength",
")",
"throws",
"IOException",
"{",
"// Resize array if necessary",
"if",
"(",
"indexStreams",
".",
"length",
"<=",
"keyLength",
")",
"{",
"indexStreams",
"=",
"Arrays",
".",
"copyOf",
"(",
"... | Get the index stream for the specified keyLength, create it if needed | [
"Get",
"the",
"index",
"stream",
"for",
"the",
"specified",
"keyLength",
"create",
"it",
"if",
"needed"
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/impl/StorageWriter.java#L453-L479 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosetsCommentsApi.java | PhotosetsCommentsApi.addComment | public CommentAdd addComment(String photosetId, String comment) throws JinxException {
"""
Add a comment to a photoset.
<br>
This method requires authentication with 'write' permission.
@param photosetId id of the photoset to add a comment to.
@param comment text of the comment.
@return object with the n... | java | public CommentAdd addComment(String photosetId, String comment) throws JinxException {
JinxUtils.validateParams(photosetId, comment);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photosets.comments.addComment");
params.put("photoset_id", photosetId);
params.put("comment... | [
"public",
"CommentAdd",
"addComment",
"(",
"String",
"photosetId",
",",
"String",
"comment",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photosetId",
",",
"comment",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params... | Add a comment to a photoset.
<br>
This method requires authentication with 'write' permission.
@param photosetId id of the photoset to add a comment to.
@param comment text of the comment.
@return object with the newly created comment's ID.
@throws JinxException if parameters are null or empty, or if there are any ... | [
"Add",
"a",
"comment",
"to",
"a",
"photoset",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosetsCommentsApi.java#L55-L62 |
square/pagerduty-incidents | src/main/java/com/squareup/pagerduty/incidents/Util.java | Util.checkStringArgument | static String checkStringArgument(String s, String name) {
"""
Reject {@code null}, empty, and blank strings with a good exception type and message.
"""
checkNotNull(s, name);
checkArgument(!s.trim().isEmpty(), "'" + name + "' must not be blank. Was: '" + s + "'");
return s;
} | java | static String checkStringArgument(String s, String name) {
checkNotNull(s, name);
checkArgument(!s.trim().isEmpty(), "'" + name + "' must not be blank. Was: '" + s + "'");
return s;
} | [
"static",
"String",
"checkStringArgument",
"(",
"String",
"s",
",",
"String",
"name",
")",
"{",
"checkNotNull",
"(",
"s",
",",
"name",
")",
";",
"checkArgument",
"(",
"!",
"s",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
",",
"\"'\"",
"+",
"name... | Reject {@code null}, empty, and blank strings with a good exception type and message. | [
"Reject",
"{"
] | train | https://github.com/square/pagerduty-incidents/blob/81f29c2bd5b08c8a2f0d2abd2083f23d150fc8dd/src/main/java/com/squareup/pagerduty/incidents/Util.java#L24-L28 |
sahan/DroidBallet | droidballet/src/main/java/com/lonepulse/droidballet/detector/HorizontalMotionDetector.java | HorizontalMotionDetector.processHorizontalDirection | private HORIZONTAL_DIRECTION processHorizontalDirection(float[] output, float midRangeHigh, float midRangeLow) {
"""
<p>Determines the {@link HORIZONTAL_DIRECTION} of the motion and trims
the sensor reading on the X-Axis to within the bounds handled by the the
motion detector.
@param output
the smoothed sens... | java | private HORIZONTAL_DIRECTION processHorizontalDirection(float[] output, float midRangeHigh, float midRangeLow) {
output[1] = (output[1] < 0)? 0.0f : output[1];
if (output[1] < midRangeLow) {
output[1] *= -1;
return HORIZONTAL_DIRECTION.RIGHT;
}
else if (output[1] > midRangeHigh) {
return HORIZON... | [
"private",
"HORIZONTAL_DIRECTION",
"processHorizontalDirection",
"(",
"float",
"[",
"]",
"output",
",",
"float",
"midRangeHigh",
",",
"float",
"midRangeLow",
")",
"{",
"output",
"[",
"1",
"]",
"=",
"(",
"output",
"[",
"1",
"]",
"<",
"0",
")",
"?",
"0.0f",
... | <p>Determines the {@link HORIZONTAL_DIRECTION} of the motion and trims
the sensor reading on the X-Axis to within the bounds handled by the the
motion detector.
@param output
the smoothed sensor values
@param midRangeHigh
the upper-bound of the mid-range which correlates with {@link HORIZONTAL_DIRECTION#NONE}
@param... | [
"<p",
">",
"Determines",
"the",
"{",
"@link",
"HORIZONTAL_DIRECTION",
"}",
"of",
"the",
"motion",
"and",
"trims",
"the",
"sensor",
"reading",
"on",
"the",
"X",
"-",
"Axis",
"to",
"within",
"the",
"bounds",
"handled",
"by",
"the",
"the",
"motion",
"detector... | train | https://github.com/sahan/DroidBallet/blob/c6001c9e933cb2c8dbcabe1ae561678b31b10b62/droidballet/src/main/java/com/lonepulse/droidballet/detector/HorizontalMotionDetector.java#L141-L158 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/pipeline/ChunkAnnotationUtils.java | ChunkAnnotationUtils.getAnnotatedChunk | public static Annotation getAnnotatedChunk(List<CoreLabel> tokens, int tokenStartIndex, int tokenEndIndex, int totalTokenOffset) {
"""
Create a new chunk Annotation with basic chunk information
CharacterOffsetBeginAnnotation - set to CharacterOffsetBeginAnnotation of first token in chunk
CharacterOffsetEndAnnota... | java | public static Annotation getAnnotatedChunk(List<CoreLabel> tokens, int tokenStartIndex, int tokenEndIndex, int totalTokenOffset)
{
Annotation chunk = new Annotation("");
annotateChunk(chunk, tokens, tokenStartIndex, tokenEndIndex, totalTokenOffset);
return chunk;
} | [
"public",
"static",
"Annotation",
"getAnnotatedChunk",
"(",
"List",
"<",
"CoreLabel",
">",
"tokens",
",",
"int",
"tokenStartIndex",
",",
"int",
"tokenEndIndex",
",",
"int",
"totalTokenOffset",
")",
"{",
"Annotation",
"chunk",
"=",
"new",
"Annotation",
"(",
"\"\"... | Create a new chunk Annotation with basic chunk information
CharacterOffsetBeginAnnotation - set to CharacterOffsetBeginAnnotation of first token in chunk
CharacterOffsetEndAnnotation - set to CharacterOffsetEndAnnotation of last token in chunk
TokensAnnotation - List of tokens in this chunk
TokenBeginAnnotation - Index... | [
"Create",
"a",
"new",
"chunk",
"Annotation",
"with",
"basic",
"chunk",
"information",
"CharacterOffsetBeginAnnotation",
"-",
"set",
"to",
"CharacterOffsetBeginAnnotation",
"of",
"first",
"token",
"in",
"chunk",
"CharacterOffsetEndAnnotation",
"-",
"set",
"to",
"Characte... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/pipeline/ChunkAnnotationUtils.java#L614-L619 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/configuration/JspConfiguration.java | JspConfiguration.createClonedJspConfiguration | public JspConfiguration createClonedJspConfiguration() {
"""
This method is used for creating a configuration for a tag file. The tag file may want to override some properties if it's jsp version in the tld is different than the server version
"""
return new JspConfiguration(configManager, this.getSer... | java | public JspConfiguration createClonedJspConfiguration() {
return new JspConfiguration(configManager, this.getServletVersion(), this.jspVersion, this.isXml, this.isXmlSpecified, this.elIgnored, this.scriptingInvalid(), this.isTrimDirectiveWhitespaces(), this.isDeferredSyntaxAllowedAsLiteral(), this.getTrimDirecti... | [
"public",
"JspConfiguration",
"createClonedJspConfiguration",
"(",
")",
"{",
"return",
"new",
"JspConfiguration",
"(",
"configManager",
",",
"this",
".",
"getServletVersion",
"(",
")",
",",
"this",
".",
"jspVersion",
",",
"this",
".",
"isXml",
",",
"this",
".",
... | This method is used for creating a configuration for a tag file. The tag file may want to override some properties if it's jsp version in the tld is different than the server version | [
"This",
"method",
"is",
"used",
"for",
"creating",
"a",
"configuration",
"for",
"a",
"tag",
"file",
".",
"The",
"tag",
"file",
"may",
"want",
"to",
"override",
"some",
"properties",
"if",
"it",
"s",
"jsp",
"version",
"in",
"the",
"tld",
"is",
"different"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/configuration/JspConfiguration.java#L118-L120 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java | DatabaseImpl.forceInsert | public void forceInsert(final List<ForceInsertItem> items) throws DocumentException {
"""
<p>
Inserts one or more revisions of a document into the database. For efficiency, this is
performed as one database transaction.
</p>
<p>
Each revision is inserted at a point in the tree expressed by the path described ... | java | public void forceInsert(final List<ForceInsertItem> items) throws DocumentException {
Misc.checkState(this.isOpen(), "Database is closed");
for (ForceInsertItem item : items) {
Misc.checkNotNull(item.rev, "Input document revision");
Misc.checkNotNull(item.revisionHistory, "Input... | [
"public",
"void",
"forceInsert",
"(",
"final",
"List",
"<",
"ForceInsertItem",
">",
"items",
")",
"throws",
"DocumentException",
"{",
"Misc",
".",
"checkState",
"(",
"this",
".",
"isOpen",
"(",
")",
",",
"\"Database is closed\"",
")",
";",
"for",
"(",
"Force... | <p>
Inserts one or more revisions of a document into the database. For efficiency, this is
performed as one database transaction.
</p>
<p>
Each revision is inserted at a point in the tree expressed by the path described in the
{@code revisionHistory} field. If any non-leaf revisions do not exist locally, then they are
... | [
"<p",
">",
"Inserts",
"one",
"or",
"more",
"revisions",
"of",
"a",
"document",
"into",
"the",
"database",
".",
"For",
"efficiency",
"this",
"is",
"performed",
"as",
"one",
"database",
"transaction",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Each",
"revision",... | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java#L541-L574 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java | JacksonDBCollection.findAndRemove | public T findAndRemove(DBObject query) {
"""
calls {@link DBCollection#findAndModify(com.mongodb.DBObject, com.mongodb.DBObject, com.mongodb.DBObject, boolean, com.mongodb.DBObject, boolean, boolean)}
with fields=null, sort=null, remove=true, returnNew=false, upsert=false
@param query The query
@return the re... | java | public T findAndRemove(DBObject query) {
return findAndModify(query, null, null, true, new BasicDBObject(), false, false); // Alibi DBObject due ambiguous method call
} | [
"public",
"T",
"findAndRemove",
"(",
"DBObject",
"query",
")",
"{",
"return",
"findAndModify",
"(",
"query",
",",
"null",
",",
"null",
",",
"true",
",",
"new",
"BasicDBObject",
"(",
")",
",",
"false",
",",
"false",
")",
";",
"// Alibi DBObject due ambiguous ... | calls {@link DBCollection#findAndModify(com.mongodb.DBObject, com.mongodb.DBObject, com.mongodb.DBObject, boolean, com.mongodb.DBObject, boolean, boolean)}
with fields=null, sort=null, remove=true, returnNew=false, upsert=false
@param query The query
@return the removed object | [
"calls",
"{",
"@link",
"DBCollection#findAndModify",
"(",
"com",
".",
"mongodb",
".",
"DBObject",
"com",
".",
"mongodb",
".",
"DBObject",
"com",
".",
"mongodb",
".",
"DBObject",
"boolean",
"com",
".",
"mongodb",
".",
"DBObject",
"boolean",
"boolean",
")",
"}... | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L659-L661 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/helpers/APIHelper.java | APIHelper.createMessage | public static MessageToSend createMessage(@NonNull String conversationId, @NonNull String body, @Nullable String title) {
"""
Convenience method to create a Message object with a single text body part.
@param conversationId Unique conversation id.
@param body Message text body.
@param title ... | java | public static MessageToSend createMessage(@NonNull String conversationId, @NonNull String body, @Nullable String title) {
Map<String, Object> fcm = new HashMap<>();
String fcmMsg = !TextUtils.isEmpty(body) ? body : "attachments";
fcm.put("notification", new Notification(title != null ? title : ... | [
"public",
"static",
"MessageToSend",
"createMessage",
"(",
"@",
"NonNull",
"String",
"conversationId",
",",
"@",
"NonNull",
"String",
"body",
",",
"@",
"Nullable",
"String",
"title",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"fcm",
"=",
"new",
"H... | Convenience method to create a Message object with a single text body part.
@param conversationId Unique conversation id.
@param body Message text body.
@param title Remote notification title.
@return Message object that can by sent to other participants of the conversation. | [
"Convenience",
"method",
"to",
"create",
"a",
"Message",
"object",
"with",
"a",
"single",
"text",
"body",
"part",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/helpers/APIHelper.java#L50-L64 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/DataFrames.java | DataFrames.toDataFrame | public static DataRowsFacade toDataFrame(Schema schema, JavaRDD<List<Writable>> data) {
"""
Creates a data frame from a collection of writables
rdd given a schema
@param schema the schema to use
@param data the data to convert
@return the dataframe object
"""
JavaSparkContext sc = new JavaSpark... | java | public static DataRowsFacade toDataFrame(Schema schema, JavaRDD<List<Writable>> data) {
JavaSparkContext sc = new JavaSparkContext(data.context());
SQLContext sqlContext = new SQLContext(sc);
JavaRDD<Row> rows = data.map(new ToRow(schema));
return dataRows(sqlContext.createDataFrame(rows... | [
"public",
"static",
"DataRowsFacade",
"toDataFrame",
"(",
"Schema",
"schema",
",",
"JavaRDD",
"<",
"List",
"<",
"Writable",
">",
">",
"data",
")",
"{",
"JavaSparkContext",
"sc",
"=",
"new",
"JavaSparkContext",
"(",
"data",
".",
"context",
"(",
")",
")",
";... | Creates a data frame from a collection of writables
rdd given a schema
@param schema the schema to use
@param data the data to convert
@return the dataframe object | [
"Creates",
"a",
"data",
"frame",
"from",
"a",
"collection",
"of",
"writables",
"rdd",
"given",
"a",
"schema"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/DataFrames.java#L321-L326 |
lesaint/damapping | core-parent/model/src/main/java/fr/javatronic/damapping/processor/model/factory/DATypeFactory.java | DATypeFactory.from | @Nonnull
public static DAType from(@Nonnull Class<?> clazz, @Nonnull List<DAType> typeArgs) {
"""
Créer un objet DAType à partir de la Class d'une enum/classe/annotation et la liste typeArgs.
@param clazz une {@link Class}
@param typeArgs une {@link List} de {@link DAType}
@return un objet {@link DATyp... | java | @Nonnull
public static DAType from(@Nonnull Class<?> clazz, @Nonnull List<DAType> typeArgs) {
return instance(clazz.getSimpleName(), clazz.getCanonicalName(), typeArgs);
} | [
"@",
"Nonnull",
"public",
"static",
"DAType",
"from",
"(",
"@",
"Nonnull",
"Class",
"<",
"?",
">",
"clazz",
",",
"@",
"Nonnull",
"List",
"<",
"DAType",
">",
"typeArgs",
")",
"{",
"return",
"instance",
"(",
"clazz",
".",
"getSimpleName",
"(",
")",
",",
... | Créer un objet DAType à partir de la Class d'une enum/classe/annotation et la liste typeArgs.
@param clazz une {@link Class}
@param typeArgs une {@link List} de {@link DAType}
@return un objet {@link DAType} | [
"Créer",
"un",
"objet",
"DAType",
"à",
"partir",
"de",
"la",
"Class",
"d",
"une",
"enum",
"/",
"classe",
"/",
"annotation",
"et",
"la",
"liste",
"typeArgs",
"."
] | train | https://github.com/lesaint/damapping/blob/357afa5866939fd2a18c09213975ffef4836f328/core-parent/model/src/main/java/fr/javatronic/damapping/processor/model/factory/DATypeFactory.java#L70-L73 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetricSchemaRecord.java | MetricSchemaRecord.constructSchemaRecord | public static MetricSchemaRecord constructSchemaRecord(String s) {
"""
/*
Returns the Metric Schema Record constructed from a given string
@param s String representing the metric expression in the format scope:metric{tagKey=tagValue}:namespace
"""
if(s==null || s.length()==0)
return null;
... | java | public static MetricSchemaRecord constructSchemaRecord(String s){
if(s==null || s.length()==0)
return null;
String[] querySplit=s.split(":");
String scope=querySplit[0], namespace=querySplit.length==3?querySplit[2]:null,metric, tagKey, tagValue;
if(querySplit[1].contains("{")){
met... | [
"public",
"static",
"MetricSchemaRecord",
"constructSchemaRecord",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"null",
";",
"String",
"[",
"]",
"querySplit",
"=",
"s",
".",
... | /*
Returns the Metric Schema Record constructed from a given string
@param s String representing the metric expression in the format scope:metric{tagKey=tagValue}:namespace | [
"/",
"*",
"Returns",
"the",
"Metric",
"Schema",
"Record",
"constructed",
"from",
"a",
"given",
"string"
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetricSchemaRecord.java#L300-L322 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/InternalUtils.java | InternalUtils.setForwardedFormBean | public static void setForwardedFormBean( ServletRequest request, ActionForm form ) {
"""
Set the forwarded form. This overrides the auto-generated form created by processActionForm
and populated by processPopulate (in PageFlowRequestProcessor).
"""
if ( form == null )
{
request.re... | java | public static void setForwardedFormBean( ServletRequest request, ActionForm form )
{
if ( form == null )
{
request.removeAttribute( FORWARDED_FORMBEAN_ATTR );
}
else
{
request.setAttribute( FORWARDED_FORMBEAN_ATTR, form );
}
} | [
"public",
"static",
"void",
"setForwardedFormBean",
"(",
"ServletRequest",
"request",
",",
"ActionForm",
"form",
")",
"{",
"if",
"(",
"form",
"==",
"null",
")",
"{",
"request",
".",
"removeAttribute",
"(",
"FORWARDED_FORMBEAN_ATTR",
")",
";",
"}",
"else",
"{",... | Set the forwarded form. This overrides the auto-generated form created by processActionForm
and populated by processPopulate (in PageFlowRequestProcessor). | [
"Set",
"the",
"forwarded",
"form",
".",
"This",
"overrides",
"the",
"auto",
"-",
"generated",
"form",
"created",
"by",
"processActionForm",
"and",
"populated",
"by",
"processPopulate",
"(",
"in",
"PageFlowRequestProcessor",
")",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/InternalUtils.java#L1022-L1032 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/replay/HttpHeaderOperation.java | HttpHeaderOperation.replaceHeader | public static void replaceHeader(Map<String, String> headers, String name, String value) {
"""
Replace header field {@code name} value with {@code value}, or
add it if {@code headers} does not have {@code name}.
@param headers header fields
@param name header field name
@param value new value for the header fi... | java | public static void replaceHeader(Map<String, String> headers, String name, String value) {
removeHeader(headers, name);
headers.put(name, value);
} | [
"public",
"static",
"void",
"replaceHeader",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"removeHeader",
"(",
"headers",
",",
"name",
")",
";",
"headers",
".",
"put",
"(",
"name",
"... | Replace header field {@code name} value with {@code value}, or
add it if {@code headers} does not have {@code name}.
@param headers header fields
@param name header field name
@param value new value for the header field | [
"Replace",
"header",
"field",
"{"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/replay/HttpHeaderOperation.java#L166-L169 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/jni/Serial.java | Serial.write | public synchronized static void write(int fd, Charset charset, CharBuffer ... data) throws IllegalStateException, IOException {
"""
<p>Sends one or more CharBuffers to the serial port/device identified by the given file descriptor.</p>
@param fd
The file descriptor of the serial port/device.
@param charset
T... | java | public synchronized static void write(int fd, Charset charset, CharBuffer ... data) throws IllegalStateException, IOException {
for(CharBuffer single : data) {
write(fd, charset.encode(single));
}
} | [
"public",
"synchronized",
"static",
"void",
"write",
"(",
"int",
"fd",
",",
"Charset",
"charset",
",",
"CharBuffer",
"...",
"data",
")",
"throws",
"IllegalStateException",
",",
"IOException",
"{",
"for",
"(",
"CharBuffer",
"single",
":",
"data",
")",
"{",
"w... | <p>Sends one or more CharBuffers to the serial port/device identified by the given file descriptor.</p>
@param fd
The file descriptor of the serial port/device.
@param charset
The character set to use for encoding/decoding bytes to/from text characters
@param data
One or more CharBuffers (or an array) of data to be tr... | [
"<p",
">",
"Sends",
"one",
"or",
"more",
"CharBuffers",
"to",
"the",
"serial",
"port",
"/",
"device",
"identified",
"by",
"the",
"given",
"file",
"descriptor",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/jni/Serial.java#L826-L830 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/graphics/GraphicUtils.java | GraphicUtils.filterColor | public static int filterColor(int color, Filter filter) {
"""
Color filtering.
@param color color value in layout 0xAARRGGBB.
@param filter filter to apply on the color.
@return the filtered color.
"""
if (filter == Filter.NONE) {
return color;
}
int a = color >>> 24;
... | java | public static int filterColor(int color, Filter filter) {
if (filter == Filter.NONE) {
return color;
}
int a = color >>> 24;
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
switch (filter) {
case GRAYSCALE:
... | [
"public",
"static",
"int",
"filterColor",
"(",
"int",
"color",
",",
"Filter",
"filter",
")",
"{",
"if",
"(",
"filter",
"==",
"Filter",
".",
"NONE",
")",
"{",
"return",
"color",
";",
"}",
"int",
"a",
"=",
"color",
">>>",
"24",
";",
"int",
"r",
"=",
... | Color filtering.
@param color color value in layout 0xAARRGGBB.
@param filter filter to apply on the color.
@return the filtered color. | [
"Color",
"filtering",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/graphics/GraphicUtils.java#L30-L52 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/api/UserResource.java | UserResource.changeUsername | @POST
@Path("me/username")
@RolesAllowed( {
"""
Change current users username.
The username must be unique
@param usernameRequest new username
@return 200 if success
409 if username is not unique
""""ROLE_ADMIN", "ROLE_USER"})
public Response changeUsername(@Context HttpServletRequest request, User... | java | @POST
@Path("me/username")
@RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
public Response changeUsername(@Context HttpServletRequest request, UsernameRequest usernameRequest) {
Long userId = (Long) request.getAttribute(OAuth2Filter.NAME_USER_ID);
return changeUsername(userId, usernameRequest);
} | [
"@",
"POST",
"@",
"Path",
"(",
"\"me/username\"",
")",
"@",
"RolesAllowed",
"(",
"{",
"\"ROLE_ADMIN\"",
",",
"\"ROLE_USER\"",
"}",
")",
"public",
"Response",
"changeUsername",
"(",
"@",
"Context",
"HttpServletRequest",
"request",
",",
"UsernameRequest",
"usernameR... | Change current users username.
The username must be unique
@param usernameRequest new username
@return 200 if success
409 if username is not unique | [
"Change",
"current",
"users",
"username",
".",
"The",
"username",
"must",
"be",
"unique"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/api/UserResource.java#L325-L331 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ObjectUtils.java | ObjectUtils.equalsIgnoreNull | @NullSafe
public static boolean equalsIgnoreNull(Object obj1, Object obj2) {
"""
Determines whether two objects are equal in value as determined by the Object.equals method. Both objects are
considered equal if and only if both are null or obj1.equals(obj2).
@param obj1 the first Object in the equality comp... | java | @NullSafe
public static boolean equalsIgnoreNull(Object obj1, Object obj2) {
return obj1 == null ? obj2 == null : obj1.equals(obj2);
} | [
"@",
"NullSafe",
"public",
"static",
"boolean",
"equalsIgnoreNull",
"(",
"Object",
"obj1",
",",
"Object",
"obj2",
")",
"{",
"return",
"obj1",
"==",
"null",
"?",
"obj2",
"==",
"null",
":",
"obj1",
".",
"equals",
"(",
"obj2",
")",
";",
"}"
] | Determines whether two objects are equal in value as determined by the Object.equals method. Both objects are
considered equal if and only if both are null or obj1.equals(obj2).
@param obj1 the first Object in the equality comparison.
@param obj2 the second Object in the equality comparison.
@return a boolean value i... | [
"Determines",
"whether",
"two",
"objects",
"are",
"equal",
"in",
"value",
"as",
"determined",
"by",
"the",
"Object",
".",
"equals",
"method",
".",
"Both",
"objects",
"are",
"considered",
"equal",
"if",
"and",
"only",
"if",
"both",
"are",
"null",
"or",
"obj... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ObjectUtils.java#L311-L314 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_click2Call_POST | public void billingAccount_line_serviceName_click2Call_POST(String billingAccount, String serviceName, String calledNumber, String callingNumber, Boolean intercom) throws IOException {
"""
Make a phone call from the current line
REST: POST /telephony/{billingAccount}/line/{serviceName}/click2Call
@param called... | java | public void billingAccount_line_serviceName_click2Call_POST(String billingAccount, String serviceName, String calledNumber, String callingNumber, Boolean intercom) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/click2Call";
StringBuilder sb = path(qPath, billingAccount, serviceN... | [
"public",
"void",
"billingAccount_line_serviceName_click2Call_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"calledNumber",
",",
"String",
"callingNumber",
",",
"Boolean",
"intercom",
")",
"throws",
"IOException",
"{",
"String",
"q... | Make a phone call from the current line
REST: POST /telephony/{billingAccount}/line/{serviceName}/click2Call
@param calledNumber [required]
@param callingNumber [required]
@param intercom [required] Activate the calling number in intercom mode automatically (pick up and speaker automatic activation).
@param billingAcc... | [
"Make",
"a",
"phone",
"call",
"from",
"the",
"current",
"line"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L819-L827 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxDevicePin.java | BoxDevicePin.getEnterpriceDevicePins | public static Iterable<BoxDevicePin.Info> getEnterpriceDevicePins(final BoxAPIConnection api, String enterpriseID,
String ... fields) {
"""
Returns iterable with all the device pins within a given enterprise.
Must be an enterprise admin with t... | java | public static Iterable<BoxDevicePin.Info> getEnterpriceDevicePins(final BoxAPIConnection api, String enterpriseID,
String ... fields) {
return getEnterpriceDevicePins(api, enterpriseID, DEVICES_DEFAULT_LIMIT, fields);
} | [
"public",
"static",
"Iterable",
"<",
"BoxDevicePin",
".",
"Info",
">",
"getEnterpriceDevicePins",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"enterpriseID",
",",
"String",
"...",
"fields",
")",
"{",
"return",
"getEnterpriceDevicePins",
"(",
"api",
","... | Returns iterable with all the device pins within a given enterprise.
Must be an enterprise admin with the manage enterprise scope to make this call.
@param api API used to connect the Box.
@param enterpriseID ID of the enterprise to get all the device pins within.
@param fields the optional fields to retrieve.
@return ... | [
"Returns",
"iterable",
"with",
"all",
"the",
"device",
"pins",
"within",
"a",
"given",
"enterprise",
".",
"Must",
"be",
"an",
"enterprise",
"admin",
"with",
"the",
"manage",
"enterprise",
"scope",
"to",
"make",
"this",
"call",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxDevicePin.java#L70-L73 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsToolBar.java | CmsToolBar.createDropDown | public static Component createDropDown(ExternalResource icon, Component content, String title) {
"""
Creates a drop down menu.<p>
@param icon the button icon
@param content the drop down content
@param title the button title
@return the component
"""
return createDropDown(getDropDownButtonHtml... | java | public static Component createDropDown(ExternalResource icon, Component content, String title) {
return createDropDown(getDropDownButtonHtml(icon), content, title);
} | [
"public",
"static",
"Component",
"createDropDown",
"(",
"ExternalResource",
"icon",
",",
"Component",
"content",
",",
"String",
"title",
")",
"{",
"return",
"createDropDown",
"(",
"getDropDownButtonHtml",
"(",
"icon",
")",
",",
"content",
",",
"title",
")",
";",... | Creates a drop down menu.<p>
@param icon the button icon
@param content the drop down content
@param title the button title
@return the component | [
"Creates",
"a",
"drop",
"down",
"menu",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsToolBar.java#L252-L255 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java | CommerceTierPriceEntryPersistenceImpl.findByC_LtM | @Override
public List<CommerceTierPriceEntry> findByC_LtM(long commercePriceEntryId,
int minQuantity, int start, int end) {
"""
Returns a range of all the commerce tier price entries where commercePriceEntryId = ? and minQuantity ≤ ?.
<p>
Useful when paginating results. Returns a maximum of <code... | java | @Override
public List<CommerceTierPriceEntry> findByC_LtM(long commercePriceEntryId,
int minQuantity, int start, int end) {
return findByC_LtM(commercePriceEntryId, minQuantity, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceTierPriceEntry",
">",
"findByC_LtM",
"(",
"long",
"commercePriceEntryId",
",",
"int",
"minQuantity",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByC_LtM",
"(",
"commercePriceEntryId",
",",
"mi... | Returns a range of all the commerce tier price entries where commercePriceEntryId = ? and minQuantity ≤ ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <cod... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"tier",
"price",
"entries",
"where",
"commercePriceEntryId",
"=",
"?",
";",
"and",
"minQuantity",
"&le",
";",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java#L3313-L3317 |
crawljax/crawljax | plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/OutputBuilder.java | OutputBuilder.persistDom | void persistDom(String name, @Nullable String dom) {
"""
Save the dom to disk.
@param name
statename
@param dom
the DOM as string
"""
try {
Files.write(Strings.nullToEmpty(dom), new File(doms, name + ".html"), Charsets.UTF_8);
} catch (IOException e) {
LOG.warn("Could not save dom state for {}"... | java | void persistDom(String name, @Nullable String dom) {
try {
Files.write(Strings.nullToEmpty(dom), new File(doms, name + ".html"), Charsets.UTF_8);
} catch (IOException e) {
LOG.warn("Could not save dom state for {}", name);
LOG.debug("Could not save dom state", e);
}
} | [
"void",
"persistDom",
"(",
"String",
"name",
",",
"@",
"Nullable",
"String",
"dom",
")",
"{",
"try",
"{",
"Files",
".",
"write",
"(",
"Strings",
".",
"nullToEmpty",
"(",
"dom",
")",
",",
"new",
"File",
"(",
"doms",
",",
"name",
"+",
"\".html\"",
")",... | Save the dom to disk.
@param name
statename
@param dom
the DOM as string | [
"Save",
"the",
"dom",
"to",
"disk",
"."
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/OutputBuilder.java#L262-L269 |
grails/grails-core | grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java | AbstractEncodedAppender.shouldEncode | public boolean shouldEncode(Encoder encoderToApply, EncodingState encodingState) {
"""
Check if the encoder should be used to a input with certain encodingState
@param encoderToApply
the encoder to apply
@param encodingState
the current encoding state
@return true, if should encode
"""
return ig... | java | public boolean shouldEncode(Encoder encoderToApply, EncodingState encodingState) {
return ignoreEncodingState || (encoderToApply != null
&& (encodingState == null || shouldEncodeWith(encoderToApply, encodingState)));
} | [
"public",
"boolean",
"shouldEncode",
"(",
"Encoder",
"encoderToApply",
",",
"EncodingState",
"encodingState",
")",
"{",
"return",
"ignoreEncodingState",
"||",
"(",
"encoderToApply",
"!=",
"null",
"&&",
"(",
"encodingState",
"==",
"null",
"||",
"shouldEncodeWith",
"(... | Check if the encoder should be used to a input with certain encodingState
@param encoderToApply
the encoder to apply
@param encodingState
the current encoding state
@return true, if should encode | [
"Check",
"if",
"the",
"encoder",
"should",
"be",
"used",
"to",
"a",
"input",
"with",
"certain",
"encodingState"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/encoder/AbstractEncodedAppender.java#L170-L173 |
cubedtear/aritzh | aritzh-gameEngine/src/main/java/io/github/aritzhack/aritzh/awt/util/SpriteUtil.java | SpriteUtil.addBorder | public static Sprite addBorder(Sprite original, int color, int size) {
"""
Adds a border to a Sprite (the border is added inside, so part of the sprite will be covered)
@param original The sprite to which the border will be added
@param color The color of the border (in ARGB format: 0xAARRGGBB)
@param size... | java | public static Sprite addBorder(Sprite original, int color, int size) {
int[] newPix = Arrays.copyOf(original.getPixels(), original.getPixels().length);
for (int x = 0; x < original.getWidth(); x++) {
for (int y = 0; y < original.getHeight(); y++) {
if (x < size || x >= original.getWidth() - size || y < size ... | [
"public",
"static",
"Sprite",
"addBorder",
"(",
"Sprite",
"original",
",",
"int",
"color",
",",
"int",
"size",
")",
"{",
"int",
"[",
"]",
"newPix",
"=",
"Arrays",
".",
"copyOf",
"(",
"original",
".",
"getPixels",
"(",
")",
",",
"original",
".",
"getPix... | Adds a border to a Sprite (the border is added inside, so part of the sprite will be covered)
@param original The sprite to which the border will be added
@param color The color of the border (in ARGB format: 0xAARRGGBB)
@param size The sice of the border, in pixels
@return The sprite with the border | [
"Adds",
"a",
"border",
"to",
"a",
"Sprite",
"(",
"the",
"border",
"is",
"added",
"inside",
"so",
"part",
"of",
"the",
"sprite",
"will",
"be",
"covered",
")"
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-gameEngine/src/main/java/io/github/aritzhack/aritzh/awt/util/SpriteUtil.java#L391-L401 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java | ArgumentAttr.processArg | @SuppressWarnings("unchecked")
<T extends JCExpression, Z extends ArgumentType<T>> void processArg(T that, Function<T, Z> argumentTypeFactory) {
"""
Process a method argument; this method takes care of performing a speculative pass over the
argument tree and calling a well-defined entry point to build the arg... | java | @SuppressWarnings("unchecked")
<T extends JCExpression, Z extends ArgumentType<T>> void processArg(T that, Function<T, Z> argumentTypeFactory) {
UniquePos pos = new UniquePos(that);
processArg(that, () -> {
T speculativeTree = (T)deferredAttr.attribSpeculative(that, env, attr.new MethodA... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"<",
"T",
"extends",
"JCExpression",
",",
"Z",
"extends",
"ArgumentType",
"<",
"T",
">",
">",
"void",
"processArg",
"(",
"T",
"that",
",",
"Function",
"<",
"T",
",",
"Z",
">",
"argumentTypeFactory",
")",
... | Process a method argument; this method takes care of performing a speculative pass over the
argument tree and calling a well-defined entry point to build the argument type associated
with such tree. | [
"Process",
"a",
"method",
"argument",
";",
"this",
"method",
"takes",
"care",
"of",
"performing",
"a",
"speculative",
"pass",
"over",
"the",
"argument",
"tree",
"and",
"calling",
"a",
"well",
"-",
"defined",
"entry",
"point",
"to",
"build",
"the",
"argument"... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ArgumentAttr.java#L212-L224 |
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.getEntity | public EntityExtractor getEntity(UUID appId, String versionId, UUID entityId) {
"""
Gets information about the entity model.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@t... | java | public EntityExtractor getEntity(UUID appId, String versionId, UUID entityId) {
return getEntityWithServiceResponseAsync(appId, versionId, entityId).toBlocking().single().body();
} | [
"public",
"EntityExtractor",
"getEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
")",
"{",
"return",
"getEntityWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"entityId",
")",
".",
"toBlocking",
"(",
")",
".",
... | Gets information about the entity model.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeExcepti... | [
"Gets",
"information",
"about",
"the",
"entity",
"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#L3285-L3287 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java | WebSocketClientHandshaker.close | public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
"""
Performs the closing handshake
@param channel
Channel
@param frame
Closing Frame that was received
@param promise
the {@link ChannelPromise} to be notified when the closing handshake is done
"""
... | java | public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
if (channel == null) {
throw new NullPointerException("channel");
}
channel.writeAndFlush(frame, promise);
applyForceCloseTimeout(channel, promise);
return promise;
} | [
"public",
"ChannelFuture",
"close",
"(",
"Channel",
"channel",
",",
"CloseWebSocketFrame",
"frame",
",",
"ChannelPromise",
"promise",
")",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"channel\"",
")",
";",
... | Performs the closing handshake
@param channel
Channel
@param frame
Closing Frame that was received
@param promise
the {@link ChannelPromise} to be notified when the closing handshake is done | [
"Performs",
"the",
"closing",
"handshake"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java#L490-L497 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java | AbstractCodeGen.writeClassComment | void writeClassComment(Definition def, Writer out) throws IOException {
"""
Output class comment
@param def definition
@param out Writer
@throws IOException ioException
"""
out.write("/**\n");
out.write(" * " + getClassName(def));
writeEol(out);
out.write(" *\n");
out.write("... | java | void writeClassComment(Definition def, Writer out) throws IOException
{
out.write("/**\n");
out.write(" * " + getClassName(def));
writeEol(out);
out.write(" *\n");
out.write(" * @version $Revision: $\n");
out.write(" */\n");
} | [
"void",
"writeClassComment",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"\"/**\\n\"",
")",
";",
"out",
".",
"write",
"(",
"\" * \"",
"+",
"getClassName",
"(",
"def",
")",
")",
";",
"writeE... | Output class comment
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class",
"comment"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java#L67-L75 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosSuggestionsApi.java | PhotosSuggestionsApi.suggestLocation | public Suggestions suggestLocation(String photoId, Float lat, Float lon, Integer accuracy, String woeId, String placeId, String note) throws JinxException {
"""
Suggest a geotagged location for a photo.
<br>
This method requires authentication with 'write' permission.
The returned {@link net.jeremybrooks.jinx... | java | public Suggestions suggestLocation(String photoId, Float lat, Float lon, Integer accuracy, String woeId, String placeId, String note) throws JinxException {
JinxUtils.validateParams(photoId, lat, lon);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.suggestions.suggestLocat... | [
"public",
"Suggestions",
"suggestLocation",
"(",
"String",
"photoId",
",",
"Float",
"lat",
",",
"Float",
"lon",
",",
"Integer",
"accuracy",
",",
"String",
"woeId",
",",
"String",
"placeId",
",",
"String",
"note",
")",
"throws",
"JinxException",
"{",
"JinxUtils... | Suggest a geotagged location for a photo.
<br>
This method requires authentication with 'write' permission.
The returned {@link net.jeremybrooks.jinx.response.photos.suggestions.Suggestions} object has only one
Suggestion object in the list, and that Suggestion object has only the suggestionId set. All other fields
wi... | [
"Suggest",
"a",
"geotagged",
"location",
"for",
"a",
"photo",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosSuggestionsApi.java#L145-L165 |
phax/ph-commons | ph-less-commons/src/main/java/com/helger/lesscommons/jmx/ObjectNameHelper.java | ObjectNameHelper.createWithDefaultProperties | @Nonnull
public static ObjectName createWithDefaultProperties (@Nonnull final Object aObj, @Nonnull final String sName) {
"""
Create a standard {@link ObjectName} using the default domain and the
"type" and "name" properties. The type property is the class local name of
the specified object.
@param aObj
Th... | java | @Nonnull
public static ObjectName createWithDefaultProperties (@Nonnull final Object aObj, @Nonnull final String sName)
{
ValueEnforcer.notNull (aObj, "Object");
ValueEnforcer.notNull (sName, "Name");
final Hashtable <String, String> aParams = new Hashtable <> ();
aParams.put (CJMX.PROPERTY_TYPE, C... | [
"@",
"Nonnull",
"public",
"static",
"ObjectName",
"createWithDefaultProperties",
"(",
"@",
"Nonnull",
"final",
"Object",
"aObj",
",",
"@",
"Nonnull",
"final",
"String",
"sName",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aObj",
",",
"\"Object\"",
")",
";... | Create a standard {@link ObjectName} using the default domain and the
"type" and "name" properties. The type property is the class local name of
the specified object.
@param aObj
The object from which the name is to be created.
@param sName
The value of the "name" JMX property
@return The non-<code>null</code> {@link ... | [
"Create",
"a",
"standard",
"{",
"@link",
"ObjectName",
"}",
"using",
"the",
"default",
"domain",
"and",
"the",
"type",
"and",
"name",
"properties",
".",
"The",
"type",
"property",
"is",
"the",
"class",
"local",
"name",
"of",
"the",
"specified",
"object",
"... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-less-commons/src/main/java/com/helger/lesscommons/jmx/ObjectNameHelper.java#L160-L170 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseDelayedExtract | private void parseDelayedExtract(Map<Object, Object> props) {
"""
Check the input configuration for the flag on whether to immediately
extract header values during the parsing stage or not.
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_EXTRACT_VALUE);
if (null != va... | java | private void parseDelayedExtract(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_EXTRACT_VALUE);
if (null != value) {
this.bExtractValue = convertBoolean(value);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
... | [
"private",
"void",
"parseDelayedExtract",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_EXTRACT_VALUE",
")",
";",
"if",
"(",
"null",
"!=",
"value",
... | Check the input configuration for the flag on whether to immediately
extract header values during the parsing stage or not.
@param props | [
"Check",
"the",
"input",
"configuration",
"for",
"the",
"flag",
"on",
"whether",
"to",
"immediately",
"extract",
"header",
"values",
"during",
"the",
"parsing",
"stage",
"or",
"not",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L781-L789 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/creational/proxy/ObjectProxy.java | ObjectProxy.executeMethod | public static Object executeMethod(Object aObject, String methodName, Object[] aArguments)
throws Exception {
"""
Note that this methods does not support auto boxing of primitive types
@param aObject the object
@param methodName the method
@param aArguments the input argument
@return the object return valu... | java | public static Object executeMethod(Object aObject, String methodName, Object[] aArguments)
throws Exception
{
Class<?>[] parameterTypes = null;
ArrayList<Object> parameterTypeArrayList = null;
if(aArguments != null && aArguments.length >0)
{
//get array of inputs
parameterType... | [
"public",
"static",
"Object",
"executeMethod",
"(",
"Object",
"aObject",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"aArguments",
")",
"throws",
"Exception",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
"=",
"null",
";",
"ArrayList",
... | Note that this methods does not support auto boxing of primitive types
@param aObject the object
@param methodName the method
@param aArguments the input argument
@return the object return values
@throws Exception | [
"Note",
"that",
"this",
"methods",
"does",
"not",
"support",
"auto",
"boxing",
"of",
"primitive",
"types"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/creational/proxy/ObjectProxy.java#L42-L90 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.colorListRes | @NonNull
public IconicsDrawable colorListRes(@ColorRes int colorResId) {
"""
Set the color of the drawable.
@param colorResId The color resource, from your R file.
@return The current IconicsDrawable for chaining.
"""
return color(ContextCompat.getColorStateList(mContext, colorResId));
} | java | @NonNull
public IconicsDrawable colorListRes(@ColorRes int colorResId) {
return color(ContextCompat.getColorStateList(mContext, colorResId));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"colorListRes",
"(",
"@",
"ColorRes",
"int",
"colorResId",
")",
"{",
"return",
"color",
"(",
"ContextCompat",
".",
"getColorStateList",
"(",
"mContext",
",",
"colorResId",
")",
")",
";",
"}"
] | Set the color of the drawable.
@param colorResId The color resource, from your R file.
@return The current IconicsDrawable for chaining. | [
"Set",
"the",
"color",
"of",
"the",
"drawable",
"."
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L488-L491 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createTransferMessageSenderFromEntityPath | public static IMessageSender createTransferMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath, String viaEntityPath) throws InterruptedException, ServiceBusException {
"""
Creates a transfer message sender. This sender sends message to destination entity via another entity.
This i... | java | public static IMessageSender createTransferMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath, String viaEntityPath) throws InterruptedException, ServiceBusException
{
return Utils.completeFuture(createTransferMessageSenderFromEntityPathAsync(messagingFactory, entityPath, viaE... | [
"public",
"static",
"IMessageSender",
"createTransferMessageSenderFromEntityPath",
"(",
"MessagingFactory",
"messagingFactory",
",",
"String",
"entityPath",
",",
"String",
"viaEntityPath",
")",
"throws",
"InterruptedException",
",",
"ServiceBusException",
"{",
"return",
"Util... | Creates a transfer message sender. This sender sends message to destination entity via another entity.
This is mainly to be used when sending messages in a transaction.
When messages need to be sent across entities in a single transaction, this can be used to ensure
all the messages land initially in the same entity/p... | [
"Creates",
"a",
"transfer",
"message",
"sender",
".",
"This",
"sender",
"sends",
"message",
"to",
"destination",
"entity",
"via",
"another",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L116-L119 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/StringUtil.java | StringUtil.startsWithIgnoreCase | public static boolean startsWithIgnoreCase(final String base, final String start) {
"""
Helper functions to query a strings start portion. The comparison is case insensitive.
@param base the base string.
@param start the starting text.
@return true, if the string starts with the given starting text.
"""... | java | public static boolean startsWithIgnoreCase(final String base, final String start) {
if (base.length() < start.length()) {
return false;
}
return base.regionMatches(true, 0, start, 0, start.length());
} | [
"public",
"static",
"boolean",
"startsWithIgnoreCase",
"(",
"final",
"String",
"base",
",",
"final",
"String",
"start",
")",
"{",
"if",
"(",
"base",
".",
"length",
"(",
")",
"<",
"start",
".",
"length",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
... | Helper functions to query a strings start portion. The comparison is case insensitive.
@param base the base string.
@param start the starting text.
@return true, if the string starts with the given starting text. | [
"Helper",
"functions",
"to",
"query",
"a",
"strings",
"start",
"portion",
".",
"The",
"comparison",
"is",
"case",
"insensitive",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/StringUtil.java#L889-L894 |
camunda/camunda-commons | logging/src/main/java/org/camunda/commons/logging/BaseLogger.java | BaseLogger.logDebug | protected void logDebug(String id, String messageTemplate, Object... parameters) {
"""
Logs a 'DEBUG' message
@param id the unique id of this log message
@param messageTemplate the message template to use
@param parameters a list of optional parameters
"""
if(delegateLogger.isDebugEnabled()) {
S... | java | protected void logDebug(String id, String messageTemplate, Object... parameters) {
if(delegateLogger.isDebugEnabled()) {
String msg = formatMessageTemplate(id, messageTemplate);
delegateLogger.debug(msg, parameters);
}
} | [
"protected",
"void",
"logDebug",
"(",
"String",
"id",
",",
"String",
"messageTemplate",
",",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"delegateLogger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"String",
"msg",
"=",
"formatMessageTemplate",
"(",
... | Logs a 'DEBUG' message
@param id the unique id of this log message
@param messageTemplate the message template to use
@param parameters a list of optional parameters | [
"Logs",
"a",
"DEBUG",
"message"
] | train | https://github.com/camunda/camunda-commons/blob/bd3195db47c92c25717288fe9e6735f8e882f247/logging/src/main/java/org/camunda/commons/logging/BaseLogger.java#L115-L120 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.constructCNF | private Formula constructCNF(final LinkedHashSet<? extends Formula> clauses) {
"""
Creates a new CNF.
@param clauses the clauses
@return a new CNF
"""
if (clauses.isEmpty())
return this.verum();
if (clauses.size() == 1)
return clauses.iterator().next();
Map<LinkedHashSet<? extends For... | java | private Formula constructCNF(final LinkedHashSet<? extends Formula> clauses) {
if (clauses.isEmpty())
return this.verum();
if (clauses.size() == 1)
return clauses.iterator().next();
Map<LinkedHashSet<? extends Formula>, And> opAndMap = this.andsN;
switch (clauses.size()) {
case 2:
... | [
"private",
"Formula",
"constructCNF",
"(",
"final",
"LinkedHashSet",
"<",
"?",
"extends",
"Formula",
">",
"clauses",
")",
"{",
"if",
"(",
"clauses",
".",
"isEmpty",
"(",
")",
")",
"return",
"this",
".",
"verum",
"(",
")",
";",
"if",
"(",
"clauses",
"."... | Creates a new CNF.
@param clauses the clauses
@return a new CNF | [
"Creates",
"a",
"new",
"CNF",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L507-L532 |
comapi/comapi-chat-sdk-android | COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java | ChatController.synchroniseConversation | Observable<ChatResult> synchroniseConversation(String conversationId) {
"""
Updates single conversation state.
@return Result of synchronisation with services.
"""
return checkState().flatMap(client -> client.service().messaging()
.queryMessages(conversationId, null, 1)
... | java | Observable<ChatResult> synchroniseConversation(String conversationId) {
return checkState().flatMap(client -> client.service().messaging()
.queryMessages(conversationId, null, 1)
.map(result -> {
if (result.isSuccessful() && result.getResult() != null) {
... | [
"Observable",
"<",
"ChatResult",
">",
"synchroniseConversation",
"(",
"String",
"conversationId",
")",
"{",
"return",
"checkState",
"(",
")",
".",
"flatMap",
"(",
"client",
"->",
"client",
".",
"service",
"(",
")",
".",
"messaging",
"(",
")",
".",
"queryMess... | Updates single conversation state.
@return Result of synchronisation with services. | [
"Updates",
"single",
"conversation",
"state",
"."
] | train | https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java#L504-L518 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicatedCloud_serviceName_additionalBandwidth_duration_GET | public OvhOrder dedicatedCloud_serviceName_additionalBandwidth_duration_GET(String serviceName, String duration, OvhAdditionalBandwidthEnum bandwidth) throws IOException {
"""
Get prices and contracts information
REST: GET /order/dedicatedCloud/{serviceName}/additionalBandwidth/{duration}
@param bandwidth [req... | java | public OvhOrder dedicatedCloud_serviceName_additionalBandwidth_duration_GET(String serviceName, String duration, OvhAdditionalBandwidthEnum bandwidth) throws IOException {
String qPath = "/order/dedicatedCloud/{serviceName}/additionalBandwidth/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
qu... | [
"public",
"OvhOrder",
"dedicatedCloud_serviceName_additionalBandwidth_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhAdditionalBandwidthEnum",
"bandwidth",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/dedicatedCloud/{ser... | Get prices and contracts information
REST: GET /order/dedicatedCloud/{serviceName}/additionalBandwidth/{duration}
@param bandwidth [required] How much additional bandwidth do you want ?
@param serviceName [required]
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5686-L5692 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/FunctionExtensions.java | FunctionExtensions.andThen | public static <V,T,R> Function1<V, R> andThen(final Function1<? super V, ? extends T> before, final Function1<? super T, ? extends R> after) {
"""
Returns a composed function that first applies the {@code before}
function to its input, and then applies the {@code after} function to the result.
If evaluation of e... | java | public static <V,T,R> Function1<V, R> andThen(final Function1<? super V, ? extends T> before, final Function1<? super T, ? extends R> after) {
return compose(after, before);
} | [
"public",
"static",
"<",
"V",
",",
"T",
",",
"R",
">",
"Function1",
"<",
"V",
",",
"R",
">",
"andThen",
"(",
"final",
"Function1",
"<",
"?",
"super",
"V",
",",
"?",
"extends",
"T",
">",
"before",
",",
"final",
"Function1",
"<",
"?",
"super",
"T",... | Returns a composed function that first applies the {@code before}
function to its input, and then applies the {@code after} function to the result.
If evaluation of either function throws an exception, it is relayed to
the caller of the composed function.
@param <V> the type of input to the {@code before} function, an... | [
"Returns",
"a",
"composed",
"function",
"that",
"first",
"applies",
"the",
"{",
"@code",
"before",
"}",
"function",
"to",
"its",
"input",
"and",
"then",
"applies",
"the",
"{",
"@code",
"after",
"}",
"function",
"to",
"the",
"result",
".",
"If",
"evaluation... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/FunctionExtensions.java#L214-L216 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/CopyFieldHandler.java | CopyFieldHandler.init | public void init(BaseField field, BaseField fldDest, Converter fldCheckMark, String fieldName) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param iFieldSeq The field sequence in this record to move this listener's field to.
@param field The field to... | java | public void init(BaseField field, BaseField fldDest, Converter fldCheckMark, String fieldName)
{
BaseField fldSource = null;
boolean bClearIfThisNull = true;
boolean bOnlyIfDestNull = false;
boolean bDontMoveNull = false;
super.init(field, fldDest, fldSource, bClearIfThisNull... | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"BaseField",
"fldDest",
",",
"Converter",
"fldCheckMark",
",",
"String",
"fieldName",
")",
"{",
"BaseField",
"fldSource",
"=",
"null",
";",
"boolean",
"bClearIfThisNull",
"=",
"true",
";",
"boolean",
"b... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param iFieldSeq The field sequence in this record to move this listener's field to.
@param field The field to move this listener's field to.
@param fldCheckMark Only move if this field evaluates to true. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CopyFieldHandler.java#L79-L91 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/internal/mysql/MySQLProtocol.java | MySQLProtocol.cancelCurrentQuery | public void cancelCurrentQuery() throws QueryException {
"""
cancels the current query - clones the current protocol and executes a query using the new connection
<p/>
thread safe
@throws QueryException
"""
Protocol copiedProtocol = new MySQLProtocol(host, port, database, username, password, info)... | java | public void cancelCurrentQuery() throws QueryException {
Protocol copiedProtocol = new MySQLProtocol(host, port, database, username, password, info);
queryWasCancelled = true;
copiedProtocol.executeQuery(new DrizzleQuery("KILL QUERY " + serverThreadId));
copiedProtocol.close();
} | [
"public",
"void",
"cancelCurrentQuery",
"(",
")",
"throws",
"QueryException",
"{",
"Protocol",
"copiedProtocol",
"=",
"new",
"MySQLProtocol",
"(",
"host",
",",
"port",
",",
"database",
",",
"username",
",",
"password",
",",
"info",
")",
";",
"queryWasCancelled",... | cancels the current query - clones the current protocol and executes a query using the new connection
<p/>
thread safe
@throws QueryException | [
"cancels",
"the",
"current",
"query",
"-",
"clones",
"the",
"current",
"protocol",
"and",
"executes",
"a",
"query",
"using",
"the",
"new",
"connection",
"<p",
"/",
">",
"thread",
"safe"
] | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/mysql/MySQLProtocol.java#L624-L629 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java | TmdbTV.getTVCredits | public MediaCreditList getTVCredits(int tvID, String language) throws MovieDbException {
"""
Get the cast & crew information about a TV series.
@param tvID
@param language
@return
@throws com.omertron.themoviedbapi.MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
par... | java | public MediaCreditList getTVCredits(int tvID, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.CREDITS).b... | [
"public",
"MediaCreditList",
"getTVCredits",
"(",
"int",
"tvID",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"ID",
... | Get the cast & crew information about a TV series.
@param tvID
@param language
@return
@throws com.omertron.themoviedbapi.MovieDbException | [
"Get",
"the",
"cast",
"&",
"crew",
"information",
"about",
"a",
"TV",
"series",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java#L176-L188 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.getWebElement | public WebElement getWebElement(By by, int index) {
"""
Returns a WebElement matching the specified By object and index.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param index the index of the {@link WebElement}. {@code 0} if only one is available
@return a {@link ... | java | public WebElement getWebElement(By by, int index){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "getWebElement("+by+", "+index+")");
}
int match = index + 1;
WebElement webElement = waiter.waitForWebElement(by, match, Timeout.getSmallTimeout(), true);
if(webElement == null) {
if(match ... | [
"public",
"WebElement",
"getWebElement",
"(",
"By",
"by",
",",
"int",
"index",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"getWebElement(\"",
"+",
"by",
"+",
"\", \"",
... | Returns a WebElement matching the specified By object and index.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param index the index of the {@link WebElement}. {@code 0} if only one is available
@return a {@link WebElement} matching the specified index | [
"Returns",
"a",
"WebElement",
"matching",
"the",
"specified",
"By",
"object",
"and",
"index",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3174-L3191 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/util/Util.java | Util.mkString | public static String mkString(@javax.annotation.Nonnull final String separator, final String... strs) {
"""
Mk string string.
@param separator the separator
@param strs the strs
@return the string
"""
return Arrays.asList(strs).stream().collect(Collectors.joining(separator));
} | java | public static String mkString(@javax.annotation.Nonnull final String separator, final String... strs) {
return Arrays.asList(strs).stream().collect(Collectors.joining(separator));
} | [
"public",
"static",
"String",
"mkString",
"(",
"@",
"javax",
".",
"annotation",
".",
"Nonnull",
"final",
"String",
"separator",
",",
"final",
"String",
"...",
"strs",
")",
"{",
"return",
"Arrays",
".",
"asList",
"(",
"strs",
")",
".",
"stream",
"(",
")",... | Mk string string.
@param separator the separator
@param strs the strs
@return the string | [
"Mk",
"string",
"string",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/util/Util.java#L345-L347 |
soulwarelabs/jParley-Utility | src/main/java/com/soulwarelabs/jparley/utility/Manager.java | Manager.setupAll | public void setupAll(Connection connection, Statement statement)
throws SQLException {
"""
Set up all registered parameters to specified statement.
@param connection an SQL database connection.
@param statement an SQL callable statement.
@throws SQLException if error occurs while setting up parame... | java | public void setupAll(Connection connection, Statement statement)
throws SQLException {
for (Object key : mappings.keySet()) {
Parameter parameter = mappings.get(key);
if (parameter.getInput() != null) {
Object value = parameter.getInput().getValue();
... | [
"public",
"void",
"setupAll",
"(",
"Connection",
"connection",
",",
"Statement",
"statement",
")",
"throws",
"SQLException",
"{",
"for",
"(",
"Object",
"key",
":",
"mappings",
".",
"keySet",
"(",
")",
")",
"{",
"Parameter",
"parameter",
"=",
"mappings",
".",... | Set up all registered parameters to specified statement.
@param connection an SQL database connection.
@param statement an SQL callable statement.
@throws SQLException if error occurs while setting up parameters.
@see Connection
@see Statement
@since v1.0 | [
"Set",
"up",
"all",
"registered",
"parameters",
"to",
"specified",
"statement",
"."
] | train | https://github.com/soulwarelabs/jParley-Utility/blob/825d139b9d294ef4cf71dbce349be5cb3da1b3a9/src/main/java/com/soulwarelabs/jparley/utility/Manager.java#L200-L218 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/crdt/pncounter/PNCounterImpl.java | PNCounterImpl.get | public CRDTTimestampedLong get(VectorClock observedTimestamps) {
"""
Returns the current value of the counter.
<p>
The method can throw a {@link ConsistencyLostException} when the state
of this CRDT is not causally related to the observed timestamps. This
means that it cannot provide the session guarantees of ... | java | public CRDTTimestampedLong get(VectorClock observedTimestamps) {
checkSessionConsistency(observedTimestamps);
stateReadLock.lock();
try {
long value = 0;
for (long[] pnValue : state.values()) {
value += pnValue[0];
value -= pnValue[1];
... | [
"public",
"CRDTTimestampedLong",
"get",
"(",
"VectorClock",
"observedTimestamps",
")",
"{",
"checkSessionConsistency",
"(",
"observedTimestamps",
")",
";",
"stateReadLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"long",
"value",
"=",
"0",
";",
"for",
"(",
"lo... | Returns the current value of the counter.
<p>
The method can throw a {@link ConsistencyLostException} when the state
of this CRDT is not causally related to the observed timestamps. This
means that it cannot provide the session guarantees of RYW (read your
writes) and monotonic read.
@param observedTimestamps the vect... | [
"Returns",
"the",
"current",
"value",
"of",
"the",
"counter",
".",
"<p",
">",
"The",
"method",
"can",
"throw",
"a",
"{",
"@link",
"ConsistencyLostException",
"}",
"when",
"the",
"state",
"of",
"this",
"CRDT",
"is",
"not",
"causally",
"related",
"to",
"the"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/crdt/pncounter/PNCounterImpl.java#L80-L93 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/AbstractReturnValueIgnored.java | AbstractReturnValueIgnored.mockitoInvocation | private static boolean mockitoInvocation(Tree tree, VisitorState state) {
"""
Don't match the method that is invoked through {@code Mockito.verify(t)} or {@code
doReturn(val).when(t)}.
"""
if (!(tree instanceof JCMethodInvocation)) {
return false;
}
JCMethodInvocation invocation = (JCMethodI... | java | private static boolean mockitoInvocation(Tree tree, VisitorState state) {
if (!(tree instanceof JCMethodInvocation)) {
return false;
}
JCMethodInvocation invocation = (JCMethodInvocation) tree;
if (!(invocation.getMethodSelect() instanceof JCFieldAccess)) {
return false;
}
Expression... | [
"private",
"static",
"boolean",
"mockitoInvocation",
"(",
"Tree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"if",
"(",
"!",
"(",
"tree",
"instanceof",
"JCMethodInvocation",
")",
")",
"{",
"return",
"false",
";",
"}",
"JCMethodInvocation",
"invocation",
"... | Don't match the method that is invoked through {@code Mockito.verify(t)} or {@code
doReturn(val).when(t)}. | [
"Don",
"t",
"match",
"the",
"method",
"that",
"is",
"invoked",
"through",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/AbstractReturnValueIgnored.java#L285-L295 |
alkacon/opencms-core | src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java | CmsContentEditor.setEditable | public static boolean setEditable(Element element, String serverId, boolean editable) {
"""
Sets all annotated child elements editable.<p>
@param element the element
@param serverId the editable resource structure id
@param editable <code>true</code> to enable editing
@return <code>true</code> if the eleme... | java | public static boolean setEditable(Element element, String serverId, boolean editable) {
I_CmsLayoutBundle.INSTANCE.editorCss().ensureInjected();
NodeList<Element> children = CmsDomUtil.querySelectorAll(
FIELD_SELECTOR + ENTITY_ID_SELECTOR_PREFIX + serverId + ENTITY_ID_SELECTOR_SUFFIX,
... | [
"public",
"static",
"boolean",
"setEditable",
"(",
"Element",
"element",
",",
"String",
"serverId",
",",
"boolean",
"editable",
")",
"{",
"I_CmsLayoutBundle",
".",
"INSTANCE",
".",
"editorCss",
"(",
")",
".",
"ensureInjected",
"(",
")",
";",
"NodeList",
"<",
... | Sets all annotated child elements editable.<p>
@param element the element
@param serverId the editable resource structure id
@param editable <code>true</code> to enable editing
@return <code>true</code> if the element had editable elements | [
"Sets",
"all",
"annotated",
"child",
"elements",
"editable",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java#L526-L544 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | logging/api/src/main/java/org/wildfly/swarm/logging/LoggingFraction.java | LoggingFraction.fileHandler | public LoggingFraction fileHandler(String name, String path, Level level, String formatter) {
"""
Add a FileHandler to the list of handlers for this logger
@param name The name of the handler
@param path The log file path
@param level The logging level
@param formatter The pattern string for th... | java | public LoggingFraction fileHandler(String name, String path, Level level, String formatter) {
Map<Object, Object> fileProperties = new HashMap<>();
fileProperties.put("path", path);
fileProperties.put("relative-to", "jboss.server.log.dir");
fileHandler(new FileHandler(name)
... | [
"public",
"LoggingFraction",
"fileHandler",
"(",
"String",
"name",
",",
"String",
"path",
",",
"Level",
"level",
",",
"String",
"formatter",
")",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"fileProperties",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
... | Add a FileHandler to the list of handlers for this logger
@param name The name of the handler
@param path The log file path
@param level The logging level
@param formatter The pattern string for the formatter
@return This fraction | [
"Add",
"a",
"FileHandler",
"to",
"the",
"list",
"of",
"handlers",
"for",
"this",
"logger"
] | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/logging/api/src/main/java/org/wildfly/swarm/logging/LoggingFraction.java#L219-L228 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/matrix/TileMatrix.java | TileMatrix.validateValues | private void validateValues(String column, long value, boolean allowZero) {
"""
Validate the long values are greater than 0, or greater than or equal to
0 based upon the allowZero flag
@param column
@param value
@param allowZero
"""
if (value < 0 || (value == 0 && !allowZero)) {
throw new GeoPackage... | java | private void validateValues(String column, long value, boolean allowZero) {
if (value < 0 || (value == 0 && !allowZero)) {
throw new GeoPackageException(column
+ " value must be greater than "
+ (allowZero ? "or equal to " : "") + "0: " + value);
}
} | [
"private",
"void",
"validateValues",
"(",
"String",
"column",
",",
"long",
"value",
",",
"boolean",
"allowZero",
")",
"{",
"if",
"(",
"value",
"<",
"0",
"||",
"(",
"value",
"==",
"0",
"&&",
"!",
"allowZero",
")",
")",
"{",
"throw",
"new",
"GeoPackageEx... | Validate the long values are greater than 0, or greater than or equal to
0 based upon the allowZero flag
@param column
@param value
@param allowZero | [
"Validate",
"the",
"long",
"values",
"are",
"greater",
"than",
"0",
"or",
"greater",
"than",
"or",
"equal",
"to",
"0",
"based",
"upon",
"the",
"allowZero",
"flag"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/matrix/TileMatrix.java#L279-L285 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ScriptContext.java | ScriptContext.chooseFile | @Cmd
public File chooseFile(final String fileKey) {
"""
Opens a file chooser dialog which can then be used to choose a file or directory and assign
the path of the chosen object to a variable. The name of the variable must be passed as a
parameter.
@param fileKey
the key the selected file path is stored und... | java | @Cmd
public File chooseFile(final String fileKey) {
log.debug("Opening file chooser dialog");
JFileChooser fileChooser = new JFileChooser(System.getProperty(JFunkConstants.USER_DIR));
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fileChooser.setPreferredSize(new Dimension(600, 326));
... | [
"@",
"Cmd",
"public",
"File",
"chooseFile",
"(",
"final",
"String",
"fileKey",
")",
"{",
"log",
".",
"debug",
"(",
"\"Opening file chooser dialog\"",
")",
";",
"JFileChooser",
"fileChooser",
"=",
"new",
"JFileChooser",
"(",
"System",
".",
"getProperty",
"(",
"... | Opens a file chooser dialog which can then be used to choose a file or directory and assign
the path of the chosen object to a variable. The name of the variable must be passed as a
parameter.
@param fileKey
the key the selected file path is stored under in the configuration
@return the chosen file | [
"Opens",
"a",
"file",
"chooser",
"dialog",
"which",
"can",
"then",
"be",
"used",
"to",
"choose",
"a",
"file",
"or",
"directory",
"and",
"assign",
"the",
"path",
"of",
"the",
"chosen",
"object",
"to",
"a",
"variable",
".",
"The",
"name",
"of",
"the",
"v... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ScriptContext.java#L196-L214 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/YearMonthView.java | YearMonthView.setCellFactory | public final void setCellFactory(Callback<YearMonthView, DateCell> factory) {
"""
Sets the value of {@link #cellFactoryProperty()}.
@param factory
the cell factory
"""
requireNonNull(factory);
cellFactoryProperty().set(factory);
} | java | public final void setCellFactory(Callback<YearMonthView, DateCell> factory) {
requireNonNull(factory);
cellFactoryProperty().set(factory);
} | [
"public",
"final",
"void",
"setCellFactory",
"(",
"Callback",
"<",
"YearMonthView",
",",
"DateCell",
">",
"factory",
")",
"{",
"requireNonNull",
"(",
"factory",
")",
";",
"cellFactoryProperty",
"(",
")",
".",
"set",
"(",
"factory",
")",
";",
"}"
] | Sets the value of {@link #cellFactoryProperty()}.
@param factory
the cell factory | [
"Sets",
"the",
"value",
"of",
"{",
"@link",
"#cellFactoryProperty",
"()",
"}",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/YearMonthView.java#L129-L132 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java | SecurityRulesInner.createOrUpdateAsync | public Observable<SecurityRuleInner> createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) {
"""
Creates or updates a security rule in the specified network security group.
@param resourceGroupName The name of the resour... | java | public Observable<SecurityRuleInner> createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParame... | [
"public",
"Observable",
"<",
"SecurityRuleInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkSecurityGroupName",
",",
"String",
"securityRuleName",
",",
"SecurityRuleInner",
"securityRuleParameters",
")",
"{",
"return",
"createOrU... | Creates or updates a security rule in the specified network security group.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@param securityRuleName The name of the security rule.
@param securityRuleParameters Parameters supplied to the cr... | [
"Creates",
"or",
"updates",
"a",
"security",
"rule",
"in",
"the",
"specified",
"network",
"security",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/SecurityRulesInner.java#L391-L398 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_publicFolder_path_permission_allowedAccountId_GET | public OvhExchangePublicFolderPermission organizationName_service_exchangeService_publicFolder_path_permission_allowedAccountId_GET(String organizationName, String exchangeService, String path, Long allowedAccountId) throws IOException {
"""
Get this object properties
REST: GET /email/exchange/{organizationName... | java | public OvhExchangePublicFolderPermission organizationName_service_exchangeService_publicFolder_path_permission_allowedAccountId_GET(String organizationName, String exchangeService, String path, Long allowedAccountId) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/pub... | [
"public",
"OvhExchangePublicFolderPermission",
"organizationName_service_exchangeService_publicFolder_path_permission_allowedAccountId_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"path",
",",
"Long",
"allowedAccountId",
")",
"throws",
"... | Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}/permission/{allowedAccountId}
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service
@param path... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L248-L253 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/crypto/CertUtils.java | CertUtils.readCertificate | public static X509Certificate readCertificate(final InputStreamSource resource) {
"""
Read certificate.
@param resource the resource to read the cert from
@return the x 509 certificate
"""
try (val in = resource.getInputStream()) {
return CertUtil.readCertificate(in);
} catch (f... | java | public static X509Certificate readCertificate(final InputStreamSource resource) {
try (val in = resource.getInputStream()) {
return CertUtil.readCertificate(in);
} catch (final IOException e) {
throw new IllegalArgumentException("Error reading certificate " + resource, e);
... | [
"public",
"static",
"X509Certificate",
"readCertificate",
"(",
"final",
"InputStreamSource",
"resource",
")",
"{",
"try",
"(",
"val",
"in",
"=",
"resource",
".",
"getInputStream",
"(",
")",
")",
"{",
"return",
"CertUtil",
".",
"readCertificate",
"(",
"in",
")"... | Read certificate.
@param resource the resource to read the cert from
@return the x 509 certificate | [
"Read",
"certificate",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/crypto/CertUtils.java#L65-L71 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaMetaCodeGen.java | RaMetaCodeGen.writeClassBody | @Override
public void writeClassBody(Definition def, Writer out) throws IOException {
"""
Output Metadata class
@param def definition
@param out Writer
@throws IOException ioException
"""
out.write("public class " + getClassName(def) + " implements ResourceAdapterMetaData");
writeLeftCurly... | java | @Override
public void writeClassBody(Definition def, Writer out) throws IOException
{
out.write("public class " + getClassName(def) + " implements ResourceAdapterMetaData");
writeLeftCurlyBracket(out, 0);
int indent = 1;
writeDefaultConstructor(def, out, indent);
writeInfo(def, ou... | [
"@",
"Override",
"public",
"void",
"writeClassBody",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"\"public class \"",
"+",
"getClassName",
"(",
"def",
")",
"+",
"\" implements ResourceAdapterMetaData... | Output Metadata class
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"Metadata",
"class"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaMetaCodeGen.java#L43-L57 |
Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.processCommits | protected void processCommits(Pipeline pipeline, List<Commit> commits) {
"""
Computes the commit stage of the pipeline.
@param pipeline
@param commits
"""
// TODO when processing commits should we only add the commits that are within the time boundaries?
Set<String> seenRevisionNumbers = new HashS... | java | protected void processCommits(Pipeline pipeline, List<Commit> commits) {
// TODO when processing commits should we only add the commits that are within the time boundaries?
Set<String> seenRevisionNumbers = new HashSet<>();
if (logger.isDebugEnabled()) {
StringBuilder sb = new StringBuilder... | [
"protected",
"void",
"processCommits",
"(",
"Pipeline",
"pipeline",
",",
"List",
"<",
"Commit",
">",
"commits",
")",
"{",
"// TODO when processing commits should we only add the commits that are within the time boundaries?\r",
"Set",
"<",
"String",
">",
"seenRevisionNumbers",
... | Computes the commit stage of the pipeline.
@param pipeline
@param commits | [
"Computes",
"the",
"commit",
"stage",
"of",
"the",
"pipeline",
"."
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L245-L266 |
liferay/com-liferay-commerce | commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java | CommerceNotificationTemplateWrapper.getFromName | @Override
public String getFromName(String languageId, boolean useDefault) {
"""
Returns the localized from name of this commerce notification template in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param u... | java | @Override
public String getFromName(String languageId, boolean useDefault) {
return _commerceNotificationTemplate.getFromName(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getFromName",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceNotificationTemplate",
".",
"getFromName",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized from name of this commerce notification template in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested ... | [
"Returns",
"the",
"localized",
"from",
"name",
"of",
"this",
"commerce",
"notification",
"template",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java#L433-L436 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/mapping/MappingUtils.java | MappingUtils.getMappingColumn | public static MappingColumn getMappingColumn(final Class<?> entityType, final SqlKind kind,
final String camelColumnName) {
"""
カラムマッピング情報取得
@param entityType エンティティ型
@param kind SQL種別
@param camelColumnName 取得するカラムのキャメルケース名
@return カラムマッピング情報
@exception UroborosqlRuntimeException 指定したキャメルケースカラム名に該当する{@l... | java | public static MappingColumn getMappingColumn(final Class<?> entityType, final SqlKind kind,
final String camelColumnName) {
return getMappingColumnMap(entityType, kind).entrySet().stream()
.filter(entry -> entry.getKey().equals(camelColumnName)).map(entry -> entry.getValue()).findFirst()
.orElseThrow(() ->... | [
"public",
"static",
"MappingColumn",
"getMappingColumn",
"(",
"final",
"Class",
"<",
"?",
">",
"entityType",
",",
"final",
"SqlKind",
"kind",
",",
"final",
"String",
"camelColumnName",
")",
"{",
"return",
"getMappingColumnMap",
"(",
"entityType",
",",
"kind",
")... | カラムマッピング情報取得
@param entityType エンティティ型
@param kind SQL種別
@param camelColumnName 取得するカラムのキャメルケース名
@return カラムマッピング情報
@exception UroborosqlRuntimeException 指定したキャメルケースカラム名に該当する{@link MappingColumn}が見つからなかった場合 | [
"カラムマッピング情報取得"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/mapping/MappingUtils.java#L273-L278 |
adamfisk/littleshoot-commons-id | src/main/java/org/apache/commons/id/Hex.java | Hex.toDigit | protected static int toDigit(char ch, int index) throws DecoderException {
"""
Converts a hexadecimal character to an integer.
@param ch A character to convert to an integer digit
@param index The index of the character in the source
@return An integer
@throws DecoderException Thrown if ch is an illegal hex ... | java | protected static int toDigit(char ch, int index) throws DecoderException {
int digit = Character.digit(ch, 16);
if (digit == -1) {
throw new DecoderException("Illegal hexadecimal charcter " + ch + " at index " + index);
}
return digit;
} | [
"protected",
"static",
"int",
"toDigit",
"(",
"char",
"ch",
",",
"int",
"index",
")",
"throws",
"DecoderException",
"{",
"int",
"digit",
"=",
"Character",
".",
"digit",
"(",
"ch",
",",
"16",
")",
";",
"if",
"(",
"digit",
"==",
"-",
"1",
")",
"{",
"... | Converts a hexadecimal character to an integer.
@param ch A character to convert to an integer digit
@param index The index of the character in the source
@return An integer
@throws DecoderException Thrown if ch is an illegal hex character | [
"Converts",
"a",
"hexadecimal",
"character",
"to",
"an",
"integer",
"."
] | train | https://github.com/adamfisk/littleshoot-commons-id/blob/49a8f5f2b10831c509876ca463bf1a87e1e49ae9/src/main/java/org/apache/commons/id/Hex.java#L83-L89 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java | JSONObject.optString | public String optString(String name, String fallback) {
"""
Returns the value mapped by {@code name} if it exists, coercing it if necessary.
Returns {@code fallback} if no such mapping exists.
@param name the name of the property
@param fallback a fallback value
@return the value or {@code fallback}
"""
... | java | public String optString(String name, String fallback) {
Object object = opt(name);
String result = JSON.toString(object);
return result != null ? result : fallback;
} | [
"public",
"String",
"optString",
"(",
"String",
"name",
",",
"String",
"fallback",
")",
"{",
"Object",
"object",
"=",
"opt",
"(",
"name",
")",
";",
"String",
"result",
"=",
"JSON",
".",
"toString",
"(",
"object",
")",
";",
"return",
"result",
"!=",
"nu... | Returns the value mapped by {@code name} if it exists, coercing it if necessary.
Returns {@code fallback} if no such mapping exists.
@param name the name of the property
@param fallback a fallback value
@return the value or {@code fallback} | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L586-L590 |
tootedom/related | app/core/searching/src/main/java/org/greencheek/related/searching/repository/ElasticSearchFrequentlyRelatedItemSearchProcessor.java | ElasticSearchFrequentlyRelatedItemSearchProcessor.createFrequentlyRelatedContentSearch | private SearchRequestBuilder createFrequentlyRelatedContentSearch(RelatedItemSearch search, Client searchClient) {
"""
/*
Creates a query like:
{
"size" : 0,
"timeout" : 5000,
"query" : {
"constant_score" : {
"filter" : {
"bool" : {
"must" : [ {
"term" : {
"related-with" : "apparentice you're hired"
... | java | private SearchRequestBuilder createFrequentlyRelatedContentSearch(RelatedItemSearch search, Client searchClient) {
SearchRequestBuilder sr = searchClient.prepareSearch();
sr.internalBuilder(builder.createFrequentlyRelatedContentSearch(search));
sr.setIndices(indexName);
return sr;
} | [
"private",
"SearchRequestBuilder",
"createFrequentlyRelatedContentSearch",
"(",
"RelatedItemSearch",
"search",
",",
"Client",
"searchClient",
")",
"{",
"SearchRequestBuilder",
"sr",
"=",
"searchClient",
".",
"prepareSearch",
"(",
")",
";",
"sr",
".",
"internalBuilder",
... | /*
Creates a query like:
{
"size" : 0,
"timeout" : 5000,
"query" : {
"constant_score" : {
"filter" : {
"bool" : {
"must" : [ {
"term" : {
"related-with" : "apparentice you're hired"
}
}, {
"term" : {
"channel" : "bbc"
}
} ]
}
}
}
},
"facets" : {
"frequently-related-with" : {
"terms" : {
"field" : "id",
"size" : 5,
"ex... | [
"/",
"*",
"Creates",
"a",
"query",
"like",
":"
] | train | https://github.com/tootedom/related/blob/3782dd5a839bbcdc15661d598e8b895aae8aabb7/app/core/searching/src/main/java/org/greencheek/related/searching/repository/ElasticSearchFrequentlyRelatedItemSearchProcessor.java#L191-L197 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java | IPAddress.toCanonicalHostName | public HostName toCanonicalHostName() {
"""
Does a reverse name lookup to get the canonical host name.
Note that the canonical host name may differ on different systems, as it aligns with {@link InetAddress#getCanonicalHostName()}
In particular, on some systems the loopback address has canonical host localhost a... | java | public HostName toCanonicalHostName() {
HostName host = canonicalHost;
if(host == null) {
if(isMultiple()) {
throw new IncompatibleAddressException(this, "ipaddress.error.unavailable.numeric");
}
InetAddress inetAddress = toInetAddress();
String hostStr = inetAddress.getCanonicalHostName();//note: t... | [
"public",
"HostName",
"toCanonicalHostName",
"(",
")",
"{",
"HostName",
"host",
"=",
"canonicalHost",
";",
"if",
"(",
"host",
"==",
"null",
")",
"{",
"if",
"(",
"isMultiple",
"(",
")",
")",
"{",
"throw",
"new",
"IncompatibleAddressException",
"(",
"this",
... | Does a reverse name lookup to get the canonical host name.
Note that the canonical host name may differ on different systems, as it aligns with {@link InetAddress#getCanonicalHostName()}
In particular, on some systems the loopback address has canonical host localhost and on others the canonical host is the same loopbac... | [
"Does",
"a",
"reverse",
"name",
"lookup",
"to",
"get",
"the",
"canonical",
"host",
"name",
".",
"Note",
"that",
"the",
"canonical",
"host",
"name",
"may",
"differ",
"on",
"different",
"systems",
"as",
"it",
"aligns",
"with",
"{"
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java#L195-L214 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.findAll | @Override
public List<CPDefinitionOptionRel> findAll() {
"""
Returns all the cp definition option rels.
@return the cp definition option rels
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionOptionRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition option rels.
@return the cp definition option rels | [
"Returns",
"all",
"the",
"cp",
"definition",
"option",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L4572-L4575 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java | MapExtensions.operator_add | @Inline(value = "$1.put($2.getKey(), $2.getValue())", statementExpression = true)
public static <K, V> V operator_add(Map<K, V> map, Pair<? extends K, ? extends V> entry) {
"""
Add the given pair into the map.
<p>
If the pair key already exists in the map, its value is replaced
by the value in the pair, and ... | java | @Inline(value = "$1.put($2.getKey(), $2.getValue())", statementExpression = true)
public static <K, V> V operator_add(Map<K, V> map, Pair<? extends K, ? extends V> entry) {
return map.put(entry.getKey(), entry.getValue());
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"$1.put($2.getKey(), $2.getValue())\"",
",",
"statementExpression",
"=",
"true",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"operator_add",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Pair",
"<",
"?",... | Add the given pair into the map.
<p>
If the pair key already exists in the map, its value is replaced
by the value in the pair, and the old value in the map is returned.
</p>
@param <K> type of the map keys.
@param <V> type of the map values.
@param map the map to update.
@param entry the entry (key, value) to add in... | [
"Add",
"the",
"given",
"pair",
"into",
"the",
"map",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java#L118-L121 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java | CommerceNotificationQueueEntryPersistenceImpl.findAll | @Override
public List<CommerceNotificationQueueEntry> findAll(int start, int end) {
"""
Returns a range of all the commerce notification queue entries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, the... | java | @Override
public List<CommerceNotificationQueueEntry> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationQueueEntry",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce notification queue entries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Sett... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"queue",
"entries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java#L2811-L2814 |
banq/jdonframework | src/main/java/com/jdon/util/UtilDateTime.java | UtilDateTime.toTimestamp | public static java.sql.Timestamp toTimestamp(int month, int day, int year, int hour, int minute, int second) {
"""
Makes a Timestamp from separate ints for month, day, year, hour, minute,
and second.
@param month
The month int
@param day
The day int
@param year
The year int
@param hour
The hour int
@pa... | java | public static java.sql.Timestamp toTimestamp(int month, int day, int year, int hour, int minute, int second) {
java.util.Date newDate = toDate(month, day, year, hour, minute, second);
if (newDate != null)
return new java.sql.Timestamp(newDate.getTime());
else
return null;
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Timestamp",
"toTimestamp",
"(",
"int",
"month",
",",
"int",
"day",
",",
"int",
"year",
",",
"int",
"hour",
",",
"int",
"minute",
",",
"int",
"second",
")",
"{",
"java",
".",
"util",
".",
"Date",
"newDate"... | Makes a Timestamp from separate ints for month, day, year, hour, minute,
and second.
@param month
The month int
@param day
The day int
@param year
The year int
@param hour
The hour int
@param minute
The minute int
@param second
The second int
@return A Timestamp made from separate ints for month, day, year, hour,
minu... | [
"Makes",
"a",
"Timestamp",
"from",
"separate",
"ints",
"for",
"month",
"day",
"year",
"hour",
"minute",
"and",
"second",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilDateTime.java#L286-L293 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createNicePartialMockForAllMethodsExcept | public static synchronized <T> T createNicePartialMockForAllMethodsExcept(Class<T> type,
String methodNameToExclude, Class<?> firstArgumentType, Class<?>... moreTypes) {
"""
Mock all methods of a class except for a specific one nicely. U... | java | public static synchronized <T> T createNicePartialMockForAllMethodsExcept(Class<T> type,
String methodNameToExclude, Class<?> firstArgumentType, Class<?>... moreTypes) {
/*
* The reason why we've split the first and "additi... | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createNicePartialMockForAllMethodsExcept",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"methodNameToExclude",
",",
"Class",
"<",
"?",
">",
"firstArgumentType",
",",
"Class",
"<",
"?",
">",
"...",... | Mock all methods of a class except for a specific one nicely. Use this
method only if you have several overloaded methods.
@param <T> The type of the mock.
@param type The type that'll be used to create a mock instance.
@param methodNameToExclude The name of the method not to mock.
@para... | [
"Mock",
"all",
"methods",
"of",
"a",
"class",
"except",
"for",
"a",
"specific",
"one",
"nicely",
".",
"Use",
"this",
"method",
"only",
"if",
"you",
"have",
"several",
"overloaded",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L420-L430 |
joestelmach/natty | src/main/java/com/joestelmach/natty/WalkerState.java | WalkerState.setExplicitTime | public void setExplicitTime(String hours, String minutes, String seconds, String amPm, String zoneString) {
"""
Sets the the time of day
@param hours the hours to set. Must be guaranteed to parse as an
integer between 0 and 23
@param minutes the minutes to set. Must be guaranteed to parse as
an integer b... | java | public void setExplicitTime(String hours, String minutes, String seconds, String amPm, String zoneString) {
int hoursInt = Integer.parseInt(hours);
int minutesInt = minutes != null ? Integer.parseInt(minutes) : 0;
assert(amPm == null || amPm.equals(AM) || amPm.equals(PM));
assert(hoursInt >= 0);
ass... | [
"public",
"void",
"setExplicitTime",
"(",
"String",
"hours",
",",
"String",
"minutes",
",",
"String",
"seconds",
",",
"String",
"amPm",
",",
"String",
"zoneString",
")",
"{",
"int",
"hoursInt",
"=",
"Integer",
".",
"parseInt",
"(",
"hours",
")",
";",
"int"... | Sets the the time of day
@param hours the hours to set. Must be guaranteed to parse as an
integer between 0 and 23
@param minutes the minutes to set. Must be guaranteed to parse as
an integer between 0 and 59
@param seconds the optional seconds to set. Must be guaranteed to parse as
an integer between 0 and 59
@... | [
"Sets",
"the",
"the",
"time",
"of",
"day"
] | train | https://github.com/joestelmach/natty/blob/74389feb4c9372e51cd51eb0800a0177fec3e5a0/src/main/java/com/joestelmach/natty/WalkerState.java#L334-L380 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorageDirectoryRetentionManager.java | NNStorageDirectoryRetentionManager.backupFiles | public static void backupFiles(FileSystem fs, File dest,
Configuration conf) throws IOException {
"""
Backup given directory.
Enforce that max number of backups has not been reached.
"""
// check if we can still backup
cleanUpAndCheckBackup(conf, dest);
int MAX_ATTEMPT = 3;
for (in... | java | public static void backupFiles(FileSystem fs, File dest,
Configuration conf) throws IOException {
// check if we can still backup
cleanUpAndCheckBackup(conf, dest);
int MAX_ATTEMPT = 3;
for (int i = 0; i < MAX_ATTEMPT; i++) {
try {
String mdate = dateForm.get().format(new Date(... | [
"public",
"static",
"void",
"backupFiles",
"(",
"FileSystem",
"fs",
",",
"File",
"dest",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"// check if we can still backup",
"cleanUpAndCheckBackup",
"(",
"conf",
",",
"dest",
")",
";",
"int",
"MAX_AT... | Backup given directory.
Enforce that max number of backups has not been reached. | [
"Backup",
"given",
"directory",
".",
"Enforce",
"that",
"max",
"number",
"of",
"backups",
"has",
"not",
"been",
"reached",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorageDirectoryRetentionManager.java#L83-L112 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDictionary.java | MutableDictionary.setInt | @NonNull
@Override
public MutableDictionary setInt(@NonNull String key, int value) {
"""
Set an int value for the given key.
@param key The key
@param value The int value.
@return The self object.
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDictionary setInt(@NonNull String key, int value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDictionary",
"setInt",
"(",
"@",
"NonNull",
"String",
"key",
",",
"int",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set an int value for the given key.
@param key The key
@param value The int value.
@return The self object. | [
"Set",
"an",
"int",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDictionary.java#L143-L147 |
nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.readFont | public boolean readFont(FontFileReader in, String name) throws IOException {
"""
Read the font data.
If the fontfile is a TrueType Collection (.ttc file)
the name of the font to read data for must be supplied,
else the name is ignored.
@param in The FontFileReader to use
@param name The name of the font
@r... | java | public boolean readFont(FontFileReader in, String name) throws IOException {
/*
* Check if TrueType collection, and that the name
* exists in the collection
*/
if (!checkTTC(in, name)) {
if (name == null) {
throw new IllegalArgumentException(
... | [
"public",
"boolean",
"readFont",
"(",
"FontFileReader",
"in",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"/*\n * Check if TrueType collection, and that the name\n * exists in the collection\n */",
"if",
"(",
"!",
"checkTTC",
"(",
"in",
"... | Read the font data.
If the fontfile is a TrueType Collection (.ttc file)
the name of the font to read data for must be supplied,
else the name is ignored.
@param in The FontFileReader to use
@param name The name of the font
@return boolean Returns true if the font is valid
@throws IOException In case of an I/O problem | [
"Read",
"the",
"font",
"data",
".",
"If",
"the",
"fontfile",
"is",
"a",
"TrueType",
"Collection",
"(",
".",
"ttc",
"file",
")",
"the",
"name",
"of",
"the",
"font",
"to",
"read",
"data",
"for",
"must",
"be",
"supplied",
"else",
"the",
"name",
"is",
"i... | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L520-L563 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapClientActionBuilder.java | SoapClientActionBuilder.receive | public SoapClientResponseActionBuilder receive() {
"""
Generic response builder for expecting response messages on client.
@return
"""
SoapClientResponseActionBuilder soapClientResponseActionBuilder;
if (soapClient != null) {
soapClientResponseActionBuilder = new SoapClientResponse... | java | public SoapClientResponseActionBuilder receive() {
SoapClientResponseActionBuilder soapClientResponseActionBuilder;
if (soapClient != null) {
soapClientResponseActionBuilder = new SoapClientResponseActionBuilder(action, soapClient);
} else {
soapClientResponseActionBuilde... | [
"public",
"SoapClientResponseActionBuilder",
"receive",
"(",
")",
"{",
"SoapClientResponseActionBuilder",
"soapClientResponseActionBuilder",
";",
"if",
"(",
"soapClient",
"!=",
"null",
")",
"{",
"soapClientResponseActionBuilder",
"=",
"new",
"SoapClientResponseActionBuilder",
... | Generic response builder for expecting response messages on client.
@return | [
"Generic",
"response",
"builder",
"for",
"expecting",
"response",
"messages",
"on",
"client",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapClientActionBuilder.java#L59-L70 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/detector/ServerHandle.java | ServerHandle.getDetectorOptions | protected JSONObject getDetectorOptions(Configuration pConfig, LogHandler pLogHandler) {
"""
Get the optional options used for detectors. This should be a JSON string specifying all options
for all detectors. Keys are the name of the detector's product, the values are JSON object containing
specific parameters f... | java | protected JSONObject getDetectorOptions(Configuration pConfig, LogHandler pLogHandler) {
String options = pConfig.get(ConfigKey.DETECTOR_OPTIONS);
try {
if (options != null) {
JSONObject opts = (JSONObject) new JSONParser().parse(options);
return (JSON... | [
"protected",
"JSONObject",
"getDetectorOptions",
"(",
"Configuration",
"pConfig",
",",
"LogHandler",
"pLogHandler",
")",
"{",
"String",
"options",
"=",
"pConfig",
".",
"get",
"(",
"ConfigKey",
".",
"DETECTOR_OPTIONS",
")",
";",
"try",
"{",
"if",
"(",
"options",
... | Get the optional options used for detectors. This should be a JSON string specifying all options
for all detectors. Keys are the name of the detector's product, the values are JSON object containing
specific parameters for this agent. E.g.
<pre>
{
"glassfish" : { "bootAmx": true }
}
</pre>
@param pConfig the agent ... | [
"Get",
"the",
"optional",
"options",
"used",
"for",
"detectors",
".",
"This",
"should",
"be",
"a",
"JSON",
"string",
"specifying",
"all",
"options",
"for",
"all",
"detectors",
".",
"Keys",
"are",
"the",
"name",
"of",
"the",
"detector",
"s",
"product",
"the... | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/ServerHandle.java#L201-L213 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/inf/BeliefPropagation.java | BeliefPropagation.getResidual | private double getResidual(VarTensor t1, VarTensor t2) {
"""
Gets the residual for a new message, as the maximum error over all assignments.
Following the definition of Sutton & McCallum (2007), we compute the residual as the infinity
norm of the difference of the log of the message vectors.
Note: the retur... | java | private double getResidual(VarTensor t1, VarTensor t2) {
assert s == t1.getAlgebra() && s == t2.getAlgebra();
Tensor.checkEqualSize(t1, t2);
Tensor.checkSameAlgebra(t1, t2);
double residual = Double.NEGATIVE_INFINITY;
for (int c=0; c<t1.size(); c++) {
double abs = Mat... | [
"private",
"double",
"getResidual",
"(",
"VarTensor",
"t1",
",",
"VarTensor",
"t2",
")",
"{",
"assert",
"s",
"==",
"t1",
".",
"getAlgebra",
"(",
")",
"&&",
"s",
"==",
"t2",
".",
"getAlgebra",
"(",
")",
";",
"Tensor",
".",
"checkEqualSize",
"(",
"t1",
... | Gets the residual for a new message, as the maximum error over all assignments.
Following the definition of Sutton & McCallum (2007), we compute the residual as the infinity
norm of the difference of the log of the message vectors.
Note: the returned value is NOT in the semiring / abstract algebra. It is the actual v... | [
"Gets",
"the",
"residual",
"for",
"a",
"new",
"message",
"as",
"the",
"maximum",
"error",
"over",
"all",
"assignments",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/inf/BeliefPropagation.java#L485-L497 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/pq/pq_stats.java | pq_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
"""
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre>
"""
pq_stats[] resources = new pq_stats[1];
pq_response result = (pq_response) service.get_payl... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
pq_stats[] resources = new pq_stats[1];
pq_response result = (pq_response) service.get_payload_formatter().string_to_resource(pq_response.class, response);
if(result.errorcode != 0) {
if (result.errorcode ==... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"pq_stats",
"[",
"]",
"resources",
"=",
"new",
"pq_stats",
"[",
"1",
"]",
";",
"pq_response",
"result",
"... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/pq/pq_stats.java#L157-L176 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/REST.java | REST.setProxy | public void setProxy(String proxyHost, int proxyPort) {
"""
Set a proxy for REST-requests.
@param proxyHost
@param proxyPort
"""
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", proxyHost);
System.setProperty("http.proxyPort", "" + proxyPort);
... | java | public void setProxy(String proxyHost, int proxyPort) {
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", proxyHost);
System.setProperty("http.proxyPort", "" + proxyPort);
System.setProperty("https.proxyHost", proxyHost);
System.setProperty("https.... | [
"public",
"void",
"setProxy",
"(",
"String",
"proxyHost",
",",
"int",
"proxyPort",
")",
"{",
"System",
".",
"setProperty",
"(",
"\"http.proxySet\"",
",",
"\"true\"",
")",
";",
"System",
".",
"setProperty",
"(",
"\"http.proxyHost\"",
",",
"proxyHost",
")",
";",... | Set a proxy for REST-requests.
@param proxyHost
@param proxyPort | [
"Set",
"a",
"proxy",
"for",
"REST",
"-",
"requests",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/REST.java#L103-L109 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/bodyanalysis/AipBodyAnalysis.java | AipBodyAnalysis.bodyTracking | public JSONObject bodyTracking(byte[] image, String dynamic, HashMap<String, String> options) {
"""
人流量统计-动态版接口
统计图像中的人体个数和流动趋势,主要适用于**低空俯拍、出入口场景,以人体头肩为主要识别目标**
@param image - 二进制图像数据
@param dynamic - true:动态人流量统计,返回总人数、跟踪ID、区域进出人数;<br>false:静态人数统计,返回总人数
@param options - 可选参数对象,key: value都为string类型
options ... | java | public JSONObject bodyTracking(byte[] image, String dynamic, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
String base64Content = Base64Util.encode(image);
request.addBody("image", base64Content);
request.addBod... | [
"public",
"JSONObject",
"bodyTracking",
"(",
"byte",
"[",
"]",
"image",
",",
"String",
"dynamic",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",... | 人流量统计-动态版接口
统计图像中的人体个数和流动趋势,主要适用于**低空俯拍、出入口场景,以人体头肩为主要识别目标**
@param image - 二进制图像数据
@param dynamic - true:动态人流量统计,返回总人数、跟踪ID、区域进出人数;<br>false:静态人数统计,返回总人数
@param options - 可选参数对象,key: value都为string类型
options - options列表:
case_id 任务ID(通过case_id区分不同视频流,自拟,不同序列间不可重复即可)
case_init 每个case的初始化信号,为true时对该case下的跟踪算法进行初始化,为fals... | [
"人流量统计",
"-",
"动态版接口",
"统计图像中的人体个数和流动趋势,主要适用于",
"**",
"低空俯拍、出入口场景,以人体头肩为主要识别目标",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/bodyanalysis/AipBodyAnalysis.java#L315-L329 |
actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/ActorSystem.java | ActorSystem.actorOf | public ActorRef actorOf(Props props, String path) {
"""
Creating or getting existing actor from actor props
@param props Actor Props
@param path Actor Path
@return ActorRef
"""
String dispatcherId = props.getDispatcher() == null ? DEFAULT_DISPATCHER : props.getDispatcher();
AbsActorDispa... | java | public ActorRef actorOf(Props props, String path) {
String dispatcherId = props.getDispatcher() == null ? DEFAULT_DISPATCHER : props.getDispatcher();
AbsActorDispatcher mailboxesDispatcher;
synchronized (dispatchers) {
if (!dispatchers.containsKey(dispatcherId)) {
th... | [
"public",
"ActorRef",
"actorOf",
"(",
"Props",
"props",
",",
"String",
"path",
")",
"{",
"String",
"dispatcherId",
"=",
"props",
".",
"getDispatcher",
"(",
")",
"==",
"null",
"?",
"DEFAULT_DISPATCHER",
":",
"props",
".",
"getDispatcher",
"(",
")",
";",
"Ab... | Creating or getting existing actor from actor props
@param props Actor Props
@param path Actor Path
@return ActorRef | [
"Creating",
"or",
"getting",
"existing",
"actor",
"from",
"actor",
"props"
] | train | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/ActorSystem.java#L115-L127 |
xwiki/xwiki-commons | xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java | XARMojo.addContentsToQueue | private static void addContentsToQueue(Queue<File> fileQueue, File sourceDir) throws MojoExecutionException {
"""
Adds the contents of a specific directory to a queue of files.
@param fileQueue the queue of files
@param sourceDir the directory to be scanned
"""
File[] files = sourceDir.listFiles();... | java | private static void addContentsToQueue(Queue<File> fileQueue, File sourceDir) throws MojoExecutionException
{
File[] files = sourceDir.listFiles();
if (files != null) {
for (File currentFile : files) {
fileQueue.add(currentFile);
}
} else {
... | [
"private",
"static",
"void",
"addContentsToQueue",
"(",
"Queue",
"<",
"File",
">",
"fileQueue",
",",
"File",
"sourceDir",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"[",
"]",
"files",
"=",
"sourceDir",
".",
"listFiles",
"(",
")",
";",
"if",
"(",
... | Adds the contents of a specific directory to a queue of files.
@param fileQueue the queue of files
@param sourceDir the directory to be scanned | [
"Adds",
"the",
"contents",
"of",
"a",
"specific",
"directory",
"to",
"a",
"queue",
"of",
"files",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L543-L553 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.