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 |
|---|---|---|---|---|---|---|---|---|---|---|
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getAttributeLongWithDefault | @Pure
public static Long getAttributeLongWithDefault(Node document, Long defaultValue, String... path) {
"""
Replies the long value that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
Be careful about the fact that the name... | java | @Pure
public static Long getAttributeLongWithDefault(Node document, Long defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
return getAttributeLongWithDefault(document, true, defaultValue, path);
} | [
"@",
"Pure",
"public",
"static",
"Long",
"getAttributeLongWithDefault",
"(",
"Node",
"document",
",",
"Long",
"defaultValue",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
... | Replies the long value that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
Be careful about the fact that the names are case sensitives.
@param document is the XML document to explore.
@param defaultValue is the default value to rep... | [
"Replies",
"the",
"long",
"value",
"that",
"corresponds",
"to",
"the",
"specified",
"attribute",
"s",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L945-L949 |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.handleFileField | private static String handleFileField(String property, CtClass clazz) throws NotFoundException,
CannotCompileException {
"""
Creates the logic which is needed to handle fields which are File types, since they need special treatment.
"""
String wrapperName = property + "wrapper";
StringB... | java | private static String handleFileField(String property, CtClass clazz) throws NotFoundException,
CannotCompileException {
String wrapperName = property + "wrapper";
StringBuilder builder = new StringBuilder();
builder.append(createTrace(String.format("Handle File type property '%s'", prop... | [
"private",
"static",
"String",
"handleFileField",
"(",
"String",
"property",
",",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
"{",
"String",
"wrapperName",
"=",
"property",
"+",
"\"wrapper\"",
";",
"StringBuilder",
"builder",... | Creates the logic which is needed to handle fields which are File types, since they need special treatment. | [
"Creates",
"the",
"logic",
"which",
"is",
"needed",
"to",
"handle",
"fields",
"which",
"are",
"File",
"types",
"since",
"they",
"need",
"special",
"treatment",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L415-L429 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionContext.java | SessionContext.addHttpSessionIdListener | public void addHttpSessionIdListener(ArrayList al, String j2eeName) {
"""
/*
Adds a list of Session ID Listeners
For shared session context or global sesions, we call
this method to add each app's listeners.
"""
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_C... | java | public void addHttpSessionIdListener(ArrayList al, String j2eeName) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[ADD_HTTP_SESSION_ID_LISTENER], "addHttpSes... | [
"public",
"void",
"addHttpSessionIdListener",
"(",
"ArrayList",
"al",
",",
"String",
"j2eeName",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"LoggingUtil",
".",
"SESSION_L... | /*
Adds a list of Session ID Listeners
For shared session context or global sesions, we call
this method to add each app's listeners. | [
"/",
"*",
"Adds",
"a",
"list",
"of",
"Session",
"ID",
"Listeners",
"For",
"shared",
"session",
"context",
"or",
"global",
"sesions",
"we",
"call",
"this",
"method",
"to",
"add",
"each",
"app",
"s",
"listeners",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionContext.java#L1196-L1210 |
drinkjava2/jDialects | core/src/main/java/com/github/drinkjava2/jdialects/ClassCacheUtils.java | ClassCacheUtils.getClassFieldReadMethod | public static Method getClassFieldReadMethod(Class<?> clazz, String fieldName) {
"""
Return cached class field read method to avoid each time use reflect
"""
return getClassReadMethods(clazz).get(fieldName);
} | java | public static Method getClassFieldReadMethod(Class<?> clazz, String fieldName) {
return getClassReadMethods(clazz).get(fieldName);
} | [
"public",
"static",
"Method",
"getClassFieldReadMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"return",
"getClassReadMethods",
"(",
"clazz",
")",
".",
"get",
"(",
"fieldName",
")",
";",
"}"
] | Return cached class field read method to avoid each time use reflect | [
"Return",
"cached",
"class",
"field",
"read",
"method",
"to",
"avoid",
"each",
"time",
"use",
"reflect"
] | train | https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/ClassCacheUtils.java#L162-L164 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java | AlertResources.createAlert | @POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Description("Creates an alert.")
public AlertDto createAlert(@Context HttpServletRequest req, AlertDto alertDto) {
"""
Creates a new alert.
@param req The HttpServlet request object. Cannot be null.
@param alertDto... | java | @POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Description("Creates an alert.")
public AlertDto createAlert(@Context HttpServletRequest req, AlertDto alertDto) {
if (alertDto == null) {
throw new WebApplicationException("Null alert object cannot be created.", Status.BAD_R... | [
"@",
"POST",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Description",
"(",
"\"Creates an alert.\"",
")",
"public",
"AlertDto",
"createAlert",
"(",
"@",
"Context",
"HttpS... | Creates a new alert.
@param req The HttpServlet request object. Cannot be null.
@param alertDto The alert object. Cannot be null.
@return Created alert object.
@throws WebApplicationException The exception with 400 status will be thrown if the alert object is null. | [
"Creates",
"a",
"new",
"alert",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AlertResources.java#L635-L650 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Music.java | Music.startMusic | private void startMusic(float pitch, float volume, boolean loop) {
"""
play or loop the music at a given pitch and volume
@param pitch The pitch to play the music at (1.0 = default)
@param volume The volume to play the music at (1.0 = default)
@param loop if false the music is played once, the music is looped o... | java | private void startMusic(float pitch, float volume, boolean loop) {
if (currentMusic != null) {
currentMusic.stop();
currentMusic.fireMusicSwapped(this);
}
currentMusic = this;
if (volume < 0.0f)
volume = 0.0f;
if (volume > 1.0f)
volume = 1.0f;
sound.playAsMusic(pitch, volume, loo... | [
"private",
"void",
"startMusic",
"(",
"float",
"pitch",
",",
"float",
"volume",
",",
"boolean",
"loop",
")",
"{",
"if",
"(",
"currentMusic",
"!=",
"null",
")",
"{",
"currentMusic",
".",
"stop",
"(",
")",
";",
"currentMusic",
".",
"fireMusicSwapped",
"(",
... | play or loop the music at a given pitch and volume
@param pitch The pitch to play the music at (1.0 = default)
@param volume The volume to play the music at (1.0 = default)
@param loop if false the music is played once, the music is looped otherwise | [
"play",
"or",
"loop",
"the",
"music",
"at",
"a",
"given",
"pitch",
"and",
"volume"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Music.java#L259-L277 |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.getPlaylistCoverImage | @Deprecated
public GetPlaylistCoverImageRequest.Builder getPlaylistCoverImage(String user_id, String playlist_id) {
"""
Get the image used to represent a specific playlist.
@deprecated Playlist IDs are unique for themselves. This parameter is thus no longer used.
(https://developer.spotify.com/community/news... | java | @Deprecated
public GetPlaylistCoverImageRequest.Builder getPlaylistCoverImage(String user_id, String playlist_id) {
return new GetPlaylistCoverImageRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.user_id(user_id)
.playlist_id(playlist_id);
} | [
"@",
"Deprecated",
"public",
"GetPlaylistCoverImageRequest",
".",
"Builder",
"getPlaylistCoverImage",
"(",
"String",
"user_id",
",",
"String",
"playlist_id",
")",
"{",
"return",
"new",
"GetPlaylistCoverImageRequest",
".",
"Builder",
"(",
"accessToken",
")",
".",
"setD... | Get the image used to represent a specific playlist.
@deprecated Playlist IDs are unique for themselves. This parameter is thus no longer used.
(https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)
@param user_id The users Spotify user ID.
@param playlist_id The Spotify ID for the pla... | [
"Get",
"the",
"image",
"used",
"to",
"represent",
"a",
"specific",
"playlist",
"."
] | train | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L1229-L1235 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/PtoPMessageItemStream.java | PtoPMessageItemStream.replaceUuid | public void replaceUuid(SIBUuid8 newUuid, Transaction transaction) throws SIResourceException {
"""
<p>If this localisation has a temporary UUID associated with it, it
will be replaced with the UUID passed in on the call.</p>
@param newUuid
@param transaction
@throws SIStoreException
"""
if (TraceCompo... | java | public void replaceUuid(SIBUuid8 newUuid, Transaction transaction) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "replaceUuid", new Object[] {newUuid, transaction});
if (messagingEngineUuid.toString().equals(SIMPConstants.UNKNOWN_UUID))
... | [
"public",
"void",
"replaceUuid",
"(",
"SIBUuid8",
"newUuid",
",",
"Transaction",
"transaction",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr... | <p>If this localisation has a temporary UUID associated with it, it
will be replaced with the UUID passed in on the call.</p>
@param newUuid
@param transaction
@throws SIStoreException | [
"<p",
">",
"If",
"this",
"localisation",
"has",
"a",
"temporary",
"UUID",
"associated",
"with",
"it",
"it",
"will",
"be",
"replaced",
"with",
"the",
"UUID",
"passed",
"in",
"on",
"the",
"call",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/itemstreams/PtoPMessageItemStream.java#L668-L703 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CompactDecimalFormat.java | CompactDecimalFormat.getData | private Data getData(ULocale locale, CompactStyle style) {
"""
Gets the data for a particular locale and style. If style is unrecognized,
we just return data for CompactStyle.SHORT.
@param locale The locale.
@param style The style.
@return The data which must not be modified.
"""
CompactDecimalData... | java | private Data getData(ULocale locale, CompactStyle style) {
CompactDecimalDataCache.DataBundle bundle = cache.get(locale);
switch (style) {
case SHORT:
return bundle.shortData;
case LONG:
return bundle.longData;
default:
return bundle.shortData;... | [
"private",
"Data",
"getData",
"(",
"ULocale",
"locale",
",",
"CompactStyle",
"style",
")",
"{",
"CompactDecimalDataCache",
".",
"DataBundle",
"bundle",
"=",
"cache",
".",
"get",
"(",
"locale",
")",
";",
"switch",
"(",
"style",
")",
"{",
"case",
"SHORT",
":... | Gets the data for a particular locale and style. If style is unrecognized,
we just return data for CompactStyle.SHORT.
@param locale The locale.
@param style The style.
@return The data which must not be modified. | [
"Gets",
"the",
"data",
"for",
"a",
"particular",
"locale",
"and",
"style",
".",
"If",
"style",
"is",
"unrecognized",
"we",
"just",
"return",
"data",
"for",
"CompactStyle",
".",
"SHORT",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CompactDecimalFormat.java#L523-L533 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/net/SocketUtility.java | SocketUtility.getFreeServerPort | static public int getFreeServerPort(boolean tryOthers, int... ports) {
"""
Get a free server port that can be used.
Several preferred port numbers can be specified.
@param tryOthers If all preferred ports are occupied, try other free ports or not.
@param ports preferred port numbers
@return A free port number... | java | static public int getFreeServerPort(boolean tryOthers, int... ports){
for (int port: ports){
if (isServerPortFree(port)){
return port;
}
}
return tryOthers? getFreeServerPort() : 0;
} | [
"static",
"public",
"int",
"getFreeServerPort",
"(",
"boolean",
"tryOthers",
",",
"int",
"...",
"ports",
")",
"{",
"for",
"(",
"int",
"port",
":",
"ports",
")",
"{",
"if",
"(",
"isServerPortFree",
"(",
"port",
")",
")",
"{",
"return",
"port",
";",
"}",... | Get a free server port that can be used.
Several preferred port numbers can be specified.
@param tryOthers If all preferred ports are occupied, try other free ports or not.
@param ports preferred port numbers
@return A free port number, or zero if not found or exception occurred. | [
"Get",
"a",
"free",
"server",
"port",
"that",
"can",
"be",
"used",
".",
"Several",
"preferred",
"port",
"numbers",
"can",
"be",
"specified",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/net/SocketUtility.java#L107-L114 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixDiscouragedBooleanExpression | @Fix(io.sarl.lang.validation.IssueCodes.DISCOURAGED_BOOLEAN_EXPRESSION)
public void fixDiscouragedBooleanExpression(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Discouraged boolean expression".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
BehaviorUnitG... | java | @Fix(io.sarl.lang.validation.IssueCodes.DISCOURAGED_BOOLEAN_EXPRESSION)
public void fixDiscouragedBooleanExpression(final Issue issue, IssueResolutionAcceptor acceptor) {
BehaviorUnitGuardRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"io",
".",
"sarl",
".",
"lang",
".",
"validation",
".",
"IssueCodes",
".",
"DISCOURAGED_BOOLEAN_EXPRESSION",
")",
"public",
"void",
"fixDiscouragedBooleanExpression",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
... | Quick fix for "Discouraged boolean expression".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Discouraged",
"boolean",
"expression",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L765-L768 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/AuditUtil.java | AuditUtil.dateToString | public static String dateToString(final Date date, final String format) {
"""
Date to string.
@param date
the date
@param format
the format
@return the string
"""
if (date == null) {
return null;
}
final DateFormat dateFormat = new SimpleDateFormat(format, Locale.US);... | java | public static String dateToString(final Date date, final String format) {
if (date == null) {
return null;
}
final DateFormat dateFormat = new SimpleDateFormat(format, Locale.US);
return dateFormat.format(date);
} | [
"public",
"static",
"String",
"dateToString",
"(",
"final",
"Date",
"date",
",",
"final",
"String",
"format",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"DateFormat",
"dateFormat",
"=",
"new",
"SimpleDateForma... | Date to string.
@param date
the date
@param format
the format
@return the string | [
"Date",
"to",
"string",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/AuditUtil.java#L81-L87 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java | ST_ZUpdateLineExtremities.updateZExtremities | public static Geometry updateZExtremities(Geometry geometry, double startZ, double endZ, boolean interpolate) {
"""
Update the start and end Z values. If the interpolate is true the
vertices are interpolated according the start and end z values.
@param geometry
@param startZ
@param endZ
@param interpolate
... | java | public static Geometry updateZExtremities(Geometry geometry, double startZ, double endZ, boolean interpolate) {
if(geometry == null){
return null;
}
if (geometry instanceof LineString) {
return force3DStartEnd((LineString) geometry, startZ, endZ, interpolate);
} e... | [
"public",
"static",
"Geometry",
"updateZExtremities",
"(",
"Geometry",
"geometry",
",",
"double",
"startZ",
",",
"double",
"endZ",
",",
"boolean",
"interpolate",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"("... | Update the start and end Z values. If the interpolate is true the
vertices are interpolated according the start and end z values.
@param geometry
@param startZ
@param endZ
@param interpolate
@return | [
"Update",
"the",
"start",
"and",
"end",
"Z",
"values",
".",
"If",
"the",
"interpolate",
"is",
"true",
"the",
"vertices",
"are",
"interpolated",
"according",
"the",
"start",
"and",
"end",
"z",
"values",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_ZUpdateLineExtremities.java#L60-L77 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addFile | public void addFile( final String path, final File source, final int mode, final int dirmode, final Directive directive, final String uname, final String gname, final boolean addParents) throws NoSuchAlgorithmException, IOException {
"""
Add the specified file to the repository payload in order.
The required head... | java | public void addFile( final String path, final File source, final int mode, final int dirmode, final Directive directive, final String uname, final String gname, final boolean addParents) throws NoSuchAlgorithmException, IOException {
contents.addFile( path, source, mode, directive, uname, gname, dirmode, addPar... | [
"public",
"void",
"addFile",
"(",
"final",
"String",
"path",
",",
"final",
"File",
"source",
",",
"final",
"int",
"mode",
",",
"final",
"int",
"dirmode",
",",
"final",
"Directive",
"directive",
",",
"final",
"String",
"uname",
",",
"final",
"String",
"gnam... | Add the specified file to the repository payload in order.
The required header entries will automatically be generated
to record the directory names and file names, as well as their
digests.
@param path the absolute path at which this file will be installed.
@param source the file content to include in this rpm.
@para... | [
"Add",
"the",
"specified",
"file",
"to",
"the",
"repository",
"payload",
"in",
"order",
".",
"The",
"required",
"header",
"entries",
"will",
"automatically",
"be",
"generated",
"to",
"record",
"the",
"directory",
"names",
"and",
"file",
"names",
"as",
"well",
... | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L942-L944 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java | DefaultCacheableResourceService.copyResource | private File
copyResource(final File resource, final String resourceLocation)
throws ResourceDownloadError {
"""
Copy the resource to the system's temporary resources.
@param resource {@link File}, the resource to copy from
@param resourceLocation {@link String}, the resource lo... | java | private File
copyResource(final File resource, final String resourceLocation)
throws ResourceDownloadError {
final String tmpPath = asPath(getSystemConfiguration()
.getCacheDirectory().getAbsolutePath(),
ResourceType.TMP_FILE.getResourceFolderName(... | [
"private",
"File",
"copyResource",
"(",
"final",
"File",
"resource",
",",
"final",
"String",
"resourceLocation",
")",
"throws",
"ResourceDownloadError",
"{",
"final",
"String",
"tmpPath",
"=",
"asPath",
"(",
"getSystemConfiguration",
"(",
")",
".",
"getCacheDirector... | Copy the resource to the system's temporary resources.
@param resource {@link File}, the resource to copy from
@param resourceLocation {@link String}, the resource location
@return the resource copy {@link File} ready for processing
@throws ResourceDownloadError Throw if an error occurred copying the
resource | [
"Copy",
"the",
"resource",
"to",
"the",
"system",
"s",
"temporary",
"resources",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java#L212-L232 |
reactor/reactor-netty | src/main/java/reactor/netty/ByteBufFlux.java | ByteBufFlux.fromString | public static ByteBufFlux fromString(Publisher<? extends String> source) {
"""
Decorate as {@link ByteBufFlux}
@param source publisher to decorate
@return a {@link ByteBufFlux}
"""
return fromString(source, Charset.defaultCharset(), ByteBufAllocator.DEFAULT);
} | java | public static ByteBufFlux fromString(Publisher<? extends String> source) {
return fromString(source, Charset.defaultCharset(), ByteBufAllocator.DEFAULT);
} | [
"public",
"static",
"ByteBufFlux",
"fromString",
"(",
"Publisher",
"<",
"?",
"extends",
"String",
">",
"source",
")",
"{",
"return",
"fromString",
"(",
"source",
",",
"Charset",
".",
"defaultCharset",
"(",
")",
",",
"ByteBufAllocator",
".",
"DEFAULT",
")",
"... | Decorate as {@link ByteBufFlux}
@param source publisher to decorate
@return a {@link ByteBufFlux} | [
"Decorate",
"as",
"{",
"@link",
"ByteBufFlux",
"}"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/ByteBufFlux.java#L81-L83 |
wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.fromInputStream | @Override
public Document fromInputStream(InputStream stream, Charset encoding) throws IOException {
"""
Builds a new XML Document from the given input stream. The stream is not closed by this method,
and so you must close it.
@param stream the input stream, must not be {@literal null}
@param encoding t... | java | @Override
public Document fromInputStream(InputStream stream, Charset encoding) throws IOException {
try {
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource(stream);
if (encoding == null) {
is.setEncoding(Charsets.UT... | [
"@",
"Override",
"public",
"Document",
"fromInputStream",
"(",
"InputStream",
"stream",
",",
"Charset",
"encoding",
")",
"throws",
"IOException",
"{",
"try",
"{",
"DocumentBuilder",
"builder",
"=",
"factory",
".",
"newDocumentBuilder",
"(",
")",
";",
"InputSource"... | Builds a new XML Document from the given input stream. The stream is not closed by this method,
and so you must close it.
@param stream the input stream, must not be {@literal null}
@param encoding the encoding, if {@literal null}, UTF-8 is used.
@return the built document
@throws java.io.IOException if the given st... | [
"Builds",
"a",
"new",
"XML",
"Document",
"from",
"the",
"given",
"input",
"stream",
".",
"The",
"stream",
"is",
"not",
"closed",
"by",
"this",
"method",
"and",
"so",
"you",
"must",
"close",
"it",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L477-L494 |
lukas-krecan/JsonUnit | json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/JsonUnitResultMatchers.java | JsonUnitResultMatchers.isStringEqualTo | public ResultMatcher isStringEqualTo(final String expected) {
"""
Fails if the selected JSON is not a String or is not present or the value
is not equal to expected value.
"""
return new AbstractResultMatcher(path, configuration) {
public void doMatch(Object actual) {
isStr... | java | public ResultMatcher isStringEqualTo(final String expected) {
return new AbstractResultMatcher(path, configuration) {
public void doMatch(Object actual) {
isString(actual);
Node node = getNode(actual);
if (!node.asText().equals(expected)) {
... | [
"public",
"ResultMatcher",
"isStringEqualTo",
"(",
"final",
"String",
"expected",
")",
"{",
"return",
"new",
"AbstractResultMatcher",
"(",
"path",
",",
"configuration",
")",
"{",
"public",
"void",
"doMatch",
"(",
"Object",
"actual",
")",
"{",
"isString",
"(",
... | Fails if the selected JSON is not a String or is not present or the value
is not equal to expected value. | [
"Fails",
"if",
"the",
"selected",
"JSON",
"is",
"not",
"a",
"String",
"or",
"is",
"not",
"present",
"or",
"the",
"value",
"is",
"not",
"equal",
"to",
"expected",
"value",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/JsonUnitResultMatchers.java#L109-L120 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getGuildUnlockedUpgradesID | public void getGuildUnlockedUpgradesID(String id, String api, Callback<List<Integer>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on guild unlocked upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/upgrades">here</a><br/>
Give user the access to {@link Ca... | java | public void getGuildUnlockedUpgradesID(String id, String api, Callback<List<Integer>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api));
gw2API.getGuildUpgradeIDs(id, api).enqueue(callback);
} | [
"public",
"void",
"getGuildUnlockedUpgradesID",
"(",
"String",
"id",
",",
"String",
"api",
",",
"Callback",
"<",
"List",
"<",
"Integer",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"Pa... | For more info on guild unlocked upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/upgrades">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions<br/>
@param id guild id
@param api ... | [
"For",
"more",
"info",
"on",
"guild",
"unlocked",
"upgrades",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"guild",
"/",
":",
"id",
"/",
"upgrades",
">",
"here<",... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1585-L1588 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.toRSA | public KeyPair toRSA(boolean includePrivateParameters, Provider provider) {
"""
Converts JSON web key to RSA key pair and include the private key if set to
true.
@param provider
the Java security provider.
@param includePrivateParameters
true if the RSA key pair should include the private key. False
otherw... | java | public KeyPair toRSA(boolean includePrivateParameters, Provider provider) {
// Must be RSA
checkRSACompatible();
if (includePrivateParameters) {
return new KeyPair(getRSAPublicKey(provider), getRSAPrivateKey(provider));
} else {
return new KeyPair(getRSAPublicKe... | [
"public",
"KeyPair",
"toRSA",
"(",
"boolean",
"includePrivateParameters",
",",
"Provider",
"provider",
")",
"{",
"// Must be RSA",
"checkRSACompatible",
"(",
")",
";",
"if",
"(",
"includePrivateParameters",
")",
"{",
"return",
"new",
"KeyPair",
"(",
"getRSAPublicKey... | Converts JSON web key to RSA key pair and include the private key if set to
true.
@param provider
the Java security provider.
@param includePrivateParameters
true if the RSA key pair should include the private key. False
otherwise.
@return RSA key pair | [
"Converts",
"JSON",
"web",
"key",
"to",
"RSA",
"key",
"pair",
"and",
"include",
"the",
"private",
"key",
"if",
"set",
"to",
"true",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L724-L734 |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java | TableFactoryService.findInternal | public static <T> T findInternal(Class<T> factoryClass, Map<String, String> properties, Optional<ClassLoader> classLoader) {
"""
Finds a table factory of the given class, property map, and classloader.
@param factoryClass desired factory class
@param properties properties that describe the factory configuratio... | java | public static <T> T findInternal(Class<T> factoryClass, Map<String, String> properties, Optional<ClassLoader> classLoader) {
Preconditions.checkNotNull(factoryClass);
Preconditions.checkNotNull(properties);
List<TableFactory> foundFactories = discoverFactories(classLoader);
List<TableFactory> classFactories ... | [
"public",
"static",
"<",
"T",
">",
"T",
"findInternal",
"(",
"Class",
"<",
"T",
">",
"factoryClass",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
",",
"Optional",
"<",
"ClassLoader",
">",
"classLoader",
")",
"{",
"Preconditions",
".",
"ch... | Finds a table factory of the given class, property map, and classloader.
@param factoryClass desired factory class
@param properties properties that describe the factory configuration
@param classLoader classloader for service loading
@param <T> factory class type
@return the matching factory | [
"Finds",
"a",
"table",
"factory",
"of",
"the",
"given",
"class",
"property",
"map",
"and",
"classloader",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L120-L143 |
GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/model/Barrier.java | Barrier.addListArgumentSlots | public void addListArgumentSlots(Slot initialSlot, List<Slot> slotList) {
"""
Adds multiple slots to this barrier's waiting-on list representing a single
Job argument of type list.
@param slotList A list of slots that will be added to the barrier and used
as the elements of the list Job argument.
@throws Ill... | java | public void addListArgumentSlots(Slot initialSlot, List<Slot> slotList) {
if (!initialSlot.isFilled()) {
throw new IllegalArgumentException("initialSlot must be filled");
}
verifyStateBeforAdd(initialSlot);
int groupSize = slotList.size() + 1;
addSlotDescriptor(new SlotDescriptor(initialSlot, ... | [
"public",
"void",
"addListArgumentSlots",
"(",
"Slot",
"initialSlot",
",",
"List",
"<",
"Slot",
">",
"slotList",
")",
"{",
"if",
"(",
"!",
"initialSlot",
".",
"isFilled",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"initialSlot must ... | Adds multiple slots to this barrier's waiting-on list representing a single
Job argument of type list.
@param slotList A list of slots that will be added to the barrier and used
as the elements of the list Job argument.
@throws IllegalArgumentException if intialSlot is not filled. | [
"Adds",
"multiple",
"slots",
"to",
"this",
"barrier",
"s",
"waiting",
"-",
"on",
"list",
"representing",
"a",
"single",
"Job",
"argument",
"of",
"type",
"list",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/model/Barrier.java#L269-L279 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/threadContext/ComponentMetaDataAccessorImpl.java | ComponentMetaDataAccessorImpl.beginContext | public Object beginContext(ComponentMetaData cmd) {
"""
Begin the context for the ComponentMetaData provided.
@param ComponentMetaData It Must not be null. Tr.error will be logged if it is null.
@return Previous Object, which was on the stack. It can be null.
""" // modified to return object d131914
... | java | public Object beginContext(ComponentMetaData cmd) { // modified to return object d131914
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
if (cmd != null)
Tr.debug(tc, "begin context " + cmd.getJ2EEName());
else
Tr.debug(tc, "NULL was pas... | [
"public",
"Object",
"beginContext",
"(",
"ComponentMetaData",
"cmd",
")",
"{",
"// modified to return object d131914",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"if",
"(",
"cmd",
"!=... | Begin the context for the ComponentMetaData provided.
@param ComponentMetaData It Must not be null. Tr.error will be logged if it is null.
@return Previous Object, which was on the stack. It can be null. | [
"Begin",
"the",
"context",
"for",
"the",
"ComponentMetaData",
"provided",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/threadContext/ComponentMetaDataAccessorImpl.java#L83-L97 |
ops4j/org.ops4j.pax.logging | pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java | PaxLoggingServiceImpl.setLevelToJavaLogging | private static void setLevelToJavaLogging( final Dictionary<String, ?> configuration ) {
"""
Configure Java Util Logging according to the provided configuration.
Convert the log4j configuration to JUL config.
It's necessary to do that, because with pax logging, JUL loggers are not replaced.
So we need to conf... | java | private static void setLevelToJavaLogging( final Dictionary<String, ?> configuration )
{
for( Enumeration enum_ = java.util.logging.LogManager.getLogManager().getLoggerNames(); enum_.hasMoreElements();) {
String name = (String) enum_.nextElement();
java.util.logging.Logger.getLogger(... | [
"private",
"static",
"void",
"setLevelToJavaLogging",
"(",
"final",
"Dictionary",
"<",
"String",
",",
"?",
">",
"configuration",
")",
"{",
"for",
"(",
"Enumeration",
"enum_",
"=",
"java",
".",
"util",
".",
"logging",
".",
"LogManager",
".",
"getLogManager",
... | Configure Java Util Logging according to the provided configuration.
Convert the log4j configuration to JUL config.
It's necessary to do that, because with pax logging, JUL loggers are not replaced.
So we need to configure JUL loggers in order that log messages goes correctly to log Handlers.
@param configuration Pro... | [
"Configure",
"Java",
"Util",
"Logging",
"according",
"to",
"the",
"provided",
"configuration",
".",
"Convert",
"the",
"log4j",
"configuration",
"to",
"JUL",
"config",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java#L485-L512 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mountZip | public static Closeable mountZip(InputStream zipData, String zipName, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
"""
Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file
system when closed.
@param zipData ... | java | public static Closeable mountZip(InputStream zipData, String zipName, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
boolean ok = false;
try {
final TempDir tempDir = tempFileProvider.createTempDir(zipName);
try {
final MountHandle... | [
"public",
"static",
"Closeable",
"mountZip",
"(",
"InputStream",
"zipData",
",",
"String",
"zipName",
",",
"VirtualFile",
"mountPoint",
",",
"TempFileProvider",
"tempFileProvider",
")",
"throws",
"IOException",
"{",
"boolean",
"ok",
"=",
"false",
";",
"try",
"{",
... | Create and mount a zip file into the filesystem, returning a single handle which will unmount and close the file
system when closed.
@param zipData an input stream containing the zip data
@param zipName the name of the archive
@param mountPoint the point at which the filesystem should be mounte... | [
"Create",
"and",
"mount",
"a",
"zip",
"file",
"into",
"the",
"filesystem",
"returning",
"a",
"single",
"handle",
"which",
"will",
"unmount",
"and",
"close",
"the",
"file",
"system",
"when",
"closed",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L339-L355 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mountTemp | public static Closeable mountTemp(VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
"""
Create and mount a temporary file system, returning a single handle which will unmount and close the filesystem
when closed.
@param mountPoint the point at which the filesystem should be ... | java | public static Closeable mountTemp(VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
boolean ok = false;
final TempDir tempDir = tempFileProvider.createTempDir("tmpfs");
try {
final MountHandle handle = doMount(new RealFileSystem(tempDir.getRoot()), mount... | [
"public",
"static",
"Closeable",
"mountTemp",
"(",
"VirtualFile",
"mountPoint",
",",
"TempFileProvider",
"tempFileProvider",
")",
"throws",
"IOException",
"{",
"boolean",
"ok",
"=",
"false",
";",
"final",
"TempDir",
"tempDir",
"=",
"tempFileProvider",
".",
"createTe... | Create and mount a temporary file system, returning a single handle which will unmount and close the filesystem
when closed.
@param mountPoint the point at which the filesystem should be mounted
@param tempFileProvider the temporary file provider
@return a handle
@throws IOException if an error occurs | [
"Create",
"and",
"mount",
"a",
"temporary",
"file",
"system",
"returning",
"a",
"single",
"handle",
"which",
"will",
"unmount",
"and",
"close",
"the",
"filesystem",
"when",
"closed",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L393-L405 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java | NormalizableDistance.initializeRangesEmpty | public void initializeRangesEmpty(int numAtt, double[][] ranges) {
"""
Used to initialize the ranges.
@param numAtt number of attributes in the model
@param ranges low, high and width values for all attributes
"""
for (int j = 0; j < numAtt; j++) {
ranges[j][R_MIN] = Double.POSITIVE_INFINITY;
... | java | public void initializeRangesEmpty(int numAtt, double[][] ranges) {
for (int j = 0; j < numAtt; j++) {
ranges[j][R_MIN] = Double.POSITIVE_INFINITY;
ranges[j][R_MAX] = -Double.POSITIVE_INFINITY;
ranges[j][R_WIDTH] = Double.POSITIVE_INFINITY;
}
} | [
"public",
"void",
"initializeRangesEmpty",
"(",
"int",
"numAtt",
",",
"double",
"[",
"]",
"[",
"]",
"ranges",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"numAtt",
";",
"j",
"++",
")",
"{",
"ranges",
"[",
"j",
"]",
"[",
"R_MIN",
... | Used to initialize the ranges.
@param numAtt number of attributes in the model
@param ranges low, high and width values for all attributes | [
"Used",
"to",
"initialize",
"the",
"ranges",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L546-L552 |
CubeEngine/Dirigent | src/main/java/org/cubeengine/dirigent/parser/ParserHelper.java | ParserHelper.toInt | static int toInt(String input, int offset, int length) {
"""
Converts the given string into an integer using Horner's method. No validation isOneOf done on the input. This
method will produce numbers, even if the input isOneOf not a valid decimal number.
@param input an input string consisting of decimal digit... | java | static int toInt(String input, int offset, int length)
{
if (length == 1)
{
return input.charAt(offset) - '0';
}
int out = 0;
for (int i = offset + length - 1, factor = 1; i >= offset; --i, factor *= 10)
{
out += (input.charAt(i) - '0') * fact... | [
"static",
"int",
"toInt",
"(",
"String",
"input",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"==",
"1",
")",
"{",
"return",
"input",
".",
"charAt",
"(",
"offset",
")",
"-",
"'",
"'",
";",
"}",
"int",
"out",
"=",
... | Converts the given string into an integer using Horner's method. No validation isOneOf done on the input. This
method will produce numbers, even if the input isOneOf not a valid decimal number.
@param input an input string consisting of decimal digits
@param offset the base offset in the input
@param length the number... | [
"Converts",
"the",
"given",
"string",
"into",
"an",
"integer",
"using",
"Horner",
"s",
"method",
".",
"No",
"validation",
"isOneOf",
"done",
"on",
"the",
"input",
".",
"This",
"method",
"will",
"produce",
"numbers",
"even",
"if",
"the",
"input",
"isOneOf",
... | train | https://github.com/CubeEngine/Dirigent/blob/68587a8202754a6a6b629cc15e14c516806badaa/src/main/java/org/cubeengine/dirigent/parser/ParserHelper.java#L67-L80 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java | Operation.waitFor | public Operation waitFor(RetryOption... waitOptions) throws InterruptedException {
"""
Blocks until this operation completes its execution, either failing or succeeding. This method
returns current operation's latest information. If the operation no longer exists, this method
returns {@code null}. By default, th... | java | public Operation waitFor(RetryOption... waitOptions) throws InterruptedException {
RetrySettings waitSettings =
RetryOption.mergeToSettings(DEFAULT_OPERATION_WAIT_SETTINGS, waitOptions);
try {
Operation operation =
RetryHelper.poll(
new Callable<Operation>() {
... | [
"public",
"Operation",
"waitFor",
"(",
"RetryOption",
"...",
"waitOptions",
")",
"throws",
"InterruptedException",
"{",
"RetrySettings",
"waitSettings",
"=",
"RetryOption",
".",
"mergeToSettings",
"(",
"DEFAULT_OPERATION_WAIT_SETTINGS",
",",
"waitOptions",
")",
";",
"tr... | Blocks until this operation completes its execution, either failing or succeeding. This method
returns current operation's latest information. If the operation no longer exists, this method
returns {@code null}. By default, the operation status is checked using jittered exponential
backoff with 1 second as an initial d... | [
"Blocks",
"until",
"this",
"operation",
"completes",
"its",
"execution",
"either",
"failing",
"or",
"succeeding",
".",
"This",
"method",
"returns",
"current",
"operation",
"s",
"latest",
"information",
".",
"If",
"the",
"operation",
"no",
"longer",
"exists",
"th... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Operation.java#L696-L721 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.getDiskCacheHashcode | @Override
public int getDiskCacheHashcode(boolean debug, boolean includeValue) throws DynamicCacheException {
"""
Returns a hashcode of all the cache entries in disk cache. If includeValue
is true, hashcode will include the cache value. lease note that the cache key
and value objects should override the defa... | java | @Override
public int getDiskCacheHashcode(boolean debug, boolean includeValue) throws DynamicCacheException {
final String methodName = "getDiskCacheHashcode()";
if (this.swapToDisk) {
// TODO write code to support getDiskCacheHashcode function
if (tc.isDebugEnabled()) {
... | [
"@",
"Override",
"public",
"int",
"getDiskCacheHashcode",
"(",
"boolean",
"debug",
",",
"boolean",
"includeValue",
")",
"throws",
"DynamicCacheException",
"{",
"final",
"String",
"methodName",
"=",
"\"getDiskCacheHashcode()\"",
";",
"if",
"(",
"this",
".",
"swapToDi... | Returns a hashcode of all the cache entries in disk cache. If includeValue
is true, hashcode will include the cache value. lease note that the cache key
and value objects should override the default java.lang.Object.hashCode()
method to get semantic comparability between object instances.
Since this command computes a ... | [
"Returns",
"a",
"hashcode",
"of",
"all",
"the",
"cache",
"entries",
"in",
"disk",
"cache",
".",
"If",
"includeValue",
"is",
"true",
"hashcode",
"will",
"include",
"the",
"cache",
"value",
".",
"lease",
"note",
"that",
"the",
"cache",
"key",
"and",
"value",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L1099-L1117 |
Red5/red5-io | src/main/java/org/red5/io/matroska/VINT.java | VINT.fromBinary | public static VINT fromBinary(long binary) {
"""
method to construct {@link VINT} based on its binary representation
@param binary
- binary value of {@link VINT}
@return {@link VINT} corresponding to this binary
"""
BitSet bs = BitSet.valueOf(new long[] { binary });
long mask = MASK_BYTE_1... | java | public static VINT fromBinary(long binary) {
BitSet bs = BitSet.valueOf(new long[] { binary });
long mask = MASK_BYTE_1;
byte length = 1;
if (bs.length() > 3 * BIT_IN_BYTE) {
mask = MASK_BYTE_4;
length = 4;
} else if (bs.length() > 2 * BIT_IN_BYTE) {
... | [
"public",
"static",
"VINT",
"fromBinary",
"(",
"long",
"binary",
")",
"{",
"BitSet",
"bs",
"=",
"BitSet",
".",
"valueOf",
"(",
"new",
"long",
"[",
"]",
"{",
"binary",
"}",
")",
";",
"long",
"mask",
"=",
"MASK_BYTE_1",
";",
"byte",
"length",
"=",
"1",... | method to construct {@link VINT} based on its binary representation
@param binary
- binary value of {@link VINT}
@return {@link VINT} corresponding to this binary | [
"method",
"to",
"construct",
"{",
"@link",
"VINT",
"}",
"based",
"on",
"its",
"binary",
"representation"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/matroska/VINT.java#L119-L135 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java | CPDefinitionLinkPersistenceImpl.findByCProductId | @Override
public List<CPDefinitionLink> findByCProductId(long CProductId, int start,
int end) {
"""
Returns a range of all the cp definition links where CProductId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> ar... | java | @Override
public List<CPDefinitionLink> findByCProductId(long CProductId, int start,
int end) {
return findByCProductId(CProductId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionLink",
">",
"findByCProductId",
"(",
"long",
"CProductId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCProductId",
"(",
"CProductId",
",",
"start",
",",
"end",
",",
"null",
")",
"... | Returns a range of all the cp definition links where CProductId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"links",
"where",
"CProductId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L2051-L2055 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java | GVRPicker.getWorldPickRay | public final void getWorldPickRay(Vector3f origin, Vector3f direction) {
"""
Gets the pick ray in world coordinates.
<p>
World coordinates are defined as the coordinate system at the
root of the scene graph before any camera viewing transformation
is applied.
<p>
You can get the pick ray relative to the scen... | java | public final void getWorldPickRay(Vector3f origin, Vector3f direction)
{
GVRSceneObject owner = getOwnerObject();
if (owner == null) // should never come here, picker always
{ // owned by GVRGearCursorController pivot
owner = mScene.get... | [
"public",
"final",
"void",
"getWorldPickRay",
"(",
"Vector3f",
"origin",
",",
"Vector3f",
"direction",
")",
"{",
"GVRSceneObject",
"owner",
"=",
"getOwnerObject",
"(",
")",
";",
"if",
"(",
"owner",
"==",
"null",
")",
"// should never come here, picker always",
"{"... | Gets the pick ray in world coordinates.
<p>
World coordinates are defined as the coordinate system at the
root of the scene graph before any camera viewing transformation
is applied.
<p>
You can get the pick ray relative to the scene object that
owns the picker (or the camera if no owner) by calling
{@link #getPickRay(... | [
"Gets",
"the",
"pick",
"ray",
"in",
"world",
"coordinates",
".",
"<p",
">",
"World",
"coordinates",
"are",
"defined",
"as",
"the",
"coordinate",
"system",
"at",
"the",
"root",
"of",
"the",
"scene",
"graph",
"before",
"any",
"camera",
"viewing",
"transformati... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L360-L374 |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java | MarkupBuilder.escapeXmlValue | private String escapeXmlValue(String value, boolean isAttrValue) {
"""
Escapes a string so that it can be used in XML text successfully.
It replaces the following characters with the corresponding XML
entities:
<ul>
<li>& as &amp;</li>
<li>< as &lt;</li>
<li>> as &gt;</li>
</ul>
If th... | java | private String escapeXmlValue(String value, boolean isAttrValue) {
if (value == null)
throw new IllegalArgumentException();
return StringGroovyMethods.collectReplacements(value, new ReplacingClosure(isAttrValue, useDoubleQuotes));
} | [
"private",
"String",
"escapeXmlValue",
"(",
"String",
"value",
",",
"boolean",
"isAttrValue",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"return",
"StringGroovyMethods",
".",
"collectReplacements",
... | Escapes a string so that it can be used in XML text successfully.
It replaces the following characters with the corresponding XML
entities:
<ul>
<li>& as &amp;</li>
<li>< as &lt;</li>
<li>> as &gt;</li>
</ul>
If the string is to be added as an attribute value, these
characters are also escaped:
<u... | [
"Escapes",
"a",
"string",
"so",
"that",
"it",
"can",
"be",
"used",
"in",
"XML",
"text",
"successfully",
".",
"It",
"replaces",
"the",
"following",
"characters",
"with",
"the",
"corresponding",
"XML",
"entities",
":",
"<ul",
">",
"<li",
">",
"&",
";",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java#L390-L394 |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java | SQLOperation.getCurrentUGI | private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException {
"""
Returns the current UGI on the stack
@param opConfig
@return UserGroupInformation
@throws HiveSQLException
"""
try {
return Utils.getUGI();
} catch (Exception e) {
throw new HiveSQLException("Unab... | java | private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException {
try {
return Utils.getUGI();
} catch (Exception e) {
throw new HiveSQLException("Unable to get current user", e);
}
} | [
"private",
"UserGroupInformation",
"getCurrentUGI",
"(",
"HiveConf",
"opConfig",
")",
"throws",
"HiveSQLException",
"{",
"try",
"{",
"return",
"Utils",
".",
"getUGI",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"HiveSQLExcepti... | Returns the current UGI on the stack
@param opConfig
@return UserGroupInformation
@throws HiveSQLException | [
"Returns",
"the",
"current",
"UGI",
"on",
"the",
"stack"
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java#L255-L261 |
tomakehurst/wiremock | src/main/java/com/github/tomakehurst/wiremock/common/Exceptions.java | Exceptions.throwUnchecked | public static <T> T throwUnchecked(final Throwable ex, final Class<T> returnType) {
"""
Because this method throws an unchecked exception, when it is called in a method with a return type the compiler
does not know the method is exiting, requiring a further line to return null or throw an unchecked exception
dir... | java | public static <T> T throwUnchecked(final Throwable ex, final Class<T> returnType) {
Exceptions.<RuntimeException>throwsUnchecked(ex);
throw new AssertionError("This code should be unreachable. Something went terribly wrong here!");
} | [
"public",
"static",
"<",
"T",
">",
"T",
"throwUnchecked",
"(",
"final",
"Throwable",
"ex",
",",
"final",
"Class",
"<",
"T",
">",
"returnType",
")",
"{",
"Exceptions",
".",
"<",
"RuntimeException",
">",
"throwsUnchecked",
"(",
"ex",
")",
";",
"throw",
"ne... | Because this method throws an unchecked exception, when it is called in a method with a return type the compiler
does not know the method is exiting, requiring a further line to return null or throw an unchecked exception
directly. This generified method allows this to be avoided by tricking the compiler by adding a re... | [
"Because",
"this",
"method",
"throws",
"an",
"unchecked",
"exception",
"when",
"it",
"is",
"called",
"in",
"a",
"method",
"with",
"a",
"return",
"type",
"the",
"compiler",
"does",
"not",
"know",
"the",
"method",
"is",
"exiting",
"requiring",
"a",
"further",
... | train | https://github.com/tomakehurst/wiremock/blob/9d9d73463a82184ec129d620f21133ee7d52f632/src/main/java/com/github/tomakehurst/wiremock/common/Exceptions.java#L38-L41 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Utils.java | Utils.copyDocFiles | public void copyDocFiles(Configuration configuration, PackageDoc pd) {
"""
Copy the given directory contents from the source package directory
to the generated documentation directory. For example for a package
java.lang this method find out the source location of the package using
{@link SourcePath} and if giv... | java | public void copyDocFiles(Configuration configuration, PackageDoc pd) {
Location locn = configuration.getLocationForPackage(pd);
copyDocFiles(configuration, locn, DocPath.forPackage(pd).resolve(DocPaths.DOC_FILES));
} | [
"public",
"void",
"copyDocFiles",
"(",
"Configuration",
"configuration",
",",
"PackageDoc",
"pd",
")",
"{",
"Location",
"locn",
"=",
"configuration",
".",
"getLocationForPackage",
"(",
"pd",
")",
";",
"copyDocFiles",
"(",
"configuration",
",",
"locn",
",",
"DocP... | Copy the given directory contents from the source package directory
to the generated documentation directory. For example for a package
java.lang this method find out the source location of the package using
{@link SourcePath} and if given directory is found in the source
directory structure, copy the entire directory,... | [
"Copy",
"the",
"given",
"directory",
"contents",
"from",
"the",
"source",
"package",
"directory",
"to",
"the",
"generated",
"documentation",
"directory",
".",
"For",
"example",
"for",
"a",
"package",
"java",
".",
"lang",
"this",
"method",
"find",
"out",
"the",... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Utils.java#L207-L210 |
authlete/authlete-java-common | src/main/java/com/authlete/common/api/AuthleteApiImpl.java | AuthleteApiImpl.callServiceOwnerGetApi | private <TResponse> TResponse callServiceOwnerGetApi(
String path, Map<String, String> queryParams,
Class<TResponse> responseClass) throws AuthleteApiException {
"""
Call an API with HTTP GET method and Service Owner credentials.
"""
return callGetApi(mServiceOwnerCredentials, p... | java | private <TResponse> TResponse callServiceOwnerGetApi(
String path, Map<String, String> queryParams,
Class<TResponse> responseClass) throws AuthleteApiException
{
return callGetApi(mServiceOwnerCredentials, path, queryParams, responseClass);
} | [
"private",
"<",
"TResponse",
">",
"TResponse",
"callServiceOwnerGetApi",
"(",
"String",
"path",
",",
"Map",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"Class",
"<",
"TResponse",
">",
"responseClass",
")",
"throws",
"AuthleteApiException",
"{",
"retur... | Call an API with HTTP GET method and Service Owner credentials. | [
"Call",
"an",
"API",
"with",
"HTTP",
"GET",
"method",
"and",
"Service",
"Owner",
"credentials",
"."
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/api/AuthleteApiImpl.java#L262-L267 |
nmdp-bioinformatics/ngs | variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfWriter.java | VcfWriter.writeHeader | public static void writeHeader(final VcfHeader header, final PrintWriter writer) {
"""
Write VCF header with the specified print writer.
@param header VCF header, must not be null
@param writer print writer to write VCF with, must not be null
"""
checkNotNull(header);
checkNotNull(writer);
... | java | public static void writeHeader(final VcfHeader header, final PrintWriter writer) {
checkNotNull(header);
checkNotNull(writer);
for (String meta : header.getMeta()) {
writer.println(meta);
}
} | [
"public",
"static",
"void",
"writeHeader",
"(",
"final",
"VcfHeader",
"header",
",",
"final",
"PrintWriter",
"writer",
")",
"{",
"checkNotNull",
"(",
"header",
")",
";",
"checkNotNull",
"(",
"writer",
")",
";",
"for",
"(",
"String",
"meta",
":",
"header",
... | Write VCF header with the specified print writer.
@param header VCF header, must not be null
@param writer print writer to write VCF with, must not be null | [
"Write",
"VCF",
"header",
"with",
"the",
"specified",
"print",
"writer",
"."
] | train | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfWriter.java#L71-L78 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.readJSONObject | public static JSONObject readJSONObject(File file, Charset charset) throws IORuntimeException {
"""
读取JSONObject
@param file JSON文件
@param charset 编码
@return JSONObject
@throws IORuntimeException IO异常
"""
return parseObj(FileReader.create(file, charset).readString());
} | java | public static JSONObject readJSONObject(File file, Charset charset) throws IORuntimeException {
return parseObj(FileReader.create(file, charset).readString());
} | [
"public",
"static",
"JSONObject",
"readJSONObject",
"(",
"File",
"file",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"parseObj",
"(",
"FileReader",
".",
"create",
"(",
"file",
",",
"charset",
")",
".",
"readString",
"(",
")",... | 读取JSONObject
@param file JSON文件
@param charset 编码
@return JSONObject
@throws IORuntimeException IO异常 | [
"读取JSONObject"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L224-L226 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java | SslContextBuilder.forServer | public static SslContextBuilder forServer(File keyCertChainFile, File keyFile) {
"""
Creates a builder for new server-side {@link SslContext}.
@param keyCertChainFile an X.509 certificate chain file in PEM format
@param keyFile a PKCS#8 private key file in PEM format
@see #keyManager(File, File)
"""
... | java | public static SslContextBuilder forServer(File keyCertChainFile, File keyFile) {
return new SslContextBuilder(true).keyManager(keyCertChainFile, keyFile);
} | [
"public",
"static",
"SslContextBuilder",
"forServer",
"(",
"File",
"keyCertChainFile",
",",
"File",
"keyFile",
")",
"{",
"return",
"new",
"SslContextBuilder",
"(",
"true",
")",
".",
"keyManager",
"(",
"keyCertChainFile",
",",
"keyFile",
")",
";",
"}"
] | Creates a builder for new server-side {@link SslContext}.
@param keyCertChainFile an X.509 certificate chain file in PEM format
@param keyFile a PKCS#8 private key file in PEM format
@see #keyManager(File, File) | [
"Creates",
"a",
"builder",
"for",
"new",
"server",
"-",
"side",
"{",
"@link",
"SslContext",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L53-L55 |
xebialabs/overcast | src/main/java/com/xebialabs/overcast/support/libvirt/JDomUtil.java | JDomUtil.stringToDocument | public static Document stringToDocument(String xml) {
"""
Convert xml to JDOM2 {@link Document}. Throws {@link IllegalArgumentException} in case of errors.
"""
try {
SAXBuilder sax = new SAXBuilder();
return sax.build(new ByteArrayInputStream(xml.getBytes("UTF-8")));
} c... | java | public static Document stringToDocument(String xml) {
try {
SAXBuilder sax = new SAXBuilder();
return sax.build(new ByteArrayInputStream(xml.getBytes("UTF-8")));
} catch (JDOMException e) {
throw new IllegalArgumentException("Unable to parse xml", e);
} catch ... | [
"public",
"static",
"Document",
"stringToDocument",
"(",
"String",
"xml",
")",
"{",
"try",
"{",
"SAXBuilder",
"sax",
"=",
"new",
"SAXBuilder",
"(",
")",
";",
"return",
"sax",
".",
"build",
"(",
"new",
"ByteArrayInputStream",
"(",
"xml",
".",
"getBytes",
"(... | Convert xml to JDOM2 {@link Document}. Throws {@link IllegalArgumentException} in case of errors. | [
"Convert",
"xml",
"to",
"JDOM2",
"{"
] | train | https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/libvirt/JDomUtil.java#L46-L55 |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/projectparser/performance/LrProjectScenarioResults.java | LrProjectScenarioResults.vTransactionMapInit | public static void vTransactionMapInit(SortedMap<String, Integer> map) {
"""
initilize vuser maps with required values
@param map the map
"""
map.put("Pass", 0);
map.put("Stop", 0);
map.put("Fail", 0);
map.put("Count", 0);
} | java | public static void vTransactionMapInit(SortedMap<String, Integer> map) {
map.put("Pass", 0);
map.put("Stop", 0);
map.put("Fail", 0);
map.put("Count", 0);
} | [
"public",
"static",
"void",
"vTransactionMapInit",
"(",
"SortedMap",
"<",
"String",
",",
"Integer",
">",
"map",
")",
"{",
"map",
".",
"put",
"(",
"\"Pass\"",
",",
"0",
")",
";",
"map",
".",
"put",
"(",
"\"Stop\"",
",",
"0",
")",
";",
"map",
".",
"p... | initilize vuser maps with required values
@param map the map | [
"initilize",
"vuser",
"maps",
"with",
"required",
"values"
] | train | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/projectparser/performance/LrProjectScenarioResults.java#L119-L124 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ManagedExecutorServiceImpl.java | ManagedExecutorServiceImpl.getExecutionProperties | final Map<String, String> getExecutionProperties(Object task) {
"""
Returns execution properties for the task.
@param task the task being submitted for execution.
@return execution properties for the task.
"""
if (task == null) // NullPointerException is required per the JavaDoc API
thr... | java | final Map<String, String> getExecutionProperties(Object task) {
if (task == null) // NullPointerException is required per the JavaDoc API
throw new NullPointerException(Tr.formatMessage(tc, "CWWKC1111.task.invalid", (Object) null));
Map<String, String> execProps = task instanceof ManagedTas... | [
"final",
"Map",
"<",
"String",
",",
"String",
">",
"getExecutionProperties",
"(",
"Object",
"task",
")",
"{",
"if",
"(",
"task",
"==",
"null",
")",
"// NullPointerException is required per the JavaDoc API",
"throw",
"new",
"NullPointerException",
"(",
"Tr",
".",
"... | Returns execution properties for the task.
@param task the task being submitted for execution.
@return execution properties for the task. | [
"Returns",
"execution",
"properties",
"for",
"the",
"task",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ManagedExecutorServiceImpl.java#L367-L385 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java | AbstractMappedClassFieldObserver.onFieldBits | protected void onFieldBits(final Object obj, final Field field, final Bin annotation, final JBBPBitNumber bitNumber, final int value) {
"""
Notification about bit field.
@param obj the object instance, must not be null
@param field the field, must not be null
@param annotation the annotation for f... | java | protected void onFieldBits(final Object obj, final Field field, final Bin annotation, final JBBPBitNumber bitNumber, final int value) {
} | [
"protected",
"void",
"onFieldBits",
"(",
"final",
"Object",
"obj",
",",
"final",
"Field",
"field",
",",
"final",
"Bin",
"annotation",
",",
"final",
"JBBPBitNumber",
"bitNumber",
",",
"final",
"int",
"value",
")",
"{",
"}"
] | Notification about bit field.
@param obj the object instance, must not be null
@param field the field, must not be null
@param annotation the annotation for field, must not be null
@param bitNumber number of bits for the field, must not be null
@param value the value of the field | [
"Notification",
"about",
"bit",
"field",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java#L540-L542 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_hunting_queue_queueId_agent_POST | public OvhOvhPabxHuntingAgentQueue billingAccount_easyHunting_serviceName_hunting_queue_queueId_agent_POST(String billingAccount, String serviceName, Long queueId, Long position) throws IOException {
"""
Create a new skill for an agent (it adds the agent in a queue)
REST: POST /telephony/{billingAccount}/easyHu... | java | public OvhOvhPabxHuntingAgentQueue billingAccount_easyHunting_serviceName_hunting_queue_queueId_agent_POST(String billingAccount, String serviceName, Long queueId, Long position) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/hunting/queue/{queueId}/agent";
StringBuilder ... | [
"public",
"OvhOvhPabxHuntingAgentQueue",
"billingAccount_easyHunting_serviceName_hunting_queue_queueId_agent_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"queueId",
",",
"Long",
"position",
")",
"throws",
"IOException",
"{",
"String",
"qP... | Create a new skill for an agent (it adds the agent in a queue)
REST: POST /telephony/{billingAccount}/easyHunting/{serviceName}/hunting/queue/{queueId}/agent
@param position [required] The position of the agent in the queue
@param queueId [required] The queue where you want to add the agent
@param billingAccount [requ... | [
"Create",
"a",
"new",
"skill",
"for",
"an",
"agent",
"(",
"it",
"adds",
"the",
"agent",
"in",
"a",
"queue",
")"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3066-L3073 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/util/Exceptions.java | Exceptions.logIfUnexpected | public static void logIfUnexpected(Logger logger, Channel ch, String debugData, Throwable cause) {
"""
Logs the specified exception if it is {@linkplain #isExpected(Throwable) unexpected}.
"""
if (!logger.isWarnEnabled() || isExpected(cause)) {
return;
}
logger.warn("{} Un... | java | public static void logIfUnexpected(Logger logger, Channel ch, String debugData, Throwable cause) {
if (!logger.isWarnEnabled() || isExpected(cause)) {
return;
}
logger.warn("{} Unexpected exception: {}", ch, debugData, cause);
} | [
"public",
"static",
"void",
"logIfUnexpected",
"(",
"Logger",
"logger",
",",
"Channel",
"ch",
",",
"String",
"debugData",
",",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"!",
"logger",
".",
"isWarnEnabled",
"(",
")",
"||",
"isExpected",
"(",
"cause",
")",
... | Logs the specified exception if it is {@linkplain #isExpected(Throwable) unexpected}. | [
"Logs",
"the",
"specified",
"exception",
"if",
"it",
"is",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/Exceptions.java#L90-L97 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUService.java | ICUService.getDisplayName | public String getDisplayName(String id, ULocale locale) {
"""
Given a visible id, return the display name in the requested locale.
If there is no directly supported id corresponding to this id, return
null.
"""
Map<String, Factory> m = getVisibleIDMap();
Factory f = m.get(id);
if (f !... | java | public String getDisplayName(String id, ULocale locale) {
Map<String, Factory> m = getVisibleIDMap();
Factory f = m.get(id);
if (f != null) {
return f.getDisplayName(id, locale);
}
Key key = createKey(id);
while (key.fallback()) {
f = m.get(key.cu... | [
"public",
"String",
"getDisplayName",
"(",
"String",
"id",
",",
"ULocale",
"locale",
")",
"{",
"Map",
"<",
"String",
",",
"Factory",
">",
"m",
"=",
"getVisibleIDMap",
"(",
")",
";",
"Factory",
"f",
"=",
"m",
".",
"get",
"(",
"id",
")",
";",
"if",
"... | Given a visible id, return the display name in the requested locale.
If there is no directly supported id corresponding to this id, return
null. | [
"Given",
"a",
"visible",
"id",
"return",
"the",
"display",
"name",
"in",
"the",
"requested",
"locale",
".",
"If",
"there",
"is",
"no",
"directly",
"supported",
"id",
"corresponding",
"to",
"this",
"id",
"return",
"null",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUService.java#L620-L636 |
elki-project/elki | elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/VectorUtil.java | VectorUtil.angleDense | public static double angleDense(NumberVector v1, NumberVector v2) {
"""
Compute the absolute cosine of the angle between two dense vectors.
To convert it to radians, use <code>Math.acos(angle)</code>!
@param v1 first vector
@param v2 second vector
@return Angle
"""
final int dim1 = v1.getDimensiona... | java | public static double angleDense(NumberVector v1, NumberVector v2) {
final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality();
final int mindim = (dim1 <= dim2) ? dim1 : dim2;
// Essentially, we want to compute this:
// v1.transposeTimes(v2) / (v1.euclideanLength() * v2.euclideanLength());
... | [
"public",
"static",
"double",
"angleDense",
"(",
"NumberVector",
"v1",
",",
"NumberVector",
"v2",
")",
"{",
"final",
"int",
"dim1",
"=",
"v1",
".",
"getDimensionality",
"(",
")",
",",
"dim2",
"=",
"v2",
".",
"getDimensionality",
"(",
")",
";",
"final",
"... | Compute the absolute cosine of the angle between two dense vectors.
To convert it to radians, use <code>Math.acos(angle)</code>!
@param v1 first vector
@param v2 second vector
@return Angle | [
"Compute",
"the",
"absolute",
"cosine",
"of",
"the",
"angle",
"between",
"two",
"dense",
"vectors",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/VectorUtil.java#L95-L121 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java | TasksInner.beginUpdate | public TaskInner beginUpdate(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) {
"""
Updates a task with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The na... | java | public TaskInner beginUpdate(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).toBlocking().single().body();
} | [
"public",
"TaskInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"taskName",
",",
"TaskUpdateParameters",
"taskUpdateParameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Updates a task with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param taskName The name of the container registry task.
@param taskUpdateParameters The parameters for updating a task.... | [
"Updates",
"a",
"task",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L762-L764 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.loadBalancing_serviceName_backend_backend_setWeight_POST | public OvhLoadBalancingTask loadBalancing_serviceName_backend_backend_setWeight_POST(String serviceName, String backend, Long weight) throws IOException {
"""
Set the weight of a backend. For instance, if backend A has a weight of 8 and backup B was a weight of 16, backend B will receive twice more connections as ... | java | public OvhLoadBalancingTask loadBalancing_serviceName_backend_backend_setWeight_POST(String serviceName, String backend, Long weight) throws IOException {
String qPath = "/ip/loadBalancing/{serviceName}/backend/{backend}/setWeight";
StringBuilder sb = path(qPath, serviceName, backend);
HashMap<String, Object>o = ... | [
"public",
"OvhLoadBalancingTask",
"loadBalancing_serviceName_backend_backend_setWeight_POST",
"(",
"String",
"serviceName",
",",
"String",
"backend",
",",
"Long",
"weight",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/loadBalancing/{serviceName}/backend/{ba... | Set the weight of a backend. For instance, if backend A has a weight of 8 and backup B was a weight of 16, backend B will receive twice more connections as backend A. Backends must be on the same POP for the weight parameter to take effect between them.
REST: POST /ip/loadBalancing/{serviceName}/backend/{backend}/setW... | [
"Set",
"the",
"weight",
"of",
"a",
"backend",
".",
"For",
"instance",
"if",
"backend",
"A",
"has",
"a",
"weight",
"of",
"8",
"and",
"backup",
"B",
"was",
"a",
"weight",
"of",
"16",
"backend",
"B",
"will",
"receive",
"twice",
"more",
"connections",
"as"... | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1363-L1370 |
tvesalainen/util | util/src/main/java/org/vesalainen/lang/Primitives.java | Primitives.parseChar | public static final char parseChar(CharSequence cs, int beginIndex, int endIndex) {
"""
Returns char from input.
@param cs
@param beginIndex the index to the first char of the text range.
@param endIndex the index after the last char of the text range.
@return
@throws IllegalArgumentException if input length ... | java | public static final char parseChar(CharSequence cs, int beginIndex, int endIndex)
{
if (endIndex - beginIndex != 1)
{
throw new IllegalArgumentException("input length must be 1");
}
return cs.charAt(beginIndex);
} | [
"public",
"static",
"final",
"char",
"parseChar",
"(",
"CharSequence",
"cs",
",",
"int",
"beginIndex",
",",
"int",
"endIndex",
")",
"{",
"if",
"(",
"endIndex",
"-",
"beginIndex",
"!=",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"input ... | Returns char from input.
@param cs
@param beginIndex the index to the first char of the text range.
@param endIndex the index after the last char of the text range.
@return
@throws IllegalArgumentException if input length is not 1. | [
"Returns",
"char",
"from",
"input",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L471-L478 |
termsuite/termsuite-core | src/main/java/fr/univnantes/termsuite/tools/CliUtil.java | CliUtil.logCommandLineOptions | public static void logCommandLineOptions(Logger logger, CommandLine line) {
"""
Displays all command line options in log messages.
@param line
"""
for (Option myOption : line.getOptions()) {
String message;
String opt = "";
if(myOption.getOpt() != null) {
opt+="-"+myOption.getOpt();
if(myOp... | java | public static void logCommandLineOptions(Logger logger, CommandLine line) {
for (Option myOption : line.getOptions()) {
String message;
String opt = "";
if(myOption.getOpt() != null) {
opt+="-"+myOption.getOpt();
if(myOption.getLongOpt() != null)
opt+=" (--"+myOption.getLongOpt()+")";
} else... | [
"public",
"static",
"void",
"logCommandLineOptions",
"(",
"Logger",
"logger",
",",
"CommandLine",
"line",
")",
"{",
"for",
"(",
"Option",
"myOption",
":",
"line",
".",
"getOptions",
"(",
")",
")",
"{",
"String",
"message",
";",
"String",
"opt",
"=",
"\"\""... | Displays all command line options in log messages.
@param line | [
"Displays",
"all",
"command",
"line",
"options",
"in",
"log",
"messages",
"."
] | train | https://github.com/termsuite/termsuite-core/blob/731e5d0bc7c14180713c01a9c7dffe1925f26130/src/main/java/fr/univnantes/termsuite/tools/CliUtil.java#L91-L110 |
alkacon/opencms-core | src/org/opencms/repository/CmsRepositoryFilter.java | CmsRepositoryFilter.isPartialMatch | private boolean isPartialMatch(Pattern pattern, String path) {
"""
Returns if the given path matches or partially matches the pattern.<p>
For example the regex "/system/modules/" should match the path "/system/".
That's not working with Java 1.4. Starting with Java 1.5 there are possiblities
to do that. Until... | java | private boolean isPartialMatch(Pattern pattern, String path) {
Matcher matcher = pattern.matcher(path);
if (matcher.matches()) {
return true;
}
if (!path.endsWith("/")) {
matcher = pattern.matcher(path + "/");
return matcher.matches();
}
... | [
"private",
"boolean",
"isPartialMatch",
"(",
"Pattern",
"pattern",
",",
"String",
"path",
")",
"{",
"Matcher",
"matcher",
"=",
"pattern",
".",
"matcher",
"(",
"path",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
")",
")",
"{",
"return",
"true",
... | Returns if the given path matches or partially matches the pattern.<p>
For example the regex "/system/modules/" should match the path "/system/".
That's not working with Java 1.4. Starting with Java 1.5 there are possiblities
to do that. Until then you have to configure all parent paths as a regex filter.<p>
@param p... | [
"Returns",
"if",
"the",
"given",
"path",
"matches",
"or",
"partially",
"matches",
"the",
"pattern",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/repository/CmsRepositoryFilter.java#L174-L188 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/jar/Attributes.java | Attributes.put | public Object put(Object name, Object value) {
"""
Associates the specified value with the specified attribute name
(key) in this Map. If the Map previously contained a mapping for
the attribute name, the old value is replaced.
@param name the attribute name
@param value the attribute value
@return the prev... | java | public Object put(Object name, Object value) {
return map.put((Attributes.Name)name, (String)value);
} | [
"public",
"Object",
"put",
"(",
"Object",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"map",
".",
"put",
"(",
"(",
"Attributes",
".",
"Name",
")",
"name",
",",
"(",
"String",
")",
"value",
")",
";",
"}"
] | Associates the specified value with the specified attribute name
(key) in this Map. If the Map previously contained a mapping for
the attribute name, the old value is replaced.
@param name the attribute name
@param value the attribute value
@return the previous value of the attribute, or null if none
@exception ClassC... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"attribute",
"name",
"(",
"key",
")",
"in",
"this",
"Map",
".",
"If",
"the",
"Map",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"attribute",
"name",
"the",
"old",
"value",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/jar/Attributes.java#L148-L150 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/monitor/impl/LocalMapStatsImpl.java | LocalMapStatsImpl.setIndexStats | public void setIndexStats(Map<String, LocalIndexStatsImpl> indexStats) {
"""
Sets the per-index stats of this map stats to the given per-index stats.
@param indexStats the per-index stats to set.
"""
this.mutableIndexStats.clear();
if (indexStats != null) {
this.mutableIndexStats... | java | public void setIndexStats(Map<String, LocalIndexStatsImpl> indexStats) {
this.mutableIndexStats.clear();
if (indexStats != null) {
this.mutableIndexStats.putAll(indexStats);
}
} | [
"public",
"void",
"setIndexStats",
"(",
"Map",
"<",
"String",
",",
"LocalIndexStatsImpl",
">",
"indexStats",
")",
"{",
"this",
".",
"mutableIndexStats",
".",
"clear",
"(",
")",
";",
"if",
"(",
"indexStats",
"!=",
"null",
")",
"{",
"this",
".",
"mutableInde... | Sets the per-index stats of this map stats to the given per-index stats.
@param indexStats the per-index stats to set. | [
"Sets",
"the",
"per",
"-",
"index",
"stats",
"of",
"this",
"map",
"stats",
"to",
"the",
"given",
"per",
"-",
"index",
"stats",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/monitor/impl/LocalMapStatsImpl.java#L396-L401 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/CommitsApi.java | CommitsApi.addComment | public Comment addComment(Object projectIdOrPath, String sha, String note) throws GitLabApiException {
"""
Add a comment to a commit.
<pre><code>GitLab Endpoint: POST /projects/:id/repository/commits/:sha/comments</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or... | java | public Comment addComment(Object projectIdOrPath, String sha, String note) throws GitLabApiException {
return (addComment(projectIdOrPath, sha, note, null, null, null));
} | [
"public",
"Comment",
"addComment",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"sha",
",",
"String",
"note",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"addComment",
"(",
"projectIdOrPath",
",",
"sha",
",",
"note",
",",
"null",
",",
"null",
... | Add a comment to a commit.
<pre><code>GitLab Endpoint: POST /projects/:id/repository/commits/:sha/comments</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param sha a commit hash or name of a branch or tag
@param note the text of the comment, required
... | [
"Add",
"a",
"comment",
"to",
"a",
"commit",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/CommitsApi.java#L547-L549 |
alkacon/opencms-core | src/org/opencms/file/history/CmsHistoryResourceHandler.java | CmsHistoryResourceHandler.getResourceWithHistory | public static CmsResource getResourceWithHistory(CmsObject cms, String resourceUri) throws CmsException {
"""
Returns the correct resource for the given URI, taken into account historical versions
marked by the <code>version</code> parameter.<p>
@param cms the current CMS context
@param resourceUri the resour... | java | public static CmsResource getResourceWithHistory(CmsObject cms, String resourceUri) throws CmsException {
CmsResource resource = null;
if (resourceUri.contains(CmsRequestUtil.URL_DELIMITER)) {
int pos = resourceUri.indexOf(CmsRequestUtil.URL_DELIMITER);
Map<String, String[]> pa... | [
"public",
"static",
"CmsResource",
"getResourceWithHistory",
"(",
"CmsObject",
"cms",
",",
"String",
"resourceUri",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"resource",
"=",
"null",
";",
"if",
"(",
"resourceUri",
".",
"contains",
"(",
"CmsRequestUtil",
"... | Returns the correct resource for the given URI, taken into account historical versions
marked by the <code>version</code> parameter.<p>
@param cms the current CMS context
@param resourceUri the resource URI
@return the resource, which can be an instance of {@link org.opencms.file.history.I_CmsHistoryResource}
@throw... | [
"Returns",
"the",
"correct",
"resource",
"for",
"the",
"given",
"URI",
"taken",
"into",
"account",
"historical",
"versions",
"marked",
"by",
"the",
"<code",
">",
"version<",
"/",
"code",
">",
"parameter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/history/CmsHistoryResourceHandler.java#L112-L130 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/util/MD5Digest.java | MD5Digest.bytesToHex | private static void bytesToHex(byte[] bytes, byte[] hex, int offset) {
"""
/*
Turn 16-byte stream into a human-readable 32-byte hex string
"""
final char[] lookup =
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
int i;
int c;
int j;
int pos = off... | java | private static void bytesToHex(byte[] bytes, byte[] hex, int offset) {
final char[] lookup =
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
int i;
int c;
int j;
int pos = offset;
for (i = 0; i < 16; i++) {
c = bytes[i] & 0xFF;
j = c >> 4;
... | [
"private",
"static",
"void",
"bytesToHex",
"(",
"byte",
"[",
"]",
"bytes",
",",
"byte",
"[",
"]",
"hex",
",",
"int",
"offset",
")",
"{",
"final",
"char",
"[",
"]",
"lookup",
"=",
"{",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
","... | /*
Turn 16-byte stream into a human-readable 32-byte hex string | [
"/",
"*",
"Turn",
"16",
"-",
"byte",
"stream",
"into",
"a",
"human",
"-",
"readable",
"32",
"-",
"byte",
"hex",
"string"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/MD5Digest.java#L60-L76 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.getAt | public static String getAt(String text, int index) {
"""
Support the subscript operator for String.
@param text a String
@param index the index of the Character to get
@return the Character at the given index
@since 1.0
"""
index = normaliseIndex(index, text.length());
return text.substr... | java | public static String getAt(String text, int index) {
index = normaliseIndex(index, text.length());
return text.substring(index, index + 1);
} | [
"public",
"static",
"String",
"getAt",
"(",
"String",
"text",
",",
"int",
"index",
")",
"{",
"index",
"=",
"normaliseIndex",
"(",
"index",
",",
"text",
".",
"length",
"(",
")",
")",
";",
"return",
"text",
".",
"substring",
"(",
"index",
",",
"index",
... | Support the subscript operator for String.
@param text a String
@param index the index of the Character to get
@return the Character at the given index
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"for",
"String",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L1449-L1452 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java | ChannelFrameworkImpl.retryChainStart | protected void retryChainStart(ChainData chainData, Exception e) {
"""
This method is called when an initial attempt to start a chain has
failed due to a particular type of exception, RetryableChannelException,
indicating that a retry may enable the chain to be started. This could
result from something like a d... | java | protected void retryChainStart(ChainData chainData, Exception e) {
// Do nothing in the core implementation. This method is overloaded in the
// service.
// 7/16/04 CAL - this prevents a dependency on the Alarm Manager and
// channelfw.service
FFDCFilter.processException(e, getCl... | [
"protected",
"void",
"retryChainStart",
"(",
"ChainData",
"chainData",
",",
"Exception",
"e",
")",
"{",
"// Do nothing in the core implementation. This method is overloaded in the",
"// service.",
"// 7/16/04 CAL - this prevents a dependency on the Alarm Manager and",
"// channelfw.servi... | This method is called when an initial attempt to start a chain has
failed due to a particular type of exception, RetryableChannelException,
indicating that a retry may enable the chain to be started. This could
result from something like a device side channel having bind problems
since a socket from a previous chain st... | [
"This",
"method",
"is",
"called",
"when",
"an",
"initial",
"attempt",
"to",
"start",
"a",
"chain",
"has",
"failed",
"due",
"to",
"a",
"particular",
"type",
"of",
"exception",
"RetryableChannelException",
"indicating",
"that",
"a",
"retry",
"may",
"enable",
"th... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java#L3762-L3770 |
iorga-group/iraj | iraj/src/main/java/com/iorga/iraj/servlet/CacheAwareServlet.java | CacheAwareServlet.checkIfUnmodifiedSince | protected boolean checkIfUnmodifiedSince(final HttpServletRequest request, final HttpServletResponse response, final Attributes resourceAttributes)
throws IOException {
"""
Check if the if-unmodified-since condition is satisfied.
@param request
The servlet request we are processing
@param response
The ser... | java | protected boolean checkIfUnmodifiedSince(final HttpServletRequest request, final HttpServletResponse response, final Attributes resourceAttributes)
throws IOException {
try {
final long lastModified = resourceAttributes.getLastModified();
final long headerValue = request.getDateHeader("If-Unmodified-Since");... | [
"protected",
"boolean",
"checkIfUnmodifiedSince",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
",",
"final",
"Attributes",
"resourceAttributes",
")",
"throws",
"IOException",
"{",
"try",
"{",
"final",
"long",
"lastModif... | Check if the if-unmodified-since condition is satisfied.
@param request
The servlet request we are processing
@param response
The servlet response we are creating
@param resourceAttributes
File object
@return boolean true if the resource meets the specified condition, and
false if the condition is not satisfied, in wh... | [
"Check",
"if",
"the",
"if",
"-",
"unmodified",
"-",
"since",
"condition",
"is",
"satisfied",
"."
] | train | https://github.com/iorga-group/iraj/blob/5fdee26464248f29833610de402275eb64505542/iraj/src/main/java/com/iorga/iraj/servlet/CacheAwareServlet.java#L792-L809 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.handleArray | private JsonError handleArray(ArrayNode node, OutputStream output) throws IOException {
"""
Handles the given {@link ArrayNode} and writes the
responses to the given {@link OutputStream}.
@param node the {@link JsonNode}
@param output the {@link OutputStream}
@return the error code, or {@code 0} if none
@... | java | private JsonError handleArray(ArrayNode node, OutputStream output) throws IOException {
logger.debug("Handling {} requests", node.size());
JsonError result = JsonError.OK;
output.write('[');
int errorCount = 0;
for (int i = 0; i < node.size(); i++) {
JsonError nodeResult = handleJsonNodeRequest(node.get(i)... | [
"private",
"JsonError",
"handleArray",
"(",
"ArrayNode",
"node",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"Handling {} requests\"",
",",
"node",
".",
"size",
"(",
")",
")",
";",
"JsonError",
"result",
"="... | Handles the given {@link ArrayNode} and writes the
responses to the given {@link OutputStream}.
@param node the {@link JsonNode}
@param output the {@link OutputStream}
@return the error code, or {@code 0} if none
@throws IOException on error | [
"Handles",
"the",
"given",
"{",
"@link",
"ArrayNode",
"}",
"and",
"writes",
"the",
"responses",
"to",
"the",
"given",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L292-L311 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendShortText | public DateTimeFormatterBuilder appendShortText(DateTimeFieldType fieldType) {
"""
Instructs the printer to emit a field value as short text, and the
parser to expect text.
@param fieldType type of field to append
@return this DateTimeFormatterBuilder, for chaining
@throws IllegalArgumentException if field ... | java | public DateTimeFormatterBuilder appendShortText(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
return append0(new TextField(fieldType, true));
} | [
"public",
"DateTimeFormatterBuilder",
"appendShortText",
"(",
"DateTimeFieldType",
"fieldType",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type must not be null\"",
")",
";",
"}",
"return",
"appe... | Instructs the printer to emit a field value as short text, and the
parser to expect text.
@param fieldType type of field to append
@return this DateTimeFormatterBuilder, for chaining
@throws IllegalArgumentException if field type is null | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"short",
"text",
"and",
"the",
"parser",
"to",
"expect",
"text",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L549-L554 |
netty/netty | codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheEncoder.java | AbstractBinaryMemcacheEncoder.encodeKey | private static void encodeKey(ByteBuf buf, ByteBuf key) {
"""
Encode the key.
@param buf the {@link ByteBuf} to write into.
@param key the key to encode.
"""
if (key == null || !key.isReadable()) {
return;
}
buf.writeBytes(key);
} | java | private static void encodeKey(ByteBuf buf, ByteBuf key) {
if (key == null || !key.isReadable()) {
return;
}
buf.writeBytes(key);
} | [
"private",
"static",
"void",
"encodeKey",
"(",
"ByteBuf",
"buf",
",",
"ByteBuf",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
"||",
"!",
"key",
".",
"isReadable",
"(",
")",
")",
"{",
"return",
";",
"}",
"buf",
".",
"writeBytes",
"(",
"key",
")"... | Encode the key.
@param buf the {@link ByteBuf} to write into.
@param key the key to encode. | [
"Encode",
"the",
"key",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheEncoder.java#L68-L74 |
johncarl81/transfuse | transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java | Contract.notNull | public static void notNull(final Object object, final String objectName) {
"""
Throw a null pointer exception if object is null
@param object the object to test
@param objectName the name of the object
@throws IllegalArgumentException if the passed object is null
"""
if (object == null) {
... | java | public static void notNull(final Object object, final String objectName) {
if (object == null) {
throw new IllegalArgumentException("expecting non-null value for " + maskNullArgument(objectName));
}
} | [
"public",
"static",
"void",
"notNull",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"objectName",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"expecting non-null value for \"",
"+",
"mask... | Throw a null pointer exception if object is null
@param object the object to test
@param objectName the name of the object
@throws IllegalArgumentException if the passed object is null | [
"Throw",
"a",
"null",
"pointer",
"exception",
"if",
"object",
"is",
"null"
] | train | https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java#L37-L41 |
bluelinelabs/Conductor | conductor/src/main/java/com/bluelinelabs/conductor/Controller.java | Controller.startActivityForResult | public final void startActivityForResult(@NonNull final Intent intent, final int requestCode, @Nullable final Bundle options) {
"""
Calls startActivityForResult(Intent, int, Bundle) from this Controller's host Activity.
"""
executeWithRouter(new RouterRequiringFunc() {
@Override public void... | java | public final void startActivityForResult(@NonNull final Intent intent, final int requestCode, @Nullable final Bundle options) {
executeWithRouter(new RouterRequiringFunc() {
@Override public void execute() { router.startActivityForResult(instanceId, intent, requestCode, options); }
});
} | [
"public",
"final",
"void",
"startActivityForResult",
"(",
"@",
"NonNull",
"final",
"Intent",
"intent",
",",
"final",
"int",
"requestCode",
",",
"@",
"Nullable",
"final",
"Bundle",
"options",
")",
"{",
"executeWithRouter",
"(",
"new",
"RouterRequiringFunc",
"(",
... | Calls startActivityForResult(Intent, int, Bundle) from this Controller's host Activity. | [
"Calls",
"startActivityForResult",
"(",
"Intent",
"int",
"Bundle",
")",
"from",
"this",
"Controller",
"s",
"host",
"Activity",
"."
] | train | https://github.com/bluelinelabs/Conductor/blob/94c9121bb16f93b481954513a8e3905846829fb2/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java#L522-L526 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getSasDefinition | public SasDefinitionBundle getSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) {
"""
Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission.
@param vaultBaseUrl The vault name, for example https://my... | java | public SasDefinitionBundle getSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName) {
return getSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName).toBlocking().single().body();
} | [
"public",
"SasDefinitionBundle",
"getSasDefinition",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
")",
"{",
"return",
"getSasDefinitionWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageAccountName",
",",
... | Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param sasDefinitionName The name of the SAS defi... | [
"Gets",
"information",
"about",
"a",
"SAS",
"definition",
"for",
"the",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"getsas",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L11160-L11162 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Searches.java | Searches.findLast | public static <E> E findLast(Iterable<E> iterable, Predicate<E> predicate) {
"""
Searches the last matching element returning it.
@param <E> the element type parameter
@param iterable the iterable to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException if ... | java | public static <E> E findLast(Iterable<E> iterable, Predicate<E> predicate) {
dbc.precondition(iterable != null, "cannot searchLast with a null iterable");
final Iterator<E> filtered = new FilteringIterator<E>(iterable.iterator(), predicate);
return new LastElement<E>().apply(filtered);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"findLast",
"(",
"Iterable",
"<",
"E",
">",
"iterable",
",",
"Predicate",
"<",
"E",
">",
"predicate",
")",
"{",
"dbc",
".",
"precondition",
"(",
"iterable",
"!=",
"null",
",",
"\"cannot searchLast with a null iterable\... | Searches the last matching element returning it.
@param <E> the element type parameter
@param iterable the iterable to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException if no element matches
@return the last element found | [
"Searches",
"the",
"last",
"matching",
"element",
"returning",
"it",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Searches.java#L612-L616 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/pom/PomHandler.java | PomHandler.startElement | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
"""
Handles the start element event.
@param uri the uri of the element being processed
@param localName the local name of the element being processed
@param qName the qName of the el... | java | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
currentText = new StringBuilder();
stack.push(qName);
if (LICENSE.equals(qName)) {
license = new License();
}
} | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"currentText",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"stack"... | Handles the start element event.
@param uri the uri of the element being processed
@param localName the local name of the element being processed
@param qName the qName of the element being processed
@param attributes the attributes of the element being processed
@throws SAXException thrown if there is an exception pr... | [
"Handles",
"the",
"start",
"element",
"event",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/pom/PomHandler.java#L114-L121 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingManager.java | CustomVisionTrainingManager.authenticate | public static TrainingApi authenticate(RestClient restClient, final String apiKey) {
"""
Initializes an instance of Custom Vision Training API client.
@param restClient the REST client to connect to Azure.
@param apiKey the Custom Vision Training API key
@return the Custom Vision Training API client
"""
... | java | public static TrainingApi authenticate(RestClient restClient, final String apiKey) {
return new TrainingApiImpl(restClient).withApiKey(apiKey);
} | [
"public",
"static",
"TrainingApi",
"authenticate",
"(",
"RestClient",
"restClient",
",",
"final",
"String",
"apiKey",
")",
"{",
"return",
"new",
"TrainingApiImpl",
"(",
"restClient",
")",
".",
"withApiKey",
"(",
"apiKey",
")",
";",
"}"
] | Initializes an instance of Custom Vision Training API client.
@param restClient the REST client to connect to Azure.
@param apiKey the Custom Vision Training API key
@return the Custom Vision Training API client | [
"Initializes",
"an",
"instance",
"of",
"Custom",
"Vision",
"Training",
"API",
"client",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/CustomVisionTrainingManager.java#L74-L76 |
cdapio/tigon | tigon-common/src/main/java/co/cask/tigon/io/BufferedEncoder.java | BufferedEncoder.writeRaw | public Encoder writeRaw(byte[] rawBytes, int off, int len) throws IOException {
"""
Writes raw bytes to the buffer without encoding.
@param rawBytes The bytes to write.
@param off Offset to start in the byte array.
@param len Number of bytes to write starting from the offset.
"""
output.write(rawBytes... | java | public Encoder writeRaw(byte[] rawBytes, int off, int len) throws IOException {
output.write(rawBytes, off, len);
return this;
} | [
"public",
"Encoder",
"writeRaw",
"(",
"byte",
"[",
"]",
"rawBytes",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"output",
".",
"write",
"(",
"rawBytes",
",",
"off",
",",
"len",
")",
";",
"return",
"this",
";",
"}"
] | Writes raw bytes to the buffer without encoding.
@param rawBytes The bytes to write.
@param off Offset to start in the byte array.
@param len Number of bytes to write starting from the offset. | [
"Writes",
"raw",
"bytes",
"to",
"the",
"buffer",
"without",
"encoding",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-common/src/main/java/co/cask/tigon/io/BufferedEncoder.java#L74-L77 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/DeploymentOperations.java | DeploymentOperations.addReplaceOperationSteps | static void addReplaceOperationSteps(final CompositeOperationBuilder builder, final Deployment deployment) {
"""
Adds a {@code full-replace-deployment} step for the deployment.
@param builder the builder to add the step to
@param deployment the deployment used to replace the existing deployment
"""
... | java | static void addReplaceOperationSteps(final CompositeOperationBuilder builder, final Deployment deployment) {
final String name = deployment.getName();
final String runtimeName = deployment.getRuntimeName();
final ModelNode op = createOperation(DEPLOYMENT_FULL_REPLACE_OPERATION);
op.get(N... | [
"static",
"void",
"addReplaceOperationSteps",
"(",
"final",
"CompositeOperationBuilder",
"builder",
",",
"final",
"Deployment",
"deployment",
")",
"{",
"final",
"String",
"name",
"=",
"deployment",
".",
"getName",
"(",
")",
";",
"final",
"String",
"runtimeName",
"... | Adds a {@code full-replace-deployment} step for the deployment.
@param builder the builder to add the step to
@param deployment the deployment used to replace the existing deployment | [
"Adds",
"a",
"{",
"@code",
"full",
"-",
"replace",
"-",
"deployment",
"}",
"step",
"for",
"the",
"deployment",
"."
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/DeploymentOperations.java#L403-L414 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.productUpdateUrl | public JSONObject productUpdateUrl(String url, HashMap<String, String> options) {
"""
商品检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、class_id1/class_id2)**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型... | java | public JSONObject productUpdateUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearchC... | [
"public",
"JSONObject",
"productUpdateUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
... | 商品检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、class_id1/class_id2)**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
brief 更新的摘要信息,最长256B。样例:{"name":"周杰伦", "id":"666"}
class_id1 更新的商品分类1,支持1... | [
"商品检索—更新接口",
"**",
"更新图库中图片的摘要和分类信息(具体变量为brief、class_id1",
"/",
"class_id2)",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L893-L904 |
tvesalainen/util | util/src/main/java/org/vesalainen/ui/AbstractView.java | AbstractView.setRect | public final void setRect(double xMin, double xMax, double yMin, double yMax) {
"""
Sets the visible rectangle of translated coordinates.
@param xMin
@param xMax
@param yMin
@param yMax
"""
setRect(new Rectangle2D.Double(xMin, yMin, xMax-xMin, yMax-yMin));
} | java | public final void setRect(double xMin, double xMax, double yMin, double yMax)
{
setRect(new Rectangle2D.Double(xMin, yMin, xMax-xMin, yMax-yMin));
} | [
"public",
"final",
"void",
"setRect",
"(",
"double",
"xMin",
",",
"double",
"xMax",
",",
"double",
"yMin",
",",
"double",
"yMax",
")",
"{",
"setRect",
"(",
"new",
"Rectangle2D",
".",
"Double",
"(",
"xMin",
",",
"yMin",
",",
"xMax",
"-",
"xMin",
",",
... | Sets the visible rectangle of translated coordinates.
@param xMin
@param xMax
@param yMin
@param yMax | [
"Sets",
"the",
"visible",
"rectangle",
"of",
"translated",
"coordinates",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/AbstractView.java#L169-L172 |
daimajia/AndroidImageSlider | library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java | PagerIndicator.setIndicatorStyleResource | public void setIndicatorStyleResource(int selected, int unselected) {
"""
Set Indicator style.
@param selected page selected drawable
@param unselected page unselected drawable
"""
mUserSetSelectedIndicatorResId = selected;
mUserSetUnSelectedIndicatorResId = unselected;
if(selected ==... | java | public void setIndicatorStyleResource(int selected, int unselected){
mUserSetSelectedIndicatorResId = selected;
mUserSetUnSelectedIndicatorResId = unselected;
if(selected == 0){
mSelectedDrawable = mSelectedLayerDrawable;
}else{
mSelectedDrawable = mContext.getRes... | [
"public",
"void",
"setIndicatorStyleResource",
"(",
"int",
"selected",
",",
"int",
"unselected",
")",
"{",
"mUserSetSelectedIndicatorResId",
"=",
"selected",
";",
"mUserSetUnSelectedIndicatorResId",
"=",
"unselected",
";",
"if",
"(",
"selected",
"==",
"0",
")",
"{",... | Set Indicator style.
@param selected page selected drawable
@param unselected page unselected drawable | [
"Set",
"Indicator",
"style",
"."
] | train | https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java#L216-L231 |
apache/incubator-heron | heron/common/src/java/org/apache/heron/common/basics/NIOLooper.java | NIOLooper.registerRead | public void registerRead(SelectableChannel channel, ISelectHandler callback)
throws ClosedChannelException {
"""
Followings are the register, unregister, isRegister for different operations for the selector and channel
"""
assert channel.keyFor(selector) == null
|| (channel.keyFor(selector).i... | java | public void registerRead(SelectableChannel channel, ISelectHandler callback)
throws ClosedChannelException {
assert channel.keyFor(selector) == null
|| (channel.keyFor(selector).interestOps() & SelectionKey.OP_CONNECT) == 0;
addInterest(channel, SelectionKey.OP_READ, callback);
} | [
"public",
"void",
"registerRead",
"(",
"SelectableChannel",
"channel",
",",
"ISelectHandler",
"callback",
")",
"throws",
"ClosedChannelException",
"{",
"assert",
"channel",
".",
"keyFor",
"(",
"selector",
")",
"==",
"null",
"||",
"(",
"channel",
".",
"keyFor",
"... | Followings are the register, unregister, isRegister for different operations for the selector and channel | [
"Followings",
"are",
"the",
"register",
"unregister",
"isRegister",
"for",
"different",
"operations",
"for",
"the",
"selector",
"and",
"channel"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/common/src/java/org/apache/heron/common/basics/NIOLooper.java#L138-L143 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.createProject | public Project createProject(Integer groupId, String projectName) throws GitLabApiException {
"""
Create a new project in the specified group.
@param groupId the group ID to create the project under
@param projectName the name of the project top create
@return the created project
@throws GitLabApiException i... | java | public Project createProject(Integer groupId, String projectName) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm().withParam("namespace_id", groupId).withParam("name", projectName, true);
Response response = post(Response.Status.CREATED, formData, "projects");
return (res... | [
"public",
"Project",
"createProject",
"(",
"Integer",
"groupId",
",",
"String",
"projectName",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"namespace_id\"",
",",
"groupId",
... | Create a new project in the specified group.
@param groupId the group ID to create the project under
@param projectName the name of the project top create
@return the created project
@throws GitLabApiException if any exception occurs | [
"Create",
"a",
"new",
"project",
"in",
"the",
"specified",
"group",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L714-L718 |
atomix/copycat | client/src/main/java/io/atomix/copycat/client/session/ClientSequencer.java | ClientSequencer.sequenceEvent | public void sequenceEvent(PublishRequest request, Runnable callback) {
"""
Sequences an event.
<p>
This method relies on the session event protocol to ensure that events are applied in sequential order.
When an event is received, if no operations are outstanding, the event is immediately completed since
the ev... | java | public void sequenceEvent(PublishRequest request, Runnable callback) {
if (requestSequence == responseSequence) {
LOGGER.trace("{} - Completing {}", state.getSessionId(), request);
callback.run();
eventIndex = request.eventIndex();
} else {
eventCallbacks.add(new EventCallback(request, c... | [
"public",
"void",
"sequenceEvent",
"(",
"PublishRequest",
"request",
",",
"Runnable",
"callback",
")",
"{",
"if",
"(",
"requestSequence",
"==",
"responseSequence",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"{} - Completing {}\"",
",",
"state",
".",
"getSessionId",
... | Sequences an event.
<p>
This method relies on the session event protocol to ensure that events are applied in sequential order.
When an event is received, if no operations are outstanding, the event is immediately completed since
the event could not have occurred concurrently with any other operation. Otherwise, the ev... | [
"Sequences",
"an",
"event",
".",
"<p",
">",
"This",
"method",
"relies",
"on",
"the",
"session",
"event",
"protocol",
"to",
"ensure",
"that",
"events",
"are",
"applied",
"in",
"sequential",
"order",
".",
"When",
"an",
"event",
"is",
"received",
"if",
"no",
... | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/client/src/main/java/io/atomix/copycat/client/session/ClientSequencer.java#L92-L101 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java | LabsInner.beginDelete | public void beginDelete(String resourceGroupName, String labAccountName, String labName) {
"""
Delete lab. This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@throws Illeg... | java | public void beginDelete(String resourceGroupName, String labAccountName, String labName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, labAccountName, labName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"labAccountName",
",",
"labName",
")",
".",
"toBlocking",
"(... | Delete lab. This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request... | [
"Delete",
"lab",
".",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java#L740-L742 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.setListAttribute | public Jar setListAttribute(String name, Collection<?> values) {
"""
Sets an attribute in the main section of the manifest to a list.
The list elements will be joined with a single whitespace character.
@param name the attribute's name
@param values the attribute's value
@return {@code this}
@throws Illeg... | java | public Jar setListAttribute(String name, Collection<?> values) {
return setAttribute(name, join(values));
} | [
"public",
"Jar",
"setListAttribute",
"(",
"String",
"name",
",",
"Collection",
"<",
"?",
">",
"values",
")",
"{",
"return",
"setAttribute",
"(",
"name",
",",
"join",
"(",
"values",
")",
")",
";",
"}"
] | Sets an attribute in the main section of the manifest to a list.
The list elements will be joined with a single whitespace character.
@param name the attribute's name
@param values the attribute's value
@return {@code this}
@throws IllegalStateException if entries have been added or the JAR has been written prior to... | [
"Sets",
"an",
"attribute",
"in",
"the",
"main",
"section",
"of",
"the",
"manifest",
"to",
"a",
"list",
".",
"The",
"list",
"elements",
"will",
"be",
"joined",
"with",
"a",
"single",
"whitespace",
"character",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L174-L176 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java | Configuration.setStrings | public void setStrings(String name, String... values) {
"""
Set the array of string values for the <code>name</code> property as
as comma delimited values.
@param name property name.
@param values The values
"""
set(name, StringUtils.join(values, ","));
} | java | public void setStrings(String name, String... values) {
set(name, StringUtils.join(values, ","));
} | [
"public",
"void",
"setStrings",
"(",
"String",
"name",
",",
"String",
"...",
"values",
")",
"{",
"set",
"(",
"name",
",",
"StringUtils",
".",
"join",
"(",
"values",
",",
"\",\"",
")",
")",
";",
"}"
] | Set the array of string values for the <code>name</code> property as
as comma delimited values.
@param name property name.
@param values The values | [
"Set",
"the",
"array",
"of",
"string",
"values",
"for",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"as",
"comma",
"delimited",
"values",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/conf/Configuration.java#L868-L870 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/SavedState.java | SavedState.getNumber | public double getNumber(String nameOfField, double defaultValue) {
"""
Get number stored at given location
@param nameOfField The name of the number to retrieve
@param defaultValue The value to return if the specified value hasn't been set
@return The number saved at this location
"""
Double value = ((... | java | public double getNumber(String nameOfField, double defaultValue) {
Double value = ((Double)numericData.get(nameOfField));
if (value == null) {
return defaultValue;
}
return value.doubleValue();
} | [
"public",
"double",
"getNumber",
"(",
"String",
"nameOfField",
",",
"double",
"defaultValue",
")",
"{",
"Double",
"value",
"=",
"(",
"(",
"Double",
")",
"numericData",
".",
"get",
"(",
"nameOfField",
")",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
... | Get number stored at given location
@param nameOfField The name of the number to retrieve
@param defaultValue The value to return if the specified value hasn't been set
@return The number saved at this location | [
"Get",
"number",
"stored",
"at",
"given",
"location"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/SavedState.java#L72-L80 |
jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/user/screen/UserPasswordChange.java | UserPasswordChange.addToolbars | public ToolScreen addToolbars() {
"""
Add the toolbars that belong with this screen.
@return The new toolbar.
"""
ToolScreen screen = new ToolScreen(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);
new SCannedBox(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConst... | java | public ToolScreen addToolbars()
{
ToolScreen screen = new ToolScreen(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);
new SCannedBox(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), screen, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.SUBMIT)... | [
"public",
"ToolScreen",
"addToolbars",
"(",
")",
"{",
"ToolScreen",
"screen",
"=",
"new",
"ToolScreen",
"(",
"null",
",",
"this",
",",
"null",
",",
"ScreenConstants",
".",
"DONT_DISPLAY_FIELD_DESC",
",",
"null",
")",
";",
"new",
"SCannedBox",
"(",
"screen",
... | Add the toolbars that belong with this screen.
@return The new toolbar. | [
"Add",
"the",
"toolbars",
"that",
"belong",
"with",
"this",
"screen",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/user/screen/UserPasswordChange.java#L78-L86 |
structr/structr | structr-ui/src/main/java/org/structr/websocket/command/AbstractCommand.java | AbstractCommand.getGraphObject | public GraphObject getGraphObject(final String id, final String nodeId) {
"""
Returns the graph object with the given id.
If no node with the given id is found and nodeId is not null,
this method will search for a relationship in the list of relationships
of the node with the given nodeId.
@param id
@para... | java | public GraphObject getGraphObject(final String id, final String nodeId) {
if (isValidUuid(id)) {
final AbstractNode node = getNode(id);
if (node != null) {
return node;
} else {
if (nodeId == null) {
logger.warn("Relationship access by UUID is deprecated and not supported by Neo4j, this can... | [
"public",
"GraphObject",
"getGraphObject",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"nodeId",
")",
"{",
"if",
"(",
"isValidUuid",
"(",
"id",
")",
")",
"{",
"final",
"AbstractNode",
"node",
"=",
"getNode",
"(",
"id",
")",
";",
"if",
"(",
"n... | Returns the graph object with the given id.
If no node with the given id is found and nodeId is not null,
this method will search for a relationship in the list of relationships
of the node with the given nodeId.
@param id
@param nodeId
@return the graph object | [
"Returns",
"the",
"graph",
"object",
"with",
"the",
"given",
"id",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/websocket/command/AbstractCommand.java#L125-L153 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/GuestWindowsRegistryManager.java | GuestWindowsRegistryManager.createRegistryKeyInGuest | public void createRegistryKeyInGuest(VirtualMachine vm, GuestAuthentication auth, GuestRegKeyNameSpec keyName, boolean isVolatile, String classType) throws GuestComponentsOutOfDate, GuestOperationsFault, GuestOperationsUnavailable,
GuestPermissionDenied, GuestRegistryKeyAlreadyExists, GuestRegistryKeyInvalid, G... | java | public void createRegistryKeyInGuest(VirtualMachine vm, GuestAuthentication auth, GuestRegKeyNameSpec keyName, boolean isVolatile, String classType) throws GuestComponentsOutOfDate, GuestOperationsFault, GuestOperationsUnavailable,
GuestPermissionDenied, GuestRegistryKeyAlreadyExists, GuestRegistryKeyInvalid, G... | [
"public",
"void",
"createRegistryKeyInGuest",
"(",
"VirtualMachine",
"vm",
",",
"GuestAuthentication",
"auth",
",",
"GuestRegKeyNameSpec",
"keyName",
",",
"boolean",
"isVolatile",
",",
"String",
"classType",
")",
"throws",
"GuestComponentsOutOfDate",
",",
"GuestOperations... | Create a registry key.
@param vm Virtual machine to perform the operation on.
@param auth The guest authentication data.
@param keyName The path to the registry key to be created.
@param isVolatile If true, the key is created in memory and is not preserved across system reboot. Otherwise, it shall per... | [
"Create",
"a",
"registry",
"key",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/GuestWindowsRegistryManager.java#L60-L63 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java | Drawable.loadSpriteParallaxed | public static SpriteParallaxed loadSpriteParallaxed(Media media, int linesNumber, int startWidth, int startHeight) {
"""
Load a parallaxed sprite, for parallax effect.
<p>
Once created, sprite must call {@link SpriteParallaxed#load(boolean)} before any other operations.
</p>
@param media The sprite media (mu... | java | public static SpriteParallaxed loadSpriteParallaxed(Media media, int linesNumber, int startWidth, int startHeight)
{
return new SpriteParallaxedImpl(getMediaDpi(media), linesNumber, startWidth, startHeight);
} | [
"public",
"static",
"SpriteParallaxed",
"loadSpriteParallaxed",
"(",
"Media",
"media",
",",
"int",
"linesNumber",
",",
"int",
"startWidth",
",",
"int",
"startHeight",
")",
"{",
"return",
"new",
"SpriteParallaxedImpl",
"(",
"getMediaDpi",
"(",
"media",
")",
",",
... | Load a parallaxed sprite, for parallax effect.
<p>
Once created, sprite must call {@link SpriteParallaxed#load(boolean)} before any other operations.
</p>
@param media The sprite media (must not be <code>null</code>).
@param linesNumber The number of parallax lines.
@param startWidth The starting width percent (100 is... | [
"Load",
"a",
"parallaxed",
"sprite",
"for",
"parallax",
"effect",
".",
"<p",
">",
"Once",
"created",
"sprite",
"must",
"call",
"{",
"@link",
"SpriteParallaxed#load",
"(",
"boolean",
")",
"}",
"before",
"any",
"other",
"operations",
".",
"<",
"/",
"p",
">"
... | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java#L250-L253 |
selendroid/selendroid | selendroid-server-common/src/main/java/io/selendroid/server/common/SelendroidResponse.java | SelendroidResponse.forCatchAllError | public static SelendroidResponse forCatchAllError(String sessionId, Throwable e) {
"""
It is currently hard to detect whether a test failed because of a legitimate
error by a developer or because something is going wrong in selendroid
internals. This response marks error responses from the server that indicate
... | java | public static SelendroidResponse forCatchAllError(String sessionId, Throwable e) {
try {
return new SelendroidResponse(sessionId, StatusCode.UNKNOWN_ERROR.getCode(), e, CATCH_ALL_ERROR_MESSAGE_PREFIX);
} catch (JSONException err) {
return new SelendroidResponse(sessionId, StatusCode.UNKNOWN_ERROR.ge... | [
"public",
"static",
"SelendroidResponse",
"forCatchAllError",
"(",
"String",
"sessionId",
",",
"Throwable",
"e",
")",
"{",
"try",
"{",
"return",
"new",
"SelendroidResponse",
"(",
"sessionId",
",",
"StatusCode",
".",
"UNKNOWN_ERROR",
".",
"getCode",
"(",
")",
","... | It is currently hard to detect whether a test failed because of a legitimate
error by a developer or because something is going wrong in selendroid
internals. This response marks error responses from the server that indicate
something has gone wrong in the internals of selendroid. | [
"It",
"is",
"currently",
"hard",
"to",
"detect",
"whether",
"a",
"test",
"failed",
"because",
"of",
"a",
"legitimate",
"error",
"by",
"a",
"developer",
"or",
"because",
"something",
"is",
"going",
"wrong",
"in",
"selendroid",
"internals",
".",
"This",
"respo... | train | https://github.com/selendroid/selendroid/blob/a32c1a96c973b80c14a588b1075f084201f7fe94/selendroid-server-common/src/main/java/io/selendroid/server/common/SelendroidResponse.java#L76-L82 |
Jasig/uPortal | uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java | UpdatePreferencesServlet.removeElement | @RequestMapping(method = RequestMethod.POST, params = "action=removeElement")
public ModelAndView removeElement(HttpServletRequest request, HttpServletResponse response)
throws IOException {
"""
Remove an element from the layout.
@param request
@param response
@return
@throws IOException
... | java | @RequestMapping(method = RequestMethod.POST, params = "action=removeElement")
public ModelAndView removeElement(HttpServletRequest request, HttpServletResponse response)
throws IOException {
IUserInstance ui = userInstanceManager.getUserInstance(request);
IPerson per = getPerson(ui, res... | [
"@",
"RequestMapping",
"(",
"method",
"=",
"RequestMethod",
".",
"POST",
",",
"params",
"=",
"\"action=removeElement\"",
")",
"public",
"ModelAndView",
"removeElement",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOExc... | Remove an element from the layout.
@param request
@param response
@return
@throws IOException | [
"Remove",
"an",
"element",
"from",
"the",
"layout",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java#L167-L205 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserTrk.java | AbstractGpxParserTrk.initialise | public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
"""
Create a new specific parser. It has in memory the default parser, the
contentBuffer, the elementNames, the currentLine and the trkID.
@param reader The XMLReader used in the default class
@param parent The parser used in the defa... | java | public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
setReader(reader);
setParent(parent);
setContentBuffer(parent.getContentBuffer());
setTrkPreparedStmt(parent.getTrkPreparedStmt());
setTrkSegmentsPreparedStmt(parent.getTrkSegmentsPreparedStmt());
... | [
"public",
"void",
"initialise",
"(",
"XMLReader",
"reader",
",",
"AbstractGpxParserDefault",
"parent",
")",
"{",
"setReader",
"(",
"reader",
")",
";",
"setParent",
"(",
"parent",
")",
";",
"setContentBuffer",
"(",
"parent",
".",
"getContentBuffer",
"(",
")",
"... | Create a new specific parser. It has in memory the default parser, the
contentBuffer, the elementNames, the currentLine and the trkID.
@param reader The XMLReader used in the default class
@param parent The parser used in the default class | [
"Create",
"a",
"new",
"specific",
"parser",
".",
"It",
"has",
"in",
"memory",
"the",
"default",
"parser",
"the",
"contentBuffer",
"the",
"elementNames",
"the",
"currentLine",
"and",
"the",
"trkID",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserTrk.java#L66-L77 |
real-logic/agrona | agrona/src/main/java/org/agrona/PrintBufferUtil.java | PrintBufferUtil.hexDump | public static String hexDump(final byte[] array, final int fromIndex, final int length) {
"""
Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a>
of the specified byte array's sub-region.
@param array dumped array
@param fromIndex where should we start to print
@param length how muc... | java | public static String hexDump(final byte[] array, final int fromIndex, final int length)
{
return HexUtil.hexDump(array, fromIndex, length);
} | [
"public",
"static",
"String",
"hexDump",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"fromIndex",
",",
"final",
"int",
"length",
")",
"{",
"return",
"HexUtil",
".",
"hexDump",
"(",
"array",
",",
"fromIndex",
",",
"length",
")",
";",
"... | Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a>
of the specified byte array's sub-region.
@param array dumped array
@param fromIndex where should we start to print
@param length how much should we print
@return hex dump in a string representation | [
"Returns",
"a",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Hex_dump",
">",
"hex",
"dump<",
"/",
"a",
">",
"of",
"the",
"specified",
"byte",
"array",
"s",
"sub",
"-",
"region",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/PrintBufferUtil.java#L98-L101 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveUtils.java | HiveUtils.getPartitions | public static List<Partition> getPartitions(IMetaStoreClient client, Table table,
Optional<String> filter, Optional<? extends HivePartitionExtendedFilter> hivePartitionExtendedFilterOptional)
throws IOException {
"""
Get a list of {@link Partition}s for the <code>table</code> that matches an optional <... | java | public static List<Partition> getPartitions(IMetaStoreClient client, Table table,
Optional<String> filter, Optional<? extends HivePartitionExtendedFilter> hivePartitionExtendedFilterOptional)
throws IOException {
try {
List<Partition> partitions = Lists.newArrayList();
List<org.apache.hadoop... | [
"public",
"static",
"List",
"<",
"Partition",
">",
"getPartitions",
"(",
"IMetaStoreClient",
"client",
",",
"Table",
"table",
",",
"Optional",
"<",
"String",
">",
"filter",
",",
"Optional",
"<",
"?",
"extends",
"HivePartitionExtendedFilter",
">",
"hivePartitionExt... | Get a list of {@link Partition}s for the <code>table</code> that matches an optional <code>filter</code>
@param client an {@link IMetaStoreClient} for the correct metastore.
@param table the {@link Table} for which we should get partitions.
@param filter an optional filter for partitions as would be used in Hive. Can ... | [
"Get",
"a",
"list",
"of",
"{",
"@link",
"Partition",
"}",
"s",
"for",
"the",
"<code",
">",
"table<",
"/",
"code",
">",
"that",
"matches",
"an",
"optional",
"<code",
">",
"filter<",
"/",
"code",
">"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveUtils.java#L87-L106 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/MethodUtils.java | MethodUtils.invokeGetter | public static Object invokeGetter(Object object, String getterName)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
"""
Gets an Object property from a bean.
@param object the bean
@param getterName the property name or getter method name
@return the property value... | java | public static Object invokeGetter(Object object, String getterName)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
return invokeMethod(object, getterName);
} | [
"public",
"static",
"Object",
"invokeGetter",
"(",
"Object",
"object",
",",
"String",
"getterName",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"return",
"invokeMethod",
"(",
"object",
",",
"getterName",
... | Gets an Object property from a bean.
@param object the bean
@param getterName the property name or getter method name
@return the property value (as an Object)
@throws NoSuchMethodException the no such method exception
@throws IllegalAccessException the illegal access exception
@throws InvocationTargetException the in... | [
"Gets",
"an",
"Object",
"property",
"from",
"a",
"bean",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/MethodUtils.java#L94-L97 |
biezhi/webp-io | src/main/java/io/github/biezhi/webp/WebpIO.java | WebpIO.toWEBP | public void toWEBP(String src, String dest) {
"""
Convert normal image to webp file
@param src nomal image path
@param dest webp file path
"""
toWEBP(new File(src), new File(dest));
} | java | public void toWEBP(String src, String dest) {
toWEBP(new File(src), new File(dest));
} | [
"public",
"void",
"toWEBP",
"(",
"String",
"src",
",",
"String",
"dest",
")",
"{",
"toWEBP",
"(",
"new",
"File",
"(",
"src",
")",
",",
"new",
"File",
"(",
"dest",
")",
")",
";",
"}"
] | Convert normal image to webp file
@param src nomal image path
@param dest webp file path | [
"Convert",
"normal",
"image",
"to",
"webp",
"file"
] | train | https://github.com/biezhi/webp-io/blob/8eefe535087b3abccacff76de2b6e27bb7301bcc/src/main/java/io/github/biezhi/webp/WebpIO.java#L97-L99 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.createCertificateAsync | public Observable<CertificateOperation> createCertificateAsync(String vaultBaseUrl, String certificateName) {
"""
Creates a new certificate.
If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.
@param vaultBaseUrl The vault name, for exa... | java | public Observable<CertificateOperation> createCertificateAsync(String vaultBaseUrl, String certificateName) {
return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<CertificateOperation>, CertificateOperation>() {
@Override
public Ce... | [
"public",
"Observable",
"<",
"CertificateOperation",
">",
"createCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"createCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
".",
"ma... | Creates a new certificate.
If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate.
@throws IllegalArgumentException... | [
"Creates",
"a",
"new",
"certificate",
".",
"If",
"this",
"is",
"the",
"first",
"version",
"the",
"certificate",
"resource",
"is",
"created",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"create",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6515-L6522 |
molgenis/molgenis | molgenis-ontology-core/src/main/java/org/molgenis/ontology/core/repository/OntologyTermRepository.java | OntologyTermRepository.calculateNodePathDistance | public int calculateNodePathDistance(String nodePath1, String nodePath2) {
"""
Calculate the distance between nodePaths, e.g. 0[0].1[1].2[2], 0[0].2[1].2[2]. The distance is
the non-overlap part of the strings
@return distance
"""
String[] nodePathFragment1 = nodePath1.split("\\.");
String[] nodePa... | java | public int calculateNodePathDistance(String nodePath1, String nodePath2) {
String[] nodePathFragment1 = nodePath1.split("\\.");
String[] nodePathFragment2 = nodePath2.split("\\.");
int overlapBlock = 0;
while (overlapBlock < nodePathFragment1.length
&& overlapBlock < nodePathFragment2.length
... | [
"public",
"int",
"calculateNodePathDistance",
"(",
"String",
"nodePath1",
",",
"String",
"nodePath2",
")",
"{",
"String",
"[",
"]",
"nodePathFragment1",
"=",
"nodePath1",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"String",
"[",
"]",
"nodePathFragment2",
"=",
"... | Calculate the distance between nodePaths, e.g. 0[0].1[1].2[2], 0[0].2[1].2[2]. The distance is
the non-overlap part of the strings
@return distance | [
"Calculate",
"the",
"distance",
"between",
"nodePaths",
"e",
".",
"g",
".",
"0",
"[",
"0",
"]",
".",
"1",
"[",
"1",
"]",
".",
"2",
"[",
"2",
"]",
"0",
"[",
"0",
"]",
".",
"2",
"[",
"1",
"]",
".",
"2",
"[",
"2",
"]",
".",
"The",
"distance"... | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-ontology-core/src/main/java/org/molgenis/ontology/core/repository/OntologyTermRepository.java#L214-L226 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.accessories_GET | public ArrayList<OvhAccessoryOffer> accessories_GET(OvhNumberCountryEnum country) throws IOException {
"""
Get all available accessories
REST: GET /telephony/accessories
@param country [required] The country
"""
String qPath = "/telephony/accessories";
StringBuilder sb = path(qPath);
query(sb, "count... | java | public ArrayList<OvhAccessoryOffer> accessories_GET(OvhNumberCountryEnum country) throws IOException {
String qPath = "/telephony/accessories";
StringBuilder sb = path(qPath);
query(sb, "country", country);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t19);
} | [
"public",
"ArrayList",
"<",
"OvhAccessoryOffer",
">",
"accessories_GET",
"(",
"OvhNumberCountryEnum",
"country",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/accessories\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",... | Get all available accessories
REST: GET /telephony/accessories
@param country [required] The country | [
"Get",
"all",
"available",
"accessories"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8513-L8519 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckJSDoc.java | CheckJSDoc.validateNoCollapse | private void validateNoCollapse(Node n, JSDocInfo info) {
"""
Warns when nocollapse annotations are present on nodes
which are not eligible for property collapsing.
"""
if (n.isFromExterns()) {
if (info != null && info.isNoCollapse()) {
// @nocollapse has no effect in externs
reportM... | java | private void validateNoCollapse(Node n, JSDocInfo info) {
if (n.isFromExterns()) {
if (info != null && info.isNoCollapse()) {
// @nocollapse has no effect in externs
reportMisplaced(n, "nocollapse", "This JSDoc has no effect in externs.");
}
return;
}
if (!NodeUtil.isProtot... | [
"private",
"void",
"validateNoCollapse",
"(",
"Node",
"n",
",",
"JSDocInfo",
"info",
")",
"{",
"if",
"(",
"n",
".",
"isFromExterns",
"(",
")",
")",
"{",
"if",
"(",
"info",
"!=",
"null",
"&&",
"info",
".",
"isNoCollapse",
"(",
")",
")",
"{",
"// @noco... | Warns when nocollapse annotations are present on nodes
which are not eligible for property collapsing. | [
"Warns",
"when",
"nocollapse",
"annotations",
"are",
"present",
"on",
"nodes",
"which",
"are",
"not",
"eligible",
"for",
"property",
"collapsing",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckJSDoc.java#L398-L413 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsTemplate.java | HalFormsTemplate.andProperty | public HalFormsTemplate andProperty(HalFormsProperty property) {
"""
Returns a new {@link HalFormsTemplate} with the given {@link HalFormsProperty} added.
@param property must not be {@literal null}.
@return
"""
Assert.notNull(property, "Property must not be null!");
List<HalFormsProperty> properties... | java | public HalFormsTemplate andProperty(HalFormsProperty property) {
Assert.notNull(property, "Property must not be null!");
List<HalFormsProperty> properties = new ArrayList<>(this.properties);
properties.add(property);
return new HalFormsTemplate(title, httpMethod, properties, contentTypes);
} | [
"public",
"HalFormsTemplate",
"andProperty",
"(",
"HalFormsProperty",
"property",
")",
"{",
"Assert",
".",
"notNull",
"(",
"property",
",",
"\"Property must not be null!\"",
")",
";",
"List",
"<",
"HalFormsProperty",
">",
"properties",
"=",
"new",
"ArrayList",
"<>",... | Returns a new {@link HalFormsTemplate} with the given {@link HalFormsProperty} added.
@param property must not be {@literal null}.
@return | [
"Returns",
"a",
"new",
"{",
"@link",
"HalFormsTemplate",
"}",
"with",
"the",
"given",
"{",
"@link",
"HalFormsProperty",
"}",
"added",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/mediatype/hal/forms/HalFormsTemplate.java#L83-L91 |
neoremind/fluent-validator | fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/FluentValidator.java | FluentValidator.on | public <T> FluentValidator on(T t, ValidatorChain chain) {
"""
在待验证对象<tt>t</tt>上,使用<tt>chain</tt>验证器链进行验证
@param t 待验证对象
@param chain 验证器链
@return FluentValidator
"""
Preconditions.checkNotNull(chain, "ValidatorChain should not be NULL");
final FluentValidator self = this;
if... | java | public <T> FluentValidator on(T t, ValidatorChain chain) {
Preconditions.checkNotNull(chain, "ValidatorChain should not be NULL");
final FluentValidator self = this;
if (CollectionUtil.isEmpty(chain.getValidators())) {
lastAddCount = 0;
} else {
for (Validator v :... | [
"public",
"<",
"T",
">",
"FluentValidator",
"on",
"(",
"T",
"t",
",",
"ValidatorChain",
"chain",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"chain",
",",
"\"ValidatorChain should not be NULL\"",
")",
";",
"final",
"FluentValidator",
"self",
"=",
"this"... | 在待验证对象<tt>t</tt>上,使用<tt>chain</tt>验证器链进行验证
@param t 待验证对象
@param chain 验证器链
@return FluentValidator | [
"在待验证对象<tt",
">",
"t<",
"/",
"tt",
">",
"上,使用<tt",
">",
"chain<",
"/",
"tt",
">",
"验证器链进行验证"
] | train | https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/FluentValidator.java#L364-L378 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.