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 |
|---|---|---|---|---|---|---|---|---|---|---|
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/QuerySnapshot.java | QuerySnapshot.withChanges | public static QuerySnapshot withChanges(
final Query query,
Timestamp readTime,
final DocumentSet documentSet,
final List<DocumentChange> documentChanges) {
"""
Creates a new QuerySnapshot representing a snapshot of a Query with changed documents.
"""
return new QuerySnapshot(query,... | java | public static QuerySnapshot withChanges(
final Query query,
Timestamp readTime,
final DocumentSet documentSet,
final List<DocumentChange> documentChanges) {
return new QuerySnapshot(query, readTime) {
volatile List<QueryDocumentSnapshot> documents;
@Nonnull
@Override
... | [
"public",
"static",
"QuerySnapshot",
"withChanges",
"(",
"final",
"Query",
"query",
",",
"Timestamp",
"readTime",
",",
"final",
"DocumentSet",
"documentSet",
",",
"final",
"List",
"<",
"DocumentChange",
">",
"documentChanges",
")",
"{",
"return",
"new",
"QuerySnap... | Creates a new QuerySnapshot representing a snapshot of a Query with changed documents. | [
"Creates",
"a",
"new",
"QuerySnapshot",
"representing",
"a",
"snapshot",
"of",
"a",
"Query",
"with",
"changed",
"documents",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/QuerySnapshot.java#L97-L149 |
kmi/iserve | iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/KnowledgeBaseManagerSparql.java | KnowledgeBaseManagerSparql.checkFetchingTasks | private boolean checkFetchingTasks(Map<URI, Future<Boolean>> concurrentTasks) {
"""
This method checks a set of fetching tasks that are pending to validate their adequate conclusion.
For each of the fetching tasks launched we will track the models that were not adequately loaded for ulterior
uploading.
@param... | java | private boolean checkFetchingTasks(Map<URI, Future<Boolean>> concurrentTasks) {
boolean result = true;
Boolean fetched;
for (URI modelUri : concurrentTasks.keySet()) {
Future<Boolean> f = concurrentTasks.get(modelUri);
try {
fetched = f.get();
... | [
"private",
"boolean",
"checkFetchingTasks",
"(",
"Map",
"<",
"URI",
",",
"Future",
"<",
"Boolean",
">",
">",
"concurrentTasks",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"Boolean",
"fetched",
";",
"for",
"(",
"URI",
"modelUri",
":",
"concurrentTasks",... | This method checks a set of fetching tasks that are pending to validate their adequate conclusion.
For each of the fetching tasks launched we will track the models that were not adequately loaded for ulterior
uploading.
@param concurrentTasks the Map with the models to fetch and the Future providing the state of the u... | [
"This",
"method",
"checks",
"a",
"set",
"of",
"fetching",
"tasks",
"that",
"are",
"pending",
"to",
"validate",
"their",
"adequate",
"conclusion",
".",
"For",
"each",
"of",
"the",
"fetching",
"tasks",
"launched",
"we",
"will",
"track",
"the",
"models",
"that"... | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/KnowledgeBaseManagerSparql.java#L241-L269 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java | DubiousSetOfCollections.isImplementationOf | private boolean isImplementationOf(JavaClass cls, JavaClass inf) {
"""
returns whether the class implements the interface
@param cls
the class
@param inf
the interface to check
@return if the class implements the interface
"""
try {
if (cls == null) {
return false;
... | java | private boolean isImplementationOf(JavaClass cls, JavaClass inf) {
try {
if (cls == null) {
return false;
}
if (cls.implementationOf(inf)) {
return true;
}
} catch (ClassNotFoundException cnfe) {
bugReporter.repo... | [
"private",
"boolean",
"isImplementationOf",
"(",
"JavaClass",
"cls",
",",
"JavaClass",
"inf",
")",
"{",
"try",
"{",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"cls",
".",
"implementationOf",
"(",
"inf",
")",
")",
... | returns whether the class implements the interface
@param cls
the class
@param inf
the interface to check
@return if the class implements the interface | [
"returns",
"whether",
"the",
"class",
"implements",
"the",
"interface"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousSetOfCollections.java#L177-L189 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java | SftpClient.chgrp | public void chgrp(String gid, String path) throws SftpStatusException,
SshException {
"""
<p>
Sets the group ID for the file or directory.
</p>
@param gid
the numeric group id for the new group
@param path
the path to the remote file/directory
@throws SftpStatusException
@throws SshException
"""... | java | public void chgrp(String gid, String path) throws SftpStatusException,
SshException {
String actual = resolveRemotePath(path);
SftpFileAttributes attrs = sftp.getAttributes(actual);
attrs.setGID(gid);
sftp.setAttributes(actual, attrs);
} | [
"public",
"void",
"chgrp",
"(",
"String",
"gid",
",",
"String",
"path",
")",
"throws",
"SftpStatusException",
",",
"SshException",
"{",
"String",
"actual",
"=",
"resolveRemotePath",
"(",
"path",
")",
";",
"SftpFileAttributes",
"attrs",
"=",
"sftp",
".",
"getAt... | <p>
Sets the group ID for the file or directory.
</p>
@param gid
the numeric group id for the new group
@param path
the path to the remote file/directory
@throws SftpStatusException
@throws SshException | [
"<p",
">",
"Sets",
"the",
"group",
"ID",
"for",
"the",
"file",
"or",
"directory",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L2024-L2032 |
brettwooldridge/HikariCP | src/main/java/com/zaxxer/hikari/pool/HikariPool.java | HikariPool.getConnection | public Connection getConnection(final long hardTimeout) throws SQLException {
"""
Get a connection from the pool, or timeout after the specified number of milliseconds.
@param hardTimeout the maximum time to wait for a connection from the pool
@return a java.sql.Connection instance
@throws SQLException thrown... | java | public Connection getConnection(final long hardTimeout) throws SQLException
{
suspendResumeLock.acquire();
final long startTime = currentTime();
try {
long timeout = hardTimeout;
do {
PoolEntry poolEntry = connectionBag.borrow(timeout, MILLISECONDS);
if (p... | [
"public",
"Connection",
"getConnection",
"(",
"final",
"long",
"hardTimeout",
")",
"throws",
"SQLException",
"{",
"suspendResumeLock",
".",
"acquire",
"(",
")",
";",
"final",
"long",
"startTime",
"=",
"currentTime",
"(",
")",
";",
"try",
"{",
"long",
"timeout"... | Get a connection from the pool, or timeout after the specified number of milliseconds.
@param hardTimeout the maximum time to wait for a connection from the pool
@return a java.sql.Connection instance
@throws SQLException thrown if a timeout occurs trying to obtain a connection | [
"Get",
"a",
"connection",
"from",
"the",
"pool",
"or",
"timeout",
"after",
"the",
"specified",
"number",
"of",
"milliseconds",
"."
] | train | https://github.com/brettwooldridge/HikariCP/blob/c509ec1a3f1e19769ee69323972f339cf098ff4b/src/main/java/com/zaxxer/hikari/pool/HikariPool.java#L171-L205 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpSubsystemChannel.java | SftpSubsystemChannel.createSymbolicLink | public void createSymbolicLink(String targetpath, String linkpath)
throws SftpStatusException, SshException {
"""
Create a symbolic link.
@param targetpath
the symbolic link to create
@param linkpath
the path to which the symbolic link points
@throws SshException
if the remote SFTP version is < 3 an exc... | java | public void createSymbolicLink(String targetpath, String linkpath)
throws SftpStatusException, SshException {
if (version < 3) {
throw new SftpStatusException(
SftpStatusException.SSH_FX_OP_UNSUPPORTED,
"Symbolic links are not supported by the server SFTP version "
+ String.valueOf(version));
... | [
"public",
"void",
"createSymbolicLink",
"(",
"String",
"targetpath",
",",
"String",
"linkpath",
")",
"throws",
"SftpStatusException",
",",
"SshException",
"{",
"if",
"(",
"version",
"<",
"3",
")",
"{",
"throw",
"new",
"SftpStatusException",
"(",
"SftpStatusExcepti... | Create a symbolic link.
@param targetpath
the symbolic link to create
@param linkpath
the path to which the symbolic link points
@throws SshException
if the remote SFTP version is < 3 an exception is thrown as
this feature is not supported by previous versions of the
protocol. | [
"Create",
"a",
"symbolic",
"link",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpSubsystemChannel.java#L1207-L1233 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Pixel.java | Pixel.setARGB_fromDouble | public Pixel setARGB_fromDouble(double a, double r, double g, double b) {
"""
Sets an ARGB value at the position currently referenced by this Pixel. <br>
Each channel value is assumed to be within [0.0 .. 1.0]. Channel values
outside these bounds will be clamped to them.
@param a normalized alpha
@param r norm... | java | public Pixel setARGB_fromDouble(double a, double r, double g, double b){
return setValue(Pixel.argb_fromNormalized(a, r, g, b));
} | [
"public",
"Pixel",
"setARGB_fromDouble",
"(",
"double",
"a",
",",
"double",
"r",
",",
"double",
"g",
",",
"double",
"b",
")",
"{",
"return",
"setValue",
"(",
"Pixel",
".",
"argb_fromNormalized",
"(",
"a",
",",
"r",
",",
"g",
",",
"b",
")",
")",
";",
... | Sets an ARGB value at the position currently referenced by this Pixel. <br>
Each channel value is assumed to be within [0.0 .. 1.0]. Channel values
outside these bounds will be clamped to them.
@param a normalized alpha
@param r normalized red
@param g normalized green
@param b normalized blue
@throws ArrayIndexOutOfBo... | [
"Sets",
"an",
"ARGB",
"value",
"at",
"the",
"position",
"currently",
"referenced",
"by",
"this",
"Pixel",
".",
"<br",
">",
"Each",
"channel",
"value",
"is",
"assumed",
"to",
"be",
"within",
"[",
"0",
".",
"0",
"..",
"1",
".",
"0",
"]",
".",
"Channel"... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Pixel.java#L406-L408 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/ServerSICoreConnectionListener.java | ServerSICoreConnectionListener.commsFailure | @Override
public void commsFailure(SICoreConnection conn, SIConnectionLostException e) {
"""
This is used to indicate a communication failure on the client. Seeing
as we are the only people who would ever generate this event for the client
if this gets invoked on the server then someone has done something no... | java | @Override
public void commsFailure(SICoreConnection conn, SIConnectionLostException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "commsFailure",
new Object[]
{
conn,
... | [
"@",
"Override",
"public",
"void",
"commsFailure",
"(",
"SICoreConnection",
"conn",
",",
"SIConnectionLostException",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
"... | This is used to indicate a communication failure on the client. Seeing
as we are the only people who would ever generate this event for the client
if this gets invoked on the server then someone has done something not bad,
not even wrong, but silly.
@param conn
@param e | [
"This",
"is",
"used",
"to",
"indicate",
"a",
"communication",
"failure",
"on",
"the",
"client",
".",
"Seeing",
"as",
"we",
"are",
"the",
"only",
"people",
"who",
"would",
"ever",
"generate",
"this",
"event",
"for",
"the",
"client",
"if",
"this",
"gets",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/ServerSICoreConnectionListener.java#L458-L478 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRJassimpAdapter.java | GVRJassimpAdapter.processMesh | private void processMesh(
GVRAssetLoader.AssetRequest assetRequest,
GVRSceneObject sceneObject,
int meshId) {
"""
Helper method to create a new {@link GVRSceneObject} with a given mesh
@param assetRequest
GVRAssetRequest containing the original request to load the model
@... | java | private void processMesh(
GVRAssetLoader.AssetRequest assetRequest,
GVRSceneObject sceneObject,
int meshId)
{
EnumSet<GVRImportSettings> settings = assetRequest.getImportSettings();
AiMesh aiMesh = mScene.getMeshes().get(meshId);
GVRMesh mesh = mMeshes[mes... | [
"private",
"void",
"processMesh",
"(",
"GVRAssetLoader",
".",
"AssetRequest",
"assetRequest",
",",
"GVRSceneObject",
"sceneObject",
",",
"int",
"meshId",
")",
"{",
"EnumSet",
"<",
"GVRImportSettings",
">",
"settings",
"=",
"assetRequest",
".",
"getImportSettings",
"... | Helper method to create a new {@link GVRSceneObject} with a given mesh
@param assetRequest
GVRAssetRequest containing the original request to load the model
@param sceneObject
The GVRSceneObject to process
@param meshId
The index of the assimp mesh in the AiScene mesh list | [
"Helper",
"method",
"to",
"create",
"a",
"new",
"{",
"@link",
"GVRSceneObject",
"}",
"with",
"a",
"given",
"mesh"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRJassimpAdapter.java#L1059-L1101 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/MapUtils.java | MapUtils.getFormat | private static String getFormat(Map<?, ?> map, int keyPrecision, int valuePrecision) {
"""
Returns a format-String that can be used to generate a String
representation of a map using the String.format method.
@param map
Map for which a String representation is desired
@param keyPrecision
Desired precision f... | java | private static String getFormat(Map<?, ?> map, int keyPrecision, int valuePrecision) {
StringBuilder builder = new StringBuilder();
builder.append('{');
int mappings = map.keySet().size();
int c = 0;
for (Object key : map.keySet()) {
c++;
builder.append(FormatUtils.getIndexedFormat(c, FormatUtils... | [
"private",
"static",
"String",
"getFormat",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"int",
"keyPrecision",
",",
"int",
"valuePrecision",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
... | Returns a format-String that can be used to generate a String
representation of a map using the String.format method.
@param map
Map for which a String representation is desired
@param keyPrecision
Desired precision for <code>Float</code> and
<code>Double</code> elements
@param valuePrecision
Desired precision for <co... | [
"Returns",
"a",
"format",
"-",
"String",
"that",
"can",
"be",
"used",
"to",
"generate",
"a",
"String",
"representation",
"of",
"a",
"map",
"using",
"the",
"String",
".",
"format",
"method",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/MapUtils.java#L70-L86 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_permute.java | DZcs_permute.cs_permute | public static DZcs cs_permute(DZcs A, int[] pinv, int[] q, boolean values) {
"""
Permutes a sparse matrix, C = PAQ.
@param A
m-by-n, column-compressed matrix
@param pinv
a permutation vector of length m
@param q
a permutation vector of length n
@param values
allocate pattern only if false, values and pat... | java | public static DZcs cs_permute(DZcs A, int[] pinv, int[] q, boolean values)
{
int t, j, k, nz = 0, m, n, Ap[], Ai[], Cp[], Ci[] ;
DZcsa Cx = new DZcsa(), Ax = new DZcsa() ;
DZcs C ;
if (!CS_CSC(A)) return (null); /* check inputs */
m = A.m ; n = A.n ; Ap = A.p ; Ai = A.i ; Ax.x = A.x ;
C = cs_spallo... | [
"public",
"static",
"DZcs",
"cs_permute",
"(",
"DZcs",
"A",
",",
"int",
"[",
"]",
"pinv",
",",
"int",
"[",
"]",
"q",
",",
"boolean",
"values",
")",
"{",
"int",
"t",
",",
"j",
",",
"k",
",",
"nz",
"=",
"0",
",",
"m",
",",
"n",
",",
"Ap",
"["... | Permutes a sparse matrix, C = PAQ.
@param A
m-by-n, column-compressed matrix
@param pinv
a permutation vector of length m
@param q
a permutation vector of length n
@param values
allocate pattern only if false, values and pattern otherwise
@return C = PAQ, null on error | [
"Permutes",
"a",
"sparse",
"matrix",
"C",
"=",
"PAQ",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_permute.java#L55-L77 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateRouteResponseRequest.java | UpdateRouteResponseRequest.withResponseModels | public UpdateRouteResponseRequest withResponseModels(java.util.Map<String, String> responseModels) {
"""
<p>
The response models for the route response.
</p>
@param responseModels
The response models for the route response.
@return Returns a reference to this object so that method calls can be chained toget... | java | public UpdateRouteResponseRequest withResponseModels(java.util.Map<String, String> responseModels) {
setResponseModels(responseModels);
return this;
} | [
"public",
"UpdateRouteResponseRequest",
"withResponseModels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseModels",
")",
"{",
"setResponseModels",
"(",
"responseModels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The response models for the route response.
</p>
@param responseModels
The response models for the route response.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"response",
"models",
"for",
"the",
"route",
"response",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateRouteResponseRequest.java#L181-L184 |
belaban/JGroups | src/org/jgroups/util/BlockingInputStream.java | BlockingInputStream.sanityCheck | protected static void sanityCheck(byte[] buf, int offset, int length) {
"""
Verifies that length doesn't exceed a buffer's length
@param buf
@param offset
@param length
"""
if(buf == null) throw new NullPointerException("buffer is null");
if(offset + length > buf.length)
throw ne... | java | protected static void sanityCheck(byte[] buf, int offset, int length) {
if(buf == null) throw new NullPointerException("buffer is null");
if(offset + length > buf.length)
throw new ArrayIndexOutOfBoundsException("length (" + length + ") + offset (" + offset +
... | [
"protected",
"static",
"void",
"sanityCheck",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"buf",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"buffer is null\"",
")",
";",
"if",
"(",... | Verifies that length doesn't exceed a buffer's length
@param buf
@param offset
@param length | [
"Verifies",
"that",
"length",
"doesn",
"t",
"exceed",
"a",
"buffer",
"s",
"length"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/BlockingInputStream.java#L260-L265 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addHumanRequestorActiveParticipant | @Deprecated
public void addHumanRequestorActiveParticipant(String userId, String altUserId, String userName, CodedValueType role) {
"""
Adds an Active Participant block representing the human requestor participant
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate... | java | @Deprecated
public void addHumanRequestorActiveParticipant(String userId, String altUserId, String userName, CodedValueType role)
{
addActiveParticipant(
userId,
altUserId,
userName,
true,
Collections.singletonList(role),
null);
} | [
"@",
"Deprecated",
"public",
"void",
"addHumanRequestorActiveParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"CodedValueType",
"role",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
"userNam... | Adds an Active Participant block representing the human requestor participant
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param role The participant's role | [
"Adds",
"an",
"Active",
"Participant",
"block",
"representing",
"the",
"human",
"requestor",
"participant"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L151-L161 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.ensureLeft | public static String ensureLeft(final String value, final String prefix, final boolean caseSensitive) {
"""
Ensures that the value begins with prefix. If it doesn't exist, it's prepended.
@param value input
@param prefix prefix
@param caseSensitive true or false
@return string with prefix if i... | java | public static String ensureLeft(final String value, final String prefix, final boolean caseSensitive) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
if (caseSensitive) {
return value.startsWith(prefix) ? value : prefix + value;
}
String _value = value.toL... | [
"public",
"static",
"String",
"ensureLeft",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"prefix",
",",
"final",
"boolean",
"caseSensitive",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")",
";",
... | Ensures that the value begins with prefix. If it doesn't exist, it's prepended.
@param value input
@param prefix prefix
@param caseSensitive true or false
@return string with prefix if it was not present. | [
"Ensures",
"that",
"the",
"value",
"begins",
"with",
"prefix",
".",
"If",
"it",
"doesn",
"t",
"exist",
"it",
"s",
"prepended",
"."
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L312-L320 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.config_git_fat_tck/fat/src/com/ibm/ws/microprofile/config/tck/ConfigGitTckLauncher.java | ConfigGitTckLauncher.runFreshMasterBranchTck | @Mode(TestMode.EXPERIMENTAL)
@Test
@AllowedFFDC // The tested exceptions cause FFDC so we have to allow for this.
public void runFreshMasterBranchTck() throws Exception {
"""
Run the TCK (controlled by autoFVT/publish/tckRunner/tcl/tck-suite.html)
@throws Exception
"""
File repoParent =... | java | @Mode(TestMode.EXPERIMENTAL)
@Test
@AllowedFFDC // The tested exceptions cause FFDC so we have to allow for this.
public void runFreshMasterBranchTck() throws Exception {
File repoParent = new File(GIT_REPO_PARENT_DIR);
File repo = new File(repoParent, GIT_REPO_NAME);
MvnUtils.mvnC... | [
"@",
"Mode",
"(",
"TestMode",
".",
"EXPERIMENTAL",
")",
"@",
"Test",
"@",
"AllowedFFDC",
"// The tested exceptions cause FFDC so we have to allow for this.",
"public",
"void",
"runFreshMasterBranchTck",
"(",
")",
"throws",
"Exception",
"{",
"File",
"repoParent",
"=",
"n... | Run the TCK (controlled by autoFVT/publish/tckRunner/tcl/tck-suite.html)
@throws Exception | [
"Run",
"the",
"TCK",
"(",
"controlled",
"by",
"autoFVT",
"/",
"publish",
"/",
"tckRunner",
"/",
"tcl",
"/",
"tck",
"-",
"suite",
".",
"html",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config_git_fat_tck/fat/src/com/ibm/ws/microprofile/config/tck/ConfigGitTckLauncher.java#L75-L108 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.createCertificate | public CertificateOperation createCertificate(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
"""
Creates a new certificate.
If this is the first version, the certificate resource is created. This operation ... | java | public CertificateOperation createCertificate(String vaultBaseUrl, String certificateName, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) {
return createCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificatePolicy, certificateA... | [
"public",
"CertificateOperation",
"createCertificate",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"CertificatePolicy",
"certificatePolicy",
",",
"CertificateAttributes",
"certificateAttributes",
",",
"Map",
"<",
"String",
",",
"String",
">",
"ta... | 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.
@param certificatePolicy The man... | [
"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#L6579-L6581 |
ontop/ontop | binding/owlapi/src/main/java/it/unibz/inf/ontop/owlapi/impl/QuestOWL.java | QuestOWL.getConnection | @Override
public OntopOWLConnection getConnection() throws ReasonerInternalException {
"""
The caller is in charge of closing the connection after usage.
(the reasoner is not responsible of connections)
"""
if (!questready) {
OWLReasonerRuntimeException owlReasonerRuntimeException = new ReasonerInternal... | java | @Override
public OntopOWLConnection getConnection() throws ReasonerInternalException {
if (!questready) {
OWLReasonerRuntimeException owlReasonerRuntimeException = new ReasonerInternalException(
"Ontop was not initialized properly. This is generally indicates, " +
"connection problems or error during ... | [
"@",
"Override",
"public",
"OntopOWLConnection",
"getConnection",
"(",
")",
"throws",
"ReasonerInternalException",
"{",
"if",
"(",
"!",
"questready",
")",
"{",
"OWLReasonerRuntimeException",
"owlReasonerRuntimeException",
"=",
"new",
"ReasonerInternalException",
"(",
"\"O... | The caller is in charge of closing the connection after usage.
(the reasoner is not responsible of connections) | [
"The",
"caller",
"is",
"in",
"charge",
"of",
"closing",
"the",
"connection",
"after",
"usage",
".",
"(",
"the",
"reasoner",
"is",
"not",
"responsible",
"of",
"connections",
")"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/binding/owlapi/src/main/java/it/unibz/inf/ontop/owlapi/impl/QuestOWL.java#L244-L262 |
lazy-koala/java-toolkit | fast-toolkit3d/src/main/java/com/thankjava/toolkit3d/core/encrypit/RSAWithBase64.java | RSAWithBase64.decrypt | public static String decrypt(String base64Cipher, String priKey) {
"""
RSA私钥解密经过base64处理的密文
<p>Function: verify</p>
<p>Description: </p>
@param base64Cipher Base64处理后的字符串
@param priKey
@return
@author acexy@thankjava.com
@date 2016年8月11日 上午9:54:13
@version 1.0
"""
return new String(RSA.decryp... | java | public static String decrypt(String base64Cipher, String priKey) {
return new String(RSA.decrypt(Base64Util.decode(base64Cipher), decryptPrivateKey(priKey)));
} | [
"public",
"static",
"String",
"decrypt",
"(",
"String",
"base64Cipher",
",",
"String",
"priKey",
")",
"{",
"return",
"new",
"String",
"(",
"RSA",
".",
"decrypt",
"(",
"Base64Util",
".",
"decode",
"(",
"base64Cipher",
")",
",",
"decryptPrivateKey",
"(",
"priK... | RSA私钥解密经过base64处理的密文
<p>Function: verify</p>
<p>Description: </p>
@param base64Cipher Base64处理后的字符串
@param priKey
@return
@author acexy@thankjava.com
@date 2016年8月11日 上午9:54:13
@version 1.0 | [
"RSA私钥解密经过base64处理的密文",
"<p",
">",
"Function",
":",
"verify<",
"/",
"p",
">",
"<p",
">",
"Description",
":",
"<",
"/",
"p",
">"
] | train | https://github.com/lazy-koala/java-toolkit/blob/f46055fae0cc73049597a3708e515f5c6582d27a/fast-toolkit3d/src/main/java/com/thankjava/toolkit3d/core/encrypit/RSAWithBase64.java#L129-L131 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.unaryOperator | public static <T> UnaryOperator<T> unaryOperator(CheckedUnaryOperator<T> operator, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedUnaryOperator} in a {@link UnaryOperator} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
Stream.of("a", "b", "c").map(Unchecked.unaryOperator(
s ->... | java | public static <T> UnaryOperator<T> unaryOperator(CheckedUnaryOperator<T> operator, Consumer<Throwable> handler) {
return t -> {
try {
return operator.apply(t);
}
catch (Throwable e) {
handler.accept(e);
throw new IllegalStateEx... | [
"public",
"static",
"<",
"T",
">",
"UnaryOperator",
"<",
"T",
">",
"unaryOperator",
"(",
"CheckedUnaryOperator",
"<",
"T",
">",
"operator",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"t",
"->",
"{",
"try",
"{",
"return",
"oper... | Wrap a {@link CheckedUnaryOperator} in a {@link UnaryOperator} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
Stream.of("a", "b", "c").map(Unchecked.unaryOperator(
s -> {
if (s.length() > 10)
throw new Exception("Only short strings allowed");
return s;
},
e -> {
throw new IllegalStateException(... | [
"Wrap",
"a",
"{",
"@link",
"CheckedUnaryOperator",
"}",
"in",
"a",
"{",
"@link",
"UnaryOperator",
"}",
"with",
"a",
"custom",
"handler",
"for",
"checked",
"exceptions",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"Stream",
".",
"of",
"(",
... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1908-L1919 |
wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java | SuffixParser.get | @SuppressWarnings("unchecked")
public <T> @Nullable T get(@NotNull String key, @NotNull Class<T> clazz) {
"""
Extract the value of a named suffix part from this request's suffix
@param key key of the suffix part
@param clazz Type expected for return value.
Only String, Boolean, Integer, Long are supported.
@... | java | @SuppressWarnings("unchecked")
public <T> @Nullable T get(@NotNull String key, @NotNull Class<T> clazz) {
if (clazz == String.class) {
return (T)getString(key, (String)null);
}
if (clazz == Boolean.class) {
return (T)(Boolean)getBoolean(key, false);
}
if (clazz == Integer.class) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"@",
"Nullable",
"T",
"get",
"(",
"@",
"NotNull",
"String",
"key",
",",
"@",
"NotNull",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
"==",
"String",
".",
... | Extract the value of a named suffix part from this request's suffix
@param key key of the suffix part
@param clazz Type expected for return value.
Only String, Boolean, Integer, Long are supported.
@param <T> Parameter type.
@return the value of that named parameter (or the default value if not used) | [
"Extract",
"the",
"value",
"of",
"a",
"named",
"suffix",
"part",
"from",
"this",
"request",
"s",
"suffix"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java#L82-L97 |
JOML-CI/JOML | src/org/joml/Matrix3x2f.java | Matrix3x2f.get3x3 | public FloatBuffer get3x3(int index, FloatBuffer buffer) {
"""
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied {@link FloatBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given FloatBuffer.
@param i... | java | public FloatBuffer get3x3(int index, FloatBuffer buffer) {
MemUtil.INSTANCE.put3x3(this, index, buffer);
return buffer;
} | [
"public",
"FloatBuffer",
"get3x3",
"(",
"int",
"index",
",",
"FloatBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"put3x3",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"buffer",
";",
"}"
] | Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied {@link FloatBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given FloatBuffer.
@param index
the absolute position into the FloatBuffer
@param buffer
will receiv... | [
"Store",
"this",
"matrix",
"as",
"an",
"equivalent",
"3x3",
"matrix",
"in",
"column",
"-",
"major",
"order",
"into",
"the",
"supplied",
"{",
"@link",
"FloatBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2f.java#L912-L915 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_POST | public OvhDHCPStaticAddress serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_POST(String serviceName, String lanName, String dhcpName, String IPAddress, String MACAddress, String name) throws IOException {
"""
Add a DHCP static lease
REST: POST /xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpNa... | java | public OvhDHCPStaticAddress serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_POST(String serviceName, String lanName, String dhcpName, String IPAddress, String MACAddress, String name) throws IOException {
String qPath = "/xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}/DHCPStaticAddresses";
S... | [
"public",
"OvhDHCPStaticAddress",
"serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_POST",
"(",
"String",
"serviceName",
",",
"String",
"lanName",
",",
"String",
"dhcpName",
",",
"String",
"IPAddress",
",",
"String",
"MACAddress",
",",
"String",
"name",
")",
... | Add a DHCP static lease
REST: POST /xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}/DHCPStaticAddresses
@param name [required] Name of the DHCP static lease
@param IPAddress [required] The IP address of the device
@param MACAddress [required] The MAC address of the device
@param serviceName [required] The inter... | [
"Add",
"a",
"DHCP",
"static",
"lease"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1070-L1079 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java | BoundingBox.getCenterLongitude | public static double getCenterLongitude(final double pWest, final double pEast) {
"""
Compute the center of two longitudes
Taking into account the case when "west is on the right and east is on the left"
@since 6.0.0
"""
double longitude = (pEast + pWest) / 2.0;
if (pEast < pWest) {
// center is on th... | java | public static double getCenterLongitude(final double pWest, final double pEast) {
double longitude = (pEast + pWest) / 2.0;
if (pEast < pWest) {
// center is on the other side of earth
longitude += 180;
}
return org.osmdroid.views.MapView.getTileSystem().cleanLongitude(longitude);
} | [
"public",
"static",
"double",
"getCenterLongitude",
"(",
"final",
"double",
"pWest",
",",
"final",
"double",
"pEast",
")",
"{",
"double",
"longitude",
"=",
"(",
"pEast",
"+",
"pWest",
")",
"/",
"2.0",
";",
"if",
"(",
"pEast",
"<",
"pWest",
")",
"{",
"/... | Compute the center of two longitudes
Taking into account the case when "west is on the right and east is on the left"
@since 6.0.0 | [
"Compute",
"the",
"center",
"of",
"two",
"longitudes",
"Taking",
"into",
"account",
"the",
"case",
"when",
"west",
"is",
"on",
"the",
"right",
"and",
"east",
"is",
"on",
"the",
"left"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java#L143-L150 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java | MetricsRecordImpl.setTag | public void setTag(String tagName, String tagValue) {
"""
Sets the named tag to the specified value.
@param tagName name of the tag
@param tagValue new value of the tag
@throws MetricsException if the tagName conflicts with the configuration
"""
if (tagValue == null) {
tagValue = "";
}
... | java | public void setTag(String tagName, String tagValue) {
if (tagValue == null) {
tagValue = "";
}
tagTable.put(tagName, tagValue);
} | [
"public",
"void",
"setTag",
"(",
"String",
"tagName",
",",
"String",
"tagValue",
")",
"{",
"if",
"(",
"tagValue",
"==",
"null",
")",
"{",
"tagValue",
"=",
"\"\"",
";",
"}",
"tagTable",
".",
"put",
"(",
"tagName",
",",
"tagValue",
")",
";",
"}"
] | Sets the named tag to the specified value.
@param tagName name of the tag
@param tagValue new value of the tag
@throws MetricsException if the tagName conflicts with the configuration | [
"Sets",
"the",
"named",
"tag",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java#L65-L70 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.linesFromFile | public static List<String> linesFromFile(String filename,String encoding) {
"""
Returns the contents of a file as a list of strings. The list may be
empty, if the file is empty. If there is an IOException, it is caught
and null is returned. Encoding can also be specified
"""
try {
List<String> ... | java | public static List<String> linesFromFile(String filename,String encoding) {
try {
List<String> lines = new ArrayList<String>();
BufferedReader in = new BufferedReader(new EncodingFileReader(filename,encoding));
String line;
while ((line = in.readLine()) != null) {
lines.add(lin... | [
"public",
"static",
"List",
"<",
"String",
">",
"linesFromFile",
"(",
"String",
"filename",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"List",
"<",
"String",
">",
"lines",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"BufferedReader"... | Returns the contents of a file as a list of strings. The list may be
empty, if the file is empty. If there is an IOException, it is caught
and null is returned. Encoding can also be specified | [
"Returns",
"the",
"contents",
"of",
"a",
"file",
"as",
"a",
"list",
"of",
"strings",
".",
"The",
"list",
"may",
"be",
"empty",
"if",
"the",
"file",
"is",
"empty",
".",
"If",
"there",
"is",
"an",
"IOException",
"it",
"is",
"caught",
"and",
"null",
"is... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L1231-L1246 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsBasicFormField.java | CmsBasicFormField.createField | public static CmsBasicFormField createField(CmsXmlContentProperty propertyConfig) {
"""
Utility method for creating a single basic form field from an id and a property configuration.
@param propertyConfig the configuration of the property
@return the newly created form field
"""
return createFie... | java | public static CmsBasicFormField createField(CmsXmlContentProperty propertyConfig) {
return createField(propertyConfig, Collections.<String, String> emptyMap());
} | [
"public",
"static",
"CmsBasicFormField",
"createField",
"(",
"CmsXmlContentProperty",
"propertyConfig",
")",
"{",
"return",
"createField",
"(",
"propertyConfig",
",",
"Collections",
".",
"<",
"String",
",",
"String",
">",
"emptyMap",
"(",
")",
")",
";",
"}"
] | Utility method for creating a single basic form field from an id and a property configuration.
@param propertyConfig the configuration of the property
@return the newly created form field | [
"Utility",
"method",
"for",
"creating",
"a",
"single",
"basic",
"form",
"field",
"from",
"an",
"id",
"and",
"a",
"property",
"configuration",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsBasicFormField.java#L112-L115 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_conference_serviceName_settings_PUT | public void billingAccount_conference_serviceName_settings_PUT(String billingAccount, String serviceName, OvhConferenceProperties body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/conference/{serviceName}/settings
@param body [required] New object properties
@pa... | java | public void billingAccount_conference_serviceName_settings_PUT(String billingAccount, String serviceName, OvhConferenceProperties body) throws IOException {
String qPath = "/telephony/{billingAccount}/conference/{serviceName}/settings";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT... | [
"public",
"void",
"billingAccount_conference_serviceName_settings_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhConferenceProperties",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/conference/{s... | Alter this object properties
REST: PUT /telephony/{billingAccount}/conference/{serviceName}/settings
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4737-L4741 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormatSymbols.java | DecimalFormatSymbols.getPatternForCurrencySpacing | public String getPatternForCurrencySpacing(int itemType, boolean beforeCurrency) {
"""
<strong>[icu]</strong> Returns the desired currency spacing value. Original values come from ICU's
CLDR data based on the locale provided during construction, and can be null. These
values govern what and when text is inserte... | java | public String getPatternForCurrencySpacing(int itemType, boolean beforeCurrency) {
if (itemType < CURRENCY_SPC_CURRENCY_MATCH ||
itemType > CURRENCY_SPC_INSERT ) {
throw new IllegalArgumentException("unknown currency spacing: " + itemType);
}
if (beforeCurrency) {
... | [
"public",
"String",
"getPatternForCurrencySpacing",
"(",
"int",
"itemType",
",",
"boolean",
"beforeCurrency",
")",
"{",
"if",
"(",
"itemType",
"<",
"CURRENCY_SPC_CURRENCY_MATCH",
"||",
"itemType",
">",
"CURRENCY_SPC_INSERT",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | <strong>[icu]</strong> Returns the desired currency spacing value. Original values come from ICU's
CLDR data based on the locale provided during construction, and can be null. These
values govern what and when text is inserted between a currency code/name/symbol
and the currency amount when formatting money.
<p>For m... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"the",
"desired",
"currency",
"spacing",
"value",
".",
"Original",
"values",
"come",
"from",
"ICU",
"s",
"CLDR",
"data",
"based",
"on",
"the",
"locale",
"provided",
"during",
"constructio... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormatSymbols.java#L979-L988 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/HttpEndpointImpl.java | HttpEndpointImpl.performAction | @Trivial
private void performAction(Runnable action, boolean addToQueue) {
"""
Schedule an activity to run off the SCR action thread,
if the ExecutorService is available
@param action Runnable action to execute
@param addToQueue Set to false if the action should be scheduled independently of the actionQue... | java | @Trivial
private void performAction(Runnable action, boolean addToQueue) {
ExecutorService exec = executorService.getService();
if (exec == null) {
// If we can't find the executor service, we have to run it in place.
action.run();
} else {
// If we can f... | [
"@",
"Trivial",
"private",
"void",
"performAction",
"(",
"Runnable",
"action",
",",
"boolean",
"addToQueue",
")",
"{",
"ExecutorService",
"exec",
"=",
"executorService",
".",
"getService",
"(",
")",
";",
"if",
"(",
"exec",
"==",
"null",
")",
"{",
"// If we c... | Schedule an activity to run off the SCR action thread,
if the ExecutorService is available
@param action Runnable action to execute
@param addToQueue Set to false if the action should be scheduled independently of the actionQueue | [
"Schedule",
"an",
"activity",
"to",
"run",
"off",
"the",
"SCR",
"action",
"thread",
"if",
"the",
"ExecutorService",
"is",
"available"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/HttpEndpointImpl.java#L748-L782 |
infinispan/infinispan | lucene/lucene-directory/src/main/java/org/infinispan/lucene/cacheloader/DirectoryLoaderAdaptor.java | DirectoryLoaderAdaptor.loadAllEntries | protected <K, V> void loadAllEntries(final Set<MarshallableEntry<K, V>> entriesCollector, final int maxEntries, MarshallableEntryFactory<K,V> entryFactory) {
"""
Loads all "entries" from the CacheLoader; considering this is actually a Lucene index,
that's going to transform segments in entries in a specific order... | java | protected <K, V> void loadAllEntries(final Set<MarshallableEntry<K, V>> entriesCollector, final int maxEntries, MarshallableEntryFactory<K,V> entryFactory) {
int existingElements = entriesCollector.size();
int toLoadElements = maxEntries - existingElements;
if (toLoadElements <= 0) {
return;
... | [
"protected",
"<",
"K",
",",
"V",
">",
"void",
"loadAllEntries",
"(",
"final",
"Set",
"<",
"MarshallableEntry",
"<",
"K",
",",
"V",
">",
">",
"entriesCollector",
",",
"final",
"int",
"maxEntries",
",",
"MarshallableEntryFactory",
"<",
"K",
",",
"V",
">",
... | Loads all "entries" from the CacheLoader; considering this is actually a Lucene index,
that's going to transform segments in entries in a specific order, simplest entries first.
@param entriesCollector loaded entries are collected in this set
@param maxEntries to limit amount of entries loaded | [
"Loads",
"all",
"entries",
"from",
"the",
"CacheLoader",
";",
"considering",
"this",
"is",
"actually",
"a",
"Lucene",
"index",
"that",
"s",
"going",
"to",
"transform",
"segments",
"in",
"entries",
"in",
"a",
"specific",
"order",
"simplest",
"entries",
"first",... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/cacheloader/DirectoryLoaderAdaptor.java#L65-L80 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/TemplatesApi.java | TemplatesApi.listTemplates | public EnvelopeTemplateResults listTemplates(String accountId, TemplatesApi.ListTemplatesOptions options) throws ApiException {
"""
Gets the definition of a template.
Retrieves the list of templates for the specified account. The request can be limited to a specific folder.
@param accountId The external account ... | java | public EnvelopeTemplateResults listTemplates(String accountId, TemplatesApi.ListTemplatesOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required parame... | [
"public",
"EnvelopeTemplateResults",
"listTemplates",
"(",
"String",
"accountId",
",",
"TemplatesApi",
".",
"ListTemplatesOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"\"{}\"",
";",
"// verify the required parameter 'accountId' i... | Gets the definition of a template.
Retrieves the list of templates for the specified account. The request can be limited to a specific folder.
@param accountId The external account number (int) or account ID Guid. (required)
@param options for modifying the method behavior.
@return EnvelopeTemplateResults
@throws ApiEx... | [
"Gets",
"the",
"definition",
"of",
"a",
"template",
".",
"Retrieves",
"the",
"list",
"of",
"templates",
"for",
"the",
"specified",
"account",
".",
"The",
"request",
"can",
"be",
"limited",
"to",
"a",
"specific",
"folder",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/TemplatesApi.java#L2639-L2691 |
dyu/protostuff-1.0.x | protostuff-me/src/main/java/com/dyuproject/protostuff/me/ProtostuffIOUtil.java | ProtostuffIOUtil.writeListTo | public static int writeListTo(final OutputStream out, final Vector messages,
final Schema schema, final LinkedBuffer buffer) throws IOException {
"""
Serializes the {@code messages} (delimited) into an {@link OutputStream}
using the given schema.
@return the bytes written
"""
if(buff... | java | public static int writeListTo(final OutputStream out, final Vector messages,
final Schema schema, final LinkedBuffer buffer) throws IOException
{
if(buffer.start != buffer.offset)
throw new IllegalArgumentException("Buffer previously used and had not been reset.");
... | [
"public",
"static",
"int",
"writeListTo",
"(",
"final",
"OutputStream",
"out",
",",
"final",
"Vector",
"messages",
",",
"final",
"Schema",
"schema",
",",
"final",
"LinkedBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
".",
"start",
... | Serializes the {@code messages} (delimited) into an {@link OutputStream}
using the given schema.
@return the bytes written | [
"Serializes",
"the",
"{",
"@code",
"messages",
"}",
"(",
"delimited",
")",
"into",
"an",
"{",
"@link",
"OutputStream",
"}",
"using",
"the",
"given",
"schema",
"."
] | train | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-me/src/main/java/com/dyuproject/protostuff/me/ProtostuffIOUtil.java#L273-L297 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ProcedureExtensions.java | ProcedureExtensions.curry | @Pure
public static <P1, P2, P3> Procedure2<P2, P3> curry(final Procedure3<? super P1, ? super P2, ? super P3> procedure, final P1 argument) {
"""
Curries a procedure that takes three arguments.
@param procedure
the original procedure. May not be <code>null</code>.
@param argument
the fixed first argument o... | java | @Pure
public static <P1, P2, P3> Procedure2<P2, P3> curry(final Procedure3<? super P1, ? super P2, ? super P3> procedure, final P1 argument) {
if (procedure == null)
throw new NullPointerException("procedure");
return new Procedure2<P2, P3>() {
@Override
public void apply(P2 p2, P3 p3) {
procedure.app... | [
"@",
"Pure",
"public",
"static",
"<",
"P1",
",",
"P2",
",",
"P3",
">",
"Procedure2",
"<",
"P2",
",",
"P3",
">",
"curry",
"(",
"final",
"Procedure3",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"super",
"P3",
">",
"procedure",
",",... | Curries a procedure that takes three arguments.
@param procedure
the original procedure. May not be <code>null</code>.
@param argument
the fixed first argument of {@code procedure}.
@return a procedure that takes two arguments. Never <code>null</code>. | [
"Curries",
"a",
"procedure",
"that",
"takes",
"three",
"arguments",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ProcedureExtensions.java#L79-L89 |
Samsung/GearVRf | GVRf/Extensions/script/src/main/java/org/gearvrf/script/GVRScriptManager.java | GVRScriptManager.loadScript | @Override
public IScriptFile loadScript(GVRAndroidResource resource, String language) throws IOException, GVRScriptException {
"""
Loads a script file using {@link GVRAndroidResource}.
@param resource The resource object.
@param language The language string.
@return A script file object or {@code null} if n... | java | @Override
public IScriptFile loadScript(GVRAndroidResource resource, String language) throws IOException, GVRScriptException {
if (getEngine(language) == null) {
mGvrContext.logError("Script language " + language + " unsupported", this);
throw new GVRScriptException(String.format("Th... | [
"@",
"Override",
"public",
"IScriptFile",
"loadScript",
"(",
"GVRAndroidResource",
"resource",
",",
"String",
"language",
")",
"throws",
"IOException",
",",
"GVRScriptException",
"{",
"if",
"(",
"getEngine",
"(",
"language",
")",
"==",
"null",
")",
"{",
"mGvrCon... | Loads a script file using {@link GVRAndroidResource}.
@param resource The resource object.
@param language The language string.
@return A script file object or {@code null} if not found.
@throws IOException if script file cannot be read.
@throws GVRScriptException if script processing error occurs. | [
"Loads",
"a",
"script",
"file",
"using",
"{"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/script/src/main/java/org/gearvrf/script/GVRScriptManager.java#L222-L236 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/math/ArrayMath.java | ArrayMath.sampleWithoutReplacement | public static void sampleWithoutReplacement(int[] array, int numArgClasses, Random rand) {
"""
Fills the array with sample from 0 to numArgClasses-1 without replacement.
"""
int[] temp = new int[numArgClasses];
for (int i = 0; i < temp.length; i++) {
temp[i] = i;
}
shuffle(temp, rand... | java | public static void sampleWithoutReplacement(int[] array, int numArgClasses, Random rand) {
int[] temp = new int[numArgClasses];
for (int i = 0; i < temp.length; i++) {
temp[i] = i;
}
shuffle(temp, rand);
System.arraycopy(temp, 0, array, 0, array.length);
} | [
"public",
"static",
"void",
"sampleWithoutReplacement",
"(",
"int",
"[",
"]",
"array",
",",
"int",
"numArgClasses",
",",
"Random",
"rand",
")",
"{",
"int",
"[",
"]",
"temp",
"=",
"new",
"int",
"[",
"numArgClasses",
"]",
";",
"for",
"(",
"int",
"i",
"="... | Fills the array with sample from 0 to numArgClasses-1 without replacement. | [
"Fills",
"the",
"array",
"with",
"sample",
"from",
"0",
"to",
"numArgClasses",
"-",
"1",
"without",
"replacement",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/ArrayMath.java#L1399-L1406 |
albfernandez/itext2 | src/main/java/com/lowagie/text/html/HtmlParser.java | HtmlParser.go | public void go(DocListener document, String file) {
"""
Parses a given file.
@param document the document the parser will write to
@param file the file with the content
"""
try {
parser.parse(file, new SAXmyHtmlHandler(document));
}
catch(SAXException se) {
thr... | java | public void go(DocListener document, String file) {
try {
parser.parse(file, new SAXmyHtmlHandler(document));
}
catch(SAXException se) {
throw new ExceptionConverter(se);
}
catch(IOException ioe) {
throw new ExceptionConverter(ioe);
}
... | [
"public",
"void",
"go",
"(",
"DocListener",
"document",
",",
"String",
"file",
")",
"{",
"try",
"{",
"parser",
".",
"parse",
"(",
"file",
",",
"new",
"SAXmyHtmlHandler",
"(",
"document",
")",
")",
";",
"}",
"catch",
"(",
"SAXException",
"se",
")",
"{",... | Parses a given file.
@param document the document the parser will write to
@param file the file with the content | [
"Parses",
"a",
"given",
"file",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/html/HtmlParser.java#L112-L122 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/pubmed/ManualDescriptor.java | ManualDescriptor.setMeSHList | public void setMeSHList(int i, MeshHeading v) {
"""
indexed setter for meSHList - sets an indexed value - A collection of objects of type uima.julielab.uima.MeSHHeading, O
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (ManualDescriptor_Type.featOkTst && ((Man... | java | public void setMeSHList(int i, MeshHeading v) {
if (ManualDescriptor_Type.featOkTst && ((ManualDescriptor_Type)jcasType).casFeat_meSHList == null)
jcasType.jcas.throwFeatMissing("meSHList", "de.julielab.jules.types.pubmed.ManualDescriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(a... | [
"public",
"void",
"setMeSHList",
"(",
"int",
"i",
",",
"MeshHeading",
"v",
")",
"{",
"if",
"(",
"ManualDescriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"ManualDescriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_meSHList",
"==",
"null",
")",
"jcasType",
... | indexed setter for meSHList - sets an indexed value - A collection of objects of type uima.julielab.uima.MeSHHeading, O
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"meSHList",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"A",
"collection",
"of",
"objects",
"of",
"type",
"uima",
".",
"julielab",
".",
"uima",
".",
"MeSHHeading",
"O"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/pubmed/ManualDescriptor.java#L121-L125 |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.getUncachedPermissionsForPrincipal | public IPermission[] getUncachedPermissionsForPrincipal(
IAuthorizationPrincipal principal, String owner, String activity, String target)
throws AuthorizationException {
"""
Returns the <code>IPermissions</code> owner has granted this <code>Principal</code> for the
specified activity and t... | java | public IPermission[] getUncachedPermissionsForPrincipal(
IAuthorizationPrincipal principal, String owner, String activity, String target)
throws AuthorizationException {
String pString = getPrincipalString(principal);
return primRetrievePermissions(owner, pString, activity, targe... | [
"public",
"IPermission",
"[",
"]",
"getUncachedPermissionsForPrincipal",
"(",
"IAuthorizationPrincipal",
"principal",
",",
"String",
"owner",
",",
"String",
"activity",
",",
"String",
"target",
")",
"throws",
"AuthorizationException",
"{",
"String",
"pString",
"=",
"g... | Returns the <code>IPermissions</code> owner has granted this <code>Principal</code> for the
specified activity and target. Null parameters will be ignored, that is, all <code>
IPermissions</code> matching the non-null parameters are retrieved. So, <code>
getPermissions(principal,null, null, null)</code> should retrieve... | [
"Returns",
"the",
"<code",
">",
"IPermissions<",
"/",
"code",
">",
"owner",
"has",
"granted",
"this",
"<code",
">",
"Principal<",
"/",
"code",
">",
"for",
"the",
"specified",
"activity",
"and",
"target",
".",
"Null",
"parameters",
"will",
"be",
"ignored",
... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L885-L890 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ClassGenericsUtil.java | ClassGenericsUtil.instantiateGenerics | @SuppressWarnings("unchecked")
public static <T> T instantiateGenerics(Class<?> type, String className) throws ClassInstantiationException {
"""
Returns a new instance of the given type for the specified className.
<p>
If the class for className is not found, the instantiation is tried using
the package of th... | java | @SuppressWarnings("unchecked")
public static <T> T instantiateGenerics(Class<?> type, String className) throws ClassInstantiationException {
// TODO: can we do a verification that type conforms to T somehow?
// (probably not because generics are implemented via erasure.
try {
try {
return ((... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"instantiateGenerics",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"className",
")",
"throws",
"ClassInstantiationException",
"{",
"// TODO: can we do a verification ... | Returns a new instance of the given type for the specified className.
<p>
If the class for className is not found, the instantiation is tried using
the package of the given type as package of the given className.
<p>
This is a weaker type checked version of "{@link #instantiate}" for use
with generics.
@param <T> Clas... | [
"Returns",
"a",
"new",
"instance",
"of",
"the",
"given",
"type",
"for",
"the",
"specified",
"className",
".",
"<p",
">",
"If",
"the",
"class",
"for",
"className",
"is",
"not",
"found",
"the",
"instantiation",
"is",
"tried",
"using",
"the",
"package",
"of",... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ClassGenericsUtil.java#L120-L137 |
knightliao/disconf | disconf-web/src/main/java/com/baidu/unbiz/common/genericdao/mapper/GenericMapper.java | GenericMapper.load2Entity | private void load2Entity(Object entity, Method setMethod, Object value) throws Exception {
"""
@param entity
@param setMethod
@param value
@throws Exception 下午4:06:04 created by Darwin(Tianxin)
"""
try {
if (value != null) {
setMethod.invoke(entity, value);
... | java | private void load2Entity(Object entity, Method setMethod, Object value) throws Exception {
try {
if (value != null) {
setMethod.invoke(entity, value);
}
} catch (Exception e) {
String sValue = value.toString();
String sValueClass = value.ge... | [
"private",
"void",
"load2Entity",
"(",
"Object",
"entity",
",",
"Method",
"setMethod",
",",
"Object",
"value",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"setMethod",
".",
"invoke",
"(",
"entity",
",",
"value... | @param entity
@param setMethod
@param value
@throws Exception 下午4:06:04 created by Darwin(Tianxin) | [
"@param",
"entity",
"@param",
"setMethod",
"@param",
"value"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-web/src/main/java/com/baidu/unbiz/common/genericdao/mapper/GenericMapper.java#L80-L92 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findExactMethod | public static JavaClassAndMethod findExactMethod(InvokeInstruction inv, ConstantPoolGen cpg, JavaClassAndMethodChooser chooser)
throws ClassNotFoundException {
"""
Look up the method referenced by given InvokeInstruction. This method
does <em>not</em> look for implementations in super or subclasses
a... | java | public static JavaClassAndMethod findExactMethod(InvokeInstruction inv, ConstantPoolGen cpg, JavaClassAndMethodChooser chooser)
throws ClassNotFoundException {
String className = inv.getClassName(cpg);
String methodName = inv.getName(cpg);
String methodSig = inv.getSignature(cpg);
... | [
"public",
"static",
"JavaClassAndMethod",
"findExactMethod",
"(",
"InvokeInstruction",
"inv",
",",
"ConstantPoolGen",
"cpg",
",",
"JavaClassAndMethodChooser",
"chooser",
")",
"throws",
"ClassNotFoundException",
"{",
"String",
"className",
"=",
"inv",
".",
"getClassName",
... | Look up the method referenced by given InvokeInstruction. This method
does <em>not</em> look for implementations in super or subclasses
according to the virtual dispatch rules.
@param inv
the InvokeInstruction
@param cpg
the ConstantPoolGen used by the class the InvokeInstruction
belongs to
@param chooser
JavaClassAnd... | [
"Look",
"up",
"the",
"method",
"referenced",
"by",
"given",
"InvokeInstruction",
".",
"This",
"method",
"does",
"<em",
">",
"not<",
"/",
"em",
">",
"look",
"for",
"implementations",
"in",
"super",
"or",
"subclasses",
"according",
"to",
"the",
"virtual",
"dis... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L252-L260 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/repository/internal/RepositoryUtils.java | RepositoryUtils.getMessage | public static String getMessage(String key, Object... args) {
"""
Get the message corresponding to the key and Repository locale.
@param key
@param args
@return formatted message associated with key input
"""
if (messages == null) {
if (locale == null)
locale = Locale.g... | java | public static String getMessage(String key, Object... args) {
if (messages == null) {
if (locale == null)
locale = Locale.getDefault();
messages = ResourceBundle.getBundle("com.ibm.ws.install.internal.resources.Repository", locale);
}
String message = mess... | [
"public",
"static",
"String",
"getMessage",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"messages",
"==",
"null",
")",
"{",
"if",
"(",
"locale",
"==",
"null",
")",
"locale",
"=",
"Locale",
".",
"getDefault",
"(",
")",
";"... | Get the message corresponding to the key and Repository locale.
@param key
@param args
@return formatted message associated with key input | [
"Get",
"the",
"message",
"corresponding",
"to",
"the",
"key",
"and",
"Repository",
"locale",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/repository/internal/RepositoryUtils.java#L65-L76 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java | RESTServlet.validateTenantAccess | private void validateTenantAccess(HttpServletRequest request, Tenant tenant, RegisteredCommand cmdModel) {
"""
Extract Authorization header, if any, and validate this command for the given tenant.
"""
String authString = request.getHeader("Authorization");
StringBuilder userID = new StringBui... | java | private void validateTenantAccess(HttpServletRequest request, Tenant tenant, RegisteredCommand cmdModel) {
String authString = request.getHeader("Authorization");
StringBuilder userID = new StringBuilder();
StringBuilder password = new StringBuilder();
decodeAuthorizationHeader(authS... | [
"private",
"void",
"validateTenantAccess",
"(",
"HttpServletRequest",
"request",
",",
"Tenant",
"tenant",
",",
"RegisteredCommand",
"cmdModel",
")",
"{",
"String",
"authString",
"=",
"request",
".",
"getHeader",
"(",
"\"Authorization\"",
")",
";",
"StringBuilder",
"... | Extract Authorization header, if any, and validate this command for the given tenant. | [
"Extract",
"Authorization",
"header",
"if",
"any",
"and",
"validate",
"this",
"command",
"for",
"the",
"given",
"tenant",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L227-L235 |
JoeKerouac/utils | src/main/java/com/joe/utils/protocol/DatagramUtil.java | DatagramUtil.convert | public static int convert(byte[] data, int start) {
"""
将四个字节转换为一个int类型的数字
@param data data数据
@param start 四个字节长度开始的位置
@return 四个byte转换为的一个int
"""
return (Byte.toUnsignedInt(data[start]) << 24) | (Byte.toUnsignedInt(data[start + 1]) << 16)
| (Byte.toUnsignedInt(data[start + 2]) << ... | java | public static int convert(byte[] data, int start) {
return (Byte.toUnsignedInt(data[start]) << 24) | (Byte.toUnsignedInt(data[start + 1]) << 16)
| (Byte.toUnsignedInt(data[start + 2]) << 8) | Byte.toUnsignedInt(data[start + 3]);
} | [
"public",
"static",
"int",
"convert",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"start",
")",
"{",
"return",
"(",
"Byte",
".",
"toUnsignedInt",
"(",
"data",
"[",
"start",
"]",
")",
"<<",
"24",
")",
"|",
"(",
"Byte",
".",
"toUnsignedInt",
"(",
"dat... | 将四个字节转换为一个int类型的数字
@param data data数据
@param start 四个字节长度开始的位置
@return 四个byte转换为的一个int | [
"将四个字节转换为一个int类型的数字"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/protocol/DatagramUtil.java#L261-L264 |
alkacon/opencms-core | src/org/opencms/util/CmsUUID.java | CmsUUID.checkId | public static void checkId(CmsUUID id, boolean canBeNull) {
"""
Check that the given id is not the null id.<p>
@param id the id to check
@param canBeNull only if flag is set, <code>null</code> is accepted
@see #isNullUUID()
"""
if (canBeNull && (id == null)) {
return;
}
... | java | public static void checkId(CmsUUID id, boolean canBeNull) {
if (canBeNull && (id == null)) {
return;
}
if ((!canBeNull && (id == null)) || id.isNullUUID()) {
throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_UUID_1, id));
}
} | [
"public",
"static",
"void",
"checkId",
"(",
"CmsUUID",
"id",
",",
"boolean",
"canBeNull",
")",
"{",
"if",
"(",
"canBeNull",
"&&",
"(",
"id",
"==",
"null",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"(",
"!",
"canBeNull",
"&&",
"(",
"id",
"==",
... | Check that the given id is not the null id.<p>
@param id the id to check
@param canBeNull only if flag is set, <code>null</code> is accepted
@see #isNullUUID() | [
"Check",
"that",
"the",
"given",
"id",
"is",
"not",
"the",
"null",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsUUID.java#L145-L153 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexRequestDispatcher.java | CmsFlexRequestDispatcher.includeExternal | private void includeExternal(ServletRequest req, ServletResponse res) throws ServletException, IOException {
"""
Include an external (non-OpenCms) file using the standard dispatcher.<p>
@param req the servlet request
@param res the servlet response
@throws ServletException in case something goes wrong
@thr... | java | private void includeExternal(ServletRequest req, ServletResponse res) throws ServletException, IOException {
// This is an external include, probably to a JSP page, dispatch with system dispatcher
if (LOG.isInfoEnabled()) {
LOG.info(
Messages.get().getBundle().key(
... | [
"private",
"void",
"includeExternal",
"(",
"ServletRequest",
"req",
",",
"ServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"// This is an external include, probably to a JSP page, dispatch with system dispatcher",
"if",
"(",
"LOG",
".",
"is... | Include an external (non-OpenCms) file using the standard dispatcher.<p>
@param req the servlet request
@param res the servlet response
@throws ServletException in case something goes wrong
@throws IOException in case something goes wrong | [
"Include",
"an",
"external",
"(",
"non",
"-",
"OpenCms",
")",
"file",
"using",
"the",
"standard",
"dispatcher",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexRequestDispatcher.java#L182-L192 |
ysc/word | src/main/java/org/apdplat/word/corpus/ExtractText.java | ExtractText.extractFromCorpus | public static void extractFromCorpus(String output, String separator, boolean includePhrase) {
"""
从语料库中抽取内容
@param output 保存抽取出的文本的文件路径
@param separator 词之间的分隔符
@param includePhrase 是否抽取短语
"""
String zipFile = "src/main/resources/corpus/corpora.zip";
LOGGER.info("开始从语料库中抽取文本");
... | java | public static void extractFromCorpus(String output, String separator, boolean includePhrase){
String zipFile = "src/main/resources/corpus/corpora.zip";
LOGGER.info("开始从语料库中抽取文本");
long start = System.currentTimeMillis();
try{
analyzeCorpus(zipFile, output, sep... | [
"public",
"static",
"void",
"extractFromCorpus",
"(",
"String",
"output",
",",
"String",
"separator",
",",
"boolean",
"includePhrase",
")",
"{",
"String",
"zipFile",
"=",
"\"src/main/resources/corpus/corpora.zip\"",
";",
"LOGGER",
".",
"info",
"(",
"\"开始从语料库中抽取文本\");"... | 从语料库中抽取内容
@param output 保存抽取出的文本的文件路径
@param separator 词之间的分隔符
@param includePhrase 是否抽取短语 | [
"从语料库中抽取内容"
] | train | https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/corpus/ExtractText.java#L59-L71 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/TypeUtils.java | TypeUtils.isCompatible | public static boolean isCompatible(final Type one, final Type two) {
"""
Check if types are compatible: types must be equal or one extend another. Object is compatible with any type.
<p>
Not resolved type variables are resolved to Object.
<p>
Primitive types are checked as wrappers (for example, int is more sp... | java | public static boolean isCompatible(final Type one, final Type two) {
final CompatibilityTypesVisitor visitor = new CompatibilityTypesVisitor();
TypesWalker.walk(one, two, visitor);
return visitor.isCompatible();
} | [
"public",
"static",
"boolean",
"isCompatible",
"(",
"final",
"Type",
"one",
",",
"final",
"Type",
"two",
")",
"{",
"final",
"CompatibilityTypesVisitor",
"visitor",
"=",
"new",
"CompatibilityTypesVisitor",
"(",
")",
";",
"TypesWalker",
".",
"walk",
"(",
"one",
... | Check if types are compatible: types must be equal or one extend another. Object is compatible with any type.
<p>
Not resolved type variables are resolved to Object.
<p>
Primitive types are checked as wrappers (for example, int is more specific then Number).
@param one first type
@param two second type
@return true if... | [
"Check",
"if",
"types",
"are",
"compatible",
":",
"types",
"must",
"be",
"equal",
"or",
"one",
"extend",
"another",
".",
"Object",
"is",
"compatible",
"with",
"any",
"type",
".",
"<p",
">",
"Not",
"resolved",
"type",
"variables",
"are",
"resolved",
"to",
... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/TypeUtils.java#L202-L206 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java | UserImpl.getOrCreateChannel | public PrivateChannel getOrCreateChannel(JsonNode data) {
"""
Gets or creates a new private channel.
@param data The data of the private channel.
@return The private channel for the given data.
"""
synchronized (this) {
if (channel != null) {
return channel;
... | java | public PrivateChannel getOrCreateChannel(JsonNode data) {
synchronized (this) {
if (channel != null) {
return channel;
}
return new PrivateChannelImpl(api, data);
}
} | [
"public",
"PrivateChannel",
"getOrCreateChannel",
"(",
"JsonNode",
"data",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"channel",
"!=",
"null",
")",
"{",
"return",
"channel",
";",
"}",
"return",
"new",
"PrivateChannelImpl",
"(",
"api",
",",
... | Gets or creates a new private channel.
@param data The data of the private channel.
@return The private channel for the given data. | [
"Gets",
"or",
"creates",
"a",
"new",
"private",
"channel",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java#L197-L204 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java | Levenshtein.sorensenDice | @SuppressWarnings("unchecked")
public static <T extends Levenshtein> T sorensenDice(String baseTarget, String compareTarget, Integer k) {
"""
Returns a new Sorensen-Dice coefficient instance with compare target string and k-shingling
@see SorensenDice
@param baseTarget
@param compareTarget
@param k
@return... | java | @SuppressWarnings("unchecked")
public static <T extends Levenshtein> T sorensenDice(String baseTarget, String compareTarget, Integer k) {
return (T) new SorensenDice(baseTarget, k).update(compareTarget);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Levenshtein",
">",
"T",
"sorensenDice",
"(",
"String",
"baseTarget",
",",
"String",
"compareTarget",
",",
"Integer",
"k",
")",
"{",
"return",
"(",
"T",
")",
"new",
... | Returns a new Sorensen-Dice coefficient instance with compare target string and k-shingling
@see SorensenDice
@param baseTarget
@param compareTarget
@param k
@return | [
"Returns",
"a",
"new",
"Sorensen",
"-",
"Dice",
"coefficient",
"instance",
"with",
"compare",
"target",
"string",
"and",
"k",
"-",
"shingling"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java#L308-L311 |
intellimate/Izou | src/main/java/org/intellimate/izou/security/PermissionManager.java | PermissionManager.checkPermission | public void checkPermission(Permission perm, AddOnModel addOnModel) throws IzouPermissionException {
"""
checks the permission
@param perm the permission
@param addOnModel the associated AddOnModel
@throws IzouPermissionException if the permission was not granted
"""
try {
rootPermission... | java | public void checkPermission(Permission perm, AddOnModel addOnModel) throws IzouPermissionException {
try {
rootPermission.checkPermission(perm, addOnModel);
//its root
return;
} catch (IzouPermissionException ignored) {
//its just not root
}
... | [
"public",
"void",
"checkPermission",
"(",
"Permission",
"perm",
",",
"AddOnModel",
"addOnModel",
")",
"throws",
"IzouPermissionException",
"{",
"try",
"{",
"rootPermission",
".",
"checkPermission",
"(",
"perm",
",",
"addOnModel",
")",
";",
"//its root",
"return",
... | checks the permission
@param perm the permission
@param addOnModel the associated AddOnModel
@throws IzouPermissionException if the permission was not granted | [
"checks",
"the",
"permission"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/security/PermissionManager.java#L51-L62 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.relativeSmoothQuadTo | public SVGPath relativeSmoothQuadTo(double x, double y) {
"""
Smooth quadratic Bezier line to the given relative coordinates.
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax.
"""
return append(PATH_SMOOTH_QUAD_TO_RELATIVE).append(x).append(y);
} | java | public SVGPath relativeSmoothQuadTo(double x, double y) {
return append(PATH_SMOOTH_QUAD_TO_RELATIVE).append(x).append(y);
} | [
"public",
"SVGPath",
"relativeSmoothQuadTo",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"append",
"(",
"PATH_SMOOTH_QUAD_TO_RELATIVE",
")",
".",
"append",
"(",
"x",
")",
".",
"append",
"(",
"y",
")",
";",
"}"
] | Smooth quadratic Bezier line to the given relative coordinates.
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax. | [
"Smooth",
"quadratic",
"Bezier",
"line",
"to",
"the",
"given",
"relative",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L524-L526 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/AbstractBceClient.java | AbstractBceClient.invokeHttpClient | protected <T extends AbstractBceResponse> T invokeHttpClient(InternalRequest request, Class<T> responseClass) {
"""
Subclasses should invoke this method for sending request to the target service.
<p>
This method will add "Content-Type" and "Date" to headers with default values if not present.
@param request t... | java | protected <T extends AbstractBceResponse> T invokeHttpClient(InternalRequest request, Class<T> responseClass) {
if (!request.getHeaders().containsKey(Headers.CONTENT_TYPE)) {
request.addHeader(Headers.CONTENT_TYPE, DEFAULT_CONTENT_TYPE);
}
if (!request.getHeaders().containsKey(Heade... | [
"protected",
"<",
"T",
"extends",
"AbstractBceResponse",
">",
"T",
"invokeHttpClient",
"(",
"InternalRequest",
"request",
",",
"Class",
"<",
"T",
">",
"responseClass",
")",
"{",
"if",
"(",
"!",
"request",
".",
"getHeaders",
"(",
")",
".",
"containsKey",
"(",... | Subclasses should invoke this method for sending request to the target service.
<p>
This method will add "Content-Type" and "Date" to headers with default values if not present.
@param request the request to build up the HTTP request.
@param responseClass the response class.
@param <T> the type of response
@return the... | [
"Subclasses",
"should",
"invoke",
"this",
"method",
"for",
"sending",
"request",
"to",
"the",
"target",
"service",
".",
"<p",
">",
"This",
"method",
"will",
"add",
"Content",
"-",
"Type",
"and",
"Date",
"to",
"headers",
"with",
"default",
"values",
"if",
"... | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/AbstractBceClient.java#L180-L190 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildSerializedFormSummaries | public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) {
"""
Build the serialized form summaries.
@param node the XML element that specifies which components to document
@param serializedTree content tree to which the documentation will be added
"""
Content serializedSummari... | java | public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) {
Content serializedSummariesTree = writer.getSerializedSummariesHeader();
PackageDoc[] packages = configuration.packages;
for (int i = 0; i < packages.length; i++) {
currentPackage = packages[i];
... | [
"public",
"void",
"buildSerializedFormSummaries",
"(",
"XMLNode",
"node",
",",
"Content",
"serializedTree",
")",
"{",
"Content",
"serializedSummariesTree",
"=",
"writer",
".",
"getSerializedSummariesHeader",
"(",
")",
";",
"PackageDoc",
"[",
"]",
"packages",
"=",
"c... | Build the serialized form summaries.
@param node the XML element that specifies which components to document
@param serializedTree content tree to which the documentation will be added | [
"Build",
"the",
"serialized",
"form",
"summaries",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L163-L172 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Block.java | Block.parseTransactions | protected void parseTransactions(final int transactionsOffset) throws ProtocolException {
"""
Parse transactions from the block.
@param transactionsOffset Offset of the transactions within the block.
Useful for non-Bitcoin chains where the block header may not be a fixed
size.
"""
cursor = transac... | java | protected void parseTransactions(final int transactionsOffset) throws ProtocolException {
cursor = transactionsOffset;
optimalEncodingMessageSize = HEADER_SIZE;
if (payload.length == cursor) {
// This message is just a header, it has no transactions.
transactionBytesValid... | [
"protected",
"void",
"parseTransactions",
"(",
"final",
"int",
"transactionsOffset",
")",
"throws",
"ProtocolException",
"{",
"cursor",
"=",
"transactionsOffset",
";",
"optimalEncodingMessageSize",
"=",
"HEADER_SIZE",
";",
"if",
"(",
"payload",
".",
"length",
"==",
... | Parse transactions from the block.
@param transactionsOffset Offset of the transactions within the block.
Useful for non-Bitcoin chains where the block header may not be a fixed
size. | [
"Parse",
"transactions",
"from",
"the",
"block",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Block.java#L230-L251 |
facebookarchive/hive-dwrf | hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java | Slice.setShort | public void setShort(int index, int value) {
"""
Sets the specified 16-bit short integer at the specified absolute
{@code index} in this buffer. The 16 high-order bits of the specified
value are ignored.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
{@code index ... | java | public void setShort(int index, int value)
{
checkIndexLength(index, SizeOf.SIZE_OF_SHORT);
unsafe.putShort(base, address + index, (short) (value & 0xFFFF));
} | [
"public",
"void",
"setShort",
"(",
"int",
"index",
",",
"int",
"value",
")",
"{",
"checkIndexLength",
"(",
"index",
",",
"SizeOf",
".",
"SIZE_OF_SHORT",
")",
";",
"unsafe",
".",
"putShort",
"(",
"base",
",",
"address",
"+",
"index",
",",
"(",
"short",
... | Sets the specified 16-bit short integer at the specified absolute
{@code index} in this buffer. The 16 high-order bits of the specified
value are ignored.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
{@code index + 2} is greater than {@code this.length()} | [
"Sets",
"the",
"specified",
"16",
"-",
"bit",
"short",
"integer",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"in",
"this",
"buffer",
".",
"The",
"16",
"high",
"-",
"order",
"bits",
"of",
"the",
"specified",
"value",
"are",
"ignored... | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java#L420-L424 |
sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/GeneratorMojo.java | GeneratorMojo.extendProjectCompileRootsAndResources | protected void extendProjectCompileRootsAndResources() throws MojoExecutionException {
"""
Extends {@link MavenProject}s compile source roots and resource
directories with the directories holding the generated artifacts.
<p>
There's no problem to call this method multiple time. The corresponding
directories ar... | java | protected void extendProjectCompileRootsAndResources() throws MojoExecutionException {
if (project != null) {
try {
extendCompileSourceRoots();
extendResources(outletResDir, false);
extendResources(outletResOnceDir, false);
extendResources(outletResTestDir, true);
extendResources(outletResTestO... | [
"protected",
"void",
"extendProjectCompileRootsAndResources",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"project",
"!=",
"null",
")",
"{",
"try",
"{",
"extendCompileSourceRoots",
"(",
")",
";",
"extendResources",
"(",
"outletResDir",
",",
"false"... | Extends {@link MavenProject}s compile source roots and resource
directories with the directories holding the generated artifacts.
<p>
There's no problem to call this method multiple time. The corresponding
directories are added only once. | [
"Extends",
"{"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/GeneratorMojo.java#L255-L267 |
Azure/azure-sdk-for-java | loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/implementation/LogAnalyticsDataClientImpl.java | LogAnalyticsDataClientImpl.queryAsync | public Observable<QueryResults> queryAsync(String workspaceId, QueryBody body) {
"""
Execute an Analytics query.
Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query.
@param workspaceId ID of the workspace. Th... | java | public Observable<QueryResults> queryAsync(String workspaceId, QueryBody body) {
return queryWithServiceResponseAsync(workspaceId, body).map(new Func1<ServiceResponse<QueryResults>, QueryResults>() {
@Override
public QueryResults call(ServiceResponse<QueryResults> response) {
... | [
"public",
"Observable",
"<",
"QueryResults",
">",
"queryAsync",
"(",
"String",
"workspaceId",
",",
"QueryBody",
"body",
")",
"{",
"return",
"queryWithServiceResponseAsync",
"(",
"workspaceId",
",",
"body",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceRespo... | Execute an Analytics query.
Executes an Analytics query for data. [Here](https://dev.loganalytics.io/documentation/Using-the-API) is an example for using POST with an Analytics query.
@param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal.
@param body The Analytics q... | [
"Execute",
"an",
"Analytics",
"query",
".",
"Executes",
"an",
"Analytics",
"query",
"for",
"data",
".",
"[",
"Here",
"]",
"(",
"https",
":",
"//",
"dev",
".",
"loganalytics",
".",
"io",
"/",
"documentation",
"/",
"Using",
"-",
"the",
"-",
"API",
")",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/loganalytics/data-plane/src/main/java/com/microsoft/azure/loganalytics/implementation/LogAnalyticsDataClientImpl.java#L222-L229 |
validator/validator | src/nu/validator/validation/SimpleDocumentValidator.java | SimpleDocumentValidator.setUpMainSchema | public void setUpMainSchema(String schemaUrl, ErrorHandler errorHandler)
throws SAXException, Exception, SchemaReadException {
"""
/* *
Prepares the main RelaxNG schema to use for document validation, by
retrieving a serialized schema instance from the copies of known
http://s.validator.nu/* schemas... | java | public void setUpMainSchema(String schemaUrl, ErrorHandler errorHandler)
throws SAXException, Exception, SchemaReadException {
Schema schema = schemaByUrl(schemaUrl, errorHandler);
if (schemaUrl.contains("html5")) {
try {
assertionSchema = CheckerSchema.ASSERTION_... | [
"public",
"void",
"setUpMainSchema",
"(",
"String",
"schemaUrl",
",",
"ErrorHandler",
"errorHandler",
")",
"throws",
"SAXException",
",",
"Exception",
",",
"SchemaReadException",
"{",
"Schema",
"schema",
"=",
"schemaByUrl",
"(",
"schemaUrl",
",",
"errorHandler",
")"... | /* *
Prepares the main RelaxNG schema to use for document validation, by
retrieving a serialized schema instance from the copies of known
http://s.validator.nu/* schemas in the local entity cache packaged with
the validator code and creating a Schema instance from it. Also checks
for resolution of secondary schemas.
@... | [
"/",
"*",
"*",
"Prepares",
"the",
"main",
"RelaxNG",
"schema",
"to",
"use",
"for",
"document",
"validation",
"by",
"retrieving",
"a",
"serialized",
"schema",
"instance",
"from",
"the",
"copies",
"of",
"known",
"http",
":",
"//",
"s",
".",
"validator",
".",... | train | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/validation/SimpleDocumentValidator.java#L253-L283 |
eclipse/hawkbit | hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java | AmqpMessageHandlerService.onMessage | public Message onMessage(final Message message, final String type, final String tenant, final String virtualHost) {
"""
* Executed if a amqp message arrives.
@param message
the message
@param type
the type
@param tenant
the tenant
@param virtualHost
the virtual host
@return the rpc message back to suppl... | java | public Message onMessage(final Message message, final String type, final String tenant, final String virtualHost) {
if (StringUtils.isEmpty(type) || StringUtils.isEmpty(tenant)) {
throw new AmqpRejectAndDontRequeueException("Invalid message! tenant and type header are mandatory!");
}
... | [
"public",
"Message",
"onMessage",
"(",
"final",
"Message",
"message",
",",
"final",
"String",
"type",
",",
"final",
"String",
"tenant",
",",
"final",
"String",
"virtualHost",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"type",
")",
"||",
"Stri... | * Executed if a amqp message arrives.
@param message
the message
@param type
the type
@param tenant
the tenant
@param virtualHost
the virtual host
@return the rpc message back to supplier. | [
"*",
"Executed",
"if",
"a",
"amqp",
"message",
"arrives",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java#L126-L158 |
Jasig/uPortal | uPortal-core/src/main/java/org/apereo/portal/properties/PropertiesManager.java | PropertiesManager.getPropertyAsShort | public static short getPropertyAsShort(String name)
throws MissingPropertyException, BadPropertyException {
"""
Returns the value of a property for a given name as a <code>short</code>
@param name the name of the requested property
@return value the property's value as a <code>short</code>
@throws... | java | public static short getPropertyAsShort(String name)
throws MissingPropertyException, BadPropertyException {
if (PropertiesManager.props == null) loadProps();
try {
return Short.parseShort(getProperty(name));
} catch (NumberFormatException nfe) {
throw new BadP... | [
"public",
"static",
"short",
"getPropertyAsShort",
"(",
"String",
"name",
")",
"throws",
"MissingPropertyException",
",",
"BadPropertyException",
"{",
"if",
"(",
"PropertiesManager",
".",
"props",
"==",
"null",
")",
"loadProps",
"(",
")",
";",
"try",
"{",
"retur... | Returns the value of a property for a given name as a <code>short</code>
@param name the name of the requested property
@return value the property's value as a <code>short</code>
@throws MissingPropertyException - if the property is not set
@throws BadPropertyException - if the property cannot be parsed as a short or ... | [
"Returns",
"the",
"value",
"of",
"a",
"property",
"for",
"a",
"given",
"name",
"as",
"a",
"<code",
">",
"short<",
"/",
"code",
">"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-core/src/main/java/org/apereo/portal/properties/PropertiesManager.java#L219-L227 |
redkale/redkale | src/org/redkale/source/EntityInfo.java | EntityInfo.getSQLValue | public Object getSQLValue(String fieldname, Serializable fieldvalue) {
"""
字段值转换成数据库的值
@param fieldname 字段名
@param fieldvalue 字段值
@return Object
"""
if (this.cryptmap == null) return fieldvalue;
CryptHandler handler = this.cryptmap.get(fieldname);
if (handler == null) return ... | java | public Object getSQLValue(String fieldname, Serializable fieldvalue) {
if (this.cryptmap == null) return fieldvalue;
CryptHandler handler = this.cryptmap.get(fieldname);
if (handler == null) return fieldvalue;
return handler.encrypt(fieldvalue);
} | [
"public",
"Object",
"getSQLValue",
"(",
"String",
"fieldname",
",",
"Serializable",
"fieldvalue",
")",
"{",
"if",
"(",
"this",
".",
"cryptmap",
"==",
"null",
")",
"return",
"fieldvalue",
";",
"CryptHandler",
"handler",
"=",
"this",
".",
"cryptmap",
".",
"get... | 字段值转换成数据库的值
@param fieldname 字段名
@param fieldvalue 字段值
@return Object | [
"字段值转换成数据库的值"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/EntityInfo.java#L890-L895 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java | GVRPicker.findCollider | protected GVRPickedObject findCollider(GVRPickedObject[] pickList, GVRCollider findme) {
"""
Find the collision against a specific collider in a list of collisions.
@param pickList collision list
@param findme collider to find
@return collision with the specified collider, null if not found
"""
if... | java | protected GVRPickedObject findCollider(GVRPickedObject[] pickList, GVRCollider findme)
{
if (pickList == null)
{
return null;
}
for (GVRPickedObject hit : pickList)
{
if ((hit != null) && (hit.hitCollider == findme))
{
retur... | [
"protected",
"GVRPickedObject",
"findCollider",
"(",
"GVRPickedObject",
"[",
"]",
"pickList",
",",
"GVRCollider",
"findme",
")",
"{",
"if",
"(",
"pickList",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"for",
"(",
"GVRPickedObject",
"hit",
":",
"pickL... | Find the collision against a specific collider in a list of collisions.
@param pickList collision list
@param findme collider to find
@return collision with the specified collider, null if not found | [
"Find",
"the",
"collision",
"against",
"a",
"specific",
"collider",
"in",
"a",
"list",
"of",
"collisions",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L894-L908 |
google/closure-compiler | src/com/google/javascript/jscomp/gwt/client/Es6ClassConverterJsDocHelper.java | Es6ClassConverterJsDocHelper.getConstructorJsDoc | @JsMethod(name = "getConstructorJsDoc", namespace = "jscomp")
public static String getConstructorJsDoc(String jsDoc) {
"""
Gets JS Doc that should be moved to a constructor. Used to upgrade ES5 to ES6 classes and
separate class from constructor comments.
"""
if (Strings.isNullOrEmpty(jsDoc)) {
ret... | java | @JsMethod(name = "getConstructorJsDoc", namespace = "jscomp")
public static String getConstructorJsDoc(String jsDoc) {
if (Strings.isNullOrEmpty(jsDoc)) {
return null;
}
Config config =
Config.builder()
.setLanguageMode(LanguageMode.ECMASCRIPT3)
.setStrictMode(Config.... | [
"@",
"JsMethod",
"(",
"name",
"=",
"\"getConstructorJsDoc\"",
",",
"namespace",
"=",
"\"jscomp\"",
")",
"public",
"static",
"String",
"getConstructorJsDoc",
"(",
"String",
"jsDoc",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"jsDoc",
")",
")",
... | Gets JS Doc that should be moved to a constructor. Used to upgrade ES5 to ES6 classes and
separate class from constructor comments. | [
"Gets",
"JS",
"Doc",
"that",
"should",
"be",
"moved",
"to",
"a",
"constructor",
".",
"Used",
"to",
"upgrade",
"ES5",
"to",
"ES6",
"classes",
"and",
"separate",
"class",
"from",
"constructor",
"comments",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/gwt/client/Es6ClassConverterJsDocHelper.java#L94-L123 |
jbundle/jcalendarbutton | src/main/java/org/jbundle/util/jcalendarbutton/JCalendarPopup.java | JCalendarPopup.createCalendarPopup | public static JCalendarPopup createCalendarPopup(String strDateParam, Date dateTarget, Component button) {
"""
Create this calendar in a popup menu and synchronize the text field on change.
@param strDateParam The name of the date property (defaults to "date").
@param dateTarget The initial date for this button.... | java | public static JCalendarPopup createCalendarPopup(String strDateParam, Date dateTarget, Component button)
{
return JCalendarPopup.createCalendarPopup(null, dateTarget, button, null);
} | [
"public",
"static",
"JCalendarPopup",
"createCalendarPopup",
"(",
"String",
"strDateParam",
",",
"Date",
"dateTarget",
",",
"Component",
"button",
")",
"{",
"return",
"JCalendarPopup",
".",
"createCalendarPopup",
"(",
"null",
",",
"dateTarget",
",",
"button",
",",
... | Create this calendar in a popup menu and synchronize the text field on change.
@param strDateParam The name of the date property (defaults to "date").
@param dateTarget The initial date for this button.
@param button The calling button. | [
"Create",
"this",
"calendar",
"in",
"a",
"popup",
"menu",
"and",
"synchronize",
"the",
"text",
"field",
"on",
"change",
"."
] | train | https://github.com/jbundle/jcalendarbutton/blob/2944e6a0b634b83768d5c0b7b4a2898176421403/src/main/java/org/jbundle/util/jcalendarbutton/JCalendarPopup.java#L582-L585 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java | IPv6AddressSection.spanWithPrefixBlocks | public IPv6AddressSection[] spanWithPrefixBlocks(IPv6AddressSection other) throws AddressPositionException {
"""
Produces the list of prefix block subnets that span from this series to the given series.
@param other
@return
"""
if(other.addressSegmentIndex != addressSegmentIndex) {
throw new AddressPo... | java | public IPv6AddressSection[] spanWithPrefixBlocks(IPv6AddressSection other) throws AddressPositionException {
if(other.addressSegmentIndex != addressSegmentIndex) {
throw new AddressPositionException(other, other.addressSegmentIndex, addressSegmentIndex);
}
return getSpanningPrefixBlocks(
this,
other,
... | [
"public",
"IPv6AddressSection",
"[",
"]",
"spanWithPrefixBlocks",
"(",
"IPv6AddressSection",
"other",
")",
"throws",
"AddressPositionException",
"{",
"if",
"(",
"other",
".",
"addressSegmentIndex",
"!=",
"addressSegmentIndex",
")",
"{",
"throw",
"new",
"AddressPositionE... | Produces the list of prefix block subnets that span from this series to the given series.
@param other
@return | [
"Produces",
"the",
"list",
"of",
"prefix",
"block",
"subnets",
"that",
"span",
"from",
"this",
"series",
"to",
"the",
"given",
"series",
"."
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6AddressSection.java#L1986-L1999 |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/util/BigDecimalUtil.java | BigDecimalUtil.roundUp | public static BigDecimal roundUp(final BigDecimal n, final int p) {
"""
Returns a value rounded-up to p digits after decimal.
If p is negative, then the number is rounded to
places to the left of the decimal point. eg.
10.23 rounded to -1 will give: 20. If p is zero,
the returned value is rounded to the neares... | java | public static BigDecimal roundUp(final BigDecimal n, final int p) {
if (n == null) {
return null;
}
final int scale = n.scale();
return BigDecimalUtil.setScale(BigDecimal.valueOf(roundUp(n.doubleValue(), p)), scale);
} | [
"public",
"static",
"BigDecimal",
"roundUp",
"(",
"final",
"BigDecimal",
"n",
",",
"final",
"int",
"p",
")",
"{",
"if",
"(",
"n",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"scale",
"=",
"n",
".",
"scale",
"(",
")",
";",
... | Returns a value rounded-up to p digits after decimal.
If p is negative, then the number is rounded to
places to the left of the decimal point. eg.
10.23 rounded to -1 will give: 20. If p is zero,
the returned value is rounded to the nearest integral
value.
<p>If n is negative, the resulting value is obtained
as the rou... | [
"Returns",
"a",
"value",
"rounded",
"-",
"up",
"to",
"p",
"digits",
"after",
"decimal",
".",
"If",
"p",
"is",
"negative",
"then",
"the",
"number",
"is",
"rounded",
"to",
"places",
"to",
"the",
"left",
"of",
"the",
"decimal",
"point",
".",
"eg",
".",
... | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/util/BigDecimalUtil.java#L641-L647 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java | StringUtils.checkSize | public static String checkSize(Object value, String defaultValue) {
"""
limit string size to 32.
@param value the value
@param defaultValue the default value
@return the string
"""
return checkSize(value, VIEW_SIZE, defaultValue);
} | java | public static String checkSize(Object value, String defaultValue) {
return checkSize(value, VIEW_SIZE, defaultValue);
} | [
"public",
"static",
"String",
"checkSize",
"(",
"Object",
"value",
",",
"String",
"defaultValue",
")",
"{",
"return",
"checkSize",
"(",
"value",
",",
"VIEW_SIZE",
",",
"defaultValue",
")",
";",
"}"
] | limit string size to 32.
@param value the value
@param defaultValue the default value
@return the string | [
"limit",
"string",
"size",
"to",
"32",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L173-L175 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java | ResolvableType.forMethodReturnType | public static ResolvableType forMethodReturnType(Method method) {
"""
Return a {@link ResolvableType} for the specified {@link Method} return type.
@param method the source for the method return type
@return a {@link ResolvableType} for the specified method return
@see #forMethodReturnType(Method, Class)
... | java | public static ResolvableType forMethodReturnType(Method method) {
LettuceAssert.notNull(method, "Method must not be null");
return forMethodParameter(new MethodParameter(method, -1));
} | [
"public",
"static",
"ResolvableType",
"forMethodReturnType",
"(",
"Method",
"method",
")",
"{",
"LettuceAssert",
".",
"notNull",
"(",
"method",
",",
"\"Method must not be null\"",
")",
";",
"return",
"forMethodParameter",
"(",
"new",
"MethodParameter",
"(",
"method",
... | Return a {@link ResolvableType} for the specified {@link Method} return type.
@param method the source for the method return type
@return a {@link ResolvableType} for the specified method return
@see #forMethodReturnType(Method, Class) | [
"Return",
"a",
"{",
"@link",
"ResolvableType",
"}",
"for",
"the",
"specified",
"{",
"@link",
"Method",
"}",
"return",
"type",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java#L919-L922 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckAccessControls.java | CheckAccessControls.checkTypeDeprecation | private void checkTypeDeprecation(NodeTraversal t, Node n) {
"""
Reports deprecation issue with regard to a type usage.
<p>Precondition: {@code n} has a constructor {@link JSType}.
"""
if (!shouldEmitDeprecationWarning(t, n)) {
return;
}
ObjectType instanceType = n.getJSType().toMaybeFunc... | java | private void checkTypeDeprecation(NodeTraversal t, Node n) {
if (!shouldEmitDeprecationWarning(t, n)) {
return;
}
ObjectType instanceType = n.getJSType().toMaybeFunctionType().getInstanceType();
String deprecationInfo = getTypeDeprecationInfo(instanceType);
if (deprecationInfo == null) {
... | [
"private",
"void",
"checkTypeDeprecation",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
")",
"{",
"if",
"(",
"!",
"shouldEmitDeprecationWarning",
"(",
"t",
",",
"n",
")",
")",
"{",
"return",
";",
"}",
"ObjectType",
"instanceType",
"=",
"n",
".",
"getJSType... | Reports deprecation issue with regard to a type usage.
<p>Precondition: {@code n} has a constructor {@link JSType}. | [
"Reports",
"deprecation",
"issue",
"with",
"regard",
"to",
"a",
"type",
"usage",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckAccessControls.java#L431-L445 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java | JdbcCpoAdapter.processUpdateGroup | protected <T> long processUpdateGroup(T obj, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Connection con) throws CpoException {
"""
DOCUMENT ME!
@param obj DOCUMENT ME!
@param groupType DOCUMENT ME!
@par... | java | protected <T> long processUpdateGroup(T obj, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions, Connection con) throws CpoException {
Logger localLogger = obj == null ? logger : LoggerFactory.getLogger(obj.getClass());
... | [
"protected",
"<",
"T",
">",
"long",
"processUpdateGroup",
"(",
"T",
"obj",
",",
"String",
"groupType",
",",
"String",
"groupName",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Collection",
"<"... | DOCUMENT ME!
@param obj DOCUMENT ME!
@param groupType DOCUMENT ME!
@param groupName DOCUMENT ME!
@param con DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L2605-L2650 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java | Assertions.assertNotNull | @Nonnull
public static <T> T assertNotNull(@Nullable final T object) {
"""
Assert that value is not null
@param <T> type of the object to check
@param object the object to check
@return the same input parameter if all is ok
@throws AssertionError it will be thrown if the value is null
@since 1.0
""... | java | @Nonnull
public static <T> T assertNotNull(@Nullable final T object) {
return assertNotNull(null, object);
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"T",
"assertNotNull",
"(",
"@",
"Nullable",
"final",
"T",
"object",
")",
"{",
"return",
"assertNotNull",
"(",
"null",
",",
"object",
")",
";",
"}"
] | Assert that value is not null
@param <T> type of the object to check
@param object the object to check
@return the same input parameter if all is ok
@throws AssertionError it will be thrown if the value is null
@since 1.0 | [
"Assert",
"that",
"value",
"is",
"not",
"null"
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java#L109-L112 |
amzn/ion-java | src/com/amazon/ion/Timestamp.java | Timestamp.addMonth | public final Timestamp addMonth(int amount) {
"""
Returns a timestamp relative to this one by the given number of months.
The day field may be adjusted to account for different month length and
leap days. For example, adding one month to {@code 2011-01-31}
results in {@code 2011-02-28}.
@param amount a numb... | java | public final Timestamp addMonth(int amount)
{
if (amount == 0 && _precision.includes(Precision.MONTH)) return this;
return addMonthForPrecision(amount, _precision.includes(Precision.MONTH) ? _precision : Precision.MONTH);
} | [
"public",
"final",
"Timestamp",
"addMonth",
"(",
"int",
"amount",
")",
"{",
"if",
"(",
"amount",
"==",
"0",
"&&",
"_precision",
".",
"includes",
"(",
"Precision",
".",
"MONTH",
")",
")",
"return",
"this",
";",
"return",
"addMonthForPrecision",
"(",
"amount... | Returns a timestamp relative to this one by the given number of months.
The day field may be adjusted to account for different month length and
leap days. For example, adding one month to {@code 2011-01-31}
results in {@code 2011-02-28}.
@param amount a number of months. | [
"Returns",
"a",
"timestamp",
"relative",
"to",
"this",
"one",
"by",
"the",
"given",
"number",
"of",
"months",
".",
"The",
"day",
"field",
"may",
"be",
"adjusted",
"to",
"account",
"for",
"different",
"month",
"length",
"and",
"leap",
"days",
".",
"For",
... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/Timestamp.java#L2494-L2498 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java | ExtensionsInner.beginDisableMonitoring | public void beginDisableMonitoring(String resourceGroupName, String clusterName) {
"""
Disables the Operations Management Suite (OMS) on the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parame... | java | public void beginDisableMonitoring(String resourceGroupName, String clusterName) {
beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | [
"public",
"void",
"beginDisableMonitoring",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"beginDisableMonitoringWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
... | Disables the Operations Management Suite (OMS) on the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by ser... | [
"Disables",
"the",
"Operations",
"Management",
"Suite",
"(",
"OMS",
")",
"on",
"the",
"HDInsight",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ExtensionsInner.java#L434-L436 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java | XmlStringBuilder.appendAttribute | public void appendAttribute(final String name, final int value) {
"""
<p>
Adds an xml attribute name+value pair to the end of this XmlStringBuilder.
</p>
<p>
Eg. name="1"
</p>
@param name the name of the attribute to be added.
@param value the value of the attribute to be added.
"""
write(' ');
wr... | java | public void appendAttribute(final String name, final int value) {
write(' ');
write(name);
write("=\"");
write(String.valueOf(value));
write('"');
} | [
"public",
"void",
"appendAttribute",
"(",
"final",
"String",
"name",
",",
"final",
"int",
"value",
")",
"{",
"write",
"(",
"'",
"'",
")",
";",
"write",
"(",
"name",
")",
";",
"write",
"(",
"\"=\\\"\"",
")",
";",
"write",
"(",
"String",
".",
"valueOf"... | <p>
Adds an xml attribute name+value pair to the end of this XmlStringBuilder.
</p>
<p>
Eg. name="1"
</p>
@param name the name of the attribute to be added.
@param value the value of the attribute to be added. | [
"<p",
">",
"Adds",
"an",
"xml",
"attribute",
"name",
"+",
"value",
"pair",
"to",
"the",
"end",
"of",
"this",
"XmlStringBuilder",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Eg",
".",
"name",
"=",
"1",
"<",
"/",
"p",
">"
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/XmlStringBuilder.java#L215-L221 |
centic9/commons-dost | src/main/java/org/dstadler/commons/http/HttpClientWrapper.java | HttpClientWrapper.simpleGet | public void simpleGet(String url, Consumer<InputStream> consumer) throws IOException {
"""
Perform a simple get-operation and passes the resulting InputStream to the given Consumer
@param url The URL to query
@param consumer A Consumer which receives the InputStream and can process the data
on-the-fly in stre... | java | public void simpleGet(String url, Consumer<InputStream> consumer) throws IOException {
simpleGetInternal(url, consumer, null);
} | [
"public",
"void",
"simpleGet",
"(",
"String",
"url",
",",
"Consumer",
"<",
"InputStream",
">",
"consumer",
")",
"throws",
"IOException",
"{",
"simpleGetInternal",
"(",
"url",
",",
"consumer",
",",
"null",
")",
";",
"}"
] | Perform a simple get-operation and passes the resulting InputStream to the given Consumer
@param url The URL to query
@param consumer A Consumer which receives the InputStream and can process the data
on-the-fly in streaming fashion without retrieving all of the data into memory
at once.
@throws IOException if the HT... | [
"Perform",
"a",
"simple",
"get",
"-",
"operation",
"and",
"passes",
"the",
"resulting",
"InputStream",
"to",
"the",
"given",
"Consumer"
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/HttpClientWrapper.java#L209-L211 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/ServiceUtils.java | ServiceUtils.getPartSize | @SdkInternalApi
public static long getPartSize(GetObjectRequest getObjectRequest, AmazonS3 s3, int partNumber) {
"""
Returns the part size of the part
@param getObjectRequest the request to check
@param s3 the s3 client
@param partNumber the part number
@return the part size
"""
ValidationUti... | java | @SdkInternalApi
public static long getPartSize(GetObjectRequest getObjectRequest, AmazonS3 s3, int partNumber) {
ValidationUtils.assertNotNull(s3, "S3 client");
ValidationUtils.assertNotNull(getObjectRequest, "GetObjectRequest");
GetObjectMetadataRequest getObjectMetadataRequest = RequestCo... | [
"@",
"SdkInternalApi",
"public",
"static",
"long",
"getPartSize",
"(",
"GetObjectRequest",
"getObjectRequest",
",",
"AmazonS3",
"s3",
",",
"int",
"partNumber",
")",
"{",
"ValidationUtils",
".",
"assertNotNull",
"(",
"s3",
",",
"\"S3 client\"",
")",
";",
"Validatio... | Returns the part size of the part
@param getObjectRequest the request to check
@param s3 the s3 client
@param partNumber the part number
@return the part size | [
"Returns",
"the",
"part",
"size",
"of",
"the",
"part"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/ServiceUtils.java#L532-L541 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/rest/RestTools.java | RestTools.getRemoteAddrFromRequest | public static String getRemoteAddrFromRequest(Request request, Set<IpSubnet> trustedSubnets) {
"""
If X-Forwarded-For request header is set, and the request came from a trusted source,
return the value of X-Forwarded-For. Otherwise return {@link Request#getRemoteAddr()}.
"""
final String remoteAddr = ... | java | public static String getRemoteAddrFromRequest(Request request, Set<IpSubnet> trustedSubnets) {
final String remoteAddr = request.getRemoteAddr();
final String XForwardedFor = request.getHeader("X-Forwarded-For");
if (XForwardedFor != null) {
for (IpSubnet s : trustedSubnets) {
... | [
"public",
"static",
"String",
"getRemoteAddrFromRequest",
"(",
"Request",
"request",
",",
"Set",
"<",
"IpSubnet",
">",
"trustedSubnets",
")",
"{",
"final",
"String",
"remoteAddr",
"=",
"request",
".",
"getRemoteAddr",
"(",
")",
";",
"final",
"String",
"XForwarde... | If X-Forwarded-For request header is set, and the request came from a trusted source,
return the value of X-Forwarded-For. Otherwise return {@link Request#getRemoteAddr()}. | [
"If",
"X",
"-",
"Forwarded",
"-",
"For",
"request",
"header",
"is",
"set",
"and",
"the",
"request",
"came",
"from",
"a",
"trusted",
"source",
"return",
"the",
"value",
"of",
"X",
"-",
"Forwarded",
"-",
"For",
".",
"Otherwise",
"return",
"{"
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/rest/RestTools.java#L66-L84 |
pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.updatePlugin | public boolean updatePlugin(String id, String version) throws PluginException {
"""
Updates a plugin id to given version or to latest version if {@code version == null}.
@param id the id of plugin to update
@param version the version to update to, on SemVer format, or null for latest
@return true if update su... | java | public boolean updatePlugin(String id, String version) throws PluginException {
if (pluginManager.getPlugin(id) == null) {
throw new PluginException("Plugin {} cannot be updated since it is not installed", id);
}
PluginInfo pluginInfo = getPluginsMap().get(id);
if (pluginInf... | [
"public",
"boolean",
"updatePlugin",
"(",
"String",
"id",
",",
"String",
"version",
")",
"throws",
"PluginException",
"{",
"if",
"(",
"pluginManager",
".",
"getPlugin",
"(",
"id",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"PluginException",
"(",
"\"Plugin... | Updates a plugin id to given version or to latest version if {@code version == null}.
@param id the id of plugin to update
@param version the version to update to, on SemVer format, or null for latest
@return true if update successful
@exception PluginException in case the given version is not available, plugin id not... | [
"Updates",
"a",
"plugin",
"id",
"to",
"given",
"version",
"or",
"to",
"latest",
"version",
"if",
"{",
"@code",
"version",
"==",
"null",
"}",
"."
] | train | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L339-L373 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/EvaluateClustering.java | EvaluateClustering.evaluteResult | protected void evaluteResult(Database db, Clustering<?> c, Clustering<?> refc) {
"""
Evaluate a clustering result.
@param db Database
@param c Clustering
@param refc Reference clustering
"""
ClusterContingencyTable contmat = new ClusterContingencyTable(selfPairing, noiseSpecialHandling);
contmat.p... | java | protected void evaluteResult(Database db, Clustering<?> c, Clustering<?> refc) {
ClusterContingencyTable contmat = new ClusterContingencyTable(selfPairing, noiseSpecialHandling);
contmat.process(refc, c);
ScoreResult sr = new ScoreResult(contmat);
sr.addHeader(c.getLongName());
db.getHierarchy().ad... | [
"protected",
"void",
"evaluteResult",
"(",
"Database",
"db",
",",
"Clustering",
"<",
"?",
">",
"c",
",",
"Clustering",
"<",
"?",
">",
"refc",
")",
"{",
"ClusterContingencyTable",
"contmat",
"=",
"new",
"ClusterContingencyTable",
"(",
"selfPairing",
",",
"noise... | Evaluate a clustering result.
@param db Database
@param c Clustering
@param refc Reference clustering | [
"Evaluate",
"a",
"clustering",
"result",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/EvaluateClustering.java#L174-L181 |
abel533/EasyXls | src/main/java/com/github/abel533/easyxls/common/XlsUtil.java | XlsUtil.list2Xls | public static boolean list2Xls(ExcelConfig config, List<?> list, String filePath, String fileName) throws Exception {
"""
导出list对象到excel
@param config 配置
@param list 导出的list
@param filePath 保存xls路径
@param fileName 保存xls文件名
@return 处理结果,true成功,false失败
@throws Exception
"""
//创建目录
F... | java | public static boolean list2Xls(ExcelConfig config, List<?> list, String filePath, String fileName) throws Exception {
//创建目录
File file = new File(filePath);
if (!(file.exists())) {
if (!file.mkdirs()) {
throw new RuntimeException("创建导出目录失败!");
}
}
... | [
"public",
"static",
"boolean",
"list2Xls",
"(",
"ExcelConfig",
"config",
",",
"List",
"<",
"?",
">",
"list",
",",
"String",
"filePath",
",",
"String",
"fileName",
")",
"throws",
"Exception",
"{",
"//创建目录",
"File",
"file",
"=",
"new",
"File",
"(",
"filePath... | 导出list对象到excel
@param config 配置
@param list 导出的list
@param filePath 保存xls路径
@param fileName 保存xls文件名
@return 处理结果,true成功,false失败
@throws Exception | [
"导出list对象到excel"
] | train | https://github.com/abel533/EasyXls/blob/f73be23745c2180d7c0b8f0a510e72e61cc37d5d/src/main/java/com/github/abel533/easyxls/common/XlsUtil.java#L357-L380 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createGroup | public GitlabGroup createGroup(String name, String path) throws IOException {
"""
Creates a Group
@param name The name of the group
@param path The path for the group
@return The GitLab Group
@throws IOException on gitlab api call error
"""
return createGroup(name, path, null, null, null);
} | java | public GitlabGroup createGroup(String name, String path) throws IOException {
return createGroup(name, path, null, null, null);
} | [
"public",
"GitlabGroup",
"createGroup",
"(",
"String",
"name",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"return",
"createGroup",
"(",
"name",
",",
"path",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Creates a Group
@param name The name of the group
@param path The path for the group
@return The GitLab Group
@throws IOException on gitlab api call error | [
"Creates",
"a",
"Group"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L560-L562 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.transformProject | public Vector4d transformProject(double x, double y, double z, double w, Vector4d dest) {
"""
/* (non-Javadoc)
@see org.joml.Matrix4dc#transformProject(double, double, double, double, org.joml.Vector4d)
"""
double invW = 1.0 / (m03 * x + m13 * y + m23 * z + m33 * w);
dest.set((m00 * x + m10 * ... | java | public Vector4d transformProject(double x, double y, double z, double w, Vector4d dest) {
double invW = 1.0 / (m03 * x + m13 * y + m23 * z + m33 * w);
dest.set((m00 * x + m10 * y + m20 * z + m30 * w) * invW,
(m01 * x + m11 * y + m21 * z + m31 * w) * invW,
(m02 * x + m12... | [
"public",
"Vector4d",
"transformProject",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
",",
"double",
"w",
",",
"Vector4d",
"dest",
")",
"{",
"double",
"invW",
"=",
"1.0",
"/",
"(",
"m03",
"*",
"x",
"+",
"m13",
"*",
"y",
"+",
"m23",
... | /* (non-Javadoc)
@see org.joml.Matrix4dc#transformProject(double, double, double, double, org.joml.Vector4d) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L4130-L4137 |
undertow-io/undertow | servlet/src/main/java/io/undertow/servlet/handlers/security/ServletFormAuthenticationMechanism.java | ServletFormAuthenticationMechanism.storeInitialLocation | protected void storeInitialLocation(final HttpServerExchange exchange, byte[] bytes, int contentLength) {
"""
This method doesn't save content of request but instead uses data from parameter.
This should be used in case that data from request was already read and therefore it is not possible to save them.
@par... | java | protected void storeInitialLocation(final HttpServerExchange exchange, byte[] bytes, int contentLength) {
if(!saveOriginalRequest) {
return;
}
final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
HttpSessionImpl htt... | [
"protected",
"void",
"storeInitialLocation",
"(",
"final",
"HttpServerExchange",
"exchange",
",",
"byte",
"[",
"]",
"bytes",
",",
"int",
"contentLength",
")",
"{",
"if",
"(",
"!",
"saveOriginalRequest",
")",
"{",
"return",
";",
"}",
"final",
"ServletRequestConte... | This method doesn't save content of request but instead uses data from parameter.
This should be used in case that data from request was already read and therefore it is not possible to save them.
@param exchange
@param bytes
@param contentLength | [
"This",
"method",
"doesn",
"t",
"save",
"content",
"of",
"request",
"but",
"instead",
"uses",
"data",
"from",
"parameter",
".",
"This",
"should",
"be",
"used",
"in",
"case",
"that",
"data",
"from",
"request",
"was",
"already",
"read",
"and",
"therefore",
"... | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/servlet/src/main/java/io/undertow/servlet/handlers/security/ServletFormAuthenticationMechanism.java#L170-L192 |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/VertexCentricIteration.java | VertexCentricIteration.setUpIteration | private void setUpIteration(DeltaIteration<?, ?> iteration) {
"""
Helper method which sets up an iteration with the given vertex value.
@param iteration
"""
// set up the iteration operator
if (this.configuration != null) {
iteration.name(this.configuration.getName("Vertex-centric iteration (" + co... | java | private void setUpIteration(DeltaIteration<?, ?> iteration) {
// set up the iteration operator
if (this.configuration != null) {
iteration.name(this.configuration.getName("Vertex-centric iteration (" + computeFunction + ")"));
iteration.parallelism(this.configuration.getParallelism());
iteration.setSolut... | [
"private",
"void",
"setUpIteration",
"(",
"DeltaIteration",
"<",
"?",
",",
"?",
">",
"iteration",
")",
"{",
"// set up the iteration operator",
"if",
"(",
"this",
".",
"configuration",
"!=",
"null",
")",
"{",
"iteration",
".",
"name",
"(",
"this",
".",
"conf... | Helper method which sets up an iteration with the given vertex value.
@param iteration | [
"Helper",
"method",
"which",
"sets",
"up",
"an",
"iteration",
"with",
"the",
"given",
"vertex",
"value",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/VertexCentricIteration.java#L443-L461 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/JSPtoPRealization.java | JSPtoPRealization.attachLocalPtoPLocalisation | @Override
public void attachLocalPtoPLocalisation(LocalizationPoint ptoPMessageItemStream) {
"""
Method attachLocalPtoPLocalisation
<p> Attach a local Localisation to this Destination's Localisations.
@param ptoPMessageItemStream is the PtoPMessageItemStream to add.
@param localisationIsRemote should be... | java | @Override
public void attachLocalPtoPLocalisation(LocalizationPoint ptoPMessageItemStream)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"attachLocalPtoPLocalisation",
new Object[] {... | [
"@",
"Override",
"public",
"void",
"attachLocalPtoPLocalisation",
"(",
"LocalizationPoint",
"ptoPMessageItemStream",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry... | Method attachLocalPtoPLocalisation
<p> Attach a local Localisation to this Destination's Localisations.
@param ptoPMessageItemStream is the PtoPMessageItemStream to add.
@param localisationIsRemote should be true if the PtoPMessageItemStream is remote.
@param transaction is the Transaction to add it under. | [
"Method",
"attachLocalPtoPLocalisation"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/JSPtoPRealization.java#L1324-L1356 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java | FormValidator.fileExists | public FormInputValidator fileExists (VisValidatableTextField field, String errorMsg) {
"""
Validates if absolute path entered in text field points to an existing file.
"""
FileExistsValidator validator = new FileExistsValidator(errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | java | public FormInputValidator fileExists (VisValidatableTextField field, String errorMsg) {
FileExistsValidator validator = new FileExistsValidator(errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"fileExists",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"FileExistsValidator",
"validator",
"=",
"new",
"FileExistsValidator",
"(",
"errorMsg",
")",
";",
"field",
".",
"addValidator",
"(",
"validator"... | Validates if absolute path entered in text field points to an existing file. | [
"Validates",
"if",
"absolute",
"path",
"entered",
"in",
"text",
"field",
"points",
"to",
"an",
"existing",
"file",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java#L57-L62 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Gaussian.java | Gaussian.Kernel1D | public double[] Kernel1D(int size) {
"""
1-D Gaussian kernel.
@param size Kernel size (should be odd), [3, 101].
@return Returns 1-D Gaussian kernel of the specified size.
"""
if (((size % 2) == 0) || (size < 3) || (size > 101)) {
try {
throw new Exception("Wrong size");... | java | public double[] Kernel1D(int size) {
if (((size % 2) == 0) || (size < 3) || (size > 101)) {
try {
throw new Exception("Wrong size");
} catch (Exception e) {
e.printStackTrace();
}
}
int r = size / 2;
// kernel
do... | [
"public",
"double",
"[",
"]",
"Kernel1D",
"(",
"int",
"size",
")",
"{",
"if",
"(",
"(",
"(",
"size",
"%",
"2",
")",
"==",
"0",
")",
"||",
"(",
"size",
"<",
"3",
")",
"||",
"(",
"size",
">",
"101",
")",
")",
"{",
"try",
"{",
"throw",
"new",
... | 1-D Gaussian kernel.
@param size Kernel size (should be odd), [3, 101].
@return Returns 1-D Gaussian kernel of the specified size. | [
"1",
"-",
"D",
"Gaussian",
"kernel",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Gaussian.java#L101-L119 |
nutzam/nutzboot | nutzboot-starter/nutzboot-starter-tio-websocket/src/main/java/org/nutz/boot/starter/tio/websocketbean/TioWebsocketMsgHandler.java | TioWebsocketMsgHandler.onBytes | @Override
public Object onBytes(WsRequest wsRequest, byte[] bytes, ChannelContext channelContext) throws Exception {
"""
receive bytes
@param wsRequest wsRequest
@param bytes bytes
@param channelContext channelContext
@return anyObject
@throws Exception e
"""
log.debug("onBytes");
TioW... | java | @Override
public Object onBytes(WsRequest wsRequest, byte[] bytes, ChannelContext channelContext) throws Exception {
log.debug("onBytes");
TioWebsocketMethodMapper onBytes = methods.getOnBytes();
if (onBytes != null) {
onBytes.getMethod().invoke(onBytes.getInstance(), channelCont... | [
"@",
"Override",
"public",
"Object",
"onBytes",
"(",
"WsRequest",
"wsRequest",
",",
"byte",
"[",
"]",
"bytes",
",",
"ChannelContext",
"channelContext",
")",
"throws",
"Exception",
"{",
"log",
".",
"debug",
"(",
"\"onBytes\"",
")",
";",
"TioWebsocketMethodMapper"... | receive bytes
@param wsRequest wsRequest
@param bytes bytes
@param channelContext channelContext
@return anyObject
@throws Exception e | [
"receive",
"bytes"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-tio-websocket/src/main/java/org/nutz/boot/starter/tio/websocketbean/TioWebsocketMsgHandler.java#L92-L106 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/AvailabilitySetsInner.java | AvailabilitySetsInner.getByResourceGroupAsync | public Observable<AvailabilitySetInner> getByResourceGroupAsync(String resourceGroupName, String availabilitySetName) {
"""
Retrieves information about an availability set.
@param resourceGroupName The name of the resource group.
@param availabilitySetName The name of the availability set.
@throws IllegalArgu... | java | public Observable<AvailabilitySetInner> getByResourceGroupAsync(String resourceGroupName, String availabilitySetName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, availabilitySetName).map(new Func1<ServiceResponse<AvailabilitySetInner>, AvailabilitySetInner>() {
@Override
... | [
"public",
"Observable",
"<",
"AvailabilitySetInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"availabilitySetName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"availabilitySetName",... | Retrieves information about an availability set.
@param resourceGroupName The name of the resource group.
@param availabilitySetName The name of the availability set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the AvailabilitySetInner object | [
"Retrieves",
"information",
"about",
"an",
"availability",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/AvailabilitySetsInner.java#L301-L308 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java | SqsManager.parseMessage | public List<CloudTrailSource> parseMessage(List<Message> sqsMessages) {
"""
Given a list of raw SQS message parse each of them, and return a list of CloudTrailSource.
@param sqsMessages list of SQS messages.
@return list of CloudTrailSource.
"""
List<CloudTrailSource> sources = new ArrayList<>();
... | java | public List<CloudTrailSource> parseMessage(List<Message> sqsMessages) {
List<CloudTrailSource> sources = new ArrayList<>();
for (Message sqsMessage : sqsMessages) {
boolean parseMessageSuccess = false;
ProgressStatus parseMessageStatus = new ProgressStatus(ProgressState.parseMe... | [
"public",
"List",
"<",
"CloudTrailSource",
">",
"parseMessage",
"(",
"List",
"<",
"Message",
">",
"sqsMessages",
")",
"{",
"List",
"<",
"CloudTrailSource",
">",
"sources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Message",
"sqsMessage",
"... | Given a list of raw SQS message parse each of them, and return a list of CloudTrailSource.
@param sqsMessages list of SQS messages.
@return list of CloudTrailSource. | [
"Given",
"a",
"list",
"of",
"raw",
"SQS",
"message",
"parse",
"each",
"of",
"them",
"and",
"return",
"a",
"list",
"of",
"CloudTrailSource",
"."
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/manager/SqsManager.java#L148-L176 |
jblas-project/jblas | src/main/java/org/jblas/Solve.java | Solve.solvePositive | public static DoubleMatrix solvePositive(DoubleMatrix A, DoubleMatrix B) {
"""
Solves the linear equation A*X = B for symmetric and positive definite A.
"""
A.assertSquare();
DoubleMatrix X = B.dup();
SimpleBlas.posv('U', A.dup(), X);
return X;
} | java | public static DoubleMatrix solvePositive(DoubleMatrix A, DoubleMatrix B) {
A.assertSquare();
DoubleMatrix X = B.dup();
SimpleBlas.posv('U', A.dup(), X);
return X;
} | [
"public",
"static",
"DoubleMatrix",
"solvePositive",
"(",
"DoubleMatrix",
"A",
",",
"DoubleMatrix",
"B",
")",
"{",
"A",
".",
"assertSquare",
"(",
")",
";",
"DoubleMatrix",
"X",
"=",
"B",
".",
"dup",
"(",
")",
";",
"SimpleBlas",
".",
"posv",
"(",
"'",
"... | Solves the linear equation A*X = B for symmetric and positive definite A. | [
"Solves",
"the",
"linear",
"equation",
"A",
"*",
"X",
"=",
"B",
"for",
"symmetric",
"and",
"positive",
"definite",
"A",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Solve.java#L63-L68 |
haraldk/TwelveMonkeys | imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/ImageWriterBase.java | ImageWriterBase.fakeAOI | protected static BufferedImage fakeAOI(final BufferedImage pImage, final ImageWriteParam pParam) {
"""
Utility method for getting the area of interest (AOI) of an image.
The AOI is defined by the {@link javax.imageio.IIOParam#setSourceRegion(java.awt.Rectangle)}
method.
<p/>
Note: If it is possible for the wri... | java | protected static BufferedImage fakeAOI(final BufferedImage pImage, final ImageWriteParam pParam) {
return IIOUtil.fakeAOI(pImage, getSourceRegion(pParam, pImage.getWidth(), pImage.getHeight()));
} | [
"protected",
"static",
"BufferedImage",
"fakeAOI",
"(",
"final",
"BufferedImage",
"pImage",
",",
"final",
"ImageWriteParam",
"pParam",
")",
"{",
"return",
"IIOUtil",
".",
"fakeAOI",
"(",
"pImage",
",",
"getSourceRegion",
"(",
"pParam",
",",
"pImage",
".",
"getWi... | Utility method for getting the area of interest (AOI) of an image.
The AOI is defined by the {@link javax.imageio.IIOParam#setSourceRegion(java.awt.Rectangle)}
method.
<p/>
Note: If it is possible for the writer to write the AOI directly, such a
method should be used instead, for efficiency.
@param pImage the image to... | [
"Utility",
"method",
"for",
"getting",
"the",
"area",
"of",
"interest",
"(",
"AOI",
")",
"of",
"an",
"image",
".",
"The",
"AOI",
"is",
"defined",
"by",
"the",
"{",
"@link",
"javax",
".",
"imageio",
".",
"IIOParam#setSourceRegion",
"(",
"java",
".",
"awt"... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-core/src/main/java/com/twelvemonkeys/imageio/ImageWriterBase.java#L159-L161 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapEntity.java | LdapEntity.setRDNAttributes | public void setRDNAttributes(List<Map<String, Object>> rdnAttrList) throws MissingInitPropertyException {
"""
Sets the RDN attribute types of this member type.
RDN attribute types will be converted to lower case.
@param The RDN attribute types of this member type.
"""
int size = rdnAttrList.size();... | java | public void setRDNAttributes(List<Map<String, Object>> rdnAttrList) throws MissingInitPropertyException {
int size = rdnAttrList.size();
// if size = 0, No RDN attributes defined. Same as RDN properties.
if (size > 0) {
iRDNAttrs = new String[size][];
iRDNObjectClass = ne... | [
"public",
"void",
"setRDNAttributes",
"(",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"rdnAttrList",
")",
"throws",
"MissingInitPropertyException",
"{",
"int",
"size",
"=",
"rdnAttrList",
".",
"size",
"(",
")",
";",
"// if size = 0, No RDN attri... | Sets the RDN attribute types of this member type.
RDN attribute types will be converted to lower case.
@param The RDN attribute types of this member type. | [
"Sets",
"the",
"RDN",
"attribute",
"types",
"of",
"this",
"member",
"type",
".",
"RDN",
"attribute",
"types",
"will",
"be",
"converted",
"to",
"lower",
"case",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapEntity.java#L400-L429 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/KeyFactory.java | KeyFactory.getInstance | public static KeyFactory getInstance(String algorithm, String provider)
throws NoSuchAlgorithmException, NoSuchProviderException {
"""
Returns a KeyFactory object that converts
public/private keys of the specified algorithm.
<p> A new KeyFactory object encapsulating the
KeyFactorySpi implementatio... | java | public static KeyFactory getInstance(String algorithm, String provider)
throws NoSuchAlgorithmException, NoSuchProviderException {
Instance instance = GetInstance.getInstance("KeyFactory",
KeyFactorySpi.class, algorithm, provider);
return new KeyFactory((KeyFactorySpi)instance.im... | [
"public",
"static",
"KeyFactory",
"getInstance",
"(",
"String",
"algorithm",
",",
"String",
"provider",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchProviderException",
"{",
"Instance",
"instance",
"=",
"GetInstance",
".",
"getInstance",
"(",
"\"KeyFactory\"",... | Returns a KeyFactory object that converts
public/private keys of the specified algorithm.
<p> A new KeyFactory object encapsulating the
KeyFactorySpi implementation from the specified provider
is returned. The specified provider must be registered
in the security provider list.
<p> Note that the list of registered p... | [
"Returns",
"a",
"KeyFactory",
"object",
"that",
"converts",
"public",
"/",
"private",
"keys",
"of",
"the",
"specified",
"algorithm",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/KeyFactory.java#L232-L238 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/SystemKeyspace.java | SystemKeyspace.checkHealth | public static void checkHealth() throws ConfigurationException {
"""
One of three things will happen if you try to read the system keyspace:
1. files are present and you can read them: great
2. no files are there: great (new node is assumed)
3. files are present but you can't read them: bad
@throws Configurati... | java | public static void checkHealth() throws ConfigurationException
{
Keyspace keyspace;
try
{
keyspace = Keyspace.open(Keyspace.SYSTEM_KS);
}
catch (AssertionError err)
{
// this happens when a user switches from OPP to RP.
Configuratio... | [
"public",
"static",
"void",
"checkHealth",
"(",
")",
"throws",
"ConfigurationException",
"{",
"Keyspace",
"keyspace",
";",
"try",
"{",
"keyspace",
"=",
"Keyspace",
".",
"open",
"(",
"Keyspace",
".",
"SYSTEM_KS",
")",
";",
"}",
"catch",
"(",
"AssertionError",
... | One of three things will happen if you try to read the system keyspace:
1. files are present and you can read them: great
2. no files are there: great (new node is assumed)
3. files are present but you can't read them: bad
@throws ConfigurationException | [
"One",
"of",
"three",
"things",
"will",
"happen",
"if",
"you",
"try",
"to",
"read",
"the",
"system",
"keyspace",
":",
"1",
".",
"files",
"are",
"present",
"and",
"you",
"can",
"read",
"them",
":",
"great",
"2",
".",
"no",
"files",
"are",
"there",
":"... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L555-L589 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/TimeGuard.java | TimeGuard.checkPoints | @Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
public static void checkPoints() {
"""
Process all time points for the current stack level.
@since 1.0
"""
final long time = System.currentTimeMillis();
final int stackDepth = ThreadUtils.stackDepth();
... | java | @Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
public static void checkPoints() {
final long time = System.currentTimeMillis();
final int stackDepth = ThreadUtils.stackDepth();
final List<TimeData> list = REGISTRY.get();
final Iterator<TimeData> iterator = ... | [
"@",
"Weight",
"(",
"value",
"=",
"Weight",
".",
"Unit",
".",
"VARIABLE",
",",
"comment",
"=",
"\"Depends on the current call stack depth\"",
")",
"public",
"static",
"void",
"checkPoints",
"(",
")",
"{",
"final",
"long",
"time",
"=",
"System",
".",
"currentTi... | Process all time points for the current stack level.
@since 1.0 | [
"Process",
"all",
"time",
"points",
"for",
"the",
"current",
"stack",
"level",
"."
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/TimeGuard.java#L154-L177 |
neo4j-contrib/neo4j-apoc-procedures | src/main/java/org/neo4j/kernel/KernelApi.java | KernelApi.getEndNode | public static Node getEndNode(GraphDatabaseService db, long id) {
"""
/*public static ExplicitIndexHits nodeQueryIndex(String indexName, Object query, GraphDatabaseService db) throws Exception {
return getReadOperation(db).nodeExplicitIndexQuery(indexName, query);
}
public static ExplicitIndexHits relationshi... | java | public static Node getEndNode(GraphDatabaseService db, long id) {
Relationship rel = db.getRelationshipById(id);
return rel.getEndNode();
} | [
"public",
"static",
"Node",
"getEndNode",
"(",
"GraphDatabaseService",
"db",
",",
"long",
"id",
")",
"{",
"Relationship",
"rel",
"=",
"db",
".",
"getRelationshipById",
"(",
"id",
")",
";",
"return",
"rel",
".",
"getEndNode",
"(",
")",
";",
"}"
] | /*public static ExplicitIndexHits nodeQueryIndex(String indexName, Object query, GraphDatabaseService db) throws Exception {
return getReadOperation(db).nodeExplicitIndexQuery(indexName, query);
}
public static ExplicitIndexHits relationshipQueryIndex(String indexName, Object query, GraphDatabaseService db, Long start... | [
"/",
"*",
"public",
"static",
"ExplicitIndexHits",
"nodeQueryIndex",
"(",
"String",
"indexName",
"Object",
"query",
"GraphDatabaseService",
"db",
")",
"throws",
"Exception",
"{",
"return",
"getReadOperation",
"(",
"db",
")",
".",
"nodeExplicitIndexQuery",
"(",
"inde... | train | https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/e8386975d1c512c0e4388a1a61f5496121c04f86/src/main/java/org/neo4j/kernel/KernelApi.java#L33-L36 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java | SqlGeneratorDefaultImpl.getDeleteMNStatement | public String getDeleteMNStatement(String table, String[] pkColumns1, String[] pkColumns2) {
"""
generate a DELETE-Statement for M:N indirection table
@param table
@param pkColumns1
@param pkColumns2
"""
SqlStatement sql;
String result;
String[] cols;
if (pkColumns2 =... | java | public String getDeleteMNStatement(String table, String[] pkColumns1, String[] pkColumns2)
{
SqlStatement sql;
String result;
String[] cols;
if (pkColumns2 == null)
{
cols = pkColumns1;
}
else
{
cols = new String[pk... | [
"public",
"String",
"getDeleteMNStatement",
"(",
"String",
"table",
",",
"String",
"[",
"]",
"pkColumns1",
",",
"String",
"[",
"]",
"pkColumns2",
")",
"{",
"SqlStatement",
"sql",
";",
"String",
"result",
";",
"String",
"[",
"]",
"cols",
";",
"if",
"(",
"... | generate a DELETE-Statement for M:N indirection table
@param table
@param pkColumns1
@param pkColumns2 | [
"generate",
"a",
"DELETE",
"-",
"Statement",
"for",
"M",
":",
"N",
"indirection",
"table"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlGeneratorDefaultImpl.java#L283-L308 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.