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 |
|---|---|---|---|---|---|---|---|---|---|---|
ical4j/ical4j | src/main/java/net/fortuna/ical4j/util/Dates.java | Dates.getAbsWeekNo | public static int getAbsWeekNo(final java.util.Date date, final int weekNo) {
"""
Returns the absolute week number for the year specified by the
supplied date. Note that a value of zero (0) is invalid for the
weekNo parameter and an <code>IllegalArgumentException</code>
will be thrown.
@param date a date insta... | java | public static int getAbsWeekNo(final java.util.Date date, final int weekNo) {
if (weekNo == 0 || weekNo < -MAX_WEEKS_PER_YEAR || weekNo > MAX_WEEKS_PER_YEAR) {
throw new IllegalArgumentException(MessageFormat.format(INVALID_WEEK_MESSAGE,
weekNo));
}
if (weekNo > 0... | [
"public",
"static",
"int",
"getAbsWeekNo",
"(",
"final",
"java",
".",
"util",
".",
"Date",
"date",
",",
"final",
"int",
"weekNo",
")",
"{",
"if",
"(",
"weekNo",
"==",
"0",
"||",
"weekNo",
"<",
"-",
"MAX_WEEKS_PER_YEAR",
"||",
"weekNo",
">",
"MAX_WEEKS_PE... | Returns the absolute week number for the year specified by the
supplied date. Note that a value of zero (0) is invalid for the
weekNo parameter and an <code>IllegalArgumentException</code>
will be thrown.
@param date a date instance representing a week of the year
@param weekNo a week number offset
@return the absolute... | [
"Returns",
"the",
"absolute",
"week",
"number",
"for",
"the",
"year",
"specified",
"by",
"the",
"supplied",
"date",
".",
"Note",
"that",
"a",
"value",
"of",
"zero",
"(",
"0",
")",
"is",
"invalid",
"for",
"the",
"weekNo",
"parameter",
"and",
"an",
"<code"... | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/util/Dates.java#L132-L151 |
alkacon/opencms-core | src/org/opencms/file/CmsLinkRewriter.java | CmsLinkRewriter.getRelativePath | protected String getRelativePath(String ancestor, String rootPath) {
"""
Computes the relative path given an ancestor folder path.<p>
@param ancestor the ancestor folder
@param rootPath the path for which the relative path should be computed
@return the relative path
"""
String result = rootPat... | java | protected String getRelativePath(String ancestor, String rootPath) {
String result = rootPath.substring(ancestor.length());
result = CmsStringUtil.joinPaths("/", result, "/");
return result;
} | [
"protected",
"String",
"getRelativePath",
"(",
"String",
"ancestor",
",",
"String",
"rootPath",
")",
"{",
"String",
"result",
"=",
"rootPath",
".",
"substring",
"(",
"ancestor",
".",
"length",
"(",
")",
")",
";",
"result",
"=",
"CmsStringUtil",
".",
"joinPat... | Computes the relative path given an ancestor folder path.<p>
@param ancestor the ancestor folder
@param rootPath the path for which the relative path should be computed
@return the relative path | [
"Computes",
"the",
"relative",
"path",
"given",
"an",
"ancestor",
"folder",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsLinkRewriter.java#L463-L468 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Setup.java | Setup.getConfigClass | @SuppressWarnings("unchecked")
public final <T> Class<T> getConfigClass(ClassLoader classLoader) {
"""
Get the class mapped to the setup. Lazy call (load class only first time, and keep its reference after).
@param <T> The element type.
@param classLoader The class loader used.
@return The class mapped t... | java | @SuppressWarnings("unchecked")
public final <T> Class<T> getConfigClass(ClassLoader classLoader)
{
if (clazz == null)
{
final FeaturableConfig config = FeaturableConfig.imports(this);
try
{
clazz = classLoader.loadClass(config.getClassN... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"getConfigClass",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
")",
"{",
"final",
"FeaturableConfig",
"config",
... | Get the class mapped to the setup. Lazy call (load class only first time, and keep its reference after).
@param <T> The element type.
@param classLoader The class loader used.
@return The class mapped to the setup.
@throws LionEngineException If the class was not found by the class loader. | [
"Get",
"the",
"class",
"mapped",
"to",
"the",
"setup",
".",
"Lazy",
"call",
"(",
"load",
"class",
"only",
"first",
"time",
"and",
"keep",
"its",
"reference",
"after",
")",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Setup.java#L96-L112 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.triangulationAngle | double triangulationAngle( Point2D_F64 normA , Point2D_F64 normB , Se3_F64 a_to_b ) {
"""
Computes the acture angle between two vectors. Larger this angle is the better the triangulation
of the features 3D location is in general
"""
// the more parallel a line is worse the triangulation. Get rid of bad idea... | java | double triangulationAngle( Point2D_F64 normA , Point2D_F64 normB , Se3_F64 a_to_b ) {
// the more parallel a line is worse the triangulation. Get rid of bad ideas early here
arrowA.set(normA.x,normA.y,1);
arrowB.set(normB.x,normB.y,1);
GeometryMath_F64.mult(a_to_b.R,arrowA,arrowA); // put them into the same ref... | [
"double",
"triangulationAngle",
"(",
"Point2D_F64",
"normA",
",",
"Point2D_F64",
"normB",
",",
"Se3_F64",
"a_to_b",
")",
"{",
"// the more parallel a line is worse the triangulation. Get rid of bad ideas early here",
"arrowA",
".",
"set",
"(",
"normA",
".",
"x",
",",
"nor... | Computes the acture angle between two vectors. Larger this angle is the better the triangulation
of the features 3D location is in general | [
"Computes",
"the",
"acture",
"angle",
"between",
"two",
"vectors",
".",
"Larger",
"this",
"angle",
"is",
"the",
"better",
"the",
"triangulation",
"of",
"the",
"features",
"3D",
"location",
"is",
"in",
"general"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L641-L648 |
geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/CreateIconChoicePopup.java | CreateIconChoicePopup.translateMarker | private ClickableMarkerShape translateMarker(ClickableMarkerShape shape, int amountOfMarkers) {
"""
used for displaying marker SVG elements in a drawing area.
@param shape
@param amountOfMarkers
@return
"""
if (amountOfMarkers % imagePerRow != 0) {
int size = choiceListImageSize + 6;
shape.setTran... | java | private ClickableMarkerShape translateMarker(ClickableMarkerShape shape, int amountOfMarkers) {
if (amountOfMarkers % imagePerRow != 0) {
int size = choiceListImageSize + 6;
shape.setTranslation(size * (amountOfMarkers % imagePerRow), size * (amountOfMarkers / imagePerRow));
}
return shape;
} | [
"private",
"ClickableMarkerShape",
"translateMarker",
"(",
"ClickableMarkerShape",
"shape",
",",
"int",
"amountOfMarkers",
")",
"{",
"if",
"(",
"amountOfMarkers",
"%",
"imagePerRow",
"!=",
"0",
")",
"{",
"int",
"size",
"=",
"choiceListImageSize",
"+",
"6",
";",
... | used for displaying marker SVG elements in a drawing area.
@param shape
@param amountOfMarkers
@return | [
"used",
"for",
"displaying",
"marker",
"SVG",
"elements",
"in",
"a",
"drawing",
"area",
"."
] | train | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/CreateIconChoicePopup.java#L351-L357 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionProcessor.java | InjectionProcessor.validateMissingJndiName | protected void validateMissingJndiName(Class<?> instanceClass, A annotation)
throws InjectionException {
"""
Perform validation on a class-level annotation for which {@link #getJndiName} returned the empty string. By default, this method
performs no validation for backwards compatibility.
@... | java | protected void validateMissingJndiName(Class<?> instanceClass, A annotation)
throws InjectionException
{
if (isValidationLoggable()) // F50309.6
{
Tr.error(tc, "MISSING_CLASS_LEVEL_ANNOTATION_NAME_CWNEN0073E",
'@' + annotation.annotationType().get... | [
"protected",
"void",
"validateMissingJndiName",
"(",
"Class",
"<",
"?",
">",
"instanceClass",
",",
"A",
"annotation",
")",
"throws",
"InjectionException",
"{",
"if",
"(",
"isValidationLoggable",
"(",
")",
")",
"// F50309.6",
"{",
"Tr",
".",
"error",
"(",
"tc",... | Perform validation on a class-level annotation for which {@link #getJndiName} returned the empty string. By default, this method
performs no validation for backwards compatibility.
@param instanceClass the class containing the annotation
@param annotation the annotation
@throws InjectionException | [
"Perform",
"validation",
"on",
"a",
"class",
"-",
"level",
"annotation",
"for",
"which",
"{",
"@link",
"#getJndiName",
"}",
"returned",
"the",
"empty",
"string",
".",
"By",
"default",
"this",
"method",
"performs",
"no",
"validation",
"for",
"backwards",
"compa... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionProcessor.java#L564-L588 |
jenkinsci/jenkins | core/src/main/java/jenkins/mvn/GlobalSettingsProvider.java | GlobalSettingsProvider.getSettingsRemotePath | public static String getSettingsRemotePath(GlobalSettingsProvider provider, AbstractBuild<?, ?> build, TaskListener listener) {
"""
Convenience method handling all <code>null</code> checks. Provides the path on the (possible) remote settings file.
@param provider
the provider to be used
@param build
the acti... | java | public static String getSettingsRemotePath(GlobalSettingsProvider provider, AbstractBuild<?, ?> build, TaskListener listener) {
FilePath fp = getSettingsFilePath(provider, build, listener);
return fp == null ? null : fp.getRemote();
} | [
"public",
"static",
"String",
"getSettingsRemotePath",
"(",
"GlobalSettingsProvider",
"provider",
",",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"build",
",",
"TaskListener",
"listener",
")",
"{",
"FilePath",
"fp",
"=",
"getSettingsFilePath",
"(",
"provider",
",",... | Convenience method handling all <code>null</code> checks. Provides the path on the (possible) remote settings file.
@param provider
the provider to be used
@param build
the active build
@param listener
the listener of the current build
@return the path to the global settings.xml | [
"Convenience",
"method",
"handling",
"all",
"<code",
">",
"null<",
"/",
"code",
">",
"checks",
".",
"Provides",
"the",
"path",
"on",
"the",
"(",
"possible",
")",
"remote",
"settings",
"file",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/mvn/GlobalSettingsProvider.java#L70-L73 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/cemi/CEMIFactory.java | CEMIFactory.createFromEMI | public static CEMI createFromEMI(byte[] frame) throws KNXFormatException {
"""
Creates a new cEMI message out of the supplied EMI frame.
<p>
@param frame EMI frame
@return the new cEMI message
@throws KNXFormatException if no (valid) EMI structure was found or unsupported EMI
message code
"""
// chec... | java | public static CEMI createFromEMI(byte[] frame) throws KNXFormatException
{
// check for minimum frame length (i.e. busmonitor)
if (frame.length < 4)
throw new KNXFormatException("EMI frame too short");
final int mc = frame[0] & 0xff;
if (mc == CEMIBusMon.MC_BUSMON_IND) {
return new CEMIBusMon(fram... | [
"public",
"static",
"CEMI",
"createFromEMI",
"(",
"byte",
"[",
"]",
"frame",
")",
"throws",
"KNXFormatException",
"{",
"// check for minimum frame length (i.e. busmonitor)\r",
"if",
"(",
"frame",
".",
"length",
"<",
"4",
")",
"throw",
"new",
"KNXFormatException",
"(... | Creates a new cEMI message out of the supplied EMI frame.
<p>
@param frame EMI frame
@return the new cEMI message
@throws KNXFormatException if no (valid) EMI structure was found or unsupported EMI
message code | [
"Creates",
"a",
"new",
"cEMI",
"message",
"out",
"of",
"the",
"supplied",
"EMI",
"frame",
".",
"<p",
">"
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/cemi/CEMIFactory.java#L200-L223 |
ptgoetz/storm-hbase | src/main/java/org/apache/storm/hbase/common/ColumnList.java | ColumnList.addColumn | public ColumnList addColumn(byte[] family, byte[] qualifier, byte[] value) {
"""
Add a standard HBase column
@param family
@param qualifier
@param value
@return
"""
columns().add(new Column(family, qualifier, -1, value));
return this;
} | java | public ColumnList addColumn(byte[] family, byte[] qualifier, byte[] value){
columns().add(new Column(family, qualifier, -1, value));
return this;
} | [
"public",
"ColumnList",
"addColumn",
"(",
"byte",
"[",
"]",
"family",
",",
"byte",
"[",
"]",
"qualifier",
",",
"byte",
"[",
"]",
"value",
")",
"{",
"columns",
"(",
")",
".",
"add",
"(",
"new",
"Column",
"(",
"family",
",",
"qualifier",
",",
"-",
"1... | Add a standard HBase column
@param family
@param qualifier
@param value
@return | [
"Add",
"a",
"standard",
"HBase",
"column"
] | train | https://github.com/ptgoetz/storm-hbase/blob/509e41514bb92ef65dba1449bbd935557dc8193c/src/main/java/org/apache/storm/hbase/common/ColumnList.java#L128-L131 |
motown-io/motown | domain/command-handling/src/main/java/io/motown/domain/chargingstation/ChargingStation.java | ChargingStation.checkCommandAllowed | private void checkCommandAllowed(IdentityContext identityContext, Class commandClass) {
"""
Checks if the identityContext is allowed access to the command class, if the identity context is not allowed
to execute the passed command class a {@code IllegalStateException} is thrown.
@param identityContext identity... | java | private void checkCommandAllowed(IdentityContext identityContext, Class commandClass) {
if (!commandAuthorization.isAuthorized(identityContext, this.authorizations.asMap(), commandClass)) {
throw new IllegalStateException(identityContext + " is not authorized to execute " + commandClass);
}
... | [
"private",
"void",
"checkCommandAllowed",
"(",
"IdentityContext",
"identityContext",
",",
"Class",
"commandClass",
")",
"{",
"if",
"(",
"!",
"commandAuthorization",
".",
"isAuthorized",
"(",
"identityContext",
",",
"this",
".",
"authorizations",
".",
"asMap",
"(",
... | Checks if the identityContext is allowed access to the command class, if the identity context is not allowed
to execute the passed command class a {@code IllegalStateException} is thrown.
@param identityContext identity context.
@param commandClass class of the command.
@throws IllegalStateException if the identity... | [
"Checks",
"if",
"the",
"identityContext",
"is",
"allowed",
"access",
"to",
"the",
"command",
"class",
"if",
"the",
"identity",
"context",
"is",
"not",
"allowed",
"to",
"execute",
"the",
"passed",
"command",
"class",
"a",
"{",
"@code",
"IllegalStateException",
... | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/domain/command-handling/src/main/java/io/motown/domain/chargingstation/ChargingStation.java#L634-L638 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java | CudaDataBufferFactory.createHalf | @Override
public DataBuffer createHalf(long offset, byte[] data, int length) {
"""
Creates a half-precision data buffer
@param offset
@param data the data to create the buffer from
@param length
@return the new buffer
"""
return new CudaHalfDataBuffer(ArrayUtil.toFloatArray(data), true, off... | java | @Override
public DataBuffer createHalf(long offset, byte[] data, int length) {
return new CudaHalfDataBuffer(ArrayUtil.toFloatArray(data), true, offset);
} | [
"@",
"Override",
"public",
"DataBuffer",
"createHalf",
"(",
"long",
"offset",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"length",
")",
"{",
"return",
"new",
"CudaHalfDataBuffer",
"(",
"ArrayUtil",
".",
"toFloatArray",
"(",
"data",
")",
",",
"true",
",",
... | Creates a half-precision data buffer
@param offset
@param data the data to create the buffer from
@param length
@return the new buffer | [
"Creates",
"a",
"half",
"-",
"precision",
"data",
"buffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java#L775-L778 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.uploadFile | public UploadResult uploadFile(String path, String fileType)
throws APIConnectionException, APIRequestException {
"""
Upload file, only support image file(jpg, bmp, gif, png) currently,
file size should not larger than 8M.
@param path Necessary, the native path of the file you want to upload
@param ... | java | public UploadResult uploadFile(String path, String fileType)
throws APIConnectionException, APIRequestException {
return _resourceClient.uploadFile(path, fileType);
} | [
"public",
"UploadResult",
"uploadFile",
"(",
"String",
"path",
",",
"String",
"fileType",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_resourceClient",
".",
"uploadFile",
"(",
"path",
",",
"fileType",
")",
";",
"}"
] | Upload file, only support image file(jpg, bmp, gif, png) currently,
file size should not larger than 8M.
@param path Necessary, the native path of the file you want to upload
@param fileType Current support type: image, file, voice
@return UploadResult
@throws APIConnectionException connect exception
@throws APIRequest... | [
"Upload",
"file",
"only",
"support",
"image",
"file",
"(",
"jpg",
"bmp",
"gif",
"png",
")",
"currently",
"file",
"size",
"should",
"not",
"larger",
"than",
"8M",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L579-L582 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Stream.java | Stream.parallelZip | public static <A, B, C, R> Stream<R> parallelZip(final Stream<A> a, final Stream<B> b, final Stream<C> c, final A valueForNoneA, final B valueForNoneB,
final C valueForNoneC, final TriFunction<? super A, ? super B, ? super C, R> zipFunction) {
"""
Put the stream in try-catch to stop the back-end readi... | java | public static <A, B, C, R> Stream<R> parallelZip(final Stream<A> a, final Stream<B> b, final Stream<C> c, final A valueForNoneA, final B valueForNoneB,
final C valueForNoneC, final TriFunction<? super A, ? super B, ? super C, R> zipFunction) {
return parallelZip(a, b, c, valueForNoneA, valueForNon... | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"C",
",",
"R",
">",
"Stream",
"<",
"R",
">",
"parallelZip",
"(",
"final",
"Stream",
"<",
"A",
">",
"a",
",",
"final",
"Stream",
"<",
"B",
">",
"b",
",",
"final",
"Stream",
"<",
"C",
">",
"c",
",",
... | Put the stream in try-catch to stop the back-end reading thread if error happens
<br />
<code>
try (Stream<Integer> stream = Stream.parallelZip(a, b, zipFunction)) {
stream.forEach(N::println);
}
</code>
@param a
@param b
@param c
@param valueForNoneA
@param valueForNoneB
@param valueForNoneC
@param zipFunction
@retur... | [
"Put",
"the",
"stream",
"in",
"try",
"-",
"catch",
"to",
"stop",
"the",
"back",
"-",
"end",
"reading",
"thread",
"if",
"error",
"happens",
"<br",
"/",
">",
"<code",
">",
"try",
"(",
"Stream<Integer",
">",
"stream",
"=",
"Stream",
".",
"parallelZip",
"(... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Stream.java#L8491-L8494 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/internal/StencilInterpreter.java | StencilInterpreter.findAndRemoveValue | private ExpressionContext findAndRemoveValue(List<NamedValueContext> namedValues, String name) {
"""
Find and remove named value with specific name
@param namedValues List of NamedValues to search
@param name Name of value to find
@return Expression for value with specified name
"""
Iterator<Name... | java | private ExpressionContext findAndRemoveValue(List<NamedValueContext> namedValues, String name) {
Iterator<NamedValueContext> namedValueIter = namedValues.iterator();
while (namedValueIter.hasNext()) {
NamedValueContext namedValue = namedValueIter.next();
if (name.equals(value(namedValue.name)))... | [
"private",
"ExpressionContext",
"findAndRemoveValue",
"(",
"List",
"<",
"NamedValueContext",
">",
"namedValues",
",",
"String",
"name",
")",
"{",
"Iterator",
"<",
"NamedValueContext",
">",
"namedValueIter",
"=",
"namedValues",
".",
"iterator",
"(",
")",
";",
"whil... | Find and remove named value with specific name
@param namedValues List of NamedValues to search
@param name Name of value to find
@return Expression for value with specified name | [
"Find",
"and",
"remove",
"named",
"value",
"with",
"specific",
"name"
] | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/internal/StencilInterpreter.java#L2784-L2796 |
to2mbn/JMCCC | jmccc/src/main/java/org/to2mbn/jmccc/version/parsing/Versions.java | Versions.resolveAssets | public static Set<Asset> resolveAssets(MinecraftDirectory minecraftDir, String assets) throws IOException {
"""
Resolves the asset index.
@param minecraftDir the minecraft directory
@param assets the name of the asset index, you can get this via
{@link Version#getAssets()}
@return the asset index, null if th... | java | public static Set<Asset> resolveAssets(MinecraftDirectory minecraftDir, String assets) throws IOException {
Objects.requireNonNull(minecraftDir);
Objects.requireNonNull(assets);
if (!minecraftDir.getAssetIndex(assets).isFile()) {
return null;
}
try {
return getVersionParser().parseAssetIndex(IOUtils.to... | [
"public",
"static",
"Set",
"<",
"Asset",
">",
"resolveAssets",
"(",
"MinecraftDirectory",
"minecraftDir",
",",
"String",
"assets",
")",
"throws",
"IOException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"minecraftDir",
")",
";",
"Objects",
".",
"requireNonNull",... | Resolves the asset index.
@param minecraftDir the minecraft directory
@param assets the name of the asset index, you can get this via
{@link Version#getAssets()}
@return the asset index, null if the asset index does not exist
@throws IOException if an I/O error has occurred during resolving asset
index
@throws NullPoi... | [
"Resolves",
"the",
"asset",
"index",
"."
] | train | https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc/src/main/java/org/to2mbn/jmccc/version/parsing/Versions.java#L102-L114 |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/PresentationManager.java | PresentationManager.logItem | public void logItem(String s1, String s2, String symbol) {
"""
Formatting helper for startup
@param evt The event
@param s1 Text
@param s2 Extra description
@param symbol Status symbol
"""
info(String.format("(%s) %-25s %s", symbol, s1, (s2 != null) ? s2 : ""));
} | java | public void logItem(String s1, String s2, String symbol) {
info(String.format("(%s) %-25s %s", symbol, s1, (s2 != null) ? s2 : ""));
} | [
"public",
"void",
"logItem",
"(",
"String",
"s1",
",",
"String",
"s2",
",",
"String",
"symbol",
")",
"{",
"info",
"(",
"String",
".",
"format",
"(",
"\"(%s) %-25s %s\"",
",",
"symbol",
",",
"s1",
",",
"(",
"s2",
"!=",
"null",
")",
"?",
"s2",
":",
"... | Formatting helper for startup
@param evt The event
@param s1 Text
@param s2 Extra description
@param symbol Status symbol | [
"Formatting",
"helper",
"for",
"startup"
] | train | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/PresentationManager.java#L222-L224 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/NativeAppCallAttachmentStore.java | NativeAppCallAttachmentStore.addAttachmentFilesForCall | public void addAttachmentFilesForCall(Context context, UUID callId, Map<String, File> imageAttachmentFiles) {
"""
Adds a number of bitmap attachment files associated with a native app call. The attachments will be
served via {@link NativeAppCallContentProvider#openFile(android.net.Uri, String) openFile}.
@para... | java | public void addAttachmentFilesForCall(Context context, UUID callId, Map<String, File> imageAttachmentFiles) {
Validate.notNull(context, "context");
Validate.notNull(callId, "callId");
Validate.containsNoNulls(imageAttachmentFiles.values(), "imageAttachmentFiles");
Validate.containsNoNull... | [
"public",
"void",
"addAttachmentFilesForCall",
"(",
"Context",
"context",
",",
"UUID",
"callId",
",",
"Map",
"<",
"String",
",",
"File",
">",
"imageAttachmentFiles",
")",
"{",
"Validate",
".",
"notNull",
"(",
"context",
",",
"\"context\"",
")",
";",
"Validate"... | Adds a number of bitmap attachment files associated with a native app call. The attachments will be
served via {@link NativeAppCallContentProvider#openFile(android.net.Uri, String) openFile}.
@param context the Context the call is being made from
@param callId the unique ID of the call
@param imageAttachments a Map of... | [
"Adds",
"a",
"number",
"of",
"bitmap",
"attachment",
"files",
"associated",
"with",
"a",
"native",
"app",
"call",
".",
"The",
"attachments",
"will",
"be",
"served",
"via",
"{",
"@link",
"NativeAppCallContentProvider#openFile",
"(",
"android",
".",
"net",
".",
... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/NativeAppCallAttachmentStore.java#L88-L113 |
Azure/azure-sdk-for-java | mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java | SpatialAnchorsAccountsInner.regenerateKeysAsync | public Observable<SpatialAnchorsAccountKeysInner> regenerateKeysAsync(String resourceGroupName, String spatialAnchorsAccountName, Integer serial) {
"""
Regenerate 1 Key of a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Real... | java | public Observable<SpatialAnchorsAccountKeysInner> regenerateKeysAsync(String resourceGroupName, String spatialAnchorsAccountName, Integer serial) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName, serial).map(new Func1<ServiceResponse<SpatialAnchorsAccountKeysInner>, S... | [
"public",
"Observable",
"<",
"SpatialAnchorsAccountKeysInner",
">",
"regenerateKeysAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"spatialAnchorsAccountName",
",",
"Integer",
"serial",
")",
"{",
"return",
"regenerateKeysWithServiceResponseAsync",
"(",
"resourceGro... | Regenerate 1 Key of a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account.
@param serial serial of key to be regenerated
@throws IllegalArgumentException thrown if parameters fail the validation
@return the... | [
"Regenerate",
"1",
"Key",
"of",
"a",
"Spatial",
"Anchors",
"Account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java#L901-L908 |
gosu-lang/gosu-lang | gosu-process/src/main/java/gw/util/ShellProcess.java | ShellProcess.readUntil | public String readUntil(String character, boolean includeDeliminator) {
"""
Reads a group of text from stdout. The line will start from the previous point until the read character. This
method will block until the specified character is read.
@param character the character to read until
@param includeDelimina... | java | public String readUntil(String character, boolean includeDeliminator) {
return readStreamUntil(_javaProcess.getInputStream(), includeDeliminator, character.toCharArray());
} | [
"public",
"String",
"readUntil",
"(",
"String",
"character",
",",
"boolean",
"includeDeliminator",
")",
"{",
"return",
"readStreamUntil",
"(",
"_javaProcess",
".",
"getInputStream",
"(",
")",
",",
"includeDeliminator",
",",
"character",
".",
"toCharArray",
"(",
")... | Reads a group of text from stdout. The line will start from the previous point until the read character. This
method will block until the specified character is read.
@param character the character to read until
@param includeDeliminator true to include the deliminator in the returned text, false to not.
@return The ... | [
"Reads",
"a",
"group",
"of",
"text",
"from",
"stdout",
".",
"The",
"line",
"will",
"start",
"from",
"the",
"previous",
"point",
"until",
"the",
"read",
"character",
".",
"This",
"method",
"will",
"block",
"until",
"the",
"specified",
"character",
"is",
"re... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-process/src/main/java/gw/util/ShellProcess.java#L36-L38 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/BaseLdpHandler.java | BaseLdpHandler.checkCache | protected void checkCache(final Instant modified, final EntityTag etag) {
"""
Check the cache.
@param modified the modification date
@param etag the resource's etag
"""
HttpUtils.checkIfMatch(getRequest().getHeaders().getFirst(IF_MATCH), etag);
HttpUtils.checkIfUnmodifiedSince(getRequest().ge... | java | protected void checkCache(final Instant modified, final EntityTag etag) {
HttpUtils.checkIfMatch(getRequest().getHeaders().getFirst(IF_MATCH), etag);
HttpUtils.checkIfUnmodifiedSince(getRequest().getHeaders().getFirst(IF_UNMODIFIED_SINCE), modified);
HttpUtils.checkIfNoneMatch(getRequest().getMe... | [
"protected",
"void",
"checkCache",
"(",
"final",
"Instant",
"modified",
",",
"final",
"EntityTag",
"etag",
")",
"{",
"HttpUtils",
".",
"checkIfMatch",
"(",
"getRequest",
"(",
")",
".",
"getHeaders",
"(",
")",
".",
"getFirst",
"(",
"IF_MATCH",
")",
",",
"et... | Check the cache.
@param modified the modification date
@param etag the resource's etag | [
"Check",
"the",
"cache",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/BaseLdpHandler.java#L89-L95 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MigrationTool.java | MigrationTool.migrate | void migrate() throws RepositoryException {
"""
Method that aggregates all needed migration operations in needed order.
@throws RepositoryException
"""
try
{
LOG.info("Migration started.");
moveOldStructure();
service.createStructure();
//Migration order is im... | java | void migrate() throws RepositoryException
{
try
{
LOG.info("Migration started.");
moveOldStructure();
service.createStructure();
//Migration order is important due to removal of nodes.
migrateGroups();
migrateMembershipTypes();
migrateUsers... | [
"void",
"migrate",
"(",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"LOG",
".",
"info",
"(",
"\"Migration started.\"",
")",
";",
"moveOldStructure",
"(",
")",
";",
"service",
".",
"createStructure",
"(",
")",
";",
"//Migration order is important due to ... | Method that aggregates all needed migration operations in needed order.
@throws RepositoryException | [
"Method",
"that",
"aggregates",
"all",
"needed",
"migration",
"operations",
"in",
"needed",
"order",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MigrationTool.java#L117-L141 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java | FeatureCollection.fromFeature | public static FeatureCollection fromFeature(@NonNull Feature feature) {
"""
Create a new instance of this class by giving the feature collection a single {@link Feature}.
@param feature a single feature
@return a new instance of this class defined by the values passed inside this static factory
method
@since... | java | public static FeatureCollection fromFeature(@NonNull Feature feature) {
List<Feature> featureList = Arrays.asList(feature);
return new FeatureCollection(TYPE, null, featureList);
} | [
"public",
"static",
"FeatureCollection",
"fromFeature",
"(",
"@",
"NonNull",
"Feature",
"feature",
")",
"{",
"List",
"<",
"Feature",
">",
"featureList",
"=",
"Arrays",
".",
"asList",
"(",
"feature",
")",
";",
"return",
"new",
"FeatureCollection",
"(",
"TYPE",
... | Create a new instance of this class by giving the feature collection a single {@link Feature}.
@param feature a single feature
@return a new instance of this class defined by the values passed inside this static factory
method
@since 3.0.0 | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"giving",
"the",
"feature",
"collection",
"a",
"single",
"{",
"@link",
"Feature",
"}",
"."
] | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java#L138-L141 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java | Vulnerability.addReference | public void addReference(String referenceSource, String referenceName, String referenceUrl) {
"""
Adds a reference.
@param referenceSource the source of the reference
@param referenceName the referenceName of the reference
@param referenceUrl the url of the reference
"""
final Reference ref = new ... | java | public void addReference(String referenceSource, String referenceName, String referenceUrl) {
final Reference ref = new Reference();
ref.setSource(referenceSource);
ref.setName(referenceName);
ref.setUrl(referenceUrl);
this.references.add(ref);
} | [
"public",
"void",
"addReference",
"(",
"String",
"referenceSource",
",",
"String",
"referenceName",
",",
"String",
"referenceUrl",
")",
"{",
"final",
"Reference",
"ref",
"=",
"new",
"Reference",
"(",
")",
";",
"ref",
".",
"setSource",
"(",
"referenceSource",
"... | Adds a reference.
@param referenceSource the source of the reference
@param referenceName the referenceName of the reference
@param referenceUrl the url of the reference | [
"Adds",
"a",
"reference",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java#L215-L221 |
abel533/Mapper | core/src/main/java/tk/mybatis/mapper/util/OGNL.java | OGNL.exampleHasAtLeastOneCriteriaCheck | public static boolean exampleHasAtLeastOneCriteriaCheck(Object parameter) {
"""
检查 paremeter 对象中指定的 fields 是否全是 null,如果是则抛出异常
@param parameter
@return
"""
if (parameter != null) {
try {
if (parameter instanceof Example) {
List<Example.Criteria> criter... | java | public static boolean exampleHasAtLeastOneCriteriaCheck(Object parameter) {
if (parameter != null) {
try {
if (parameter instanceof Example) {
List<Example.Criteria> criteriaList = ((Example) parameter).getOredCriteria();
if (criteriaList != nu... | [
"public",
"static",
"boolean",
"exampleHasAtLeastOneCriteriaCheck",
"(",
"Object",
"parameter",
")",
"{",
"if",
"(",
"parameter",
"!=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"parameter",
"instanceof",
"Example",
")",
"{",
"List",
"<",
"Example",
".",
"Cri... | 检查 paremeter 对象中指定的 fields 是否全是 null,如果是则抛出异常
@param parameter
@return | [
"检查",
"paremeter",
"对象中指定的",
"fields",
"是否全是",
"null,如果是则抛出异常"
] | train | https://github.com/abel533/Mapper/blob/45c3d716583cba3680e03f1f6790fab5e1f4f668/core/src/main/java/tk/mybatis/mapper/util/OGNL.java#L113-L133 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/img/ImageExtensions.java | ImageExtensions.getResized | public static BufferedImage getResized(final BufferedImage originalImage,
final String formatName, final int targetWidth, final int targetHeight) throws IOException {
"""
Resize the given BufferedImage and returns the resized BufferedImage.
@param originalImage
the original image
@param formatName
the form... | java | public static BufferedImage getResized(final BufferedImage originalImage,
final String formatName, final int targetWidth, final int targetHeight) throws IOException
{
return read(resize(originalImage, formatName, targetWidth, targetHeight));
} | [
"public",
"static",
"BufferedImage",
"getResized",
"(",
"final",
"BufferedImage",
"originalImage",
",",
"final",
"String",
"formatName",
",",
"final",
"int",
"targetWidth",
",",
"final",
"int",
"targetHeight",
")",
"throws",
"IOException",
"{",
"return",
"read",
"... | Resize the given BufferedImage and returns the resized BufferedImage.
@param originalImage
the original image
@param formatName
the format name
@param targetWidth
the target width
@param targetHeight
the target height
@return the resized
@throws IOException
Signals that an I/O exception has occurred. | [
"Resize",
"the",
"given",
"BufferedImage",
"and",
"returns",
"the",
"resized",
"BufferedImage",
"."
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/img/ImageExtensions.java#L188-L192 |
alkacon/opencms-core | src/org/opencms/search/documents/CmsDocumentHtml.java | CmsDocumentHtml.extractContent | public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
throws CmsIndexException, CmsException {
"""
Returns the raw text content of a given VFS resource containing HTML data.<p>
@see org.opencms.search.documents.I_CmsSearchExtractor#extractContent(CmsObject,... | java | public I_CmsExtractionResult extractContent(CmsObject cms, CmsResource resource, I_CmsSearchIndex index)
throws CmsIndexException, CmsException {
logContentExtraction(resource, index);
CmsFile file = readFile(cms, resource);
try {
CmsProperty encProp = cms.readPropertyObject(
... | [
"public",
"I_CmsExtractionResult",
"extractContent",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"I_CmsSearchIndex",
"index",
")",
"throws",
"CmsIndexException",
",",
"CmsException",
"{",
"logContentExtraction",
"(",
"resource",
",",
"index",
")",
";... | Returns the raw text content of a given VFS resource containing HTML data.<p>
@see org.opencms.search.documents.I_CmsSearchExtractor#extractContent(CmsObject, CmsResource, I_CmsSearchIndex) | [
"Returns",
"the",
"raw",
"text",
"content",
"of",
"a",
"given",
"VFS",
"resource",
"containing",
"HTML",
"data",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/CmsDocumentHtml.java#L65-L82 |
hal/core | gui/src/main/java/org/jboss/as/console/client/shared/subsys/picketlink/FederationPresenter.java | FederationPresenter.modifyIdentityProvider | public void modifyIdentityProvider(final Map<String, Object> changedValues) {
"""
------------------------------------------------------ identity provider, handlers & trust domain
"""
AddressTemplate template = IDENTITY_PROVIDER_TEMPLATE.replaceWildcards(federation, identityProvider);
modify(te... | java | public void modifyIdentityProvider(final Map<String, Object> changedValues) {
AddressTemplate template = IDENTITY_PROVIDER_TEMPLATE.replaceWildcards(federation, identityProvider);
modify(template, identityProvider, changedValues);
} | [
"public",
"void",
"modifyIdentityProvider",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"changedValues",
")",
"{",
"AddressTemplate",
"template",
"=",
"IDENTITY_PROVIDER_TEMPLATE",
".",
"replaceWildcards",
"(",
"federation",
",",
"identityProvider",
")",
... | ------------------------------------------------------ identity provider, handlers & trust domain | [
"------------------------------------------------------",
"identity",
"provider",
"handlers",
"&",
"trust",
"domain"
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/shared/subsys/picketlink/FederationPresenter.java#L182-L185 |
Omertron/api-rottentomatoes | src/main/java/com/omertron/rottentomatoesapi/RottenTomatoesApi.java | RottenTomatoesApi.getMoviesAlias | public RTMovie getMoviesAlias(String altMovieId, String type) throws RottenTomatoesException {
"""
Provides a movie lookup by an id from a different vendor
@param altMovieId
@param type
@return
@throws RottenTomatoesException
"""
properties.clear();
properties.put(ApiBuilder.PROPERTY_URL,... | java | public RTMovie getMoviesAlias(String altMovieId, String type) throws RottenTomatoesException {
properties.clear();
properties.put(ApiBuilder.PROPERTY_URL, URL_MOVIES_ALIAS);
// remove the "tt" from the start of the ID if it's imdb
if ("imdb".equalsIgnoreCase(type) && altMovieId.toLowerCa... | [
"public",
"RTMovie",
"getMoviesAlias",
"(",
"String",
"altMovieId",
",",
"String",
"type",
")",
"throws",
"RottenTomatoesException",
"{",
"properties",
".",
"clear",
"(",
")",
";",
"properties",
".",
"put",
"(",
"ApiBuilder",
".",
"PROPERTY_URL",
",",
"URL_MOVIE... | Provides a movie lookup by an id from a different vendor
@param altMovieId
@param type
@return
@throws RottenTomatoesException | [
"Provides",
"a",
"movie",
"lookup",
"by",
"an",
"id",
"from",
"a",
"different",
"vendor"
] | train | https://github.com/Omertron/api-rottentomatoes/blob/abaf1833acafc6ada593d52b14ff1bacb4e441ee/src/main/java/com/omertron/rottentomatoesapi/RottenTomatoesApi.java#L658-L670 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java | CommonOps_DDF6.addEquals | public static void addEquals( DMatrix6 a , DMatrix6 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified.
"""
a.a1 += b.a1;
a.a2 += b.a2;
a.a3 +... | java | public static void addEquals( DMatrix6 a , DMatrix6 b ) {
a.a1 += b.a1;
a.a2 += b.a2;
a.a3 += b.a3;
a.a4 += b.a4;
a.a5 += b.a5;
a.a6 += b.a6;
} | [
"public",
"static",
"void",
"addEquals",
"(",
"DMatrix6",
"a",
",",
"DMatrix6",
"b",
")",
"{",
"a",
".",
"a1",
"+=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"+=",
"b",
".",
"a2",
";",
"a",
".",
"a3",
"+=",
"b",
".",
"a3",
";",
"a",
".",
"a4",
... | <p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"+",
"b",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"+",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java#L169-L176 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/graph/GraphBuilder.java | GraphBuilder.getRelationBuilder | RelationBuilder getRelationBuilder(Object target, Relation relation, Node source) {
"""
Returns relation builder instance.
@param target
relational entity
@param relation
relation
@param source
relation originator entity
@return relation builder instance.
"""
RelationBuilder relationBuilder = ... | java | RelationBuilder getRelationBuilder(Object target, Relation relation, Node source)
{
RelationBuilder relationBuilder = new RelationBuilder(target, relation, source);
relationBuilder.assignGraphGenerator(this.generator);
return relationBuilder;
} | [
"RelationBuilder",
"getRelationBuilder",
"(",
"Object",
"target",
",",
"Relation",
"relation",
",",
"Node",
"source",
")",
"{",
"RelationBuilder",
"relationBuilder",
"=",
"new",
"RelationBuilder",
"(",
"target",
",",
"relation",
",",
"source",
")",
";",
"relationB... | Returns relation builder instance.
@param target
relational entity
@param relation
relation
@param source
relation originator entity
@return relation builder instance. | [
"Returns",
"relation",
"builder",
"instance",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/graph/GraphBuilder.java#L129-L134 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/ExecutorServiceUtils.java | ExecutorServiceUtils.gracefulShutdown | public void gracefulShutdown(final ExecutorService service, final Duration timeout)
throws InterruptedException {
"""
Gracefully shuts down the given executor service.
<p>Adopted from
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html">
the Oracle JAVA Documenta... | java | public void gracefulShutdown(final ExecutorService service, final Duration timeout)
throws InterruptedException {
service.shutdown(); // Disable new tasks from being submitted
final long timeout_in_unit_of_miliseconds = timeout.toMillis();
// Wait a while for existing tasks to terminate
if (!servi... | [
"public",
"void",
"gracefulShutdown",
"(",
"final",
"ExecutorService",
"service",
",",
"final",
"Duration",
"timeout",
")",
"throws",
"InterruptedException",
"{",
"service",
".",
"shutdown",
"(",
")",
";",
"// Disable new tasks from being submitted",
"final",
"long",
... | Gracefully shuts down the given executor service.
<p>Adopted from
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html">
the Oracle JAVA Documentation.
</a>
@param service the service to shutdown
@param timeout max wait time for the tasks to shutdown. Note that the max wait tim... | [
"Gracefully",
"shuts",
"down",
"the",
"given",
"executor",
"service",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/ExecutorServiceUtils.java#L46-L58 |
JamesIry/jADT | jADT-core/src/main/java/com/pogofish/jadt/comments/CommentProcessor.java | CommentProcessor.leftAlign | public List<JavaComment> leftAlign(List<JavaComment> originals) {
"""
Align a list of comments on the left marging. EOLComments are left alone. Block and JavaDoc comments are aligned by making every line that starts
with a * be one space in from the comment opener. Lines that don't start with * are left alone.... | java | public List<JavaComment> leftAlign(List<JavaComment> originals) {
final List<JavaComment> results = new ArrayList<JavaComment>(
originals.size());
for (JavaComment original : originals) {
results.add(original
.match(new JavaComment.MatchBlock<JavaComment>(... | [
"public",
"List",
"<",
"JavaComment",
">",
"leftAlign",
"(",
"List",
"<",
"JavaComment",
">",
"originals",
")",
"{",
"final",
"List",
"<",
"JavaComment",
">",
"results",
"=",
"new",
"ArrayList",
"<",
"JavaComment",
">",
"(",
"originals",
".",
"size",
"(",
... | Align a list of comments on the left marging. EOLComments are left alone. Block and JavaDoc comments are aligned by making every line that starts
with a * be one space in from the comment opener. Lines that don't start with * are left alone. | [
"Align",
"a",
"list",
"of",
"comments",
"on",
"the",
"left",
"marging",
".",
"EOLComments",
"are",
"left",
"alone",
".",
"Block",
"and",
"JavaDoc",
"comments",
"are",
"aligned",
"by",
"making",
"every",
"line",
"that",
"starts",
"with",
"a",
"*",
"be",
"... | train | https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/comments/CommentProcessor.java#L254-L281 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/MethodUtils.java | MethodUtils.invokeMethod | public static Object invokeMethod(Object object, String methodName, Object[] args, Class<?>[] paramTypes)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
"""
<p>Invoke a named method whose parameter type matches the object type.</p>
<p>The behaviour of this method i... | java | public static Object invokeMethod(Object object, String methodName, Object[] args, Class<?>[] paramTypes)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
if (args == null) {
args = EMPTY_OBJECT_ARRAY;
}
if (paramTypes == null) {
... | [
"public",
"static",
"Object",
"invokeMethod",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
","... | <p>Invoke a named method whose parameter type matches the object type.</p>
<p>The behaviour of this method is less deterministic
than {@link
#invokeExactMethod(Object object,String methodName,Object[] args,Class[] paramTypes)}.
It loops through all methods with names that match
and then executes the first it finds wit... | [
"<p",
">",
"Invoke",
"a",
"named",
"method",
"whose",
"parameter",
"type",
"matches",
"the",
"object",
"type",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/MethodUtils.java#L257-L270 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_boot_bootId_option_option_GET | public OvhNetbootOption serviceName_boot_bootId_option_option_GET(String serviceName, Long bootId, net.minidev.ovh.api.dedicated.server.OvhBootOptionEnum option) throws IOException {
"""
Get this object properties
REST: GET /dedicated/server/{serviceName}/boot/{bootId}/option/{option}
@param serviceName [requi... | java | public OvhNetbootOption serviceName_boot_bootId_option_option_GET(String serviceName, Long bootId, net.minidev.ovh.api.dedicated.server.OvhBootOptionEnum option) throws IOException {
String qPath = "/dedicated/server/{serviceName}/boot/{bootId}/option/{option}";
StringBuilder sb = path(qPath, serviceName, bootId, o... | [
"public",
"OvhNetbootOption",
"serviceName_boot_bootId_option_option_GET",
"(",
"String",
"serviceName",
",",
"Long",
"bootId",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"dedicated",
".",
"server",
".",
"OvhBootOptionEnum",
"option",
")",
"throws",
... | Get this object properties
REST: GET /dedicated/server/{serviceName}/boot/{bootId}/option/{option}
@param serviceName [required] The internal name of your dedicated server
@param bootId [required] boot id
@param option [required] The option of this boot | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1800-L1805 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.dialogToggleStart | public String dialogToggleStart(String headline, String id, boolean show) {
"""
Builds the HTML code to fold and unfold a white-box.<p>
@param headline the heading to display
@param id the id of the toggle
@param show true if the white box is open at the beginning
@return HTML code to fold and unfold a whi... | java | public String dialogToggleStart(String headline, String id, boolean show) {
StringBuffer result = new StringBuffer(512);
// set icon and style class to use: hide user permissions
String image = "plus.png";
String styleClass = "hide";
if (show) {
// show user permissi... | [
"public",
"String",
"dialogToggleStart",
"(",
"String",
"headline",
",",
"String",
"id",
",",
"boolean",
"show",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"512",
")",
";",
"// set icon and style class to use: hide user permissions",
"String"... | Builds the HTML code to fold and unfold a white-box.<p>
@param headline the heading to display
@param id the id of the toggle
@param show true if the white box is open at the beginning
@return HTML code to fold and unfold a white-box | [
"Builds",
"the",
"HTML",
"code",
"to",
"fold",
"and",
"unfold",
"a",
"white",
"-",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L997-L1033 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/rewrite/rewritepolicy_binding.java | rewritepolicy_binding.get | public static rewritepolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch rewritepolicy_binding resource of given name .
"""
rewritepolicy_binding obj = new rewritepolicy_binding();
obj.set_name(name);
rewritepolicy_binding response = (rewritepolicy_binding)... | java | public static rewritepolicy_binding get(nitro_service service, String name) throws Exception{
rewritepolicy_binding obj = new rewritepolicy_binding();
obj.set_name(name);
rewritepolicy_binding response = (rewritepolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"rewritepolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"rewritepolicy_binding",
"obj",
"=",
"new",
"rewritepolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
... | Use this API to fetch rewritepolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"rewritepolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/rewrite/rewritepolicy_binding.java#L136-L141 |
square/wire | wire-java-generator/src/main/java/com/squareup/wire/java/ProfileLoader.java | ProfileLoader.loadProfileFile | private ProfileFileElement loadProfileFile(Path base, String path) throws IOException {
"""
Parses the {@code .wire} file at {@code base/path} and returns it. Returns null if no such
file exists.
"""
Source source = source(base, path);
if (source == null) return null;
try {
Location location... | java | private ProfileFileElement loadProfileFile(Path base, String path) throws IOException {
Source source = source(base, path);
if (source == null) return null;
try {
Location location = Location.get(base.toString(), path);
String data = Okio.buffer(source).readUtf8();
return new ProfileParser... | [
"private",
"ProfileFileElement",
"loadProfileFile",
"(",
"Path",
"base",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"Source",
"source",
"=",
"source",
"(",
"base",
",",
"path",
")",
";",
"if",
"(",
"source",
"==",
"null",
")",
"return",
"nul... | Parses the {@code .wire} file at {@code base/path} and returns it. Returns null if no such
file exists. | [
"Parses",
"the",
"{"
] | train | https://github.com/square/wire/blob/4a9a00dfadfc14d6a0780b85810418f9cbc78a49/wire-java-generator/src/main/java/com/squareup/wire/java/ProfileLoader.java#L138-L150 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/datastructure/JMCollections.java | JMCollections.buildListWithDelimiter | public static List<String> buildListWithDelimiter(
String stringWithDelimiter, String delimiter) {
"""
Build list with delimiter list.
@param stringWithDelimiter the string with delimiter
@param delimiter the delimiter
@return the list
"""
return buildTokenStream(stringWithDe... | java | public static List<String> buildListWithDelimiter(
String stringWithDelimiter, String delimiter) {
return buildTokenStream(stringWithDelimiter, delimiter)
.collect(toList());
} | [
"public",
"static",
"List",
"<",
"String",
">",
"buildListWithDelimiter",
"(",
"String",
"stringWithDelimiter",
",",
"String",
"delimiter",
")",
"{",
"return",
"buildTokenStream",
"(",
"stringWithDelimiter",
",",
"delimiter",
")",
".",
"collect",
"(",
"toList",
"(... | Build list with delimiter list.
@param stringWithDelimiter the string with delimiter
@param delimiter the delimiter
@return the list | [
"Build",
"list",
"with",
"delimiter",
"list",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/datastructure/JMCollections.java#L150-L154 |
alkacon/opencms-core | src/org/opencms/staticexport/A_CmsStaticExportHandler.java | A_CmsStaticExportHandler.getRfsName | private String getRfsName(File file, String vfsName) {
"""
Returns the export file name starting from the OpenCms webapp folder.<p>
@param file the file to delete
@param vfsName the VFS name of the file, the root path!
@return the export file name starting from the OpenCms webapp folder
"""
Cms... | java | private String getRfsName(File file, String vfsName) {
CmsStaticExportManager manager = OpenCms.getStaticExportManager();
String filePath = file.getAbsolutePath();
String result = CmsFileUtil.normalizePath(
manager.getRfsPrefix(vfsName)
+ filePath.substring(OpenCms.g... | [
"private",
"String",
"getRfsName",
"(",
"File",
"file",
",",
"String",
"vfsName",
")",
"{",
"CmsStaticExportManager",
"manager",
"=",
"OpenCms",
".",
"getStaticExportManager",
"(",
")",
";",
"String",
"filePath",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
... | Returns the export file name starting from the OpenCms webapp folder.<p>
@param file the file to delete
@param vfsName the VFS name of the file, the root path!
@return the export file name starting from the OpenCms webapp folder | [
"Returns",
"the",
"export",
"file",
"name",
"starting",
"from",
"the",
"OpenCms",
"webapp",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/A_CmsStaticExportHandler.java#L663-L671 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java | SqlFunctionUtils.rpad | public static String rpad(String base, int len, String pad) {
"""
Returns the string str right-padded with the string pad to a length of len characters.
If str is longer than len, the return value is shortened to len characters.
"""
if (len < 0 || "".equals(pad)) {
return null;
} else if (len == 0) {
... | java | public static String rpad(String base, int len, String pad) {
if (len < 0 || "".equals(pad)) {
return null;
} else if (len == 0) {
return "";
}
char[] data = new char[len];
char[] baseChars = base.toCharArray();
char[] padChars = pad.toCharArray();
int pos = 0;
// copy the base
while (pos < b... | [
"public",
"static",
"String",
"rpad",
"(",
"String",
"base",
",",
"int",
"len",
",",
"String",
"pad",
")",
"{",
"if",
"(",
"len",
"<",
"0",
"||",
"\"\"",
".",
"equals",
"(",
"pad",
")",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"... | Returns the string str right-padded with the string pad to a length of len characters.
If str is longer than len, the return value is shortened to len characters. | [
"Returns",
"the",
"string",
"str",
"right",
"-",
"padded",
"with",
"the",
"string",
"pad",
"to",
"a",
"length",
"of",
"len",
"characters",
".",
"If",
"str",
"is",
"longer",
"than",
"len",
"the",
"return",
"value",
"is",
"shortened",
"to",
"len",
"charact... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L256-L286 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.callService | public void callService(String url, String templateName, Object model, XmlHttpResponse result, Map<String, Object> headers) {
"""
Performs POST to supplied url of result of applying template with model.
All namespaces registered in this environment will be registered with result.
@param url url to post to.
@par... | java | public void callService(String url, String templateName, Object model, XmlHttpResponse result, Map<String, Object> headers) {
doHttpPost(url, templateName, model, result, headers, XmlHttpResponse.CONTENT_TYPE_XML_TEXT_UTF8);
setContext(result);
} | [
"public",
"void",
"callService",
"(",
"String",
"url",
",",
"String",
"templateName",
",",
"Object",
"model",
",",
"XmlHttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
")",
"{",
"doHttpPost",
"(",
"url",
",",
"templateName",... | Performs POST to supplied url of result of applying template with model.
All namespaces registered in this environment will be registered with result.
@param url url to post to.
@param templateName name of template to use.
@param model model for template.
@param result result to populate with response.
@param headers h... | [
"Performs",
"POST",
"to",
"supplied",
"url",
"of",
"result",
"of",
"applying",
"template",
"with",
"model",
".",
"All",
"namespaces",
"registered",
"in",
"this",
"environment",
"will",
"be",
"registered",
"with",
"result",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L247-L250 |
aws/aws-sdk-java | aws-java-sdk-fms/src/main/java/com/amazonaws/services/fms/model/Policy.java | Policy.setIncludeMap | public void setIncludeMap(java.util.Map<String, java.util.List<String>> includeMap) {
"""
<p>
Specifies the AWS account IDs to include in the policy. If <code>IncludeMap</code> is null, all accounts in the
organization in AWS Organizations are included in the policy. If <code>IncludeMap</code> is not null, only ... | java | public void setIncludeMap(java.util.Map<String, java.util.List<String>> includeMap) {
this.includeMap = includeMap;
} | [
"public",
"void",
"setIncludeMap",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"includeMap",
")",
"{",
"this",
".",
"includeMap",
"=",
"includeMap",
";",
"}"
] | <p>
Specifies the AWS account IDs to include in the policy. If <code>IncludeMap</code> is null, all accounts in the
organization in AWS Organizations are included in the policy. If <code>IncludeMap</code> is not null, only values
listed in <code>IncludeMap</code> are included in the policy.
</p>
<p>
The key to the map ... | [
"<p",
">",
"Specifies",
"the",
"AWS",
"account",
"IDs",
"to",
"include",
"in",
"the",
"policy",
".",
"If",
"<code",
">",
"IncludeMap<",
"/",
"code",
">",
"is",
"null",
"all",
"accounts",
"in",
"the",
"organization",
"in",
"AWS",
"Organizations",
"are",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-fms/src/main/java/com/amazonaws/services/fms/model/Policy.java#L656-L658 |
molgenis/molgenis | molgenis-api-data/src/main/java/org/molgenis/api/data/v1/RestController.java | RestController.retrieveEntity | @GetMapping(value = "/ {
"""
Get's an entity by it's id
<p>Examples:
<p>/api/v1/person/99 Retrieves a person with id 99
"""entityTypeId}/{id}", produces = APPLICATION_JSON_VALUE)
public Map<String, Object> retrieveEntity(
@PathVariable("entityTypeId") String entityTypeId,
@PathVariable("id"... | java | @GetMapping(value = "/{entityTypeId}/{id}", produces = APPLICATION_JSON_VALUE)
public Map<String, Object> retrieveEntity(
@PathVariable("entityTypeId") String entityTypeId,
@PathVariable("id") String untypedId,
@RequestParam(value = "attributes", required = false) String[] attributes,
@Request... | [
"@",
"GetMapping",
"(",
"value",
"=",
"\"/{entityTypeId}/{id}\"",
",",
"produces",
"=",
"APPLICATION_JSON_VALUE",
")",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"retrieveEntity",
"(",
"@",
"PathVariable",
"(",
"\"entityTypeId\"",
")",
"String",
"entityTy... | Get's an entity by it's id
<p>Examples:
<p>/api/v1/person/99 Retrieves a person with id 99 | [
"Get",
"s",
"an",
"entity",
"by",
"it",
"s",
"id"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-api-data/src/main/java/org/molgenis/api/data/v1/RestController.java#L256-L273 |
osglworks/java-tool | src/main/java/org/osgl/util/StrBase.java | StrBase.maxLength | public T maxLength(int max) {
"""
<p>Return a string no longer than specified max length.
<p>If the string supplied is longer than the specified max length
then only it's part that is less than the max length returned, appended
with "..."
@param max the maximum length of the result
@return A StrBase instanc... | java | public T maxLength(int max) {
if (isEmpty()) return _empty();
if (length() < (max - 3)) return me();
return subList(0, max).append("...");
} | [
"public",
"T",
"maxLength",
"(",
"int",
"max",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"return",
"_empty",
"(",
")",
";",
"if",
"(",
"length",
"(",
")",
"<",
"(",
"max",
"-",
"3",
")",
")",
"return",
"me",
"(",
")",
";",
"return",
"sub... | <p>Return a string no longer than specified max length.
<p>If the string supplied is longer than the specified max length
then only it's part that is less than the max length returned, appended
with "..."
@param max the maximum length of the result
@return A StrBase instance that contains at most `max` number of chars... | [
"<p",
">",
"Return",
"a",
"string",
"no",
"longer",
"than",
"specified",
"max",
"length",
".",
"<p",
">",
"If",
"the",
"string",
"supplied",
"is",
"longer",
"than",
"the",
"specified",
"max",
"length",
"then",
"only",
"it",
"s",
"part",
"that",
"is",
"... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/StrBase.java#L1297-L1301 |
UrielCh/ovh-java-sdk | ovh-java-sdk-clusterhadoop/src/main/java/net/minidev/ovh/api/ApiOvhClusterhadoop.java | ApiOvhClusterhadoop.serviceName_node_hostname_role_type_GET | public OvhRole serviceName_node_hostname_role_type_GET(String serviceName, String hostname, net.minidev.ovh.api.cluster.hadoop.OvhRoleTypeEnum type) throws IOException {
"""
Get this object properties
REST: GET /cluster/hadoop/{serviceName}/node/{hostname}/role/{type}
@param serviceName [required] The internal... | java | public OvhRole serviceName_node_hostname_role_type_GET(String serviceName, String hostname, net.minidev.ovh.api.cluster.hadoop.OvhRoleTypeEnum type) throws IOException {
String qPath = "/cluster/hadoop/{serviceName}/node/{hostname}/role/{type}";
StringBuilder sb = path(qPath, serviceName, hostname, type);
String ... | [
"public",
"OvhRole",
"serviceName_node_hostname_role_type_GET",
"(",
"String",
"serviceName",
",",
"String",
"hostname",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"cluster",
".",
"hadoop",
".",
"OvhRoleTypeEnum",
"type",
")",
"throws",
"IOException"... | Get this object properties
REST: GET /cluster/hadoop/{serviceName}/node/{hostname}/role/{type}
@param serviceName [required] The internal name of your cluster
@param hostname [required] Hostname of the node
@param type [required] Role name | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-clusterhadoop/src/main/java/net/minidev/ovh/api/ApiOvhClusterhadoop.java#L319-L324 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/LocalTxManager.java | LocalTxManager.getCurrentTransaction | public TransactionImpl getCurrentTransaction() {
"""
Returns the current transaction for the calling thread.
@throws org.odmg.TransactionNotInProgressException
{@link org.odmg.TransactionNotInProgressException} if no transaction was found.
"""
TransactionImpl tx = tx_table.get(Thread.currentThread... | java | public TransactionImpl getCurrentTransaction()
{
TransactionImpl tx = tx_table.get(Thread.currentThread());
if(tx == null)
{
throw new TransactionNotInProgressException("Calling method needed transaction, but no transaction found for current thread :-(");
}
... | [
"public",
"TransactionImpl",
"getCurrentTransaction",
"(",
")",
"{",
"TransactionImpl",
"tx",
"=",
"tx_table",
".",
"get",
"(",
"Thread",
".",
"currentThread",
"(",
")",
")",
";",
"if",
"(",
"tx",
"==",
"null",
")",
"{",
"throw",
"new",
"TransactionNotInProg... | Returns the current transaction for the calling thread.
@throws org.odmg.TransactionNotInProgressException
{@link org.odmg.TransactionNotInProgressException} if no transaction was found. | [
"Returns",
"the",
"current",
"transaction",
"for",
"the",
"calling",
"thread",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/LocalTxManager.java#L54-L62 |
windup/windup | rules-base/api/src/main/java/org/jboss/windup/rules/files/FileMapping.java | FileMapping.addMapping | public static void addMapping(GraphRewrite event, String pattern, Class<? extends WindupVertexFrame> type) {
"""
Add a {@link WindupVertexFrame} type to the list of mappings for the given pattern and {@link GraphRewrite}
event.
"""
getMappings(event, pattern).add(type);
} | java | public static void addMapping(GraphRewrite event, String pattern, Class<? extends WindupVertexFrame> type)
{
getMappings(event, pattern).add(type);
} | [
"public",
"static",
"void",
"addMapping",
"(",
"GraphRewrite",
"event",
",",
"String",
"pattern",
",",
"Class",
"<",
"?",
"extends",
"WindupVertexFrame",
">",
"type",
")",
"{",
"getMappings",
"(",
"event",
",",
"pattern",
")",
".",
"add",
"(",
"type",
")",... | Add a {@link WindupVertexFrame} type to the list of mappings for the given pattern and {@link GraphRewrite}
event. | [
"Add",
"a",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-base/api/src/main/java/org/jboss/windup/rules/files/FileMapping.java#L176-L179 |
pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/ReaderGroupImpl.java | ReaderGroupImpl.resetReadersToCheckpoint | @Override
@Deprecated
public void resetReadersToCheckpoint(Checkpoint checkpoint) {
"""
Used to reset a reset a reader group to a checkpoint. This should be removed in time.
@deprecated Use {@link ReaderGroup#resetReaderGroup(ReaderGroupConfig)} to reset readers to a given Checkpoint.
"""
sync... | java | @Override
@Deprecated
public void resetReadersToCheckpoint(Checkpoint checkpoint) {
synchronizer.updateState((state, updates) -> {
ReaderGroupConfig config = state.getConfig();
Map<Segment, Long> positions = new HashMap<>();
for (StreamCut cut : checkpoint.asImpl().ge... | [
"@",
"Override",
"@",
"Deprecated",
"public",
"void",
"resetReadersToCheckpoint",
"(",
"Checkpoint",
"checkpoint",
")",
"{",
"synchronizer",
".",
"updateState",
"(",
"(",
"state",
",",
"updates",
")",
"->",
"{",
"ReaderGroupConfig",
"config",
"=",
"state",
".",
... | Used to reset a reset a reader group to a checkpoint. This should be removed in time.
@deprecated Use {@link ReaderGroup#resetReaderGroup(ReaderGroupConfig)} to reset readers to a given Checkpoint. | [
"Used",
"to",
"reset",
"a",
"reset",
"a",
"reader",
"group",
"to",
"a",
"checkpoint",
".",
"This",
"should",
"be",
"removed",
"in",
"time",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/ReaderGroupImpl.java#L178-L189 |
scireum/s3ninja | src/main/java/ninja/S3Dispatcher.java | S3Dispatcher.multiObject | private void multiObject(WebContext ctx, String uploadId, String partNumber, InputStreamHandler part) {
"""
Handles PUT /bucket/id?uploadId=X&partNumber=Y
@param ctx the context describing the current request
@param uploadId the multipart upload this part belongs to
@param partNumber the number of th... | java | private void multiObject(WebContext ctx, String uploadId, String partNumber, InputStreamHandler part) {
if (!multipartUploads.contains(uploadId)) {
ctx.respondWith().error(HttpResponseStatus.NOT_FOUND, ERROR_MULTIPART_UPLOAD_DOES_NOT_EXIST);
return;
}
String etag = "";
... | [
"private",
"void",
"multiObject",
"(",
"WebContext",
"ctx",
",",
"String",
"uploadId",
",",
"String",
"partNumber",
",",
"InputStreamHandler",
"part",
")",
"{",
"if",
"(",
"!",
"multipartUploads",
".",
"contains",
"(",
"uploadId",
")",
")",
"{",
"ctx",
".",
... | Handles PUT /bucket/id?uploadId=X&partNumber=Y
@param ctx the context describing the current request
@param uploadId the multipart upload this part belongs to
@param partNumber the number of this part in the complete upload
@param part input stream with the content of this part | [
"Handles",
"PUT",
"/",
"bucket",
"/",
"id?uploadId",
"=",
"X&partNumber",
"=",
"Y"
] | train | https://github.com/scireum/s3ninja/blob/445eec55c91780267a7f987818b3fedecae009c5/src/main/java/ninja/S3Dispatcher.java#L669-L696 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java | BuildsInner.listAsync | public Observable<Page<BuildInner>> listAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top, final String skipToken) {
"""
Gets all the builds for a registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@pa... | java | public Observable<Page<BuildInner>> listAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top, final String skipToken) {
return listWithServiceResponseAsync(resourceGroupName, registryName, filter, top, skipToken)
.map(new Func1<ServiceResponse<Page<... | [
"public",
"Observable",
"<",
"Page",
"<",
"BuildInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
",",
"final",
"String",
"filter",
",",
"final",
"Integer",
"top",
",",
"final",
"String",
"skipT... | Gets all the builds for a registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param filter The builds filter to apply on the operation.
@param top $top is supported for get list of builds, which limits the m... | [
"Gets",
"all",
"the",
"builds",
"for",
"a",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java#L273-L281 |
ModeShape/modeshape | modeshape-schematic/src/main/java/org/modeshape/schematic/document/Bson.java | Bson.getDateFormatter | public static DateFormat getDateFormatter() {
"""
Obtain a {@link DateFormat} object that can be used within the current thread to format {@link Date} objects.
@return the formatter; never null
"""
SoftReference<DateFormat> ref = dateFormatter.get();
DateFormat formatter = ref != null ? ref.... | java | public static DateFormat getDateFormatter() {
SoftReference<DateFormat> ref = dateFormatter.get();
DateFormat formatter = ref != null ? ref.get() : null;
if (formatter == null) {
formatter = new SimpleDateFormat(DATE_FORMAT);
formatter.setCalendar(new GregorianCalendar(ne... | [
"public",
"static",
"DateFormat",
"getDateFormatter",
"(",
")",
"{",
"SoftReference",
"<",
"DateFormat",
">",
"ref",
"=",
"dateFormatter",
".",
"get",
"(",
")",
";",
"DateFormat",
"formatter",
"=",
"ref",
"!=",
"null",
"?",
"ref",
".",
"get",
"(",
")",
"... | Obtain a {@link DateFormat} object that can be used within the current thread to format {@link Date} objects.
@return the formatter; never null | [
"Obtain",
"a",
"{",
"@link",
"DateFormat",
"}",
"object",
"that",
"can",
"be",
"used",
"within",
"the",
"current",
"thread",
"to",
"format",
"{",
"@link",
"Date",
"}",
"objects",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/document/Bson.java#L52-L61 |
JOML-CI/JOML | src/org/joml/Intersectiond.java | Intersectiond.distancePointLine | public static double distancePointLine(double pointX, double pointY, double a, double b, double c) {
"""
Determine the signed distance of the given point <code>(pointX, pointY)</code> to the line specified via its general plane equation
<i>a*x + b*y + c = 0</i>.
<p>
Reference: <a href="http://mathworld.wolfram.... | java | public static double distancePointLine(double pointX, double pointY, double a, double b, double c) {
double denom = Math.sqrt(a * a + b * b);
return (a * pointX + b * pointY + c) / denom;
} | [
"public",
"static",
"double",
"distancePointLine",
"(",
"double",
"pointX",
",",
"double",
"pointY",
",",
"double",
"a",
",",
"double",
"b",
",",
"double",
"c",
")",
"{",
"double",
"denom",
"=",
"Math",
".",
"sqrt",
"(",
"a",
"*",
"a",
"+",
"b",
"*",... | Determine the signed distance of the given point <code>(pointX, pointY)</code> to the line specified via its general plane equation
<i>a*x + b*y + c = 0</i>.
<p>
Reference: <a href="http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html">http://mathworld.wolfram.com</a>
@param pointX
the x coordinate of the... | [
"Determine",
"the",
"signed",
"distance",
"of",
"the",
"given",
"point",
"<code",
">",
"(",
"pointX",
"pointY",
")",
"<",
"/",
"code",
">",
"to",
"the",
"line",
"specified",
"via",
"its",
"general",
"plane",
"equation",
"<i",
">",
"a",
"*",
"x",
"+",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectiond.java#L3826-L3829 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listNextAsync | public ServiceFuture<List<CloudJob>> listNextAsync(final String nextPageLink, final JobListNextOptions jobListNextOptions, final ServiceFuture<List<CloudJob>> serviceFuture, final ListOperationCallback<CloudJob> serviceCallback) {
"""
Lists all of the jobs in the specified account.
@param nextPageLink The NextL... | java | public ServiceFuture<List<CloudJob>> listNextAsync(final String nextPageLink, final JobListNextOptions jobListNextOptions, final ServiceFuture<List<CloudJob>> serviceFuture, final ListOperationCallback<CloudJob> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listNextSinglePageA... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"CloudJob",
">",
">",
"listNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"JobListNextOptions",
"jobListNextOptions",
",",
"final",
"ServiceFuture",
"<",
"List",
"<",
"CloudJob",
">",
">",
"serviceFut... | Lists all of the jobs in the specified account.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param jobListNextOptions Additional parameters for the operation
@param serviceFuture the ServiceFuture object tracking the Retrofit calls
@param serviceCallback the async ServiceCallb... | [
"Lists",
"all",
"of",
"the",
"jobs",
"in",
"the",
"specified",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L3447-L3457 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java | GeneratedDOAuth2UserDaoImpl.queryByDisplayName | public Iterable<DOAuth2User> queryByDisplayName(java.lang.String displayName) {
"""
query-by method for field displayName
@param displayName the specified attribute
@return an Iterable of DOAuth2Users for the specified displayName
"""
return queryByField(null, DOAuth2UserMapper.Field.DISPLAYNAME.getField... | java | public Iterable<DOAuth2User> queryByDisplayName(java.lang.String displayName) {
return queryByField(null, DOAuth2UserMapper.Field.DISPLAYNAME.getFieldName(), displayName);
} | [
"public",
"Iterable",
"<",
"DOAuth2User",
">",
"queryByDisplayName",
"(",
"java",
".",
"lang",
".",
"String",
"displayName",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DOAuth2UserMapper",
".",
"Field",
".",
"DISPLAYNAME",
".",
"getFieldName",
"(",
... | query-by method for field displayName
@param displayName the specified attribute
@return an Iterable of DOAuth2Users for the specified displayName | [
"query",
"-",
"by",
"method",
"for",
"field",
"displayName"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDOAuth2UserDaoImpl.java#L88-L90 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java | BigtableSession.createChannelPool | public static ManagedChannel createChannelPool(final String host, final BigtableOptions options,
int count) throws IOException, GeneralSecurityException {
"""
Create a new {@link com.google.cloud.bigtable.grpc.io.ChannelPool}, with auth headers.
@param host a {@link String} object specifying the host to c... | java | public static ManagedChannel createChannelPool(final String host, final BigtableOptions options,
int count) throws IOException, GeneralSecurityException {
final List<ClientInterceptor> interceptorList = new ArrayList<>();
ClientInterceptor credentialsInterceptor = CredentialInterceptorCache.getInstance()... | [
"public",
"static",
"ManagedChannel",
"createChannelPool",
"(",
"final",
"String",
"host",
",",
"final",
"BigtableOptions",
"options",
",",
"int",
"count",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"final",
"List",
"<",
"ClientInterceptor",
... | Create a new {@link com.google.cloud.bigtable.grpc.io.ChannelPool}, with auth headers.
@param host a {@link String} object specifying the host to connect to.
@param options a {@link BigtableOptions} object with the credentials, retry and other connection options.
@param count an int defining the number of channels to ... | [
"Create",
"a",
"new",
"{",
"@link",
"com",
".",
"google",
".",
"cloud",
".",
"bigtable",
".",
"grpc",
".",
"io",
".",
"ChannelPool",
"}",
"with",
"auth",
"headers",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java#L578-L602 |
opentable/otj-jaxrs | client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java | JaxRsClientFactory.newBuilder | public synchronized ClientBuilder newBuilder(String clientName, Collection<JaxRsFeatureGroup> featureGroupsIn) {
"""
Create a new {@link ClientBuilder} instance with the given name and groups.
You own the returned client and are responsible for managing its cleanup.
"""
final JaxRsClientConfig jaxRsCo... | java | public synchronized ClientBuilder newBuilder(String clientName, Collection<JaxRsFeatureGroup> featureGroupsIn) {
final JaxRsClientConfig jaxRsConfig = configForClient(clientName);
return newBuilder(clientName, jaxRsConfig, featureGroupsIn);
} | [
"public",
"synchronized",
"ClientBuilder",
"newBuilder",
"(",
"String",
"clientName",
",",
"Collection",
"<",
"JaxRsFeatureGroup",
">",
"featureGroupsIn",
")",
"{",
"final",
"JaxRsClientConfig",
"jaxRsConfig",
"=",
"configForClient",
"(",
"clientName",
")",
";",
"retu... | Create a new {@link ClientBuilder} instance with the given name and groups.
You own the returned client and are responsible for managing its cleanup. | [
"Create",
"a",
"new",
"{"
] | train | https://github.com/opentable/otj-jaxrs/blob/384e7094fe5a56d41b2a9970bfd783fa85cbbcb8/client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java#L171-L174 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DateUtil.java | DateUtil.addHours | public static <T extends java.util.Date> T addHours(final T date, final int amount) {
"""
Adds a number of hours to a date returning a new object.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to add, may be negative
@return the new {@code Date} with the am... | java | public static <T extends java.util.Date> T addHours(final T date, final int amount) {
return roll(date, amount, CalendarUnit.HOUR);
} | [
"public",
"static",
"<",
"T",
"extends",
"java",
".",
"util",
".",
"Date",
">",
"T",
"addHours",
"(",
"final",
"T",
"date",
",",
"final",
"int",
"amount",
")",
"{",
"return",
"roll",
"(",
"date",
",",
"amount",
",",
"CalendarUnit",
".",
"HOUR",
")",
... | Adds a number of hours to a date returning a new object.
The original {@code Date} is unchanged.
@param date the date, not null
@param amount the amount to add, may be negative
@return the new {@code Date} with the amount added
@throws IllegalArgumentException if the date is null | [
"Adds",
"a",
"number",
"of",
"hours",
"to",
"a",
"date",
"returning",
"a",
"new",
"object",
".",
"The",
"original",
"{",
"@code",
"Date",
"}",
"is",
"unchanged",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L1007-L1009 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.accessRestriction_backupCode_POST | public OvhSOTPSecret accessRestriction_backupCode_POST() throws IOException {
"""
Add a SOTP access restriction
REST: POST /me/accessRestriction/backupCode
"""
String qPath = "/me/accessRestriction/backupCode";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "POST", sb.toString(), null);
r... | java | public OvhSOTPSecret accessRestriction_backupCode_POST() throws IOException {
String qPath = "/me/accessRestriction/backupCode";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, OvhSOTPSecret.class);
} | [
"public",
"OvhSOTPSecret",
"accessRestriction_backupCode_POST",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/accessRestriction/backupCode\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
"resp",
"=",
"exec",
"(... | Add a SOTP access restriction
REST: POST /me/accessRestriction/backupCode | [
"Add",
"a",
"SOTP",
"access",
"restriction"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3996-L4001 |
jenkinsci/jenkins | core/src/main/java/hudson/util/DescribableList.java | DescribableList.buildDependencyGraph | public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) {
"""
Picks up {@link DependencyDeclarer}s and allow it to build dependencies.
"""
for (Object o : this) {
if (o instanceof DependencyDeclarer) {
DependencyDeclarer dd = (DependencyDeclarer) o;
... | java | public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) {
for (Object o : this) {
if (o instanceof DependencyDeclarer) {
DependencyDeclarer dd = (DependencyDeclarer) o;
try {
dd.buildDependencyGraph(owner,graph);
... | [
"public",
"void",
"buildDependencyGraph",
"(",
"AbstractProject",
"owner",
",",
"DependencyGraph",
"graph",
")",
"{",
"for",
"(",
"Object",
"o",
":",
"this",
")",
"{",
"if",
"(",
"o",
"instanceof",
"DependencyDeclarer",
")",
"{",
"DependencyDeclarer",
"dd",
"=... | Picks up {@link DependencyDeclarer}s and allow it to build dependencies. | [
"Picks",
"up",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/DescribableList.java#L214-L225 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_bill_GET | public OvhBill order_orderId_bill_GET(Long orderId) throws IOException {
"""
Get this object properties
REST: GET /me/order/{orderId}/bill
@param orderId [required]
"""
String qPath = "/me/order/{orderId}/bill";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), ... | java | public OvhBill order_orderId_bill_GET(Long orderId) throws IOException {
String qPath = "/me/order/{orderId}/bill";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhBill.class);
} | [
"public",
"OvhBill",
"order_orderId_bill_GET",
"(",
"Long",
"orderId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/bill\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"orderId",
")",
";",
"String",
"resp",
"... | Get this object properties
REST: GET /me/order/{orderId}/bill
@param orderId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2081-L2086 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java | UnsafeOperations.putByte | public final void putByte(Object parent, long offset, byte value) {
"""
Puts the value at the given offset of the supplied parent object
@param parent The Object's parent
@param offset The offset
@param value byte to be put
"""
THE_UNSAFE.putByte(parent, offset, value);
} | java | public final void putByte(Object parent, long offset, byte value) {
THE_UNSAFE.putByte(parent, offset, value);
} | [
"public",
"final",
"void",
"putByte",
"(",
"Object",
"parent",
",",
"long",
"offset",
",",
"byte",
"value",
")",
"{",
"THE_UNSAFE",
".",
"putByte",
"(",
"parent",
",",
"offset",
",",
"value",
")",
";",
"}"
] | Puts the value at the given offset of the supplied parent object
@param parent The Object's parent
@param offset The offset
@param value byte to be put | [
"Puts",
"the",
"value",
"at",
"the",
"given",
"offset",
"of",
"the",
"supplied",
"parent",
"object"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java#L1023-L1025 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java | FhirContext.newRestfulClient | public <T extends IRestfulClient> T newRestfulClient(Class<T> theClientType, String theServerBase) {
"""
Instantiates a new client instance. This method requires an interface which is defined specifically for your use
cases to contain methods for each of the RESTful operations you wish to implement (e.g. "read Im... | java | public <T extends IRestfulClient> T newRestfulClient(Class<T> theClientType, String theServerBase) {
return getRestfulClientFactory().newClient(theClientType, theServerBase);
} | [
"public",
"<",
"T",
"extends",
"IRestfulClient",
">",
"T",
"newRestfulClient",
"(",
"Class",
"<",
"T",
">",
"theClientType",
",",
"String",
"theServerBase",
")",
"{",
"return",
"getRestfulClientFactory",
"(",
")",
".",
"newClient",
"(",
"theClientType",
",",
"... | Instantiates a new client instance. This method requires an interface which is defined specifically for your use
cases to contain methods for each of the RESTful operations you wish to implement (e.g. "read ImagingStudy",
"search Patient by identifier", etc.). This interface must extend {@link IRestfulClient} (or commo... | [
"Instantiates",
"a",
"new",
"client",
"instance",
".",
"This",
"method",
"requires",
"an",
"interface",
"which",
"is",
"defined",
"specifically",
"for",
"your",
"use",
"cases",
"to",
"contain",
"methods",
"for",
"each",
"of",
"the",
"RESTful",
"operations",
"y... | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java#L648-L650 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java | VisualizeImageData.grayMagnitude | public static void grayMagnitude(GrayS32 input , int maxAbsValue , Bitmap output , byte[] storage) {
"""
Renders the image using its gray magnitude
@param input (Input) Image image
@param maxAbsValue (Input) Largest absolute value of a pixel in the image
@param output (Output) Bitmap ARGB_8888 image.
@param ... | java | public static void grayMagnitude(GrayS32 input , int maxAbsValue , Bitmap output , byte[] storage) {
shapeShape(input, output);
if( storage == null )
storage = declareStorage(output,null);
if( maxAbsValue < 0 )
maxAbsValue = ImageStatistics.maxAbs(input);
int indexDst = 0;
for( int y = 0; y < input.... | [
"public",
"static",
"void",
"grayMagnitude",
"(",
"GrayS32",
"input",
",",
"int",
"maxAbsValue",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"shapeShape",
"(",
"input",
",",
"output",
")",
";",
"if",
"(",
"storage",
"==",
"null",... | Renders the image using its gray magnitude
@param input (Input) Image image
@param maxAbsValue (Input) Largest absolute value of a pixel in the image
@param output (Output) Bitmap ARGB_8888 image.
@param storage Optional working buffer for Bitmap image. | [
"Renders",
"the",
"image",
"using",
"its",
"gray",
"magnitude"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/VisualizeImageData.java#L176-L199 |
nominanuda/zen-project | zen-core/src/main/java/com/nominanuda/zen/obj/JsonPath.java | JsonPath.convertLeaves | @SuppressWarnings("unchecked")
public <X extends Stru> X convertLeaves(X source, SafeConvertor<Object, Object> convertor) {
"""
if convertor#canConvert returns false value is not added to result
"""
return Check.notNull(source) instanceof Obj
? (X)convertLeavesInternal((Obj)source, convertor)
: (X)con... | java | @SuppressWarnings("unchecked")
public <X extends Stru> X convertLeaves(X source, SafeConvertor<Object, Object> convertor) {
return Check.notNull(source) instanceof Obj
? (X)convertLeavesInternal((Obj)source, convertor)
: (X)convertLeavesInternal((Arr)source, convertor);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"X",
"extends",
"Stru",
">",
"X",
"convertLeaves",
"(",
"X",
"source",
",",
"SafeConvertor",
"<",
"Object",
",",
"Object",
">",
"convertor",
")",
"{",
"return",
"Check",
".",
"notNull",
"("... | if convertor#canConvert returns false value is not added to result | [
"if",
"convertor#canConvert",
"returns",
"false",
"value",
"is",
"not",
"added",
"to",
"result"
] | train | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-core/src/main/java/com/nominanuda/zen/obj/JsonPath.java#L251-L256 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/instance/HazelcastInstanceFactory.java | HazelcastInstanceFactory.newHazelcastInstance | public static HazelcastInstance newHazelcastInstance(Config config, String instanceName, NodeContext nodeContext) {
"""
Creates a new Hazelcast instance.
@param config the configuration to use; if <code>null</code>, the set of defaults
as specified in the XSD for the configuration XML will be used.
@par... | java | public static HazelcastInstance newHazelcastInstance(Config config, String instanceName, NodeContext nodeContext) {
if (config == null) {
config = new XmlConfigBuilder().build();
}
String name = getInstanceName(instanceName, config);
InstanceFuture future = new InstanceFutu... | [
"public",
"static",
"HazelcastInstance",
"newHazelcastInstance",
"(",
"Config",
"config",
",",
"String",
"instanceName",
",",
"NodeContext",
"nodeContext",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"config",
"=",
"new",
"XmlConfigBuilder",
"(",
")",... | Creates a new Hazelcast instance.
@param config the configuration to use; if <code>null</code>, the set of defaults
as specified in the XSD for the configuration XML will be used.
@param instanceName the name of the {@link HazelcastInstance}
@param nodeContext the {@link NodeContext} to use
@return the configur... | [
"Creates",
"a",
"new",
"Hazelcast",
"instance",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/instance/HazelcastInstanceFactory.java#L194-L213 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/timeseries/Smoothing.java | Smoothing.simpleExponentialSmoothingQuick | public static double simpleExponentialSmoothingQuick(double Ytminus1, double Stminus1, double a) {
"""
Simple Explonential Smoothing: Calculates Ft+1 by using previous results. A quick version of the simpleExponentialSmoothing
@param Ytminus1
@param Stminus1
@param a
@return
"""
double EMA=a*Ytmi... | java | public static double simpleExponentialSmoothingQuick(double Ytminus1, double Stminus1, double a) {
double EMA=a*Ytminus1+(1-a)*Stminus1;
return EMA;
} | [
"public",
"static",
"double",
"simpleExponentialSmoothingQuick",
"(",
"double",
"Ytminus1",
",",
"double",
"Stminus1",
",",
"double",
"a",
")",
"{",
"double",
"EMA",
"=",
"a",
"*",
"Ytminus1",
"+",
"(",
"1",
"-",
"a",
")",
"*",
"Stminus1",
";",
"return",
... | Simple Explonential Smoothing: Calculates Ft+1 by using previous results. A quick version of the simpleExponentialSmoothing
@param Ytminus1
@param Stminus1
@param a
@return | [
"Simple",
"Explonential",
"Smoothing",
":",
"Calculates",
"Ft",
"+",
"1",
"by",
"using",
"previous",
"results",
".",
"A",
"quick",
"version",
"of",
"the",
"simpleExponentialSmoothing"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/timeseries/Smoothing.java#L126-L130 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/inventory/message/UpdateInventorySlotsMessage.java | UpdateInventorySlotsMessage.updateSlots | public static void updateSlots(int inventoryId, List<MalisisSlot> slots, EntityPlayerMP player, int windowId) {
"""
Sends a {@link Packet} to player to update the inventory slots.
@param inventoryId the inventory id
@param slots the slots
@param player the player
@param windowId the window id
"""
Packe... | java | public static void updateSlots(int inventoryId, List<MalisisSlot> slots, EntityPlayerMP player, int windowId)
{
Packet packet = new Packet(inventoryId, windowId);
for (MalisisSlot slot : slots)
packet.addSlot(slot);
MalisisCore.network.sendTo(packet, player);
} | [
"public",
"static",
"void",
"updateSlots",
"(",
"int",
"inventoryId",
",",
"List",
"<",
"MalisisSlot",
">",
"slots",
",",
"EntityPlayerMP",
"player",
",",
"int",
"windowId",
")",
"{",
"Packet",
"packet",
"=",
"new",
"Packet",
"(",
"inventoryId",
",",
"window... | Sends a {@link Packet} to player to update the inventory slots.
@param inventoryId the inventory id
@param slots the slots
@param player the player
@param windowId the window id | [
"Sends",
"a",
"{",
"@link",
"Packet",
"}",
"to",
"player",
"to",
"update",
"the",
"inventory",
"slots",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/inventory/message/UpdateInventorySlotsMessage.java#L121-L127 |
apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/retention/HivePartitionVersionRetentionCleaner.java | HivePartitionVersionRetentionCleaner.clean | @Override
public void clean()
throws IOException {
"""
If simulate is set to true, this will simply return.
If version is pointing to an empty location, drop the partition and close the jdbc connection.
If version is pointing to the same location as of the dataset, then drop the partition and close the j... | java | @Override
public void clean()
throws IOException {
Path versionLocation = ((HivePartitionRetentionVersion) this.datasetVersion).getLocation();
Path datasetLocation = ((CleanableHivePartitionDataset) this.cleanableDataset).getLocation();
String completeName = ((HivePartitionRetentionVersion) this.dat... | [
"@",
"Override",
"public",
"void",
"clean",
"(",
")",
"throws",
"IOException",
"{",
"Path",
"versionLocation",
"=",
"(",
"(",
"HivePartitionRetentionVersion",
")",
"this",
".",
"datasetVersion",
")",
".",
"getLocation",
"(",
")",
";",
"Path",
"datasetLocation",
... | If simulate is set to true, this will simply return.
If version is pointing to an empty location, drop the partition and close the jdbc connection.
If version is pointing to the same location as of the dataset, then drop the partition and close the jdbc connection.
If version is pointing to the non deletable version lo... | [
"If",
"simulate",
"is",
"set",
"to",
"true",
"this",
"will",
"simply",
"return",
".",
"If",
"version",
"is",
"pointing",
"to",
"an",
"empty",
"location",
"drop",
"the",
"partition",
"and",
"close",
"the",
"jdbc",
"connection",
".",
"If",
"version",
"is",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/retention/HivePartitionVersionRetentionCleaner.java#L70-L102 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java | RemoteRegionRegistry.reconcileAndLogDifference | private boolean reconcileAndLogDifference(Applications delta, String reconcileHashCode) throws Throwable {
"""
Reconciles the delta information fetched to see if the hashcodes match.
@param delta - the delta information fetched previously for reconciliation.
@param reconcileHashCode - the hashcode for comparis... | java | private boolean reconcileAndLogDifference(Applications delta, String reconcileHashCode) throws Throwable {
logger.warn("The Reconcile hashcodes do not match, client : {}, server : {}. Getting the full registry",
reconcileHashCode, delta.getAppsHashCode());
long currentGeneration = fetch... | [
"private",
"boolean",
"reconcileAndLogDifference",
"(",
"Applications",
"delta",
",",
"String",
"reconcileHashCode",
")",
"throws",
"Throwable",
"{",
"logger",
".",
"warn",
"(",
"\"The Reconcile hashcodes do not match, client : {}, server : {}. Getting the full registry\"",
",",
... | Reconciles the delta information fetched to see if the hashcodes match.
@param delta - the delta information fetched previously for reconciliation.
@param reconcileHashCode - the hashcode for comparison.
@return - response
@throws Throwable | [
"Reconciles",
"the",
"delta",
"information",
"fetched",
"to",
"see",
"if",
"the",
"hashcodes",
"match",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java#L427-L450 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/registry/GlobalTransformerRegistry.java | GlobalTransformerRegistry.discardOperation | public void discardOperation(final PathAddress address, ModelVersion version, final String operationName) {
"""
Discard an operation.
@param address the operation handler address
@param version the model version
@param operationName the operation name
"""
registerTransformer(address.iterator(), ve... | java | public void discardOperation(final PathAddress address, ModelVersion version, final String operationName) {
registerTransformer(address.iterator(), version, operationName, OperationTransformerRegistry.DISCARD);
} | [
"public",
"void",
"discardOperation",
"(",
"final",
"PathAddress",
"address",
",",
"ModelVersion",
"version",
",",
"final",
"String",
"operationName",
")",
"{",
"registerTransformer",
"(",
"address",
".",
"iterator",
"(",
")",
",",
"version",
",",
"operationName",... | Discard an operation.
@param address the operation handler address
@param version the model version
@param operationName the operation name | [
"Discard",
"an",
"operation",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/GlobalTransformerRegistry.java#L75-L77 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.formatMessage | public static String formatMessage(String msg, Object... params) {
"""
Formats a messages containing {0}, {1}... etc. Used for translation.
@param msg a message with placeholders
@param params objects used to populate the placeholders
@return a formatted message
"""
try {
// required by MessageFormat, ... | java | public static String formatMessage(String msg, Object... params) {
try {
// required by MessageFormat, single quotes break string interpolation!
msg = StringUtils.replace(msg, "'", "''");
return StringUtils.isBlank(msg) ? "" : MessageFormat.format(msg, params);
} catch (IllegalArgumentException e) {
ret... | [
"public",
"static",
"String",
"formatMessage",
"(",
"String",
"msg",
",",
"Object",
"...",
"params",
")",
"{",
"try",
"{",
"// required by MessageFormat, single quotes break string interpolation!",
"msg",
"=",
"StringUtils",
".",
"replace",
"(",
"msg",
",",
"\"'\"",
... | Formats a messages containing {0}, {1}... etc. Used for translation.
@param msg a message with placeholders
@param params objects used to populate the placeholders
@return a formatted message | [
"Formats",
"a",
"messages",
"containing",
"{",
"0",
"}",
"{",
"1",
"}",
"...",
"etc",
".",
"Used",
"for",
"translation",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L375-L383 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.saveObject | public JSONObject saveObject(JSONObject object, String objectID) throws AlgoliaException {
"""
Override the content of object
@param object the object to update
"""
return this.saveObject(object, objectID, RequestOptions.empty);
} | java | public JSONObject saveObject(JSONObject object, String objectID) throws AlgoliaException {
return this.saveObject(object, objectID, RequestOptions.empty);
} | [
"public",
"JSONObject",
"saveObject",
"(",
"JSONObject",
"object",
",",
"String",
"objectID",
")",
"throws",
"AlgoliaException",
"{",
"return",
"this",
".",
"saveObject",
"(",
"object",
",",
"objectID",
",",
"RequestOptions",
".",
"empty",
")",
";",
"}"
] | Override the content of object
@param object the object to update | [
"Override",
"the",
"content",
"of",
"object"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L477-L479 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/SpecNodeWithRelationships.java | SpecNodeWithRelationships.addRelationshipToTarget | public void addRelationshipToTarget(final SpecTopic topic, final RelationshipType type) {
"""
Add a relationship to the topic.
@param topic The topic that is to be related to.
@param type The type of the relationship.
"""
final TargetRelationship relationship = new TargetRelationship(this, topic, ... | java | public void addRelationshipToTarget(final SpecTopic topic, final RelationshipType type) {
final TargetRelationship relationship = new TargetRelationship(this, topic, type);
topicTargetRelationships.add(relationship);
relationships.add(relationship);
} | [
"public",
"void",
"addRelationshipToTarget",
"(",
"final",
"SpecTopic",
"topic",
",",
"final",
"RelationshipType",
"type",
")",
"{",
"final",
"TargetRelationship",
"relationship",
"=",
"new",
"TargetRelationship",
"(",
"this",
",",
"topic",
",",
"type",
")",
";",
... | Add a relationship to the topic.
@param topic The topic that is to be related to.
@param type The type of the relationship. | [
"Add",
"a",
"relationship",
"to",
"the",
"topic",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/SpecNodeWithRelationships.java#L82-L86 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/HandshakeReader.java | HandshakeReader.validateExtensions | private void validateExtensions(StatusLine statusLine, Map<String, List<String>> headers) throws WebSocketException {
"""
Validate the value of {@code Sec-WebSocket-Extensions} header.
<blockquote>
<p>From RFC 6455, p19.</p>
<p><i>
If the response includes a {@code Sec-WebSocket-Extensions} header
field and... | java | private void validateExtensions(StatusLine statusLine, Map<String, List<String>> headers) throws WebSocketException
{
// Get the values of Sec-WebSocket-Extensions.
List<String> values = headers.get("Sec-WebSocket-Extensions");
if (values == null || values.size() == 0)
{
... | [
"private",
"void",
"validateExtensions",
"(",
"StatusLine",
"statusLine",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"throws",
"WebSocketException",
"{",
"// Get the values of Sec-WebSocket-Extensions.",
"List",
"<",
"String",
"... | Validate the value of {@code Sec-WebSocket-Extensions} header.
<blockquote>
<p>From RFC 6455, p19.</p>
<p><i>
If the response includes a {@code Sec-WebSocket-Extensions} header
field and this header field indicates the use of an extension
that was not present in the client's handshake (the server has
indicated an exte... | [
"Validate",
"the",
"value",
"of",
"{",
"@code",
"Sec",
"-",
"WebSocket",
"-",
"Extensions",
"}",
"header",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/HandshakeReader.java#L468-L526 |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Reflect.java | Reflect.callProc | public static void callProc(Object instance, Class<?> type, String methodName, Class<?>[] types, Object... args) {
"""
Call the method.
@param instance the instance to call on.
@param type the type.
@param methodName the name of the method.
@param types the types of the parameters.
@param args the values of... | java | public static void callProc(Object instance, Class<?> type, String methodName, Class<?>[] types, Object... args) {
try {
final Method method = type.getDeclaredMethod(methodName, types);
method.setAccessible(true);
method.invoke(instance, args);
} catch (Exception exception) {
throw new Error(exception);... | [
"public",
"static",
"void",
"callProc",
"(",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
",",
"Object",
"...",
"args",
")",
"{",
"try",
"{",
"final",
"Method"... | Call the method.
@param instance the instance to call on.
@param type the type.
@param methodName the name of the method.
@param types the types of the parameters.
@param args the values of the arguments. | [
"Call",
"the",
"method",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Reflect.java#L77-L85 |
Netflix/astyanax | astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java | ShardedDistributedMessageQueue.peekMessages | private Collection<Message> peekMessages(String shardName, int itemsToPeek) throws MessageQueueException {
"""
Peek into messages contained in the shard. This call does not take trigger time into account
and will return messages that are not yet due to be executed
@param shardName
@param itemsToPeek
@return
... | java | private Collection<Message> peekMessages(String shardName, int itemsToPeek) throws MessageQueueException {
try {
ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily)
.setConsistencyLevel(consistencyLevel)
.getKey(shardName)
... | [
"private",
"Collection",
"<",
"Message",
">",
"peekMessages",
"(",
"String",
"shardName",
",",
"int",
"itemsToPeek",
")",
"throws",
"MessageQueueException",
"{",
"try",
"{",
"ColumnList",
"<",
"MessageQueueEntry",
">",
"result",
"=",
"keyspace",
".",
"prepareQuery... | Peek into messages contained in the shard. This call does not take trigger time into account
and will return messages that are not yet due to be executed
@param shardName
@param itemsToPeek
@return
@throws MessageQueueException | [
"Peek",
"into",
"messages",
"contained",
"in",
"the",
"shard",
".",
"This",
"call",
"does",
"not",
"take",
"trigger",
"time",
"into",
"account",
"and",
"will",
"return",
"messages",
"that",
"are",
"not",
"yet",
"due",
"to",
"be",
"executed"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L1042-L1069 |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java | SessionProvider.createAnonimProvider | public static SessionProvider createAnonimProvider() {
"""
Helper for creating Anonymous session provider.
@return an anonymous session provider
"""
Identity id = new Identity(IdentityConstants.ANONIM, new HashSet<MembershipEntry>());
return new SessionProvider(new ConversationState(id));
} | java | public static SessionProvider createAnonimProvider()
{
Identity id = new Identity(IdentityConstants.ANONIM, new HashSet<MembershipEntry>());
return new SessionProvider(new ConversationState(id));
} | [
"public",
"static",
"SessionProvider",
"createAnonimProvider",
"(",
")",
"{",
"Identity",
"id",
"=",
"new",
"Identity",
"(",
"IdentityConstants",
".",
"ANONIM",
",",
"new",
"HashSet",
"<",
"MembershipEntry",
">",
"(",
")",
")",
";",
"return",
"new",
"SessionPr... | Helper for creating Anonymous session provider.
@return an anonymous session provider | [
"Helper",
"for",
"creating",
"Anonymous",
"session",
"provider",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/common/SessionProvider.java#L128-L132 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/jaxrx/core/Systems.java | Systems.getInstance | public static JaxRx getInstance(final String impl) {
"""
Returns the instance for the specified implementation. If the system is
unknown, throws an exception.
@param impl
implementation to be checked.
@return instances
"""
final String path = Systems.getSystems().get(impl);
if (path == nu... | java | public static JaxRx getInstance(final String impl) {
final String path = Systems.getSystems().get(impl);
if (path == null) {
throw new JaxRxException(404, "Unknown implementation: " + impl);
}
JaxRx jaxrx = INSTANCES.get(path);
if (jaxrx == null) {
try {
... | [
"public",
"static",
"JaxRx",
"getInstance",
"(",
"final",
"String",
"impl",
")",
"{",
"final",
"String",
"path",
"=",
"Systems",
".",
"getSystems",
"(",
")",
".",
"get",
"(",
"impl",
")",
";",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"new"... | Returns the instance for the specified implementation. If the system is
unknown, throws an exception.
@param impl
implementation to be checked.
@return instances | [
"Returns",
"the",
"instance",
"for",
"the",
"specified",
"implementation",
".",
"If",
"the",
"system",
"is",
"unknown",
"throws",
"an",
"exception",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/jaxrx/core/Systems.java#L134-L150 |
prestodb/presto | presto-hive/src/main/java/com/facebook/presto/hive/metastore/glue/GlueExpressionUtil.java | GlueExpressionUtil.buildGlueExpression | public static String buildGlueExpression(List<Column> partitionKeys, List<String> partitionValues) {
"""
Build an expression string used for partition filtering in {@link GetPartitionsRequest}
<pre>
Ex: partition keys: ['a', 'b']
partition values: ['1', '2']
expression: (a='1') AND (b='2')
Partial specifica... | java | public static String buildGlueExpression(List<Column> partitionKeys, List<String> partitionValues)
{
if (partitionValues == null || partitionValues.isEmpty()) {
return null;
}
if (partitionKeys == null || partitionValues.size() != partitionKeys.size()) {
throw new Pr... | [
"public",
"static",
"String",
"buildGlueExpression",
"(",
"List",
"<",
"Column",
">",
"partitionKeys",
",",
"List",
"<",
"String",
">",
"partitionValues",
")",
"{",
"if",
"(",
"partitionValues",
"==",
"null",
"||",
"partitionValues",
".",
"isEmpty",
"(",
")",
... | Build an expression string used for partition filtering in {@link GetPartitionsRequest}
<pre>
Ex: partition keys: ['a', 'b']
partition values: ['1', '2']
expression: (a='1') AND (b='2')
Partial specification ex:
partition values: ['', '2']
expression: (b='2')
</pre>
@param partitionKeys List of partition keys to filt... | [
"Build",
"an",
"expression",
"string",
"used",
"for",
"partition",
"filtering",
"in",
"{",
"@link",
"GetPartitionsRequest",
"}",
"<pre",
">",
"Ex",
":",
"partition",
"keys",
":",
"[",
"a",
"b",
"]",
"partition",
"values",
":",
"[",
"1",
"2",
"]",
"expres... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-hive/src/main/java/com/facebook/presto/hive/metastore/glue/GlueExpressionUtil.java#L52-L70 |
kazocsaba/matrix | src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java | ImmutableMatrixFactory.createVector | public static ImmutableVector4 createVector(final double x, final double y, final double z, final double h) {
"""
Creates a new immutable 4D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@param z the z coordinate of the new vector
@param h the h coordi... | java | public static ImmutableVector4 createVector(final double x, final double y, final double z, final double h) {
return new ImmutableVector4(new ImmutableData(4, 1) {
@Override
public double getQuick(int row, int col) {
switch (row) {
case 0:
return x;
case 1:
return y;
case 2:
... | [
"public",
"static",
"ImmutableVector4",
"createVector",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
",",
"final",
"double",
"z",
",",
"final",
"double",
"h",
")",
"{",
"return",
"new",
"ImmutableVector4",
"(",
"new",
"ImmutableData",
"(",
"4",
... | Creates a new immutable 4D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@param z the z coordinate of the new vector
@param h the h coordinate of the new vector
@return the new vector | [
"Creates",
"a",
"new",
"immutable",
"4D",
"column",
"vector",
"."
] | train | https://github.com/kazocsaba/matrix/blob/018570db945fe616b25606fe605fa6e0c180ab5b/src/main/java/hu/kazocsaba/math/matrix/immutable/ImmutableMatrixFactory.java#L69-L85 |
prestodb/presto | presto-orc/src/main/java/com/facebook/presto/orc/OrcDataSourceUtils.java | OrcDataSourceUtils.getDiskRangeSlice | public static Slice getDiskRangeSlice(DiskRange diskRange, Map<DiskRange, byte[]> buffers) {
"""
Get a slice for the disk range from the provided buffers. The buffers ranges do not have
to exactly match {@code diskRange}, but {@code diskRange} must be completely contained within
one of the buffer ranges.
""... | java | public static Slice getDiskRangeSlice(DiskRange diskRange, Map<DiskRange, byte[]> buffers)
{
for (Entry<DiskRange, byte[]> bufferEntry : buffers.entrySet()) {
DiskRange bufferRange = bufferEntry.getKey();
byte[] buffer = bufferEntry.getValue();
if (bufferRange.contains(di... | [
"public",
"static",
"Slice",
"getDiskRangeSlice",
"(",
"DiskRange",
"diskRange",
",",
"Map",
"<",
"DiskRange",
",",
"byte",
"[",
"]",
">",
"buffers",
")",
"{",
"for",
"(",
"Entry",
"<",
"DiskRange",
",",
"byte",
"[",
"]",
">",
"bufferEntry",
":",
"buffer... | Get a slice for the disk range from the provided buffers. The buffers ranges do not have
to exactly match {@code diskRange}, but {@code diskRange} must be completely contained within
one of the buffer ranges. | [
"Get",
"a",
"slice",
"for",
"the",
"disk",
"range",
"from",
"the",
"provided",
"buffers",
".",
"The",
"buffers",
"ranges",
"do",
"not",
"have",
"to",
"exactly",
"match",
"{"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/OrcDataSourceUtils.java#L79-L90 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java | FastAdapter.notifyAdapterItemRangeInserted | public void notifyAdapterItemRangeInserted(int position, int itemCount) {
"""
wraps notifyItemRangeInserted
@param position the global position
@param itemCount the count of items inserted
"""
// handle our extensions
for (IAdapterExtension<Item> ext : mExtensions.values()) {
e... | java | public void notifyAdapterItemRangeInserted(int position, int itemCount) {
// handle our extensions
for (IAdapterExtension<Item> ext : mExtensions.values()) {
ext.notifyAdapterItemRangeInserted(position, itemCount);
}
cacheSizes();
notifyItemRangeInserted(position, ite... | [
"public",
"void",
"notifyAdapterItemRangeInserted",
"(",
"int",
"position",
",",
"int",
"itemCount",
")",
"{",
"// handle our extensions",
"for",
"(",
"IAdapterExtension",
"<",
"Item",
">",
"ext",
":",
"mExtensions",
".",
"values",
"(",
")",
")",
"{",
"ext",
"... | wraps notifyItemRangeInserted
@param position the global position
@param itemCount the count of items inserted | [
"wraps",
"notifyItemRangeInserted"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L1279-L1286 |
cogroo/cogroo4 | cogroo-eval/GramEval/src/main/java/cogroo/uima/XmiWriterCasConsumer.java | XmiWriterCasConsumer.writeXmi | private void writeXmi(CAS aCas, File name, String modelFileName)
throws IOException, SAXException {
"""
Serialize a CAS to a file in XMI format
@param aCas
CAS to serialize
@param name
output file
@throws SAXException
@throws Exception
@throws ResourceProcessException
"""
FileOutputStream ... | java | private void writeXmi(CAS aCas, File name, String modelFileName)
throws IOException, SAXException {
FileOutputStream out = null;
try {
// write XMI
out = new FileOutputStream(name);
XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
XMLSerializer xmlSer = new XMLSe... | [
"private",
"void",
"writeXmi",
"(",
"CAS",
"aCas",
",",
"File",
"name",
",",
"String",
"modelFileName",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"FileOutputStream",
"out",
"=",
"null",
";",
"try",
"{",
"// write XMI",
"out",
"=",
"new",
"FileO... | Serialize a CAS to a file in XMI format
@param aCas
CAS to serialize
@param name
output file
@throws SAXException
@throws Exception
@throws ResourceProcessException | [
"Serialize",
"a",
"CAS",
"to",
"a",
"file",
"in",
"XMI",
"format"
] | train | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-eval/GramEval/src/main/java/cogroo/uima/XmiWriterCasConsumer.java#L147-L162 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java | BackportReusePublicIdentifiers.reportBug | private void reportBug(Library library) {
"""
issues a new bug at this location
@param library
the type of backport library that is in use
"""
bugReporter.reportBug(new BugInstance(this, BugType.BRPI_BACKPORT_REUSE_PUBLIC_IDENTIFIERS.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
... | java | private void reportBug(Library library) {
bugReporter.reportBug(new BugInstance(this, BugType.BRPI_BACKPORT_REUSE_PUBLIC_IDENTIFIERS.name(), NORMAL_PRIORITY).addClass(this).addMethod(this)
.addSourceLine(this).addString(library.name()));
} | [
"private",
"void",
"reportBug",
"(",
"Library",
"library",
")",
"{",
"bugReporter",
".",
"reportBug",
"(",
"new",
"BugInstance",
"(",
"this",
",",
"BugType",
".",
"BRPI_BACKPORT_REUSE_PUBLIC_IDENTIFIERS",
".",
"name",
"(",
")",
",",
"NORMAL_PRIORITY",
")",
".",
... | issues a new bug at this location
@param library
the type of backport library that is in use | [
"issues",
"a",
"new",
"bug",
"at",
"this",
"location"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/BackportReusePublicIdentifiers.java#L130-L133 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.beginResetAADProfileAsync | public Observable<Void> beginResetAADProfileAsync(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) {
"""
Reset AAD Profile of a managed cluster.
Update the AAD Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The nam... | java | public Observable<Void> beginResetAADProfileAsync(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) {
return beginResetAADProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"beginResetAADProfileAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterAADProfile",
"parameters",
")",
"{",
"return",
"beginResetAADProfileWithServiceResponseAsync",
"(",
"resourceGroupName... | Reset AAD Profile of a managed cluster.
Update the AAD Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster.
@throws IllegalArg... | [
"Reset",
"AAD",
"Profile",
"of",
"a",
"managed",
"cluster",
".",
"Update",
"the",
"AAD",
"Profile",
"for",
"a",
"managed",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1782-L1789 |
bwkimmel/java-util | src/main/java/ca/eandb/util/ByteArray.java | ByteArray.setAll | public void setAll(int index, ByteArray items) {
"""
Sets a range of elements of this array.
@param index
The index of the first element to set.
@param items
The values to set.
@throws IndexOutOfBoundsException
if
<code>index < 0 || index + items.size() > size()</code>.
"""
rangeCheck(index,... | java | public void setAll(int index, ByteArray items) {
rangeCheck(index, index + items.size);
for (int i = index, j = 0; j < items.size; i++, j++) {
elements[i] = items.elements[j];
}
} | [
"public",
"void",
"setAll",
"(",
"int",
"index",
",",
"ByteArray",
"items",
")",
"{",
"rangeCheck",
"(",
"index",
",",
"index",
"+",
"items",
".",
"size",
")",
";",
"for",
"(",
"int",
"i",
"=",
"index",
",",
"j",
"=",
"0",
";",
"j",
"<",
"items",... | Sets a range of elements of this array.
@param index
The index of the first element to set.
@param items
The values to set.
@throws IndexOutOfBoundsException
if
<code>index < 0 || index + items.size() > size()</code>. | [
"Sets",
"a",
"range",
"of",
"elements",
"of",
"this",
"array",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/ByteArray.java#L273-L278 |
belaban/jgroups-raft | src/org/jgroups/raft/blocks/ReplicatedStateMachine.java | ReplicatedStateMachine.put | public V put(K key, V val) throws Exception {
"""
Adds a key value pair to the state machine. The data is not added directly, but sent to the RAFT leader and only
added to the hashmap after the change has been committed (by majority decision). The actual change will be
applied with callback {@link #apply(byte[],... | java | public V put(K key, V val) throws Exception {
return invoke(PUT, key, val, false);
} | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"val",
")",
"throws",
"Exception",
"{",
"return",
"invoke",
"(",
"PUT",
",",
"key",
",",
"val",
",",
"false",
")",
";",
"}"
] | Adds a key value pair to the state machine. The data is not added directly, but sent to the RAFT leader and only
added to the hashmap after the change has been committed (by majority decision). The actual change will be
applied with callback {@link #apply(byte[],int,int)}.
@param key The key to be added.
@param val Th... | [
"Adds",
"a",
"key",
"value",
"pair",
"to",
"the",
"state",
"machine",
".",
"The",
"data",
"is",
"not",
"added",
"directly",
"but",
"sent",
"to",
"the",
"RAFT",
"leader",
"and",
"only",
"added",
"to",
"the",
"hashmap",
"after",
"the",
"change",
"has",
"... | train | https://github.com/belaban/jgroups-raft/blob/5923a4761df50bfd203cc82cefc138694b4d7fc3/src/org/jgroups/raft/blocks/ReplicatedStateMachine.java#L130-L132 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_PUT | public void organizationName_service_exchangeService_PUT(String organizationName, String exchangeService, OvhExchangeService body) throws IOException {
"""
Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}
@param body [required] New object properties
@param or... | java | public void organizationName_service_exchangeService_PUT(String organizationName, String exchangeService, OvhExchangeService body) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}";
StringBuilder sb = path(qPath, organizationName, exchangeService);
exec(qPath, "PUT... | [
"public",
"void",
"organizationName_service_exchangeService_PUT",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"OvhExchangeService",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{organizationName}/service/{ex... | Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}
@param body [required] New object properties
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Alter",
"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#L111-L115 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.CustomArray | public JBBPDslBuilder CustomArray(final String type, final String name, final int size, final String param) {
"""
Create named custom type array which size calculated by expression.
@param type custom type, must not be null
@param name name of the array, can be null for anonymous one
@param size size of th... | java | public JBBPDslBuilder CustomArray(final String type, final String name, final int size, final String param) {
return this.CustomArray(type, name, arraySizeToString(size), param);
} | [
"public",
"JBBPDslBuilder",
"CustomArray",
"(",
"final",
"String",
"type",
",",
"final",
"String",
"name",
",",
"final",
"int",
"size",
",",
"final",
"String",
"param",
")",
"{",
"return",
"this",
".",
"CustomArray",
"(",
"type",
",",
"name",
",",
"arraySi... | Create named custom type array which size calculated by expression.
@param type custom type, must not be null
@param name name of the array, can be null for anonymous one
@param size size of the array, if negative then read till the end of stream.
@param param optional parameter for the field, can be null
@return t... | [
"Create",
"named",
"custom",
"type",
"array",
"which",
"size",
"calculated",
"by",
"expression",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L533-L535 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java | PathMetadataFactory.forListAccess | public static PathMetadata forListAccess(Path<?> parent, Expression<Integer> index) {
"""
Create a new PathMetadata instance for indexed list access
@param parent parent path
@param index index of element
@return list access path
"""
return new PathMetadata(parent, index, PathType.LISTVALUE);
... | java | public static PathMetadata forListAccess(Path<?> parent, Expression<Integer> index) {
return new PathMetadata(parent, index, PathType.LISTVALUE);
} | [
"public",
"static",
"PathMetadata",
"forListAccess",
"(",
"Path",
"<",
"?",
">",
"parent",
",",
"Expression",
"<",
"Integer",
">",
"index",
")",
"{",
"return",
"new",
"PathMetadata",
"(",
"parent",
",",
"index",
",",
"PathType",
".",
"LISTVALUE",
")",
";",... | Create a new PathMetadata instance for indexed list access
@param parent parent path
@param index index of element
@return list access path | [
"Create",
"a",
"new",
"PathMetadata",
"instance",
"for",
"indexed",
"list",
"access"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java#L75-L77 |
sualeh/magnetictrackparser | src/main/java/us/fatehi/magnetictrack/bankcard/Track3.java | Track3.from | public static Track3 from(final String rawTrackData) {
"""
Parses magnetic track 3 data into a Track3 object.
@param rawTrackData
Raw track data as a string. Can include newlines, and other
tracks as well.
@return A Track3instance, corresponding to the parsed data.
"""
final Matcher matcher = track3P... | java | public static Track3 from(final String rawTrackData)
{
final Matcher matcher = track3Pattern.matcher(trimToEmpty(rawTrackData));
final String rawTrack3Data;
final String discretionaryData;
if (matcher.matches())
{
rawTrack3Data = getGroup(matcher, 1);
discretionaryData = getGroup(matc... | [
"public",
"static",
"Track3",
"from",
"(",
"final",
"String",
"rawTrackData",
")",
"{",
"final",
"Matcher",
"matcher",
"=",
"track3Pattern",
".",
"matcher",
"(",
"trimToEmpty",
"(",
"rawTrackData",
")",
")",
";",
"final",
"String",
"rawTrack3Data",
";",
"final... | Parses magnetic track 3 data into a Track3 object.
@param rawTrackData
Raw track data as a string. Can include newlines, and other
tracks as well.
@return A Track3instance, corresponding to the parsed data. | [
"Parses",
"magnetic",
"track",
"3",
"data",
"into",
"a",
"Track3",
"object",
"."
] | train | https://github.com/sualeh/magnetictrackparser/blob/1da8ff20ac6269b1d523875157278978ba71d260/src/main/java/us/fatehi/magnetictrack/bankcard/Track3.java#L50-L67 |
mfornos/humanize | humanize-slim/src/main/java/humanize/spi/MessageFormat.java | MessageFormat.render | public StringBuffer render(StringBuffer buffer, Object... arguments) {
"""
Formats the current pattern with the given arguments.
@param buffer
The StringBuffer
@param arguments
The formatting arguments
@return StringBuffer with the formatted message
"""
return format(arguments, buffer, null);
... | java | public StringBuffer render(StringBuffer buffer, Object... arguments)
{
return format(arguments, buffer, null);
} | [
"public",
"StringBuffer",
"render",
"(",
"StringBuffer",
"buffer",
",",
"Object",
"...",
"arguments",
")",
"{",
"return",
"format",
"(",
"arguments",
",",
"buffer",
",",
"null",
")",
";",
"}"
] | Formats the current pattern with the given arguments.
@param buffer
The StringBuffer
@param arguments
The formatting arguments
@return StringBuffer with the formatted message | [
"Formats",
"the",
"current",
"pattern",
"with",
"the",
"given",
"arguments",
"."
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/spi/MessageFormat.java#L108-L113 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java | ImageClient.deprecateImage | @BetaApi
public final Operation deprecateImage(String image, DeprecationStatus deprecationStatusResource) {
"""
Sets the deprecation status of an image.
<p>If an empty request body is given, clears the deprecation status instead.
<p>Sample code:
<pre><code>
try (ImageClient imageClient = ImageClient.cr... | java | @BetaApi
public final Operation deprecateImage(String image, DeprecationStatus deprecationStatusResource) {
DeprecateImageHttpRequest request =
DeprecateImageHttpRequest.newBuilder()
.setImage(image)
.setDeprecationStatusResource(deprecationStatusResource)
.build();
... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"deprecateImage",
"(",
"String",
"image",
",",
"DeprecationStatus",
"deprecationStatusResource",
")",
"{",
"DeprecateImageHttpRequest",
"request",
"=",
"DeprecateImageHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setIma... | Sets the deprecation status of an image.
<p>If an empty request body is given, clears the deprecation status instead.
<p>Sample code:
<pre><code>
try (ImageClient imageClient = ImageClient.create()) {
ProjectGlobalImageName image = ProjectGlobalImageName.of("[PROJECT]", "[IMAGE]");
DeprecationStatus deprecationStatu... | [
"Sets",
"the",
"deprecation",
"status",
"of",
"an",
"image",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/ImageClient.java#L302-L311 |
wdtinc/mapbox-vector-tile-java | src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java | JtsAdapter.equalAsInts2d | private static boolean equalAsInts2d(Coordinate a, Coordinate b) {
"""
Return true if the values of the two {@link Coordinate} are equal when their
first and second ordinates are cast as ints. Ignores 3rd ordinate.
@param a first coordinate to compare
@param b second coordinate to compare
@return true if the... | java | private static boolean equalAsInts2d(Coordinate a, Coordinate b) {
return ((int)a.getOrdinate(0)) == ((int)b.getOrdinate(0))
&& ((int)a.getOrdinate(1)) == ((int)b.getOrdinate(1));
} | [
"private",
"static",
"boolean",
"equalAsInts2d",
"(",
"Coordinate",
"a",
",",
"Coordinate",
"b",
")",
"{",
"return",
"(",
"(",
"int",
")",
"a",
".",
"getOrdinate",
"(",
"0",
")",
")",
"==",
"(",
"(",
"int",
")",
"b",
".",
"getOrdinate",
"(",
"0",
"... | Return true if the values of the two {@link Coordinate} are equal when their
first and second ordinates are cast as ints. Ignores 3rd ordinate.
@param a first coordinate to compare
@param b second coordinate to compare
@return true if the values of the two {@link Coordinate} are equal when their
first and second ordin... | [
"Return",
"true",
"if",
"the",
"values",
"of",
"the",
"two",
"{",
"@link",
"Coordinate",
"}",
"are",
"equal",
"when",
"their",
"first",
"and",
"second",
"ordinates",
"are",
"cast",
"as",
"ints",
".",
"Ignores",
"3rd",
"ordinate",
"."
] | train | https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/JtsAdapter.java#L618-L621 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.isCase | public static boolean isCase(Object caseValue, Object switchValue) {
"""
Method for overloading the behavior of the 'case' method in switch statements.
The default implementation handles arrays types but otherwise simply delegates
to Object#equals, but this may be overridden for other types. In this example:
<p... | java | public static boolean isCase(Object caseValue, Object switchValue) {
if (caseValue.getClass().isArray()) {
return isCase(DefaultTypeTransformation.asCollection(caseValue), switchValue);
}
return caseValue.equals(switchValue);
} | [
"public",
"static",
"boolean",
"isCase",
"(",
"Object",
"caseValue",
",",
"Object",
"switchValue",
")",
"{",
"if",
"(",
"caseValue",
".",
"getClass",
"(",
")",
".",
"isArray",
"(",
")",
")",
"{",
"return",
"isCase",
"(",
"DefaultTypeTransformation",
".",
"... | Method for overloading the behavior of the 'case' method in switch statements.
The default implementation handles arrays types but otherwise simply delegates
to Object#equals, but this may be overridden for other types. In this example:
<pre> switch( a ) {
case b: //some code
}</pre>
"some code" is called when <code>b.... | [
"Method",
"for",
"overloading",
"the",
"behavior",
"of",
"the",
"case",
"method",
"in",
"switch",
"statements",
".",
"The",
"default",
"implementation",
"handles",
"arrays",
"types",
"but",
"otherwise",
"simply",
"delegates",
"to",
"Object#equals",
"but",
"this",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L1110-L1115 |
kohsuke/jcifs | src/jcifs/http/NtlmSsp.java | NtlmSsp.authenticate | public static NtlmPasswordAuthentication authenticate(
HttpServletRequest req, HttpServletResponse resp, byte[] challenge)
throws IOException, ServletException {
"""
Performs NTLM authentication for the servlet request.
@param req The request being serviced.
@param resp The re... | java | public static NtlmPasswordAuthentication authenticate(
HttpServletRequest req, HttpServletResponse resp, byte[] challenge)
throws IOException, ServletException {
String msg = req.getHeader("Authorization");
if (msg != null && msg.startsWith("NTLM ")) {
by... | [
"public",
"static",
"NtlmPasswordAuthentication",
"authenticate",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
",",
"byte",
"[",
"]",
"challenge",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"msg",
"=",
"req",
".",
... | Performs NTLM authentication for the servlet request.
@param req The request being serviced.
@param resp The response.
@param challenge The domain controller challenge.
@throws IOException If an IO error occurs.
@throws ServletException If an error occurs. | [
"Performs",
"NTLM",
"authentication",
"for",
"the",
"servlet",
"request",
"."
] | train | https://github.com/kohsuke/jcifs/blob/7751f4e4826c35614d237a70c2582553f95b58de/src/jcifs/http/NtlmSsp.java#L81-L108 |
zxing/zxing | core/src/main/java/com/google/zxing/aztec/detector/Detector.java | Detector.getColor | private int getColor(Point p1, Point p2) {
"""
Gets the color of a segment
@return 1 if segment more than 90% black, -1 if segment is more than 90% white, 0 else
"""
float d = distance(p1, p2);
float dx = (p2.getX() - p1.getX()) / d;
float dy = (p2.getY() - p1.getY()) / d;
int error = 0;
... | java | private int getColor(Point p1, Point p2) {
float d = distance(p1, p2);
float dx = (p2.getX() - p1.getX()) / d;
float dy = (p2.getY() - p1.getY()) / d;
int error = 0;
float px = p1.getX();
float py = p1.getY();
boolean colorModel = image.get(p1.getX(), p1.getY());
int iMax = (int) Math... | [
"private",
"int",
"getColor",
"(",
"Point",
"p1",
",",
"Point",
"p2",
")",
"{",
"float",
"d",
"=",
"distance",
"(",
"p1",
",",
"p2",
")",
";",
"float",
"dx",
"=",
"(",
"p2",
".",
"getX",
"(",
")",
"-",
"p1",
".",
"getX",
"(",
")",
")",
"/",
... | Gets the color of a segment
@return 1 if segment more than 90% black, -1 if segment is more than 90% white, 0 else | [
"Gets",
"the",
"color",
"of",
"a",
"segment"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/aztec/detector/Detector.java#L462-L489 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_webHosting_GET | public ArrayList<OvhWebHostingProductInformation> cart_cartId_webHosting_GET(String cartId) throws IOException {
"""
Get informations about webHosting offers
REST: GET /order/cart/{cartId}/webHosting
@param cartId [required] Cart identifier
"""
String qPath = "/order/cart/{cartId}/webHosting";
StringBu... | java | public ArrayList<OvhWebHostingProductInformation> cart_cartId_webHosting_GET(String cartId) throws IOException {
String qPath = "/order/cart/{cartId}/webHosting";
StringBuilder sb = path(qPath, cartId);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | [
"public",
"ArrayList",
"<",
"OvhWebHostingProductInformation",
">",
"cart_cartId_webHosting_GET",
"(",
"String",
"cartId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/webHosting\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qP... | Get informations about webHosting offers
REST: GET /order/cart/{cartId}/webHosting
@param cartId [required] Cart identifier | [
"Get",
"informations",
"about",
"webHosting",
"offers"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L7750-L7755 |
soarcn/AndroidLifecyle | lifecycle/src/main/java/com/cocosw/lifecycle/LifecycleDispatcher.java | LifecycleDispatcher.registerActivityLifecycleCallbacks | public static void registerActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
"""
Registers a callback to be called following the life cycle of the application's {@link android.app.Activity activities}.
@param application The application with which to register the c... | java | public static void registerActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
if (PRE_ICS) {
preIcsRegisterActivityLifecycleCallbacks(callback);
} else {
postIcsRegisterActivityLifecycleCallbacks(application, callback);
}
... | [
"public",
"static",
"void",
"registerActivityLifecycleCallbacks",
"(",
"Application",
"application",
",",
"ActivityLifecycleCallbacksCompat",
"callback",
")",
"{",
"if",
"(",
"PRE_ICS",
")",
"{",
"preIcsRegisterActivityLifecycleCallbacks",
"(",
"callback",
")",
";",
"}",
... | Registers a callback to be called following the life cycle of the application's {@link android.app.Activity activities}.
@param application The application with which to register the callback.
@param callback The callback to register. | [
"Registers",
"a",
"callback",
"to",
"be",
"called",
"following",
"the",
"life",
"cycle",
"of",
"the",
"application",
"s",
"{",
"@link",
"android",
".",
"app",
".",
"Activity",
"activities",
"}",
"."
] | train | https://github.com/soarcn/AndroidLifecyle/blob/f1e36f1f20871863cc2007aa0fa6c30143dd2091/lifecycle/src/main/java/com/cocosw/lifecycle/LifecycleDispatcher.java#L41-L47 |
3redronin/mu-server | src/main/java/io/muserver/rest/UriPattern.java | UriPattern.matcher | public PathMatch matcher(String rawPath) {
"""
Matches the given raw path against this pattern.
@param rawPath The URL-encoded path to match, for example <code>/example/some%20path</code>
@return Returns a {@link PathMatch} where {@link PathMatch#prefixMatches()} is <code>true</code> if the URI matches
and othe... | java | public PathMatch matcher(String rawPath) {
if (rawPath.startsWith("/")) {
rawPath = rawPath.substring(1);
}
Matcher matcher = pattern.matcher(rawPath);
if (matcher.matches()) {
HashMap<String, String> params = new HashMap<>();
for (String namedGroup : ... | [
"public",
"PathMatch",
"matcher",
"(",
"String",
"rawPath",
")",
"{",
"if",
"(",
"rawPath",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"rawPath",
"=",
"rawPath",
".",
"substring",
"(",
"1",
")",
";",
"}",
"Matcher",
"matcher",
"=",
"pattern",
".",... | Matches the given raw path against this pattern.
@param rawPath The URL-encoded path to match, for example <code>/example/some%20path</code>
@return Returns a {@link PathMatch} where {@link PathMatch#prefixMatches()} is <code>true</code> if the URI matches
and otherwise <code>false</code>. | [
"Matches",
"the",
"given",
"raw",
"path",
"against",
"this",
"pattern",
"."
] | train | https://github.com/3redronin/mu-server/blob/51598606a3082a121fbd785348ee9770b40308e6/src/main/java/io/muserver/rest/UriPattern.java#L59-L73 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.