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 |
|---|---|---|---|---|---|---|---|---|---|---|
PinaeOS/nala | src/main/java/org/pinae/nala/xb/Xml.java | Xml.toObject | public static Object toObject(String xml, String encoding, Class<?> cls) throws UnmarshalException {
"""
将XML文件绑定为对象
@param xml XML字符串
@param encoding XML文件编码, 例如UTF-8, GBK
@param cls 绑定目标类
@return 绑定后的对象
@throws UnmarshalException 解组异常
"""
if (xml == null || xml.trim().equals("")) {
throw n... | java | public static Object toObject(String xml, String encoding, Class<?> cls) throws UnmarshalException {
if (xml == null || xml.trim().equals("")) {
throw new UnmarshalException("XML String is Empty");
}
Object object = null;
Unmarshaller bind = null;
try {
bind = new XmlUnmarshaller(new ByteArr... | [
"public",
"static",
"Object",
"toObject",
"(",
"String",
"xml",
",",
"String",
"encoding",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"throws",
"UnmarshalException",
"{",
"if",
"(",
"xml",
"==",
"null",
"||",
"xml",
".",
"trim",
"(",
")",
".",
"equals",
... | 将XML文件绑定为对象
@param xml XML字符串
@param encoding XML文件编码, 例如UTF-8, GBK
@param cls 绑定目标类
@return 绑定后的对象
@throws UnmarshalException 解组异常 | [
"将XML文件绑定为对象"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/Xml.java#L53-L75 |
jenkinsci/jenkins | core/src/main/java/hudson/tasks/BuildWrapper.java | BuildWrapper.decorateLauncher | public Launcher decorateLauncher(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException, RunnerAbortedException {
"""
Provides an opportunity for a {@link BuildWrapper} to decorate a {@link Launcher} to be used in the build.
<p>
This hook is called very early o... | java | public Launcher decorateLauncher(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException, RunnerAbortedException {
return launcher;
} | [
"public",
"Launcher",
"decorateLauncher",
"(",
"AbstractBuild",
"build",
",",
"Launcher",
"launcher",
",",
"BuildListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException",
",",
"RunnerAbortedException",
"{",
"return",
"launcher",
";",
"}"
] | Provides an opportunity for a {@link BuildWrapper} to decorate a {@link Launcher} to be used in the build.
<p>
This hook is called very early on in the build (even before {@link #setUp(AbstractBuild, Launcher, BuildListener)} is invoked.)
The typical use of {@link Launcher} decoration involves in modifying the environ... | [
"Provides",
"an",
"opportunity",
"for",
"a",
"{",
"@link",
"BuildWrapper",
"}",
"to",
"decorate",
"a",
"{",
"@link",
"Launcher",
"}",
"to",
"be",
"used",
"in",
"the",
"build",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/BuildWrapper.java#L187-L189 |
netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java | AbstractEpollStreamChannel.doWriteSingle | protected int doWriteSingle(ChannelOutboundBuffer in) throws Exception {
"""
Attempt to write a single object.
@param in the collection which contains objects to write.
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use ... | java | protected int doWriteSingle(ChannelOutboundBuffer in) throws Exception {
// The outbound buffer contains only one message or it contains a file region.
Object msg = in.current();
if (msg instanceof ByteBuf) {
return writeBytes(in, (ByteBuf) msg);
} else if (msg instanceof Def... | [
"protected",
"int",
"doWriteSingle",
"(",
"ChannelOutboundBuffer",
"in",
")",
"throws",
"Exception",
"{",
"// The outbound buffer contains only one message or it contains a file region.",
"Object",
"msg",
"=",
"in",
".",
"current",
"(",
")",
";",
"if",
"(",
"msg",
"inst... | Attempt to write a single object.
@param in the collection which contains objects to write.
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use cases are as follows:
<ul>
<li>0 - if no write was attempted. This is appropriate if ... | [
"Attempt",
"to",
"write",
"a",
"single",
"object",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java#L476-L495 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ApplicationServiceClient.java | ApplicationServiceClient.createApplication | public final Application createApplication(String parent, Application application) {
"""
Creates a new application entity.
<p>Sample code:
<pre><code>
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "... | java | public final Application createApplication(String parent, Application application) {
CreateApplicationRequest request =
CreateApplicationRequest.newBuilder().setParent(parent).setApplication(application).build();
return createApplication(request);
} | [
"public",
"final",
"Application",
"createApplication",
"(",
"String",
"parent",
",",
"Application",
"application",
")",
"{",
"CreateApplicationRequest",
"request",
"=",
"CreateApplicationRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".... | Creates a new application entity.
<p>Sample code:
<pre><code>
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]");
Application application = Application.newBuilder().build();
Application response = appl... | [
"Creates",
"a",
"new",
"application",
"entity",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ApplicationServiceClient.java#L214-L219 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/AvailableNumber.java | AvailableNumber.searchLocal | public static List<AvailableNumber> searchLocal(final BandwidthClient client, final Map<String, Object>params)
throws Exception {
"""
Convenience factory method to return local numbers based on a given search criteria for a given client
@param client the client
@param params the param... | java | public static List<AvailableNumber> searchLocal(final BandwidthClient client, final Map<String, Object>params)
throws Exception {
final String tollFreeUri = BandwidthConstants.AVAILABLE_NUMBERS_LOCAL_URI_PATH;
final JSONArray array = toJSONArray(client.get(tollFreeUri, ... | [
"public",
"static",
"List",
"<",
"AvailableNumber",
">",
"searchLocal",
"(",
"final",
"BandwidthClient",
"client",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"throws",
"Exception",
"{",
"final",
"String",
"tollFreeUri",
"=",
"Bandwi... | Convenience factory method to return local numbers based on a given search criteria for a given client
@param client the client
@param params the params
@return the list
@throws IOException unexpected error. | [
"Convenience",
"factory",
"method",
"to",
"return",
"local",
"numbers",
"based",
"on",
"a",
"given",
"search",
"criteria",
"for",
"a",
"given",
"client"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/AvailableNumber.java#L114-L125 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java | MimeTypeUtil.getMimeType | public static String getMimeType(String name, Property property, String defaultValue) {
"""
Detects the mime type of a binary property in the context of the nodes name.
@param name the name of the node which defines the binary resource (probably a file name)
@param property the binary property (for... | java | public static String getMimeType(String name, Property property, String defaultValue) {
MimeType mimeType = getMimeType(name, property);
return mimeType != null ? mimeType.toString() : defaultValue;
} | [
"public",
"static",
"String",
"getMimeType",
"(",
"String",
"name",
",",
"Property",
"property",
",",
"String",
"defaultValue",
")",
"{",
"MimeType",
"mimeType",
"=",
"getMimeType",
"(",
"name",
",",
"property",
")",
";",
"return",
"mimeType",
"!=",
"null",
... | Detects the mime type of a binary property in the context of the nodes name.
@param name the name of the node which defines the binary resource (probably a file name)
@param property the binary property (for stream parsing)
@param defaultValue the default value if the detection has no useful result
@return... | [
"Detects",
"the",
"mime",
"type",
"of",
"a",
"binary",
"property",
"in",
"the",
"context",
"of",
"the",
"nodes",
"name",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java#L72-L75 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/Preconditions.java | Preconditions.checkState | public static void checkState(boolean condition, @Nullable Object errorMessage) {
"""
Checks the given boolean condition, and throws an {@code IllegalStateException} if
the condition is not met (evaluates to {@code false}). The exception will have the
given error message.
@param condition The condition to che... | java | public static void checkState(boolean condition, @Nullable Object errorMessage) {
if (!condition) {
throw new IllegalStateException(String.valueOf(errorMessage));
}
} | [
"public",
"static",
"void",
"checkState",
"(",
"boolean",
"condition",
",",
"@",
"Nullable",
"Object",
"errorMessage",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
"valueOf",
"(",
"errorMessage",... | Checks the given boolean condition, and throws an {@code IllegalStateException} if
the condition is not met (evaluates to {@code false}). The exception will have the
given error message.
@param condition The condition to check
@param errorMessage The message for the {@code IllegalStateException} that is thrown if the ... | [
"Checks",
"the",
"given",
"boolean",
"condition",
"and",
"throws",
"an",
"{",
"@code",
"IllegalStateException",
"}",
"if",
"the",
"condition",
"is",
"not",
"met",
"(",
"evaluates",
"to",
"{",
"@code",
"false",
"}",
")",
".",
"The",
"exception",
"will",
"ha... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/Preconditions.java#L193-L197 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/io/Tokenizer.java | Tokenizer.addColumn | private void addColumn(final List<String> columns, String line, int charIndex) {
"""
Adds the currentColumn to columns list managing the case with currentColumn.length() == 0
It was introduced to manage the emptyColumnParsing.
@param columns
@param line
@param charIndex
"""
if(currentColumn.length()... | java | private void addColumn(final List<String> columns, String line, int charIndex) {
if(currentColumn.length() > 0){
columns.add(currentColumn.toString());
}
else{
int previousCharIndex = charIndex - 1;
boolean availableCharacters = previousCharIndex >= 0 ;
boolean previousCharIsQuote = availableCharac... | [
"private",
"void",
"addColumn",
"(",
"final",
"List",
"<",
"String",
">",
"columns",
",",
"String",
"line",
",",
"int",
"charIndex",
")",
"{",
"if",
"(",
"currentColumn",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"columns",
".",
"add",
"(",
"curre... | Adds the currentColumn to columns list managing the case with currentColumn.length() == 0
It was introduced to manage the emptyColumnParsing.
@param columns
@param line
@param charIndex | [
"Adds",
"the",
"currentColumn",
"to",
"columns",
"list",
"managing",
"the",
"case",
"with",
"currentColumn",
".",
"length",
"()",
"==",
"0",
"It",
"was",
"introduced",
"to",
"manage",
"the",
"emptyColumnParsing",
"."
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/io/Tokenizer.java#L314-L326 |
Samsung/GearVRf | GVRf/Extensions/3DCursor/IODevices/io_template/src/main/java/com/sample/template/TemplateDevice.java | TemplateDevice.processPosition | public void processPosition(float x, float y, float z) {
"""
This is a convenience wrapper around the {@link #setPosition(float, float, float)} call.
This method applies the cameras model matrix to the x, y, z to give relative positions
with respect to the camera rig.
This call is made from the native layer.
... | java | public void processPosition(float x, float y, float z) {
GVRScene scene = context.getMainScene();
if (scene != null) {
float depth = z * MAX_DEPTH;
float frustumWidth, frustumHeight;
// calculate the frustum using the aspect ratio and FOV
// http://docs.un... | [
"public",
"void",
"processPosition",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"GVRScene",
"scene",
"=",
"context",
".",
"getMainScene",
"(",
")",
";",
"if",
"(",
"scene",
"!=",
"null",
")",
"{",
"float",
"depth",
"=",
"z",
... | This is a convenience wrapper around the {@link #setPosition(float, float, float)} call.
This method applies the cameras model matrix to the x, y, z to give relative positions
with respect to the camera rig.
This call is made from the native layer.
@param x normalized values for the x axis. This values is adjusted fo... | [
"This",
"is",
"a",
"convenience",
"wrapper",
"around",
"the",
"{",
"@link",
"#setPosition",
"(",
"float",
"float",
"float",
")",
"}",
"call",
".",
"This",
"method",
"applies",
"the",
"cameras",
"model",
"matrix",
"to",
"the",
"x",
"y",
"z",
"to",
"give",... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/3DCursor/IODevices/io_template/src/main/java/com/sample/template/TemplateDevice.java#L114-L137 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/DataMessageServerStreamObserver.java | DataMessageServerStreamObserver.onNext | public void onNext(DataMessage<T, DataBuffer> value) {
"""
Receives a message with data buffer from the stream.
@param value the value passed to the stream
"""
DataBuffer buffer = value.getBuffer();
if (buffer != null) {
mBufferRepository.offerBuffer(buffer, value.getMessage());
}
mObs... | java | public void onNext(DataMessage<T, DataBuffer> value) {
DataBuffer buffer = value.getBuffer();
if (buffer != null) {
mBufferRepository.offerBuffer(buffer, value.getMessage());
}
mObserver.onNext(value.getMessage());
} | [
"public",
"void",
"onNext",
"(",
"DataMessage",
"<",
"T",
",",
"DataBuffer",
">",
"value",
")",
"{",
"DataBuffer",
"buffer",
"=",
"value",
".",
"getBuffer",
"(",
")",
";",
"if",
"(",
"buffer",
"!=",
"null",
")",
"{",
"mBufferRepository",
".",
"offerBuffe... | Receives a message with data buffer from the stream.
@param value the value passed to the stream | [
"Receives",
"a",
"message",
"with",
"data",
"buffer",
"from",
"the",
"stream",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/DataMessageServerStreamObserver.java#L49-L55 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/ModifyingCollectionWithItself.java | ModifyingCollectionWithItself.matchMethodInvocation | @Override
public Description matchMethodInvocation(MethodInvocationTree t, VisitorState state) {
"""
Matches calls to addAll, containsAll, removeAll, and retainAll on itself
"""
if (IS_COLLECTION_MODIFIED_WITH_ITSELF.matches(t, state)) {
return describe(t, state);
}
return Description.NO_MA... | java | @Override
public Description matchMethodInvocation(MethodInvocationTree t, VisitorState state) {
if (IS_COLLECTION_MODIFIED_WITH_ITSELF.matches(t, state)) {
return describe(t, state);
}
return Description.NO_MATCH;
} | [
"@",
"Override",
"public",
"Description",
"matchMethodInvocation",
"(",
"MethodInvocationTree",
"t",
",",
"VisitorState",
"state",
")",
"{",
"if",
"(",
"IS_COLLECTION_MODIFIED_WITH_ITSELF",
".",
"matches",
"(",
"t",
",",
"state",
")",
")",
"{",
"return",
"describe... | Matches calls to addAll, containsAll, removeAll, and retainAll on itself | [
"Matches",
"calls",
"to",
"addAll",
"containsAll",
"removeAll",
"and",
"retainAll",
"on",
"itself"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/ModifyingCollectionWithItself.java#L78-L84 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java | PersistenceBrokerImpl.storeReferences | private void storeReferences(Object obj, ClassDescriptor cld, boolean insert, boolean ignoreReferences) {
"""
Store all object references that <b>obj</b> points to.
All objects which we have a FK pointing to (Via ReferenceDescriptors) will be
stored if auto-update is true <b>AND</b> the member field containing t... | java | private void storeReferences(Object obj, ClassDescriptor cld, boolean insert, boolean ignoreReferences)
{
// get all members of obj that are references and store them
Collection listRds = cld.getObjectReferenceDescriptors();
// return if nothing to do
if(listRds == null || listRds.si... | [
"private",
"void",
"storeReferences",
"(",
"Object",
"obj",
",",
"ClassDescriptor",
"cld",
",",
"boolean",
"insert",
",",
"boolean",
"ignoreReferences",
")",
"{",
"// get all members of obj that are references and store them",
"Collection",
"listRds",
"=",
"cld",
".",
"... | Store all object references that <b>obj</b> points to.
All objects which we have a FK pointing to (Via ReferenceDescriptors) will be
stored if auto-update is true <b>AND</b> the member field containing the object
reference is NOT null.
With flag <em>ignoreReferences</em> the storing/linking
of references can be suppres... | [
"Store",
"all",
"object",
"references",
"that",
"<b",
">",
"obj<",
"/",
"b",
">",
"points",
"to",
".",
"All",
"objects",
"which",
"we",
"have",
"a",
"FK",
"pointing",
"to",
"(",
"Via",
"ReferenceDescriptors",
")",
"will",
"be",
"stored",
"if",
"auto",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java#L963-L987 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphDump.java | ObjectGraphDump.readField | private Object readField(final Field field, final Object obj) {
"""
Reads the contents of a field.
@param field the field definition.
@param obj the object to read the value from.
@return the value of the field in the given object.
"""
try {
return field.get(obj);
} catch (IllegalAccessException e)... | java | private Object readField(final Field field, final Object obj) {
try {
return field.get(obj);
} catch (IllegalAccessException e) {
// Should not happen as we've called Field.setAccessible(true).
LOG.error("Failed to read " + field.getName() + " of " + obj.getClass().getName(), e);
}
return null;
} | [
"private",
"Object",
"readField",
"(",
"final",
"Field",
"field",
",",
"final",
"Object",
"obj",
")",
"{",
"try",
"{",
"return",
"field",
".",
"get",
"(",
"obj",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"// Should not happen as... | Reads the contents of a field.
@param field the field definition.
@param obj the object to read the value from.
@return the value of the field in the given object. | [
"Reads",
"the",
"contents",
"of",
"a",
"field",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphDump.java#L189-L198 |
jakenjarvis/Android-OrmLiteContentProvider | ormlite-content-provider-library/src/com/tojc/ormlite/android/OrmLiteDefaultContentProvider.java | OrmLiteDefaultContentProvider.onInsertCompleted | protected void onInsertCompleted(Uri result, Uri uri, MatcherPattern target, InsertParameters parameter) {
"""
This method is called after the onInsert processing has been handled. If you're a need,
you can override this method.
@param result
This is the return value of onInsert method.
@param uri
This is the... | java | protected void onInsertCompleted(Uri result, Uri uri, MatcherPattern target, InsertParameters parameter) {
this.getContext().getContentResolver().notifyChange(result, null);
} | [
"protected",
"void",
"onInsertCompleted",
"(",
"Uri",
"result",
",",
"Uri",
"uri",
",",
"MatcherPattern",
"target",
",",
"InsertParameters",
"parameter",
")",
"{",
"this",
".",
"getContext",
"(",
")",
".",
"getContentResolver",
"(",
")",
".",
"notifyChange",
"... | This method is called after the onInsert processing has been handled. If you're a need,
you can override this method.
@param result
This is the return value of onInsert method.
@param uri
This is the Uri of target.
@param target
This is identical to the argument of onInsert method.
It is MatcherPattern objects that mat... | [
"This",
"method",
"is",
"called",
"after",
"the",
"onInsert",
"processing",
"has",
"been",
"handled",
".",
"If",
"you",
"re",
"a",
"need",
"you",
"can",
"override",
"this",
"method",
"."
] | train | https://github.com/jakenjarvis/Android-OrmLiteContentProvider/blob/8f102f0743b308c9f58d43639e98f832fd951985/ormlite-content-provider-library/src/com/tojc/ormlite/android/OrmLiteDefaultContentProvider.java#L238-L240 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.create | public FSDataOutputStream create(Path f) throws IOException {
"""
Opens an FSDataOutputStream at the indicated Path.
Files are overwritten by default.
"""
return create(f, CreateOptions.writeOptions(true, null));
} | java | public FSDataOutputStream create(Path f) throws IOException {
return create(f, CreateOptions.writeOptions(true, null));
} | [
"public",
"FSDataOutputStream",
"create",
"(",
"Path",
"f",
")",
"throws",
"IOException",
"{",
"return",
"create",
"(",
"f",
",",
"CreateOptions",
".",
"writeOptions",
"(",
"true",
",",
"null",
")",
")",
";",
"}"
] | Opens an FSDataOutputStream at the indicated Path.
Files are overwritten by default. | [
"Opens",
"an",
"FSDataOutputStream",
"at",
"the",
"indicated",
"Path",
".",
"Files",
"are",
"overwritten",
"by",
"default",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L465-L467 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/pubmed/ManualDescriptor.java | ManualDescriptor.setChemicalList | public void setChemicalList(int i, Chemical v) {
"""
indexed setter for chemicalList - sets an indexed value - A collection of objects of type uima.julielab.uima.Chemical, O
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (ManualDescriptor_Type.featOkTst && ((M... | java | public void setChemicalList(int i, Chemical v) {
if (ManualDescriptor_Type.featOkTst && ((ManualDescriptor_Type)jcasType).casFeat_chemicalList == null)
jcasType.jcas.throwFeatMissing("chemicalList", "de.julielab.jules.types.pubmed.ManualDescriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getR... | [
"public",
"void",
"setChemicalList",
"(",
"int",
"i",
",",
"Chemical",
"v",
")",
"{",
"if",
"(",
"ManualDescriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"ManualDescriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_chemicalList",
"==",
"null",
")",
"jcasType... | indexed setter for chemicalList - sets an indexed value - A collection of objects of type uima.julielab.uima.Chemical, O
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"chemicalList",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"A",
"collection",
"of",
"objects",
"of",
"type",
"uima",
".",
"julielab",
".",
"uima",
".",
"Chemical",
"O"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/pubmed/ManualDescriptor.java#L165-L169 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/ClassAvailableTransformer.java | ClassAvailableTransformer.transformCandidate | byte[] transformCandidate(byte[] classfileBuffer) {
"""
Inject the byte code required to call the {@code processCandidate} proxy
after class initialization.
@param classfileBuffer the source class file
@return the modified class file
"""
// reader --> serial version uid adder --> process candida... | java | byte[] transformCandidate(byte[] classfileBuffer) {
// reader --> serial version uid adder --> process candidate hook adapter --> tracing --> writer
ClassReader reader = new ClassReader(classfileBuffer);
ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_MAXS);
ClassVisito... | [
"byte",
"[",
"]",
"transformCandidate",
"(",
"byte",
"[",
"]",
"classfileBuffer",
")",
"{",
"// reader --> serial version uid adder --> process candidate hook adapter --> tracing --> writer",
"ClassReader",
"reader",
"=",
"new",
"ClassReader",
"(",
"classfileBuffer",
")",
";"... | Inject the byte code required to call the {@code processCandidate} proxy
after class initialization.
@param classfileBuffer the source class file
@return the modified class file | [
"Inject",
"the",
"byte",
"code",
"required",
"to",
"call",
"the",
"{",
"@code",
"processCandidate",
"}",
"proxy",
"after",
"class",
"initialization",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/ClassAvailableTransformer.java#L106-L129 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyDecoder.java | KeyDecoder.decodeShortDesc | public static short decodeShortDesc(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a signed short from exactly 2 bytes, as encoded for descending
order.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed short value
"""
... | java | public static short decodeShortDesc(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
return (short)(((src[srcOffset] << 8) | (src[srcOffset + 1] & 0xff)) ^ 0x7fff);
} catch (IndexOutOfBoundsException e) {
throw new CorruptEncodingException(null... | [
"public",
"static",
"short",
"decodeShortDesc",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"return",
"(",
"short",
")",
"(",
"(",
"(",
"src",
"[",
"srcOffset",
"]",
"<<",
"8",
")",
... | Decodes a signed short from exactly 2 bytes, as encoded for descending
order.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed short value | [
"Decodes",
"a",
"signed",
"short",
"from",
"exactly",
"2",
"bytes",
"as",
"encoded",
"for",
"descending",
"order",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java#L156-L164 |
geomajas/geomajas-project-client-gwt | plugin/editing/editing-gwt/src/main/java/org/geomajas/plugin/editing/gwt/client/gfx/GeometryRendererImpl.java | GeometryRendererImpl.getOrCreateGroup | private Composite getOrCreateGroup(Object parent, String name) {
"""
Used in creating the "edges", "selection" and "vertices" groups for LineStrings and LinearRings.
"""
if (groups.containsKey(name)) {
return groups.get(name);
}
Composite group = new Composite(name);
mapWidget.getVectorContext().dra... | java | private Composite getOrCreateGroup(Object parent, String name) {
if (groups.containsKey(name)) {
return groups.get(name);
}
Composite group = new Composite(name);
mapWidget.getVectorContext().drawGroup(parent, group);
groups.put(name, group);
return group;
} | [
"private",
"Composite",
"getOrCreateGroup",
"(",
"Object",
"parent",
",",
"String",
"name",
")",
"{",
"if",
"(",
"groups",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"groups",
".",
"get",
"(",
"name",
")",
";",
"}",
"Composite",
"group",
... | Used in creating the "edges", "selection" and "vertices" groups for LineStrings and LinearRings. | [
"Used",
"in",
"creating",
"the",
"edges",
"selection",
"and",
"vertices",
"groups",
"for",
"LineStrings",
"and",
"LinearRings",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/editing/editing-gwt/src/main/java/org/geomajas/plugin/editing/gwt/client/gfx/GeometryRendererImpl.java#L776-L784 |
aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/SnorocketReasoner.java | SnorocketReasoner.getInferredAxioms | public Collection<Axiom> getInferredAxioms() {
"""
Ideally we'd return some kind of normal form axioms here. However, in
the presence of GCIs this is not well defined (as far as I know -
Michael).
<p>
Instead, we will return stated form axioms for Sufficient conditions
(i.e. for INamedConcept on the RHS), an... | java | public Collection<Axiom> getInferredAxioms() {
final Collection<Axiom> inferred = new HashSet<>();
if(!isClassified) classify();
if (!no.isTaxonomyComputed()) {
log.info("Building taxonomy");
no.buildTaxonomy();
}
final Map<String, Node> taxonomy = no.g... | [
"public",
"Collection",
"<",
"Axiom",
">",
"getInferredAxioms",
"(",
")",
"{",
"final",
"Collection",
"<",
"Axiom",
">",
"inferred",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"!",
"isClassified",
")",
"classify",
"(",
")",
";",
"if",
"(",
... | Ideally we'd return some kind of normal form axioms here. However, in
the presence of GCIs this is not well defined (as far as I know -
Michael).
<p>
Instead, we will return stated form axioms for Sufficient conditions
(i.e. for INamedConcept on the RHS), and SNOMED CT DNF-based axioms for
Necessary conditions. The fo... | [
"Ideally",
"we",
"d",
"return",
"some",
"kind",
"of",
"normal",
"form",
"axioms",
"here",
".",
"However",
"in",
"the",
"presence",
"of",
"GCIs",
"this",
"is",
"not",
"well",
"defined",
"(",
"as",
"far",
"as",
"I",
"know",
"-",
"Michael",
")",
".",
"<... | train | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/SnorocketReasoner.java#L289-L319 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/runtime/cli/PublicMethodsCliObjectFactory.java | PublicMethodsCliObjectFactory.applyCommandLineOptions | public void applyCommandLineOptions(CommandLine cli, T embeddedGobblin) {
"""
For each method for which the helper created an {@link Option} and for which the input {@link CommandLine} contains
that option, this method will automatically call the method on the input object with the correct
arguments.
"""
... | java | public void applyCommandLineOptions(CommandLine cli, T embeddedGobblin) {
try {
for (Option option : cli.getOptions()) {
if (!this.methodsMap.containsKey(option.getOpt())) {
// Option added by cli driver itself.
continue;
}
if (option.hasArg()) {
this.meth... | [
"public",
"void",
"applyCommandLineOptions",
"(",
"CommandLine",
"cli",
",",
"T",
"embeddedGobblin",
")",
"{",
"try",
"{",
"for",
"(",
"Option",
"option",
":",
"cli",
".",
"getOptions",
"(",
")",
")",
"{",
"if",
"(",
"!",
"this",
".",
"methodsMap",
".",
... | For each method for which the helper created an {@link Option} and for which the input {@link CommandLine} contains
that option, this method will automatically call the method on the input object with the correct
arguments. | [
"For",
"each",
"method",
"for",
"which",
"the",
"helper",
"created",
"an",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/runtime/cli/PublicMethodsCliObjectFactory.java#L140-L156 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RegisteredResources.java | RegisteredResources.compare | @Override
public int compare(JTAResource o1, JTAResource o2) {
"""
Comparator returning 0 should leave elements in list alone, preserving original order.
"""
if (tc.isEntryEnabled())
Tr.entry(tc, "compare", new Object[] { o1, o2, this });
int result = 0;
int p1 = o1.getP... | java | @Override
public int compare(JTAResource o1, JTAResource o2) {
if (tc.isEntryEnabled())
Tr.entry(tc, "compare", new Object[] { o1, o2, this });
int result = 0;
int p1 = o1.getPriority();
int p2 = o2.getPriority();
if (p1 < p2)
result = 1;
else ... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"JTAResource",
"o1",
",",
"JTAResource",
"o2",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"compare\"",
",",
"new",
"Object",
"[",
"]",
"{",
... | Comparator returning 0 should leave elements in list alone, preserving original order. | [
"Comparator",
"returning",
"0",
"should",
"leave",
"elements",
"in",
"list",
"alone",
"preserving",
"original",
"order",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RegisteredResources.java#L2631-L2645 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeCheck.java | TypeCheck.visitAssign | private void visitAssign(NodeTraversal t, Node assign) {
"""
Visits an assignment <code>lvalue = rvalue</code>. If the
<code>lvalue</code> is a prototype modification, we change the schema
of the object type it is referring to.
@param t the traversal
@param assign the assign node
(<code>assign.isAssign()</cod... | java | private void visitAssign(NodeTraversal t, Node assign) {
JSDocInfo info = assign.getJSDocInfo();
Node lvalue = assign.getFirstChild();
Node rvalue = assign.getLastChild();
JSType rightType = getJSType(rvalue);
checkCanAssignToWithScope(t, assign, lvalue, rightType, info, "assignment");
ensureTy... | [
"private",
"void",
"visitAssign",
"(",
"NodeTraversal",
"t",
",",
"Node",
"assign",
")",
"{",
"JSDocInfo",
"info",
"=",
"assign",
".",
"getJSDocInfo",
"(",
")",
";",
"Node",
"lvalue",
"=",
"assign",
".",
"getFirstChild",
"(",
")",
";",
"Node",
"rvalue",
... | Visits an assignment <code>lvalue = rvalue</code>. If the
<code>lvalue</code> is a prototype modification, we change the schema
of the object type it is referring to.
@param t the traversal
@param assign the assign node
(<code>assign.isAssign()</code> is an implicit invariant) | [
"Visits",
"an",
"assignment",
"<code",
">",
"lvalue",
"=",
"rvalue<",
"/",
"code",
">",
".",
"If",
"the",
"<code",
">",
"lvalue<",
"/",
"code",
">",
"is",
"a",
"prototype",
"modification",
"we",
"change",
"the",
"schema",
"of",
"the",
"object",
"type",
... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeCheck.java#L1095-L1103 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.expectStrictNew | public static synchronized <T> IExpectationSetters<T> expectStrictNew(Class<T> type, Object... arguments)
throws Exception {
"""
Allows specifying expectations on new invocations. For example you might
want to throw an exception or return a mock.
<p/>
This method checks the order of constructor invo... | java | public static synchronized <T> IExpectationSetters<T> expectStrictNew(Class<T> type, Object... arguments)
throws Exception {
return doExpectNew(type, new StrictMockStrategy(), null, arguments);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"IExpectationSetters",
"<",
"T",
">",
"expectStrictNew",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"return",
"doExpectNew",
"(",
"type",
",",
... | Allows specifying expectations on new invocations. For example you might
want to throw an exception or return a mock.
<p/>
This method checks the order of constructor invocations.
<p/>
Note that you must replay the class when using this method since this
behavior is part of the class mock. | [
"Allows",
"specifying",
"expectations",
"on",
"new",
"invocations",
".",
"For",
"example",
"you",
"might",
"want",
"to",
"throw",
"an",
"exception",
"or",
"return",
"a",
"mock",
".",
"<p",
"/",
">",
"This",
"method",
"checks",
"the",
"order",
"of",
"constr... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1697-L1700 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_03_31_preview/implementation/TasksInner.java | TasksInner.createOrUpdateAsync | public Observable<ProjectTaskInner> createOrUpdateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) {
"""
Create or update task.
The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a n... | java | public Observable<ProjectTaskInner> createOrUpdateAsync(String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) {
return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, taskName, parameters).map(new Func1<ServiceResponse<ProjectTaskInne... | [
"public",
"Observable",
"<",
"ProjectTaskInner",
">",
"createOrUpdateAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"String",
"taskName",
",",
"ProjectTaskInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWi... | Create or update task.
The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one.
@param groupName Name of the ... | [
"Create",
"or",
"update",
"task",
".",
"The",
"tasks",
"resource",
"is",
"a",
"nested",
"proxy",
"-",
"only",
"resource",
"representing",
"work",
"performed",
"by",
"a",
"DMS",
"instance",
".",
"The",
"PUT",
"method",
"creates",
"a",
"new",
"task",
"or",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_03_31_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_03_31_preview/implementation/TasksInner.java#L414-L421 |
h2oai/h2o-3 | h2o-core/src/main/java/water/ExternalFrameWriterClient.java | ExternalFrameWriterClient.createChunks | public void createChunks(String frameKey, byte[] expectedTypes, int chunkId, int totalNumRows, int[] maxVecSizes) throws IOException {
"""
Create chunks on the h2o backend. This method creates chunk in en empty frame.
@param frameKey name of the frame
@param expectedTypes expected types
@param chunkId chunk ind... | java | public void createChunks(String frameKey, byte[] expectedTypes, int chunkId, int totalNumRows, int[] maxVecSizes) throws IOException {
ab.put1(ExternalFrameHandler.INIT_BYTE);
ab.put1(ExternalFrameHandler.CREATE_FRAME);
ab.putStr(frameKey);
this.expectedTypes = expectedTypes;
ab.... | [
"public",
"void",
"createChunks",
"(",
"String",
"frameKey",
",",
"byte",
"[",
"]",
"expectedTypes",
",",
"int",
"chunkId",
",",
"int",
"totalNumRows",
",",
"int",
"[",
"]",
"maxVecSizes",
")",
"throws",
"IOException",
"{",
"ab",
".",
"put1",
"(",
"Externa... | Create chunks on the h2o backend. This method creates chunk in en empty frame.
@param frameKey name of the frame
@param expectedTypes expected types
@param chunkId chunk index
@param totalNumRows total number of rows which is about to be sent | [
"Create",
"chunks",
"on",
"the",
"h2o",
"backend",
".",
"This",
"method",
"creates",
"chunk",
"in",
"en",
"empty",
"frame",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExternalFrameWriterClient.java#L76-L86 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/ClosableCharArrayWriter.java | ClosableCharArrayWriter.toCharArrayReader | public synchronized CharArrayReader toCharArrayReader()
throws IOException {
"""
Performs an effecient (zero-copy) conversion of the character data
accumulated in this writer to a reader. <p>
To ensure the integrity of the resulting reader, {@link #free()
free} is invoked upon this writer as a side-effect... | java | public synchronized CharArrayReader toCharArrayReader()
throws IOException {
checkFreed();
CharArrayReader reader = new CharArrayReader(buf, 0, count);
//System.out.println("toCharArrayReader::buf.length: " + buf.length);
free();
return reader;
} | [
"public",
"synchronized",
"CharArrayReader",
"toCharArrayReader",
"(",
")",
"throws",
"IOException",
"{",
"checkFreed",
"(",
")",
";",
"CharArrayReader",
"reader",
"=",
"new",
"CharArrayReader",
"(",
"buf",
",",
"0",
",",
"count",
")",
";",
"//System.out.println(\... | Performs an effecient (zero-copy) conversion of the character data
accumulated in this writer to a reader. <p>
To ensure the integrity of the resulting reader, {@link #free()
free} is invoked upon this writer as a side-effect.
@return a reader representing this writer's accumulated
character data
@throws java.io.IOEx... | [
"Performs",
"an",
"effecient",
"(",
"zero",
"-",
"copy",
")",
"conversion",
"of",
"the",
"character",
"data",
"accumulated",
"in",
"this",
"writer",
"to",
"a",
"reader",
".",
"<p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/ClosableCharArrayWriter.java#L354-L365 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/indexing/BranchUniversalObject.java | BranchUniversalObject.userCompletedAction | @SuppressWarnings("deprecation")
public void userCompletedAction(BRANCH_STANDARD_EVENT action, HashMap<String, String> metadata) {
"""
<p>
Method to report user actions happened on this BUO. Use this method to report the user actions for analytics purpose.
</p>
@param action A {@link BRANCH_STANDARD_EVE... | java | @SuppressWarnings("deprecation")
public void userCompletedAction(BRANCH_STANDARD_EVENT action, HashMap<String, String> metadata) {
userCompletedAction(action.getName(), metadata);
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"void",
"userCompletedAction",
"(",
"BRANCH_STANDARD_EVENT",
"action",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"metadata",
")",
"{",
"userCompletedAction",
"(",
"action",
".",
"getName",
"(... | <p>
Method to report user actions happened on this BUO. Use this method to report the user actions for analytics purpose.
</p>
@param action A {@link BRANCH_STANDARD_EVENT }with value of user action name. See {@link BRANCH_STANDARD_EVENT} for Branch defined user events.
@param metadata A HashMap containing any addi... | [
"<p",
">",
"Method",
"to",
"report",
"user",
"actions",
"happened",
"on",
"this",
"BUO",
".",
"Use",
"this",
"method",
"to",
"report",
"the",
"user",
"actions",
"for",
"analytics",
"purpose",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/indexing/BranchUniversalObject.java#L383-L386 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/animation/ViewPosition.java | ViewPosition.apply | public static boolean apply(@NonNull ViewPosition pos, @NonNull View view) {
"""
Computes view position and stores it in given {@code pos}. Note, that view should be already
attached and laid out before calling this method.
@param pos Output position
@param view View for which we want to get on-screen locatio... | java | public static boolean apply(@NonNull ViewPosition pos, @NonNull View view) {
return pos.init(view);
} | [
"public",
"static",
"boolean",
"apply",
"(",
"@",
"NonNull",
"ViewPosition",
"pos",
",",
"@",
"NonNull",
"View",
"view",
")",
"{",
"return",
"pos",
".",
"init",
"(",
"view",
")",
";",
"}"
] | Computes view position and stores it in given {@code pos}. Note, that view should be already
attached and laid out before calling this method.
@param pos Output position
@param view View for which we want to get on-screen location
@return true if view position is changed, false otherwise | [
"Computes",
"view",
"position",
"and",
"stores",
"it",
"in",
"given",
"{",
"@code",
"pos",
"}",
".",
"Note",
"that",
"view",
"should",
"be",
"already",
"attached",
"and",
"laid",
"out",
"before",
"calling",
"this",
"method",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/animation/ViewPosition.java#L158-L160 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java | DirectoryConnection.setDirectoryUser | public void setDirectoryUser(String userName, String password) {
"""
Change the Directory Authentication.
It will reopen session use the new authentication.
If failed, need to close the session.
@param userName
@param password
"""
this.authData = generateDirectoryAuthData(userName, password);
... | java | public void setDirectoryUser(String userName, String password){
this.authData = generateDirectoryAuthData(userName, password);
if(getStatus().isConnected()){
ErrorCode ec = sendConnectProtocol(this.getConnectTimeOut());
if(ErrorCode.SESSION_EXPIRED.equals(ec)){
LO... | [
"public",
"void",
"setDirectoryUser",
"(",
"String",
"userName",
",",
"String",
"password",
")",
"{",
"this",
".",
"authData",
"=",
"generateDirectoryAuthData",
"(",
"userName",
",",
"password",
")",
";",
"if",
"(",
"getStatus",
"(",
")",
".",
"isConnected",
... | Change the Directory Authentication.
It will reopen session use the new authentication.
If failed, need to close the session.
@param userName
@param password | [
"Change",
"the",
"Directory",
"Authentication",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java#L598-L609 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/MustBeClosedChecker.java | MustBeClosedChecker.matchMethod | @Override
public Description matchMethod(MethodTree tree, VisitorState state) {
"""
Check that the {@link MustBeClosed} annotation is only used for constructors of AutoCloseables
and methods that return an AutoCloseable.
"""
if (!HAS_MUST_BE_CLOSED_ANNOTATION.matches(tree, state)) {
// Ignore meth... | java | @Override
public Description matchMethod(MethodTree tree, VisitorState state) {
if (!HAS_MUST_BE_CLOSED_ANNOTATION.matches(tree, state)) {
// Ignore methods and constructors that are not annotated with {@link MustBeClosed}.
return NO_MATCH;
}
boolean isAConstructor = methodIsConstructor().mat... | [
"@",
"Override",
"public",
"Description",
"matchMethod",
"(",
"MethodTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"if",
"(",
"!",
"HAS_MUST_BE_CLOSED_ANNOTATION",
".",
"matches",
"(",
"tree",
",",
"state",
")",
")",
"{",
"// Ignore methods and constructo... | Check that the {@link MustBeClosed} annotation is only used for constructors of AutoCloseables
and methods that return an AutoCloseable. | [
"Check",
"that",
"the",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/MustBeClosedChecker.java#L82-L102 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getGroupName | public synchronized String getGroupName(int ch, int choice) {
"""
Gets the group name of the character
@param ch character to get the group name
@param choice name choice selector to choose a unicode 1.0 or newer name
"""
// gets the msb
int msb = getCodepointMSB(ch);
int group = ge... | java | public synchronized String getGroupName(int ch, int choice)
{
// gets the msb
int msb = getCodepointMSB(ch);
int group = getGroup(ch);
// return this if it is an exact match
if (msb == m_groupinfo_[group * m_groupsize_]) {
int index = getGroupLengths(group, m_g... | [
"public",
"synchronized",
"String",
"getGroupName",
"(",
"int",
"ch",
",",
"int",
"choice",
")",
"{",
"// gets the msb",
"int",
"msb",
"=",
"getCodepointMSB",
"(",
"ch",
")",
";",
"int",
"group",
"=",
"getGroup",
"(",
"ch",
")",
";",
"// return this if it is... | Gets the group name of the character
@param ch character to get the group name
@param choice name choice selector to choose a unicode 1.0 or newer name | [
"Gets",
"the",
"group",
"name",
"of",
"the",
"character"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L507-L523 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getEntityRolesAsync | public Observable<List<EntityRole>> getEntityRolesAsync(UUID appId, String versionId, UUID entityId) {
"""
Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity Id
@throws IllegalArgumentException thrown if parameters fail the valida... | java | public Observable<List<EntityRole>> getEntityRolesAsync(UUID appId, String versionId, UUID entityId) {
return getEntityRolesWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<List<EntityRole>>, List<EntityRole>>() {
@Override
public List<EntityRole> call(S... | [
"public",
"Observable",
"<",
"List",
"<",
"EntityRole",
">",
">",
"getEntityRolesAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
")",
"{",
"return",
"getEntityRolesWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
... | Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity Id
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<EntityRole> object | [
"Get",
"All",
"Entity",
"Roles",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7686-L7693 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/dynamic/JarXtractor.java | JarXtractor.extract | public static boolean extract(File jarFile, File newJar, String[] includePrefixes, String[] excludePrefixes) throws IOException {
"""
Creates a jar file that contains only classes with specified prefix. Note
that new jar is created in the same directory as the original jar
(hopefully the user has write permissio... | java | public static boolean extract(File jarFile, File newJar, String[] includePrefixes, String[] excludePrefixes) throws IOException {
boolean isSomethingExtracted = false;
if (!jarFile.exists()) {
Log.w("Jar file does not exists at: " + jarFile.getAbsolutePath());
return isSomethingE... | [
"public",
"static",
"boolean",
"extract",
"(",
"File",
"jarFile",
",",
"File",
"newJar",
",",
"String",
"[",
"]",
"includePrefixes",
",",
"String",
"[",
"]",
"excludePrefixes",
")",
"throws",
"IOException",
"{",
"boolean",
"isSomethingExtracted",
"=",
"false",
... | Creates a jar file that contains only classes with specified prefix. Note
that new jar is created in the same directory as the original jar
(hopefully the user has write permission).
Returns true if classes with the given prefix are detected.
@throws IOException
if a file is not found or there is some error during
re... | [
"Creates",
"a",
"jar",
"file",
"that",
"contains",
"only",
"classes",
"with",
"specified",
"prefix",
".",
"Note",
"that",
"new",
"jar",
"is",
"created",
"in",
"the",
"same",
"directory",
"as",
"the",
"original",
"jar",
"(",
"hopefully",
"the",
"user",
"has... | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/dynamic/JarXtractor.java#L55-L84 |
alkacon/opencms-core | src/org/opencms/ui/login/CmsInactiveUserMessages.java | CmsInactiveUserMessages.getMessage | public static String getMessage(String key, Locale locale) {
"""
Gets the message for the given key and locale.<p>
@param key the key
@param locale the locale
@return the localized text
"""
ResourceBundle bundle = null;
try {
bundle = CmsResourceBundleLoader.getBundle("org.ope... | java | public static String getMessage(String key, Locale locale) {
ResourceBundle bundle = null;
try {
bundle = CmsResourceBundleLoader.getBundle("org.opencms.inactiveusers.custom", locale);
return bundle.getString(key);
} catch (MissingResourceException e) {
LOG.i... | [
"public",
"static",
"String",
"getMessage",
"(",
"String",
"key",
",",
"Locale",
"locale",
")",
"{",
"ResourceBundle",
"bundle",
"=",
"null",
";",
"try",
"{",
"bundle",
"=",
"CmsResourceBundleLoader",
".",
"getBundle",
"(",
"\"org.opencms.inactiveusers.custom\"",
... | Gets the message for the given key and locale.<p>
@param key the key
@param locale the locale
@return the localized text | [
"Gets",
"the",
"message",
"for",
"the",
"given",
"key",
"and",
"locale",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/login/CmsInactiveUserMessages.java#L69-L80 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsInner.java | ExpressRouteConnectionsInner.beginCreateOrUpdate | public ExpressRouteConnectionInner beginCreateOrUpdate(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) {
"""
Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit.
@param resourceGroupNam... | java | public ExpressRouteConnectionInner beginCreateOrUpdate(String resourceGroupName, String expressRouteGatewayName, String connectionName, ExpressRouteConnectionInner putExpressRouteConnectionParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName... | [
"public",
"ExpressRouteConnectionInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRouteGatewayName",
",",
"String",
"connectionName",
",",
"ExpressRouteConnectionInner",
"putExpressRouteConnectionParameters",
")",
"{",
"return",
"beginCrea... | Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit.
@param resourceGroupName The name of the resource group.
@param expressRouteGatewayName The name of the ExpressRoute gateway.
@param connectionName The name of the connection subresource.
@param putExpressRouteConnectionParameters Parame... | [
"Creates",
"a",
"connection",
"between",
"an",
"ExpressRoute",
"gateway",
"and",
"an",
"ExpressRoute",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteConnectionsInner.java#L178-L180 |
aws/aws-sdk-java | jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathContainsFunction.java | JmesPathContainsFunction.doesStringContain | private static BooleanNode doesStringContain(JsonNode subject, JsonNode search) {
"""
If the provided subject is a string, this function returns
true if the string contains the provided search argument.
@param subject String
@param search JmesPath expression
@return True string contains search;
False other... | java | private static BooleanNode doesStringContain(JsonNode subject, JsonNode search) {
if (subject.asText().contains(search.asText())) {
return BooleanNode.TRUE;
}
return BooleanNode.FALSE;
} | [
"private",
"static",
"BooleanNode",
"doesStringContain",
"(",
"JsonNode",
"subject",
",",
"JsonNode",
"search",
")",
"{",
"if",
"(",
"subject",
".",
"asText",
"(",
")",
".",
"contains",
"(",
"search",
".",
"asText",
"(",
")",
")",
")",
"{",
"return",
"Bo... | If the provided subject is a string, this function returns
true if the string contains the provided search argument.
@param subject String
@param search JmesPath expression
@return True string contains search;
False otherwise | [
"If",
"the",
"provided",
"subject",
"is",
"a",
"string",
"this",
"function",
"returns",
"true",
"if",
"the",
"string",
"contains",
"the",
"provided",
"search",
"argument",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathContainsFunction.java#L99-L104 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/parser/PdfContentReaderTool.java | PdfContentReaderTool.listContentStreamForPage | static public void listContentStreamForPage(PdfReader reader, int pageNum, PrintWriter out) throws IOException {
"""
Writes information about a specific page from PdfReader to the specified output stream.
@since 2.1.5
@param reader the PdfReader to read the page content from
@param pageNum the page number ... | java | static public void listContentStreamForPage(PdfReader reader, int pageNum, PrintWriter out) throws IOException {
out.println("==============Page " + pageNum + "====================");
out.println("- - - - - Dictionary - - - - - -");
PdfDictionary pageDictionary = reader.getPageN(pageNum);
... | [
"static",
"public",
"void",
"listContentStreamForPage",
"(",
"PdfReader",
"reader",
",",
"int",
"pageNum",
",",
"PrintWriter",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"println",
"(",
"\"==============Page \"",
"+",
"pageNum",
"+",
"\"==================... | Writes information about a specific page from PdfReader to the specified output stream.
@since 2.1.5
@param reader the PdfReader to read the page content from
@param pageNum the page number to read
@param out the output stream to send the content to
@throws IOException | [
"Writes",
"information",
"about",
"a",
"specific",
"page",
"from",
"PdfReader",
"to",
"the",
"specified",
"output",
"stream",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/parser/PdfContentReaderTool.java#L126-L154 |
jurmous/etcd4j | src/main/java/mousio/etcd4j/EtcdClient.java | EtcdClient.getSelfStats | public EtcdSelfStatsResponse getSelfStats() {
"""
Get the Self Statistics of Etcd
@return EtcdSelfStatsResponse
"""
try {
return new EtcdSelfStatsRequest(this.client, retryHandler).send().get();
} catch (IOException | EtcdException | EtcdAuthenticationException | TimeoutException e) {
re... | java | public EtcdSelfStatsResponse getSelfStats() {
try {
return new EtcdSelfStatsRequest(this.client, retryHandler).send().get();
} catch (IOException | EtcdException | EtcdAuthenticationException | TimeoutException e) {
return null;
}
} | [
"public",
"EtcdSelfStatsResponse",
"getSelfStats",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"EtcdSelfStatsRequest",
"(",
"this",
".",
"client",
",",
"retryHandler",
")",
".",
"send",
"(",
")",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",... | Get the Self Statistics of Etcd
@return EtcdSelfStatsResponse | [
"Get",
"the",
"Self",
"Statistics",
"of",
"Etcd"
] | train | https://github.com/jurmous/etcd4j/blob/ffb1d574cf85bbab025dd566ce250f1860bbcbc7/src/main/java/mousio/etcd4j/EtcdClient.java#L145-L151 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getText | @Pure
public static String getText(Node document, String... path) {
"""
Replies the text inside the node at the specified path.
<p>The path is an ordered list of tag's names and ended by the name of
the desired node.
Be careful about the fact that the names are case sensitives.
@param document is the XML ... | java | @Pure
public static String getText(Node document, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
Node parentNode = getNodeFromPath(document, path);
if (parentNode == null) {
parentNode = document;
}
final StringBuilder text = new StringBuilder();
final NodeList children ... | [
"@",
"Pure",
"public",
"static",
"String",
"getText",
"(",
"Node",
"document",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",
")",
";",
"Node",
"parentNode",
"=",
"getNo... | Replies the text inside the node at the specified path.
<p>The path is an ordered list of tag's names and ended by the name of
the desired node.
Be careful about the fact that the names are case sensitives.
@param document is the XML document to explore.
@param path is the list of names. This path may be empty.
@retu... | [
"Replies",
"the",
"text",
"inside",
"the",
"node",
"at",
"the",
"specified",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L1674-L1694 |
apereo/cas | support/cas-server-support-saml/src/main/java/org/apereo/cas/support/saml/authentication/SamlResponseBuilder.java | SamlResponseBuilder.setStatusRequestDenied | public void setStatusRequestDenied(final Response response, final String description) {
"""
Sets status request denied.
@param response the response
@param description the description
"""
response.setStatus(this.samlObjectBuilder.newStatus(StatusCode.REQUEST_DENIED, description));
} | java | public void setStatusRequestDenied(final Response response, final String description) {
response.setStatus(this.samlObjectBuilder.newStatus(StatusCode.REQUEST_DENIED, description));
} | [
"public",
"void",
"setStatusRequestDenied",
"(",
"final",
"Response",
"response",
",",
"final",
"String",
"description",
")",
"{",
"response",
".",
"setStatus",
"(",
"this",
".",
"samlObjectBuilder",
".",
"newStatus",
"(",
"StatusCode",
".",
"REQUEST_DENIED",
",",... | Sets status request denied.
@param response the response
@param description the description | [
"Sets",
"status",
"request",
"denied",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml/src/main/java/org/apereo/cas/support/saml/authentication/SamlResponseBuilder.java#L64-L66 |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/RedmineJSONParser.java | RedmineJSONParser.getDateOrNull | private static Date getDateOrNull(JSONObject obj, String field)
throws JSONException {
"""
Fetches an optional date from an object.
@param obj
object to get a field from.
@param field
field to get a value from.
@throws RedmineFormatException
if value is not valid
"""
String dateStr = JsonInput.get... | java | private static Date getDateOrNull(JSONObject obj, String field)
throws JSONException {
String dateStr = JsonInput.getStringOrNull(obj, field);
if (dateStr == null)
return null;
try {
if (dateStr.length() >= 5 && dateStr.charAt(4) == '/') {
return RedmineDateUtils.FULL_DATE_FORMAT.get().parse(dateStr)... | [
"private",
"static",
"Date",
"getDateOrNull",
"(",
"JSONObject",
"obj",
",",
"String",
"field",
")",
"throws",
"JSONException",
"{",
"String",
"dateStr",
"=",
"JsonInput",
".",
"getStringOrNull",
"(",
"obj",
",",
"field",
")",
";",
"if",
"(",
"dateStr",
"=="... | Fetches an optional date from an object.
@param obj
object to get a field from.
@param field
field to get a value from.
@throws RedmineFormatException
if value is not valid | [
"Fetches",
"an",
"optional",
"date",
"from",
"an",
"object",
"."
] | train | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONParser.java#L549-L574 |
damianszczepanik/cucumber-reporting | src/main/java/net/masterthought/cucumber/ReportBuilder.java | ReportBuilder.generateReports | public Reportable generateReports() {
"""
Parses provided files and generates the report. When generating process fails
report with information about error is provided.
@return stats for the generated report
"""
Trends trends = null;
try {
// first copy static resources so ErrorP... | java | public Reportable generateReports() {
Trends trends = null;
try {
// first copy static resources so ErrorPage is displayed properly
copyStaticResources();
// create directory for embeddings before files are generated
createEmbeddingsDirectory();
... | [
"public",
"Reportable",
"generateReports",
"(",
")",
"{",
"Trends",
"trends",
"=",
"null",
";",
"try",
"{",
"// first copy static resources so ErrorPage is displayed properly",
"copyStaticResources",
"(",
")",
";",
"// create directory for embeddings before files are generated",
... | Parses provided files and generates the report. When generating process fails
report with information about error is provided.
@return stats for the generated report | [
"Parses",
"provided",
"files",
"and",
"generates",
"the",
"report",
".",
"When",
"generating",
"process",
"fails",
"report",
"with",
"information",
"about",
"error",
"is",
"provided",
"."
] | train | https://github.com/damianszczepanik/cucumber-reporting/blob/9ffe0d4a9c0aec161b0988a930a8312ba36dc742/src/main/java/net/masterthought/cucumber/ReportBuilder.java#L74-L117 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java | DbcHelper.getConnection | public static Connection getConnection(String dataSourceName, boolean startTransaction)
throws SQLException {
"""
Obtains a JDBC connection from a named data-source (start a new
transaction if specified).
<p>
Note: call {@link #returnConnection(Connection)} to return the connection
back to the po... | java | public static Connection getConnection(String dataSourceName, boolean startTransaction)
throws SQLException {
Map<String, OpenConnStats> statsMap = openConnStats.get();
OpenConnStats connStats = statsMap.get(dataSourceName);
Connection conn;
if (connStats == null) {
... | [
"public",
"static",
"Connection",
"getConnection",
"(",
"String",
"dataSourceName",
",",
"boolean",
"startTransaction",
")",
"throws",
"SQLException",
"{",
"Map",
"<",
"String",
",",
"OpenConnStats",
">",
"statsMap",
"=",
"openConnStats",
".",
"get",
"(",
")",
"... | Obtains a JDBC connection from a named data-source (start a new
transaction if specified).
<p>
Note: call {@link #returnConnection(Connection)} to return the connection
back to the pool. Do NOT use {@code Connection.clode()}.
</p>
@param dataSourceName
@param startTransaction
@return
@throws SQLException | [
"Obtains",
"a",
"JDBC",
"connection",
"from",
"a",
"named",
"data",
"-",
"source",
"(",
"start",
"a",
"new",
"transaction",
"if",
"specified",
")",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/utils/DbcHelper.java#L117-L151 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java | QueryReferenceBroker.getCollectionByQuery | public Collection getCollectionByQuery(Query query, boolean lazy) throws PersistenceBrokerException {
"""
retrieve a collection of itemClass Objects matching the Query query
"""
// thma: the following cast is safe because:
// 1. ManageableVector implements Collection (will be returned if lazy... | java | public Collection getCollectionByQuery(Query query, boolean lazy) throws PersistenceBrokerException
{
// thma: the following cast is safe because:
// 1. ManageableVector implements Collection (will be returned if lazy == false)
// 2. CollectionProxy implements Collection (will be returne... | [
"public",
"Collection",
"getCollectionByQuery",
"(",
"Query",
"query",
",",
"boolean",
"lazy",
")",
"throws",
"PersistenceBrokerException",
"{",
"// thma: the following cast is safe because:\r",
"// 1. ManageableVector implements Collection (will be returned if lazy == false)\r",
"// 2... | retrieve a collection of itemClass Objects matching the Query query | [
"retrieve",
"a",
"collection",
"of",
"itemClass",
"Objects",
"matching",
"the",
"Query",
"query"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/QueryReferenceBroker.java#L284-L290 |
centic9/commons-dost | src/main/java/org/dstadler/commons/http/NanoHTTPD.java | NanoHTTPD.encodeUri | private String encodeUri( String uri ) {
"""
URL-encodes everything between '/'-characters.
Encodes spaces as '%20' instead of '+'.
"""
StringBuilder newUri = new StringBuilder();
StringTokenizer st = new StringTokenizer( uri, "/ ", true );
while ( st.hasMoreTokens())
{
String tok = st.nextToken();... | java | private String encodeUri( String uri )
{
StringBuilder newUri = new StringBuilder();
StringTokenizer st = new StringTokenizer( uri, "/ ", true );
while ( st.hasMoreTokens())
{
String tok = st.nextToken();
if ( tok.equals( "/" )) {
newUri.append('/');
} else if ( tok.equals( " " )) {
newUri.app... | [
"private",
"String",
"encodeUri",
"(",
"String",
"uri",
")",
"{",
"StringBuilder",
"newUri",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"uri",
",",
"\"/ \"",
",",
"true",
")",
";",
"while",
"(",... | URL-encodes everything between '/'-characters.
Encodes spaces as '%20' instead of '+'. | [
"URL",
"-",
"encodes",
"everything",
"between",
"/",
"-",
"characters",
".",
"Encodes",
"spaces",
"as",
"%20",
"instead",
"of",
"+",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/http/NanoHTTPD.java#L648-L668 |
jamesagnew/hapi-fhir | hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Period.java | Period.setEnd | public Period setEnd( Date theDate, TemporalPrecisionEnum thePrecision) {
"""
Sets the value for <b>end</b> ()
<p>
<b>Definition:</b>
The end of the period. The boundary is inclusive.
</p>
"""
end = new DateTimeType(theDate, thePrecision);
return this;
} | java | public Period setEnd( Date theDate, TemporalPrecisionEnum thePrecision) {
end = new DateTimeType(theDate, thePrecision);
return this;
} | [
"public",
"Period",
"setEnd",
"(",
"Date",
"theDate",
",",
"TemporalPrecisionEnum",
"thePrecision",
")",
"{",
"end",
"=",
"new",
"DateTimeType",
"(",
"theDate",
",",
"thePrecision",
")",
";",
"return",
"this",
";",
"}"
] | Sets the value for <b>end</b> ()
<p>
<b>Definition:</b>
The end of the period. The boundary is inclusive.
</p> | [
"Sets",
"the",
"value",
"for",
"<b",
">",
"end<",
"/",
"b",
">",
"()"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/model/Period.java#L190-L193 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/OntRelationMention.java | OntRelationMention.setRangeList | public void setRangeList(int i, Annotation v) {
"""
indexed setter for rangeList - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (OntRelationMention_Type.featOkTst && ((OntRelationMention_Type)jcasType).casFeat_rangeList == null)
... | java | public void setRangeList(int i, Annotation v) {
if (OntRelationMention_Type.featOkTst && ((OntRelationMention_Type)jcasType).casFeat_rangeList == null)
jcasType.jcas.throwFeatMissing("rangeList", "de.julielab.jules.types.OntRelationMention");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(... | [
"public",
"void",
"setRangeList",
"(",
"int",
"i",
",",
"Annotation",
"v",
")",
"{",
"if",
"(",
"OntRelationMention_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"OntRelationMention_Type",
")",
"jcasType",
")",
".",
"casFeat_rangeList",
"==",
"null",
")",
"jcasType... | indexed setter for rangeList - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"rangeList",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/OntRelationMention.java#L204-L208 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/util/StringHelper.java | StringHelper.makeFormattedString | public static String makeFormattedString(String aAttrName, Object aObj) {
"""
Overloaded method with <code>aPrependSeparator = true</code>.
@see #makeFormattedString(String, Object, boolean)
@param aAttrName A String attribute name value.
@param aObj An Object value.
@return A formatted String.
"""
... | java | public static String makeFormattedString(String aAttrName, Object aObj) {
return makeFormattedString(aAttrName, aObj, true);
} | [
"public",
"static",
"String",
"makeFormattedString",
"(",
"String",
"aAttrName",
",",
"Object",
"aObj",
")",
"{",
"return",
"makeFormattedString",
"(",
"aAttrName",
",",
"aObj",
",",
"true",
")",
";",
"}"
] | Overloaded method with <code>aPrependSeparator = true</code>.
@see #makeFormattedString(String, Object, boolean)
@param aAttrName A String attribute name value.
@param aObj An Object value.
@return A formatted String. | [
"Overloaded",
"method",
"with",
"<code",
">",
"aPrependSeparator",
"=",
"true<",
"/",
"code",
">",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/StringHelper.java#L720-L722 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.withdrawal_withdrawalId_payment_GET | public OvhPayment withdrawal_withdrawalId_payment_GET(String withdrawalId) throws IOException {
"""
Get this object properties
REST: GET /me/withdrawal/{withdrawalId}/payment
@param withdrawalId [required]
"""
String qPath = "/me/withdrawal/{withdrawalId}/payment";
StringBuilder sb = path(qPath, withdr... | java | public OvhPayment withdrawal_withdrawalId_payment_GET(String withdrawalId) throws IOException {
String qPath = "/me/withdrawal/{withdrawalId}/payment";
StringBuilder sb = path(qPath, withdrawalId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPayment.class);
} | [
"public",
"OvhPayment",
"withdrawal_withdrawalId_payment_GET",
"(",
"String",
"withdrawalId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/withdrawal/{withdrawalId}/payment\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"withdrawalId"... | Get this object properties
REST: GET /me/withdrawal/{withdrawalId}/payment
@param withdrawalId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L4332-L4337 |
andi12/msbuild-maven-plugin | msbuild-maven-plugin/src/main/java/uk/org/raje/maven/plugin/msbuild/VersionInfoMojo.java | VersionInfoMojo.writeVersionInfoTemplateToTempFile | private File writeVersionInfoTemplateToTempFile() throws MojoExecutionException {
"""
Write the default .rc template file to a temporary file and return it
@return a File pointing to the temporary file
@throws MojoExecutionException if there is an IOException
"""
try
{
final File... | java | private File writeVersionInfoTemplateToTempFile() throws MojoExecutionException
{
try
{
final File versionInfoSrc = File.createTempFile( "msbuild-maven-plugin_" + MOJO_NAME, null );
InputStream is = getClass().getResourceAsStream( DEFAULT_VERSION_INFO_TEMPLATE );
... | [
"private",
"File",
"writeVersionInfoTemplateToTempFile",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"final",
"File",
"versionInfoSrc",
"=",
"File",
".",
"createTempFile",
"(",
"\"msbuild-maven-plugin_\"",
"+",
"MOJO_NAME",
",",
"null",
")",
";",
... | Write the default .rc template file to a temporary file and return it
@return a File pointing to the temporary file
@throws MojoExecutionException if there is an IOException | [
"Write",
"the",
"default",
".",
"rc",
"template",
"file",
"to",
"a",
"temporary",
"file",
"and",
"return",
"it"
] | train | https://github.com/andi12/msbuild-maven-plugin/blob/224159c15efba20d482f8c630f7947339b1a1b86/msbuild-maven-plugin/src/main/java/uk/org/raje/maven/plugin/msbuild/VersionInfoMojo.java#L167-L191 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/context/ContextHelper.java | ContextHelper.getCookie | public static Cookie getCookie(final Collection<Cookie> cookies, final String name) {
"""
Get a specific cookie by its name.
@param cookies provided cookies
@param name the name of the cookie
@return the cookie
"""
if (cookies != null) {
for (final Cookie cookie : cookies) {
... | java | public static Cookie getCookie(final Collection<Cookie> cookies, final String name) {
if (cookies != null) {
for (final Cookie cookie : cookies) {
if (cookie != null && CommonHelper.areEquals(name, cookie.getName())) {
return cookie;
}
... | [
"public",
"static",
"Cookie",
"getCookie",
"(",
"final",
"Collection",
"<",
"Cookie",
">",
"cookies",
",",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"cookies",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Cookie",
"cookie",
":",
"cookies",
")",
... | Get a specific cookie by its name.
@param cookies provided cookies
@param name the name of the cookie
@return the cookie | [
"Get",
"a",
"specific",
"cookie",
"by",
"its",
"name",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/context/ContextHelper.java#L22-L31 |
openbase/jul | communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractRemoteClient.java | AbstractRemoteClient.addHandler | public void addHandler(final Handler handler, final boolean wait) throws InterruptedException, CouldNotPerformException {
"""
Method adds an handler to the internal rsb listener.
@param handler
@param wait
@throws InterruptedException
@throws CouldNotPerformException
"""
try {
liste... | java | public void addHandler(final Handler handler, final boolean wait) throws InterruptedException, CouldNotPerformException {
try {
listener.addHandler(handler, wait);
} catch (CouldNotPerformException ex) {
throw new CouldNotPerformException("Could not register Handler!", ex);
... | [
"public",
"void",
"addHandler",
"(",
"final",
"Handler",
"handler",
",",
"final",
"boolean",
"wait",
")",
"throws",
"InterruptedException",
",",
"CouldNotPerformException",
"{",
"try",
"{",
"listener",
".",
"addHandler",
"(",
"handler",
",",
"wait",
")",
";",
... | Method adds an handler to the internal rsb listener.
@param handler
@param wait
@throws InterruptedException
@throws CouldNotPerformException | [
"Method",
"adds",
"an",
"handler",
"to",
"the",
"internal",
"rsb",
"listener",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/communication/controller/src/main/java/org/openbase/jul/communication/controller/AbstractRemoteClient.java#L358-L364 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Treap.java | Treap.addElement | public int addElement(int element, int treap) {
"""
Adds new element to the treap. Allows duplicates to be added.
"""
int treap_;
if (treap == -1) {
if (m_defaultTreap == nullNode())
m_defaultTreap = createTreap(-1);
treap_ = m_defaultTreap;
} else {
treap_ = treap;
}
return addElement_... | java | public int addElement(int element, int treap) {
int treap_;
if (treap == -1) {
if (m_defaultTreap == nullNode())
m_defaultTreap = createTreap(-1);
treap_ = m_defaultTreap;
} else {
treap_ = treap;
}
return addElement_(element, 0, treap_);
} | [
"public",
"int",
"addElement",
"(",
"int",
"element",
",",
"int",
"treap",
")",
"{",
"int",
"treap_",
";",
"if",
"(",
"treap",
"==",
"-",
"1",
")",
"{",
"if",
"(",
"m_defaultTreap",
"==",
"nullNode",
"(",
")",
")",
"m_defaultTreap",
"=",
"createTreap",... | Adds new element to the treap. Allows duplicates to be added. | [
"Adds",
"new",
"element",
"to",
"the",
"treap",
".",
"Allows",
"duplicates",
"to",
"be",
"added",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Treap.java#L128-L139 |
SQLDroid/SQLDroid | src/main/java/org/sqldroid/SQLiteDatabase.java | SQLiteDatabase.changedRowCount | public int changedRowCount () {
"""
The count of changed rows. On JNA platforms, this is a call to sqlite3_changes
On Android, it's a convoluted call to a package-private method (or, if that fails, the
response is '1'.
"""
if ( getChangedRowCount == null ) {
try { // JNA/J2SE compatibility method... | java | public int changedRowCount () {
if ( getChangedRowCount == null ) {
try { // JNA/J2SE compatibility method.
getChangedRowCount = sqliteDatabase.getClass().getMethod("changedRowCount", (Class<?>[])null);
} catch ( Exception any ) {
try {
// Android
getChangedRowCount ... | [
"public",
"int",
"changedRowCount",
"(",
")",
"{",
"if",
"(",
"getChangedRowCount",
"==",
"null",
")",
"{",
"try",
"{",
"// JNA/J2SE compatibility method.",
"getChangedRowCount",
"=",
"sqliteDatabase",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"changedRo... | The count of changed rows. On JNA platforms, this is a call to sqlite3_changes
On Android, it's a convoluted call to a package-private method (or, if that fails, the
response is '1'. | [
"The",
"count",
"of",
"changed",
"rows",
".",
"On",
"JNA",
"platforms",
"this",
"is",
"a",
"call",
"to",
"sqlite3_changes",
"On",
"Android",
"it",
"s",
"a",
"convoluted",
"call",
"to",
"a",
"package",
"-",
"private",
"method",
"(",
"or",
"if",
"that",
... | train | https://github.com/SQLDroid/SQLDroid/blob/4fb38ee40338673cb0205044571e4379573762c4/src/main/java/org/sqldroid/SQLiteDatabase.java#L254-L276 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.isIdentical | public boolean isIdentical(T a, double tol) {
"""
Checks to see if matrix 'a' is the same as this matrix within the specified
tolerance.
@param a The matrix it is being compared against.
@param tol How similar they must be to be equals.
@return If they are equal within tolerance of each other.
"""
... | java | public boolean isIdentical(T a, double tol) {
if( a.getType() != getType() )
return false;
return ops.isIdentical(mat,a.mat,tol);
} | [
"public",
"boolean",
"isIdentical",
"(",
"T",
"a",
",",
"double",
"tol",
")",
"{",
"if",
"(",
"a",
".",
"getType",
"(",
")",
"!=",
"getType",
"(",
")",
")",
"return",
"false",
";",
"return",
"ops",
".",
"isIdentical",
"(",
"mat",
",",
"a",
".",
"... | Checks to see if matrix 'a' is the same as this matrix within the specified
tolerance.
@param a The matrix it is being compared against.
@param tol How similar they must be to be equals.
@return If they are equal within tolerance of each other. | [
"Checks",
"to",
"see",
"if",
"matrix",
"a",
"is",
"the",
"same",
"as",
"this",
"matrix",
"within",
"the",
"specified",
"tolerance",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L904-L908 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.getLogger | public static Logger getLogger(String name, String suffix) {
"""
Get a Logger instance given the logger name with the given suffix.
<p/>
<p>This will include a logger separator between logger name and suffix.
@param name the logger name
@param suffix a suffix to append to the logger name
@return the logge... | java | public static Logger getLogger(String name, String suffix) {
return getLogger(name == null || name.length() == 0 ? suffix : name + "." + suffix);
} | [
"public",
"static",
"Logger",
"getLogger",
"(",
"String",
"name",
",",
"String",
"suffix",
")",
"{",
"return",
"getLogger",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
")",
"==",
"0",
"?",
"suffix",
":",
"name",
"+",
"\".\"",
"+",
"s... | Get a Logger instance given the logger name with the given suffix.
<p/>
<p>This will include a logger separator between logger name and suffix.
@param name the logger name
@param suffix a suffix to append to the logger name
@return the logger | [
"Get",
"a",
"Logger",
"instance",
"given",
"the",
"logger",
"name",
"with",
"the",
"given",
"suffix",
".",
"<p",
"/",
">",
"<p",
">",
"This",
"will",
"include",
"a",
"logger",
"separator",
"between",
"logger",
"name",
"and",
"suffix",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L2469-L2471 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DateTimeUtils.java | DateTimeUtils.addDays | public static Calendar addDays(Calendar origin, int value) {
"""
Add/Subtract the specified amount of days to the given {@link Calendar}.
<p>
The returned {@link Calendar} has its fields synced.
</p>
@param origin
@param value
@return
@since 0.9.2
"""
Calendar cal = sync((Calendar) origin.cl... | java | public static Calendar addDays(Calendar origin, int value) {
Calendar cal = sync((Calendar) origin.clone());
cal.add(Calendar.DATE, value);
return sync(cal);
} | [
"public",
"static",
"Calendar",
"addDays",
"(",
"Calendar",
"origin",
",",
"int",
"value",
")",
"{",
"Calendar",
"cal",
"=",
"sync",
"(",
"(",
"Calendar",
")",
"origin",
".",
"clone",
"(",
")",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"DATE... | Add/Subtract the specified amount of days to the given {@link Calendar}.
<p>
The returned {@link Calendar} has its fields synced.
</p>
@param origin
@param value
@return
@since 0.9.2 | [
"Add",
"/",
"Subtract",
"the",
"specified",
"amount",
"of",
"days",
"to",
"the",
"given",
"{",
"@link",
"Calendar",
"}",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DateTimeUtils.java#L576-L580 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/serializer/NormalizerSerializer.java | NormalizerSerializer.write | public void write(@NonNull Normalizer normalizer, @NonNull File file) throws IOException {
"""
Serialize a normalizer to the given file
@param normalizer the normalizer
@param file the destination file
@throws IOException
"""
try (OutputStream out = new BufferedOutputStream(new FileOutputStr... | java | public void write(@NonNull Normalizer normalizer, @NonNull File file) throws IOException {
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(file))) {
write(normalizer, out);
}
} | [
"public",
"void",
"write",
"(",
"@",
"NonNull",
"Normalizer",
"normalizer",
",",
"@",
"NonNull",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"OutputStream",
"out",
"=",
"new",
"BufferedOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"fil... | Serialize a normalizer to the given file
@param normalizer the normalizer
@param file the destination file
@throws IOException | [
"Serialize",
"a",
"normalizer",
"to",
"the",
"given",
"file"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/serializer/NormalizerSerializer.java#L46-L50 |
h2oai/h2o-2 | src/main/java/water/fvec/NewChunk.java | NewChunk.set_impl | @Override boolean set_impl(int i, long l) {
"""
in-range and refer to the inflated values of the original Chunk.
"""
if( _ds != null ) return set_impl(i,(double)l);
if(_sparseLen != _len){ // sparse?
int idx = Arrays.binarySearch(_id,0,_sparseLen,i);
if(idx >= 0)i = idx;
else cancel... | java | @Override boolean set_impl(int i, long l) {
if( _ds != null ) return set_impl(i,(double)l);
if(_sparseLen != _len){ // sparse?
int idx = Arrays.binarySearch(_id,0,_sparseLen,i);
if(idx >= 0)i = idx;
else cancel_sparse(); // for now don't bother setting the sparse value
}
_ls[i]=l; _x... | [
"@",
"Override",
"boolean",
"set_impl",
"(",
"int",
"i",
",",
"long",
"l",
")",
"{",
"if",
"(",
"_ds",
"!=",
"null",
")",
"return",
"set_impl",
"(",
"i",
",",
"(",
"double",
")",
"l",
")",
";",
"if",
"(",
"_sparseLen",
"!=",
"_len",
")",
"{",
"... | in-range and refer to the inflated values of the original Chunk. | [
"in",
"-",
"range",
"and",
"refer",
"to",
"the",
"inflated",
"values",
"of",
"the",
"original",
"Chunk",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/NewChunk.java#L976-L986 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.createFeatureListResource | protected IResource createFeatureListResource(List<String> list, URI uri, long lastmod) {
"""
Creates an {@link IResource} object for the dependent feature list AMD
module
@param list
the dependent features list
@param uri
the resource URI
@param lastmod
the last modified time of the resource
@return the... | java | protected IResource createFeatureListResource(List<String> list, URI uri, long lastmod) {
JSONArray json;
try {
json = new JSONArray(new ArrayList<String>(dependentFeatures));
} catch (JSONException ex) {
return new ExceptionResource(uri, lastmod, new IOException(ex));
}
StringBuffer sb = new Str... | [
"protected",
"IResource",
"createFeatureListResource",
"(",
"List",
"<",
"String",
">",
"list",
",",
"URI",
"uri",
",",
"long",
"lastmod",
")",
"{",
"JSONArray",
"json",
";",
"try",
"{",
"json",
"=",
"new",
"JSONArray",
"(",
"new",
"ArrayList",
"<",
"Strin... | Creates an {@link IResource} object for the dependent feature list AMD
module
@param list
the dependent features list
@param uri
the resource URI
@param lastmod
the last modified time of the resource
@return the {@link IResource} object for the module | [
"Creates",
"an",
"{",
"@link",
"IResource",
"}",
"object",
"for",
"the",
"dependent",
"feature",
"list",
"AMD",
"module"
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L1090-L1101 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java | RTMPHandshake.getDHOffset2 | protected int getDHOffset2(byte[] handshake, int bufferOffset) {
"""
Returns the DH byte offset.
@param handshake handshake sequence
@param bufferOffset buffer offset
@return dh offset
"""
bufferOffset += 768;
int offset = handshake[bufferOffset] & 0xff;
bufferOffset++;
... | java | protected int getDHOffset2(byte[] handshake, int bufferOffset) {
bufferOffset += 768;
int offset = handshake[bufferOffset] & 0xff;
bufferOffset++;
offset += handshake[bufferOffset] & 0xff;
bufferOffset++;
offset += handshake[bufferOffset] & 0xff;
bufferOffs... | [
"protected",
"int",
"getDHOffset2",
"(",
"byte",
"[",
"]",
"handshake",
",",
"int",
"bufferOffset",
")",
"{",
"bufferOffset",
"+=",
"768",
";",
"int",
"offset",
"=",
"handshake",
"[",
"bufferOffset",
"]",
"&",
"0xff",
";",
"bufferOffset",
"++",
";",
"offse... | Returns the DH byte offset.
@param handshake handshake sequence
@param bufferOffset buffer offset
@return dh offset | [
"Returns",
"the",
"DH",
"byte",
"offset",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java#L467-L481 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/security/OSecurityManager.java | OSecurityManager.digest2String | public String digest2String(final String iInput, final boolean iIncludeAlgorithm) {
"""
Hashes the input string.
@param iInput
String to hash
@param iIncludeAlgorithm
Include the algorithm used or not
@return
"""
final StringBuilder buffer = new StringBuilder();
if (iIncludeAlgorithm)
buffer.a... | java | public String digest2String(final String iInput, final boolean iIncludeAlgorithm) {
final StringBuilder buffer = new StringBuilder();
if (iIncludeAlgorithm)
buffer.append(ALGORITHM_PREFIX);
buffer.append(OSecurityManager.instance().digest2String(iInput));
return buffer.toString();
} | [
"public",
"String",
"digest2String",
"(",
"final",
"String",
"iInput",
",",
"final",
"boolean",
"iIncludeAlgorithm",
")",
"{",
"final",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"iIncludeAlgorithm",
")",
"buffer",
".",
"... | Hashes the input string.
@param iInput
String to hash
@param iIncludeAlgorithm
Include the algorithm used or not
@return | [
"Hashes",
"the",
"input",
"string",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/security/OSecurityManager.java#L77-L85 |
JOML-CI/JOML | src/org/joml/Vector3d.java | Vector3d.set | public Vector3d set(int index, ByteBuffer buffer) {
"""
Read this vector from the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buff... | java | public Vector3d set(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector3d",
"set",
"(",
"int",
"index",
",",
"ByteBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buffer
values will be read in <code>x, y, z</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"ByteBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector3d.java#L390-L393 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java | SeaGlassLookAndFeel.getPaintingInsets | public static Insets getPaintingInsets(SynthContext state, Insets insets) {
"""
A convenience method to return where the foreground should be painted for
the Component identified by the passed in AbstractSynthContext.
@param state the SynthContext representing the current state.
@param insets an Insets obj... | java | public static Insets getPaintingInsets(SynthContext state, Insets insets) {
if (state.getRegion().isSubregion()) {
insets = state.getStyle().getInsets(state, insets);
} else {
insets = state.getComponent().getInsets(insets);
}
return insets;
} | [
"public",
"static",
"Insets",
"getPaintingInsets",
"(",
"SynthContext",
"state",
",",
"Insets",
"insets",
")",
"{",
"if",
"(",
"state",
".",
"getRegion",
"(",
")",
".",
"isSubregion",
"(",
")",
")",
"{",
"insets",
"=",
"state",
".",
"getStyle",
"(",
")",... | A convenience method to return where the foreground should be painted for
the Component identified by the passed in AbstractSynthContext.
@param state the SynthContext representing the current state.
@param insets an Insets object to be filled with the painting insets.
@return the insets object passed in and fille... | [
"A",
"convenience",
"method",
"to",
"return",
"where",
"the",
"foreground",
"should",
"be",
"painted",
"for",
"the",
"Component",
"identified",
"by",
"the",
"passed",
"in",
"AbstractSynthContext",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassLookAndFeel.java#L2522-L2530 |
dbracewell/mango | src/main/java/com/davidbracewell/conversion/Val.java | Val.asMap | public <K, V> Map<K, V> asMap(Class<K> keyClass, Class<V> valueClass) {
"""
Converts the object to a map
@param <K> the type parameter
@param <V> the type parameter
@param keyClass The key class
@param valueClass The value class
@return the object as a map
"""
return asMap(HashMap.... | java | public <K, V> Map<K, V> asMap(Class<K> keyClass, Class<V> valueClass) {
return asMap(HashMap.class, keyClass, valueClass);
} | [
"public",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"asMap",
"(",
"Class",
"<",
"K",
">",
"keyClass",
",",
"Class",
"<",
"V",
">",
"valueClass",
")",
"{",
"return",
"asMap",
"(",
"HashMap",
".",
"class",
",",
"keyClass",
",",
"va... | Converts the object to a map
@param <K> the type parameter
@param <V> the type parameter
@param keyClass The key class
@param valueClass The value class
@return the object as a map | [
"Converts",
"the",
"object",
"to",
"a",
"map"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/Val.java#L143-L145 |
YahooArchive/samoa | samoa-threads/src/main/java/com/yahoo/labs/samoa/topology/impl/ThreadsProcessingItem.java | ThreadsProcessingItem.setupInstances | public void setupInstances() {
"""
/*
Setup the replicas of this PI.
This should be called after the topology is set up (all Processors and PIs are
setup and connected to the respective streams) and before events are sent.
"""
this.piInstances = new ArrayList<ThreadsProcessingItemInstance>(this.getParalle... | java | public void setupInstances() {
this.piInstances = new ArrayList<ThreadsProcessingItemInstance>(this.getParallelism());
for (int i=0; i<this.getParallelism(); i++) {
Processor newProcessor = this.getProcessor().newProcessor(this.getProcessor());
newProcessor.onCreate(i + 1);
this.piInstances.add(new Threads... | [
"public",
"void",
"setupInstances",
"(",
")",
"{",
"this",
".",
"piInstances",
"=",
"new",
"ArrayList",
"<",
"ThreadsProcessingItemInstance",
">",
"(",
"this",
".",
"getParallelism",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | /*
Setup the replicas of this PI.
This should be called after the topology is set up (all Processors and PIs are
setup and connected to the respective streams) and before events are sent. | [
"/",
"*",
"Setup",
"the",
"replicas",
"of",
"this",
"PI",
".",
"This",
"should",
"be",
"called",
"after",
"the",
"topology",
"is",
"set",
"up",
"(",
"all",
"Processors",
"and",
"PIs",
"are",
"setup",
"and",
"connected",
"to",
"the",
"respective",
"stream... | train | https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-threads/src/main/java/com/yahoo/labs/samoa/topology/impl/ThreadsProcessingItem.java#L92-L99 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putCharLittleEndian | public final void putCharLittleEndian(int index, char value) {
"""
Writes the given character (16 bit, 2 bytes) to the given position in little-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putChar(int, char)}. For most cases (such as
tr... | java | public final void putCharLittleEndian(int index, char value) {
if (LITTLE_ENDIAN) {
putChar(index, value);
} else {
putChar(index, Character.reverseBytes(value));
}
} | [
"public",
"final",
"void",
"putCharLittleEndian",
"(",
"int",
"index",
",",
"char",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putChar",
"(",
"index",
",",
"value",
")",
";",
"}",
"else",
"{",
"putChar",
"(",
"index",
",",
"Character",
"... | Writes the given character (16 bit, 2 bytes) to the given position in little-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putChar(int, char)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
it suffice... | [
"Writes",
"the",
"given",
"character",
"(",
"16",
"bit",
"2",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"little",
"-",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"native",
"byte",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L515-L521 |
jboss/jboss-jstl-api_spec | src/main/java/javax/servlet/jsp/jstl/sql/ResultSupport.java | ResultSupport.toResult | public static Result toResult(ResultSet rs, int maxRows) {
"""
Converts <code>maxRows</code> of a <code>ResultSet</code> object to a
<code>Result</code> object.
@param rs the <code>ResultSet</code> object
@param maxRows the maximum number of rows to be cached into the <code>Result</code> object.
@return... | java | public static Result toResult(ResultSet rs, int maxRows) {
try {
return new ResultImpl(rs, -1, maxRows);
} catch (SQLException ex) {
return null;
}
} | [
"public",
"static",
"Result",
"toResult",
"(",
"ResultSet",
"rs",
",",
"int",
"maxRows",
")",
"{",
"try",
"{",
"return",
"new",
"ResultImpl",
"(",
"rs",
",",
"-",
"1",
",",
"maxRows",
")",
";",
"}",
"catch",
"(",
"SQLException",
"ex",
")",
"{",
"retu... | Converts <code>maxRows</code> of a <code>ResultSet</code> object to a
<code>Result</code> object.
@param rs the <code>ResultSet</code> object
@param maxRows the maximum number of rows to be cached into the <code>Result</code> object.
@return The <code>Result</code> object created from the <code>ResultSet</code>,
... | [
"Converts",
"<code",
">",
"maxRows<",
"/",
"code",
">",
"of",
"a",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"object",
"to",
"a",
"<code",
">",
"Result<",
"/",
"code",
">",
"object",
"."
] | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/javax/servlet/jsp/jstl/sql/ResultSupport.java#L60-L66 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java | CommerceSubscriptionEntryPersistenceImpl.findBySubscriptionStatus | @Override
public List<CommerceSubscriptionEntry> findBySubscriptionStatus(
int subscriptionStatus, int start, int end) {
"""
Returns a range of all the commerce subscription entries where subscriptionStatus = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances.... | java | @Override
public List<CommerceSubscriptionEntry> findBySubscriptionStatus(
int subscriptionStatus, int start, int end) {
return findBySubscriptionStatus(subscriptionStatus, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceSubscriptionEntry",
">",
"findBySubscriptionStatus",
"(",
"int",
"subscriptionStatus",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findBySubscriptionStatus",
"(",
"subscriptionStatus",
",",
"start",
"... | Returns a range of all the commerce subscription entries where subscriptionStatus = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the fi... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"subscription",
"entries",
"where",
"subscriptionStatus",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java#L2070-L2074 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java | BaseSparseNDArrayCOO.checkBufferCoherence | protected void checkBufferCoherence() {
"""
Check that the length of indices and values are coherent and matches the rank of the matrix.
"""
if (values.length() < length){
throw new IllegalStateException("nnz is larger than capacity of buffers");
}
if (values.length() * ran... | java | protected void checkBufferCoherence(){
if (values.length() < length){
throw new IllegalStateException("nnz is larger than capacity of buffers");
}
if (values.length() * rank() != indices.length()){
throw new IllegalArgumentException("Sizes of values, indices and shape ar... | [
"protected",
"void",
"checkBufferCoherence",
"(",
")",
"{",
"if",
"(",
"values",
".",
"length",
"(",
")",
"<",
"length",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"nnz is larger than capacity of buffers\"",
")",
";",
"}",
"if",
"(",
"values",
"... | Check that the length of indices and values are coherent and matches the rank of the matrix. | [
"Check",
"that",
"the",
"length",
"of",
"indices",
"and",
"values",
"are",
"coherent",
"and",
"matches",
"the",
"rank",
"of",
"the",
"matrix",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCOO.java#L143-L151 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/patterns/StepPattern.java | StepPattern.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize) {
"""
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corre... | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
super.fixupVariables(vars, globalsSize);
if (null != m_predicates)
{
for (int i = 0; i < m_predicates.length; i++)
{
m_predicates[i].fixupVariables(vars, globalsSize);
}
}
if (null != m_relativePathPa... | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"super",
".",
"fixupVariables",
"(",
"vars",
",",
"globalsSize",
")",
";",
"if",
"(",
"null",
"!=",
"m_predicates",
")",
"{",
"for",... | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/patterns/StepPattern.java#L158-L175 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/resourceIndex/ResourceIndexImpl.java | ResourceIndexImpl.updateTriples | private void updateTriples(Set<Triple> set, boolean delete)
throws ResourceIndexException {
"""
Applies the given adds or deletes to the triplestore. If _syncUpdates is
true, changes will be flushed before returning.
"""
try {
if (delete) {
_writer.delete(getTri... | java | private void updateTriples(Set<Triple> set, boolean delete)
throws ResourceIndexException {
try {
if (delete) {
_writer.delete(getTripleIterator(set), _syncUpdates);
} else {
_writer.add(getTripleIterator(set), _syncUpdates);
}
... | [
"private",
"void",
"updateTriples",
"(",
"Set",
"<",
"Triple",
">",
"set",
",",
"boolean",
"delete",
")",
"throws",
"ResourceIndexException",
"{",
"try",
"{",
"if",
"(",
"delete",
")",
"{",
"_writer",
".",
"delete",
"(",
"getTripleIterator",
"(",
"set",
")... | Applies the given adds or deletes to the triplestore. If _syncUpdates is
true, changes will be flushed before returning. | [
"Applies",
"the",
"given",
"adds",
"or",
"deletes",
"to",
"the",
"triplestore",
".",
"If",
"_syncUpdates",
"is",
"true",
"changes",
"will",
"be",
"flushed",
"before",
"returning",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/resourceIndex/ResourceIndexImpl.java#L159-L170 |
molgenis/molgenis | molgenis-data-validation/src/main/java/org/molgenis/data/validation/meta/AttributeValidator.java | AttributeValidator.validateMappedBy | private static void validateMappedBy(Attribute attr, Attribute mappedByAttr) {
"""
Validate whether the mappedBy attribute is part of the referenced entity.
@param attr attribute
@param mappedByAttr mappedBy attribute
@throws MolgenisDataException if mappedBy is an attribute that is not part of the referenced... | java | private static void validateMappedBy(Attribute attr, Attribute mappedByAttr) {
if (mappedByAttr != null) {
if (!isSingleReferenceType(mappedByAttr)) {
throw new MolgenisDataException(
format(
"Invalid mappedBy attribute [%s] data type [%s].",
mappedByAttr.ge... | [
"private",
"static",
"void",
"validateMappedBy",
"(",
"Attribute",
"attr",
",",
"Attribute",
"mappedByAttr",
")",
"{",
"if",
"(",
"mappedByAttr",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"isSingleReferenceType",
"(",
"mappedByAttr",
")",
")",
"{",
"throw",
"n... | Validate whether the mappedBy attribute is part of the referenced entity.
@param attr attribute
@param mappedByAttr mappedBy attribute
@throws MolgenisDataException if mappedBy is an attribute that is not part of the referenced
entity | [
"Validate",
"whether",
"the",
"mappedBy",
"attribute",
"is",
"part",
"of",
"the",
"referenced",
"entity",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-validation/src/main/java/org/molgenis/data/validation/meta/AttributeValidator.java#L296-L313 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.getNumberOfBytesRequiredToSpend | public int getNumberOfBytesRequiredToSpend(@Nullable ECKey pubKey, @Nullable Script redeemScript) {
"""
Returns number of bytes required to spend this script. It accepts optional ECKey and redeemScript that may
be required for certain types of script to estimate target size.
"""
if (ScriptPattern.isP2... | java | public int getNumberOfBytesRequiredToSpend(@Nullable ECKey pubKey, @Nullable Script redeemScript) {
if (ScriptPattern.isP2SH(this)) {
// scriptSig: <sig> [sig] [sig...] <redeemscript>
checkArgument(redeemScript != null, "P2SH script requires redeemScript to be spent");
return... | [
"public",
"int",
"getNumberOfBytesRequiredToSpend",
"(",
"@",
"Nullable",
"ECKey",
"pubKey",
",",
"@",
"Nullable",
"Script",
"redeemScript",
")",
"{",
"if",
"(",
"ScriptPattern",
".",
"isP2SH",
"(",
"this",
")",
")",
"{",
"// scriptSig: <sig> [sig] [sig...] <redeems... | Returns number of bytes required to spend this script. It accepts optional ECKey and redeemScript that may
be required for certain types of script to estimate target size. | [
"Returns",
"number",
"of",
"bytes",
"required",
"to",
"spend",
"this",
"script",
".",
"It",
"accepts",
"optional",
"ECKey",
"and",
"redeemScript",
"that",
"may",
"be",
"required",
"for",
"certain",
"types",
"of",
"script",
"to",
"estimate",
"target",
"size",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L611-L634 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/util/concurrent/UnsynchronizedRateLimiter.java | UnsynchronizedRateLimiter.tryAcquire | public boolean tryAcquire(int permits, long timeout, TimeUnit unit) {
"""
Acquires the given number of permits from this {@code UnsynchronizedRateLimiter} if it can be obtained
without exceeding the specified {@code timeout}, or returns {@code false}
immediately (without waiting) if the permits would not have be... | java | public boolean tryAcquire(int permits, long timeout, TimeUnit unit) {
long timeoutMicros = unit.toMicros(timeout);
checkPermits(permits);
long microsToWait;
long nowMicros = readSafeMicros();
if (nextFreeTicketMicros > nowMicros + timeoutMicros) {
return false;
} else {
microsToWait ... | [
"public",
"boolean",
"tryAcquire",
"(",
"int",
"permits",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"long",
"timeoutMicros",
"=",
"unit",
".",
"toMicros",
"(",
"timeout",
")",
";",
"checkPermits",
"(",
"permits",
")",
";",
"long",
"microsT... | Acquires the given number of permits from this {@code UnsynchronizedRateLimiter} if it can be obtained
without exceeding the specified {@code timeout}, or returns {@code false}
immediately (without waiting) if the permits would not have been granted
before the timeout expired.
@param permits the number of permits to a... | [
"Acquires",
"the",
"given",
"number",
"of",
"permits",
"from",
"this",
"{",
"@code",
"UnsynchronizedRateLimiter",
"}",
"if",
"it",
"can",
"be",
"obtained",
"without",
"exceeding",
"the",
"specified",
"{",
"@code",
"timeout",
"}",
"or",
"returns",
"{",
"@code",... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/util/concurrent/UnsynchronizedRateLimiter.java#L479-L491 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/macro/SarlProcessorInstanceForJvmTypeProvider.java | SarlProcessorInstanceForJvmTypeProvider.filterActiveProcessorType | public static JvmType filterActiveProcessorType(JvmType type, CommonTypeComputationServices services) {
"""
Filter the type in order to create the correct processor.
@param type the type of the processor specified into the {@code @Active} annotation.
@param services the type services of the framework.
@return... | java | public static JvmType filterActiveProcessorType(JvmType type, CommonTypeComputationServices services) {
if (AccessorsProcessor.class.getName().equals(type.getQualifiedName())) {
return services.getTypeReferences().findDeclaredType(SarlAccessorsProcessor.class, type);
}
return type;
} | [
"public",
"static",
"JvmType",
"filterActiveProcessorType",
"(",
"JvmType",
"type",
",",
"CommonTypeComputationServices",
"services",
")",
"{",
"if",
"(",
"AccessorsProcessor",
".",
"class",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"type",
".",
"getQualifiedN... | Filter the type in order to create the correct processor.
@param type the type of the processor specified into the {@code @Active} annotation.
@param services the type services of the framework.
@return the real type of the processor to instance. | [
"Filter",
"the",
"type",
"in",
"order",
"to",
"create",
"the",
"correct",
"processor",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/macro/SarlProcessorInstanceForJvmTypeProvider.java#L59-L64 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.unwrapKeyAsync | public ServiceFuture<KeyOperationResult> unwrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) {
"""
Unwraps a symmetric key using the specified key that was initially used for wrappin... | java | public ServiceFuture<KeyOperationResult> unwrapKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeyEncryptionAlgorithm algorithm, byte[] value, final ServiceCallback<KeyOperationResult> serviceCallback) {
return ServiceFuture.fromResponse(unwrapKeyWithServiceResponseAsync(vaultBaseUrl, ke... | [
"public",
"ServiceFuture",
"<",
"KeyOperationResult",
">",
"unwrapKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"JsonWebKeyEncryptionAlgorithm",
"algorithm",
",",
"byte",
"[",
"]",
"value",
",",
"final",
"Servi... | Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azu... | [
"Unwraps",
"a",
"symmetric",
"key",
"using",
"the",
"specified",
"key",
"that",
"was",
"initially",
"used",
"for",
"wrapping",
"that",
"key",
".",
"The",
"UNWRAP",
"operation",
"supports",
"decryption",
"of",
"a",
"symmetric",
"key",
"using",
"the",
"target",
... | 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#L2731-L2733 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java | Workgroup.joinQueue | public void joinQueue(Form answerForm, Jid userID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
<p>Joins the workgroup queue to wait to be routed to an agent. After joining
the queue, queue status events will be sent to indicate the user's position and
estimat... | java | public void joinQueue(Form answerForm, Jid userID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// If already in the queue ignore the join request.
if (inQueue) {
throw new IllegalStateException("Already in queue " + workgroupJID);
}
... | [
"public",
"void",
"joinQueue",
"(",
"Form",
"answerForm",
",",
"Jid",
"userID",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"// If already in the queue ignore the join request.",
"if",
"(",... | <p>Joins the workgroup queue to wait to be routed to an agent. After joining
the queue, queue status events will be sent to indicate the user's position and
estimated time left in the queue. Once joining the queue, there are three ways
the user can leave the queue: <ul>
<li>The user is routed to an agent, which trigge... | [
"<p",
">",
"Joins",
"the",
"workgroup",
"queue",
"to",
"wait",
"to",
"be",
"routed",
"to",
"an",
"agent",
".",
"After",
"joining",
"the",
"queue",
"queue",
"status",
"events",
"will",
"be",
"sent",
"to",
"indicate",
"the",
"user",
"s",
"position",
"and",... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java#L345-L356 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/dictionary/TFDictionary.java | TFDictionary.combine | public int combine(TFDictionary dictionary, int limit, boolean add) {
"""
合并自己(主词典)和某个词频词典
@param dictionary 某个词频词典
@param limit 如果该词频词典试图引入一个词语,其词频不得超过此limit(如果不需要使用limit功能,可以传入Integer.MAX_VALUE)
@param add 设为true则是词频叠加模式,否则是词频覆盖模式
@return 词条的增量
"""
int preSize = trie.size();
for (Map.Entr... | java | public int combine(TFDictionary dictionary, int limit, boolean add)
{
int preSize = trie.size();
for (Map.Entry<String, TermFrequency> entry : dictionary.trie.entrySet())
{
TermFrequency termFrequency = trie.get(entry.getKey());
if (termFrequency == null)
... | [
"public",
"int",
"combine",
"(",
"TFDictionary",
"dictionary",
",",
"int",
"limit",
",",
"boolean",
"add",
")",
"{",
"int",
"preSize",
"=",
"trie",
".",
"size",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"TermFrequency",
">",
... | 合并自己(主词典)和某个词频词典
@param dictionary 某个词频词典
@param limit 如果该词频词典试图引入一个词语,其词频不得超过此limit(如果不需要使用limit功能,可以传入Integer.MAX_VALUE)
@param add 设为true则是词频叠加模式,否则是词频覆盖模式
@return 词条的增量 | [
"合并自己(主词典)和某个词频词典"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/TFDictionary.java#L55-L74 |
camunda/camunda-commons | logging/src/main/java/org/camunda/commons/logging/BaseLogger.java | BaseLogger.logError | protected void logError(String id, String messageTemplate, Object... parameters) {
"""
Logs an 'ERROR' message
@param id the unique id of this log message
@param messageTemplate the message template to use
@param parameters a list of optional parameters
"""
if(delegateLogger.isErrorEnabled()) {
... | java | protected void logError(String id, String messageTemplate, Object... parameters) {
if(delegateLogger.isErrorEnabled()) {
String msg = formatMessageTemplate(id, messageTemplate);
delegateLogger.error(msg, parameters);
}
} | [
"protected",
"void",
"logError",
"(",
"String",
"id",
",",
"String",
"messageTemplate",
",",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"delegateLogger",
".",
"isErrorEnabled",
"(",
")",
")",
"{",
"String",
"msg",
"=",
"formatMessageTemplate",
"(",
... | Logs an 'ERROR' message
@param id the unique id of this log message
@param messageTemplate the message template to use
@param parameters a list of optional parameters | [
"Logs",
"an",
"ERROR",
"message"
] | train | https://github.com/camunda/camunda-commons/blob/bd3195db47c92c25717288fe9e6735f8e882f247/logging/src/main/java/org/camunda/commons/logging/BaseLogger.java#L157-L162 |
GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java | AbstractGoogleAsyncWriteChannel.waitForCompletionAndThrowIfUploadFailed | private S waitForCompletionAndThrowIfUploadFailed() throws IOException {
"""
Throws if upload operation failed. Propagates any errors.
@throws IOException on IO error
"""
try {
return uploadOperation.get();
} catch (InterruptedException e) {
// If we were interrupted, we need to cancel t... | java | private S waitForCompletionAndThrowIfUploadFailed() throws IOException {
try {
return uploadOperation.get();
} catch (InterruptedException e) {
// If we were interrupted, we need to cancel the upload operation.
uploadOperation.cancel(true);
IOException exception = new ClosedByInterruptEx... | [
"private",
"S",
"waitForCompletionAndThrowIfUploadFailed",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"uploadOperation",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// If we were interrupted, we need to canc... | Throws if upload operation failed. Propagates any errors.
@throws IOException on IO error | [
"Throws",
"if",
"upload",
"operation",
"failed",
".",
"Propagates",
"any",
"errors",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/AbstractGoogleAsyncWriteChannel.java#L300-L315 |
netty/netty | common/src/main/java/io/netty/util/concurrent/DefaultPromise.java | DefaultPromise.notifyProgressiveListeners | @SuppressWarnings("unchecked")
void notifyProgressiveListeners(final long progress, final long total) {
"""
Notify all progressive listeners.
<p>
No attempt is made to ensure notification order if multiple calls are made to this method before
the original invocation completes.
<p>
This will do an iteratio... | java | @SuppressWarnings("unchecked")
void notifyProgressiveListeners(final long progress, final long total) {
final Object listeners = progressiveListeners();
if (listeners == null) {
return;
}
final ProgressiveFuture<V> self = (ProgressiveFuture<V>) this;
EventExecut... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"void",
"notifyProgressiveListeners",
"(",
"final",
"long",
"progress",
",",
"final",
"long",
"total",
")",
"{",
"final",
"Object",
"listeners",
"=",
"progressiveListeners",
"(",
")",
";",
"if",
"(",
"listeners... | Notify all progressive listeners.
<p>
No attempt is made to ensure notification order if multiple calls are made to this method before
the original invocation completes.
<p>
This will do an iteration over all listeners to get all of type {@link GenericProgressiveFutureListener}s.
@param progress the new progress.
@para... | [
"Notify",
"all",
"progressive",
"listeners",
".",
"<p",
">",
"No",
"attempt",
"is",
"made",
"to",
"ensure",
"notification",
"order",
"if",
"multiple",
"calls",
"are",
"made",
"to",
"this",
"method",
"before",
"the",
"original",
"invocation",
"completes",
".",
... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java#L641-L680 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/PostParameterHelper.java | PostParameterHelper.saveToSession | private void saveToSession(HttpServletRequest req, String reqURL, Map params) {
"""
Save POST parameters (reqURL, parameters) to a session
@param req
@param reqURL
@param params
"""
HttpSession postparamsession = req.getSession(true);
if (postparamsession != null && params != null && !params.isEmpty()... | java | private void saveToSession(HttpServletRequest req, String reqURL, Map params) {
HttpSession postparamsession = req.getSession(true);
if (postparamsession != null && params != null && !params.isEmpty()) {
postparamsession.setAttribute(INITIAL_URL, reqURL);
postparamsession.setAttribute(PARAM_NAMES, null);
p... | [
"private",
"void",
"saveToSession",
"(",
"HttpServletRequest",
"req",
",",
"String",
"reqURL",
",",
"Map",
"params",
")",
"{",
"HttpSession",
"postparamsession",
"=",
"req",
".",
"getSession",
"(",
"true",
")",
";",
"if",
"(",
"postparamsession",
"!=",
"null",... | Save POST parameters (reqURL, parameters) to a session
@param req
@param reqURL
@param params | [
"Save",
"POST",
"parameters",
"(",
"reqURL",
"parameters",
")",
"to",
"a",
"session"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/PostParameterHelper.java#L168-L178 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableGenerator.java | JDBCStorableGenerator.getConnection | private LocalVariable getConnection(CodeBuilder b, LocalVariable capVar) {
"""
Generates code to get connection from JDBCConnectionCapability and store
it in a local variable.
@param capVar reference to JDBCConnectionCapability
"""
b.loadLocal(capVar);
b.invokeInterface(TypeDesc.forClass(... | java | private LocalVariable getConnection(CodeBuilder b, LocalVariable capVar) {
b.loadLocal(capVar);
b.invokeInterface(TypeDesc.forClass(JDBCConnectionCapability.class),
"getConnection", TypeDesc.forClass(Connection.class), null);
LocalVariable conVar = b.createLocalVari... | [
"private",
"LocalVariable",
"getConnection",
"(",
"CodeBuilder",
"b",
",",
"LocalVariable",
"capVar",
")",
"{",
"b",
".",
"loadLocal",
"(",
"capVar",
")",
";",
"b",
".",
"invokeInterface",
"(",
"TypeDesc",
".",
"forClass",
"(",
"JDBCConnectionCapability",
".",
... | Generates code to get connection from JDBCConnectionCapability and store
it in a local variable.
@param capVar reference to JDBCConnectionCapability | [
"Generates",
"code",
"to",
"get",
"connection",
"from",
"JDBCConnectionCapability",
"and",
"store",
"it",
"in",
"a",
"local",
"variable",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableGenerator.java#L1363-L1370 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.resumeDomainStream | public ResumeDomainStreamResponse resumeDomainStream(String domain, String app, String stream) {
"""
Get detail of stream in the live stream service.
@param domain The requested domain which the specific stream belongs to
@param app The requested app which the specific stream belongs to
@param stream The requ... | java | public ResumeDomainStreamResponse resumeDomainStream(String domain, String app, String stream) {
ResumeDomainStreamRequest request = new ResumeDomainStreamRequest();
request.withDomain(domain).withApp(app).withStream(stream);
return resumeDomainStream(request);
} | [
"public",
"ResumeDomainStreamResponse",
"resumeDomainStream",
"(",
"String",
"domain",
",",
"String",
"app",
",",
"String",
"stream",
")",
"{",
"ResumeDomainStreamRequest",
"request",
"=",
"new",
"ResumeDomainStreamRequest",
"(",
")",
";",
"request",
".",
"withDomain"... | Get detail of stream in the live stream service.
@param domain The requested domain which the specific stream belongs to
@param app The requested app which the specific stream belongs to
@param stream The requested stream to resume
@return the response | [
"Get",
"detail",
"of",
"stream",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1556-L1560 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java | Bytes.compareTo | public static int compareTo(final byte [] left, final byte [] right) {
"""
Lexicographically compare two arrays.
@param left left operand
@param right right operand
@return 0 if equal, < 0 if left is less than right, etc.
"""
return LexicographicalComparerHolder.BEST_COMPARER.
compareTo(left, 0,... | java | public static int compareTo(final byte [] left, final byte [] right) {
return LexicographicalComparerHolder.BEST_COMPARER.
compareTo(left, 0, left.length, right, 0, right.length);
} | [
"public",
"static",
"int",
"compareTo",
"(",
"final",
"byte",
"[",
"]",
"left",
",",
"final",
"byte",
"[",
"]",
"right",
")",
"{",
"return",
"LexicographicalComparerHolder",
".",
"BEST_COMPARER",
".",
"compareTo",
"(",
"left",
",",
"0",
",",
"left",
".",
... | Lexicographically compare two arrays.
@param left left operand
@param right right operand
@return 0 if equal, < 0 if left is less than right, etc. | [
"Lexicographically",
"compare",
"two",
"arrays",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java#L758-L761 |
threerings/narya | core/src/main/java/com/threerings/crowd/server/PlaceManager.java | PlaceManager.addOccupantInfo | protected void addOccupantInfo (BodyObject body, OccupantInfo info) {
"""
Adds this occupant's info to the {@link PlaceObject}. This is called in a transaction on the
place object so if a derived class needs to add additional information for an occupant it
should override this method. It may opt to add the infor... | java | protected void addOccupantInfo (BodyObject body, OccupantInfo info)
{
// clone the canonical copy and insert it into the DSet
_plobj.addToOccupantInfo(info);
// add the body oid to our place object's occupant list
_plobj.addToOccupants(body.getOid());
} | [
"protected",
"void",
"addOccupantInfo",
"(",
"BodyObject",
"body",
",",
"OccupantInfo",
"info",
")",
"{",
"// clone the canonical copy and insert it into the DSet",
"_plobj",
".",
"addToOccupantInfo",
"(",
"info",
")",
";",
"// add the body oid to our place object's occupant li... | Adds this occupant's info to the {@link PlaceObject}. This is called in a transaction on the
place object so if a derived class needs to add additional information for an occupant it
should override this method. It may opt to add the information before calling super if it
wishes to rely on its information being configu... | [
"Adds",
"this",
"occupant",
"s",
"info",
"to",
"the",
"{"
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L662-L669 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/commons/IOUtils.java | IOUtils.contentEquals | public static boolean contentEquals(InputStream input1, InputStream input2)
throws IOException {
"""
Compare the contents of two Streams to determine if they are equal or
not.
<p>
This method buffers the input internally using
<code>BufferedInputStream</code> if they are not already buffered.
@param i... | java | public static boolean contentEquals(InputStream input1, InputStream input2)
throws IOException {
if (!(input1 instanceof BufferedInputStream)) {
input1 = new BufferedInputStream(input1);
}
if (!(input2 instanceof BufferedInputStream)) {
input2 = new BufferedInputStream(input2);
}
... | [
"public",
"static",
"boolean",
"contentEquals",
"(",
"InputStream",
"input1",
",",
"InputStream",
"input2",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"(",
"input1",
"instanceof",
"BufferedInputStream",
")",
")",
"{",
"input1",
"=",
"new",
"BufferedInput... | Compare the contents of two Streams to determine if they are equal or
not.
<p>
This method buffers the input internally using
<code>BufferedInputStream</code> if they are not already buffered.
@param input1 the first stream
@param input2 the second stream
@return true if the content of the streams are equal or they ... | [
"Compare",
"the",
"contents",
"of",
"two",
"Streams",
"to",
"determine",
"if",
"they",
"are",
"equal",
"or",
"not",
".",
"<p",
">",
"This",
"method",
"buffers",
"the",
"input",
"internally",
"using",
"<code",
">",
"BufferedInputStream<",
"/",
"code",
">",
... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/commons/IOUtils.java#L467-L487 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.appendWithSeparators | public StrBuilder appendWithSeparators(final Iterable<?> iterable, final String separator) {
"""
Appends an iterable placing separators between each value, but
not before the first or after the last.
Appending a null iterable will have no effect.
Each object is appended using {@link #append(Object)}.
@param ... | java | public StrBuilder appendWithSeparators(final Iterable<?> iterable, final String separator) {
if (iterable != null) {
final String sep = Objects.toString(separator, "");
final Iterator<?> it = iterable.iterator();
while (it.hasNext()) {
append(it.next());
... | [
"public",
"StrBuilder",
"appendWithSeparators",
"(",
"final",
"Iterable",
"<",
"?",
">",
"iterable",
",",
"final",
"String",
"separator",
")",
"{",
"if",
"(",
"iterable",
"!=",
"null",
")",
"{",
"final",
"String",
"sep",
"=",
"Objects",
".",
"toString",
"(... | Appends an iterable placing separators between each value, but
not before the first or after the last.
Appending a null iterable will have no effect.
Each object is appended using {@link #append(Object)}.
@param iterable the iterable to append
@param separator the separator to use, null means no separator
@return th... | [
"Appends",
"an",
"iterable",
"placing",
"separators",
"between",
"each",
"value",
"but",
"not",
"before",
"the",
"first",
"or",
"after",
"the",
"last",
".",
"Appending",
"a",
"null",
"iterable",
"will",
"have",
"no",
"effect",
".",
"Each",
"object",
"is",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1273-L1285 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/TransformersLogger.java | TransformersLogger.logAttributeWarning | public void logAttributeWarning(PathAddress address, String message, Set<String> attributes) {
"""
Log a warning for the resource at the provided address and the given attributes, using the provided detail
message.
@param address where warning occurred
@param message custom error message to append
@par... | java | public void logAttributeWarning(PathAddress address, String message, Set<String> attributes) {
messageQueue.add(new AttributeLogEntry(address, null, message, attributes));
} | [
"public",
"void",
"logAttributeWarning",
"(",
"PathAddress",
"address",
",",
"String",
"message",
",",
"Set",
"<",
"String",
">",
"attributes",
")",
"{",
"messageQueue",
".",
"add",
"(",
"new",
"AttributeLogEntry",
"(",
"address",
",",
"null",
",",
"message",
... | Log a warning for the resource at the provided address and the given attributes, using the provided detail
message.
@param address where warning occurred
@param message custom error message to append
@param attributes attributes we that have problems about | [
"Log",
"a",
"warning",
"for",
"the",
"resource",
"at",
"the",
"provided",
"address",
"and",
"the",
"given",
"attributes",
"using",
"the",
"provided",
"detail",
"message",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformersLogger.java#L133-L135 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/core/model/Properties.java | Properties.set | public <K, V> void set(PropertyMapKey<K, V> property, Map<K, V> value) {
"""
Associates the specified map with the specified property key. If the properties previously contained a mapping for the property key, the old
value is replaced by the specified map.
@param <K>
the type of keys maintained by the map
@... | java | public <K, V> void set(PropertyMapKey<K, V> property, Map<K, V> value) {
properties.put(property.getName(), value);
} | [
"public",
"<",
"K",
",",
"V",
">",
"void",
"set",
"(",
"PropertyMapKey",
"<",
"K",
",",
"V",
">",
"property",
",",
"Map",
"<",
"K",
",",
"V",
">",
"value",
")",
"{",
"properties",
".",
"put",
"(",
"property",
".",
"getName",
"(",
")",
",",
"val... | Associates the specified map with the specified property key. If the properties previously contained a mapping for the property key, the old
value is replaced by the specified map.
@param <K>
the type of keys maintained by the map
@param <V>
the type of mapped values
@param property
the property key with which the spe... | [
"Associates",
"the",
"specified",
"map",
"with",
"the",
"specified",
"property",
"key",
".",
"If",
"the",
"properties",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"property",
"key",
"the",
"old",
"value",
"is",
"replaced",
"by",
"the",
"specified... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/core/model/Properties.java#L144-L146 |
huangp/entityunit | src/main/java/com/github/huangp/entityunit/maker/PreferredValueMakersRegistry.java | PreferredValueMakersRegistry.addConstructorParameterMaker | public PreferredValueMakersRegistry addConstructorParameterMaker(Class ownerType, int argIndex, Maker<?> maker) {
"""
Add a constructor parameter maker to a class type.
i.e. with:
<pre>
{@code
Class Person {
Person(String name, int age)
}
}
</pre>
You could define a custom maker for name as (Person.clas... | java | public PreferredValueMakersRegistry addConstructorParameterMaker(Class ownerType, int argIndex, Maker<?> maker) {
Preconditions.checkNotNull(ownerType);
Preconditions.checkArgument(argIndex >= 0);
makers.put(Matchers.equalTo(String.format(Settable.FULL_NAME_FORMAT, ownerType.getName(), "arg" + a... | [
"public",
"PreferredValueMakersRegistry",
"addConstructorParameterMaker",
"(",
"Class",
"ownerType",
",",
"int",
"argIndex",
",",
"Maker",
"<",
"?",
">",
"maker",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"ownerType",
")",
";",
"Preconditions",
".",
"ch... | Add a constructor parameter maker to a class type.
i.e. with:
<pre>
{@code
Class Person {
Person(String name, int age)
}
}
</pre>
You could define a custom maker for name as (Person.class, 0, myNameMaker)
@param ownerType
the class that owns the field.
@param argIndex
constructor parameter index (0 based)
@param make... | [
"Add",
"a",
"constructor",
"parameter",
"maker",
"to",
"a",
"class",
"type",
".",
"i",
".",
"e",
".",
"with",
":",
"<pre",
">",
"{",
"@code"
] | train | https://github.com/huangp/entityunit/blob/1a09b530149d707dbff7ff46f5428d9db709a4b4/src/main/java/com/github/huangp/entityunit/maker/PreferredValueMakersRegistry.java#L102-L107 |
prestodb/presto | presto-raptor/src/main/java/com/facebook/presto/raptor/storage/FileStorageService.java | FileStorageService.getFileSystemPath | public static File getFileSystemPath(File base, UUID shardUuid) {
"""
Generate a file system path for a shard UUID.
This creates a three level deep directory structure where the first
two levels each contain two hex digits (lowercase) of the UUID
and the final level contains the full UUID. Example:
<pre>
UUID... | java | public static File getFileSystemPath(File base, UUID shardUuid)
{
String uuid = shardUuid.toString().toLowerCase(ENGLISH);
return base.toPath()
.resolve(uuid.substring(0, 2))
.resolve(uuid.substring(2, 4))
.resolve(uuid + FILE_EXTENSION)
... | [
"public",
"static",
"File",
"getFileSystemPath",
"(",
"File",
"base",
",",
"UUID",
"shardUuid",
")",
"{",
"String",
"uuid",
"=",
"shardUuid",
".",
"toString",
"(",
")",
".",
"toLowerCase",
"(",
"ENGLISH",
")",
";",
"return",
"base",
".",
"toPath",
"(",
"... | Generate a file system path for a shard UUID.
This creates a three level deep directory structure where the first
two levels each contain two hex digits (lowercase) of the UUID
and the final level contains the full UUID. Example:
<pre>
UUID: 701e1a79-74f7-4f56-b438-b41e8e7d019d
Path: /base/70/1e/701e1a79-74f7-4f56-b438... | [
"Generate",
"a",
"file",
"system",
"path",
"for",
"a",
"shard",
"UUID",
".",
"This",
"creates",
"a",
"three",
"level",
"deep",
"directory",
"structure",
"where",
"the",
"first",
"two",
"levels",
"each",
"contain",
"two",
"hex",
"digits",
"(",
"lowercase",
... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-raptor/src/main/java/com/facebook/presto/raptor/storage/FileStorageService.java#L145-L153 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.lesserThan | @ArgumentsChecked
@Throws(IllegalNotLesserThanException.class)
public static byte lesserThan(final byte expected, final byte check) {
"""
Ensures that a passed {@code byte} is less than another {@code byte}.
@param expected
Expected value
@param check
Comparable to be checked
@return the passed {@code byt... | java | @ArgumentsChecked
@Throws(IllegalNotLesserThanException.class)
public static byte lesserThan(final byte expected, final byte check) {
if (expected <= check) {
throw new IllegalNotLesserThanException(check);
}
return check;
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"IllegalNotLesserThanException",
".",
"class",
")",
"public",
"static",
"byte",
"lesserThan",
"(",
"final",
"byte",
"expected",
",",
"final",
"byte",
"check",
")",
"{",
"if",
"(",
"expected",
"<=",
"check",
")",
"... | Ensures that a passed {@code byte} is less than another {@code byte}.
@param expected
Expected value
@param check
Comparable to be checked
@return the passed {@code byte} argument {@code check}
@throws IllegalNotLesserThanException
if the argument value {@code check} is not lesser than value {@code expected} | [
"Ensures",
"that",
"a",
"passed",
"{",
"@code",
"byte",
"}",
"is",
"less",
"than",
"another",
"{",
"@code",
"byte",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1370-L1378 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.resolveBinaryOperator | Symbol resolveBinaryOperator(DiagnosticPosition pos,
JCTree.Tag optag,
Env<AttrContext> env,
Type left,
Type right) {
"""
Resolve binary operator.
@param pos The position to us... | java | Symbol resolveBinaryOperator(DiagnosticPosition pos,
JCTree.Tag optag,
Env<AttrContext> env,
Type left,
Type right) {
return resolveOperator(pos, optag, env, List.of(left, right));... | [
"Symbol",
"resolveBinaryOperator",
"(",
"DiagnosticPosition",
"pos",
",",
"JCTree",
".",
"Tag",
"optag",
",",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"Type",
"left",
",",
"Type",
"right",
")",
"{",
"return",
"resolveOperator",
"(",
"pos",
",",
"optag",
... | Resolve binary operator.
@param pos The position to use for error reporting.
@param optag The tag of the operation tree.
@param env The environment current at the operation.
@param left The types of the left operand.
@param right The types of the right operand. | [
"Resolve",
"binary",
"operator",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/Resolve.java#L2721-L2727 |
undertow-io/undertow | core/src/main/java/io/undertow/protocols/http2/Http2Channel.java | Http2Channel.createStream | public synchronized Http2HeadersStreamSinkChannel createStream(HeaderMap requestHeaders) throws IOException {
"""
Creates a strema using a HEADERS frame
@param requestHeaders
@return
@throws IOException
"""
if (!isClient()) {
throw UndertowMessages.MESSAGES.headersStreamCanOnlyBeCreate... | java | public synchronized Http2HeadersStreamSinkChannel createStream(HeaderMap requestHeaders) throws IOException {
if (!isClient()) {
throw UndertowMessages.MESSAGES.headersStreamCanOnlyBeCreatedByClient();
}
if (!isOpen()) {
throw UndertowMessages.MESSAGES.channelIsClosed();
... | [
"public",
"synchronized",
"Http2HeadersStreamSinkChannel",
"createStream",
"(",
"HeaderMap",
"requestHeaders",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"isClient",
"(",
")",
")",
"{",
"throw",
"UndertowMessages",
".",
"MESSAGES",
".",
"headersStreamCanOnlyBe... | Creates a strema using a HEADERS frame
@param requestHeaders
@return
@throws IOException | [
"Creates",
"a",
"strema",
"using",
"a",
"HEADERS",
"frame"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/protocols/http2/Http2Channel.java#L881-L898 |
apereo/cas | support/cas-server-support-gauth-couchdb/src/main/java/org/apereo/cas/couchdb/gauth/credential/GoogleAuthenticatorAccountCouchDbRepository.java | GoogleAuthenticatorAccountCouchDbRepository.findByUsername | public List<CouchDbGoogleAuthenticatorAccount> findByUsername(final String username) {
"""
Final all accounts for user.
@param username username for account lookup
@return one time token accounts for user
"""
try {
return queryView("by_username", username);
} catch (final Document... | java | public List<CouchDbGoogleAuthenticatorAccount> findByUsername(final String username) {
try {
return queryView("by_username", username);
} catch (final DocumentNotFoundException ignored) {
return null;
}
} | [
"public",
"List",
"<",
"CouchDbGoogleAuthenticatorAccount",
">",
"findByUsername",
"(",
"final",
"String",
"username",
")",
"{",
"try",
"{",
"return",
"queryView",
"(",
"\"by_username\"",
",",
"username",
")",
";",
"}",
"catch",
"(",
"final",
"DocumentNotFoundExce... | Final all accounts for user.
@param username username for account lookup
@return one time token accounts for user | [
"Final",
"all",
"accounts",
"for",
"user",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-gauth-couchdb/src/main/java/org/apereo/cas/couchdb/gauth/credential/GoogleAuthenticatorAccountCouchDbRepository.java#L45-L51 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AlertDto.java | AlertDto.transformToDto | public static List<AlertDto> transformToDto(List<Alert> alerts) {
"""
Converts list of alert entity objects to list of alertDto objects.
@param alerts List of alert entities. Cannot be null.
@return List of alertDto objects.
@throws WebApplicationException If an error occurs.
"""
if (ale... | java | public static List<AlertDto> transformToDto(List<Alert> alerts) {
if (alerts == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
List<AlertDto> result = new ArrayList<AlertDto>();
for (Alert ... | [
"public",
"static",
"List",
"<",
"AlertDto",
">",
"transformToDto",
"(",
"List",
"<",
"Alert",
">",
"alerts",
")",
"{",
"if",
"(",
"alerts",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto ob... | Converts list of alert entity objects to list of alertDto objects.
@param alerts List of alert entities. Cannot be null.
@return List of alertDto objects.
@throws WebApplicationException If an error occurs. | [
"Converts",
"list",
"of",
"alert",
"entity",
"objects",
"to",
"list",
"of",
"alertDto",
"objects",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AlertDto.java#L103-L114 |
Netflix/spectator | spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/BucketDistributionSummary.java | BucketDistributionSummary.get | public static BucketDistributionSummary get(Id id, BucketFunction f) {
"""
Creates a distribution summary object that manages a set of distribution summaries based on
the bucket function supplied. Calling record will be mapped to the record on the appropriate
distribution summary.
@param id
Identifier for th... | java | public static BucketDistributionSummary get(Id id, BucketFunction f) {
return get(Spectator.globalRegistry(), id, f);
} | [
"public",
"static",
"BucketDistributionSummary",
"get",
"(",
"Id",
"id",
",",
"BucketFunction",
"f",
")",
"{",
"return",
"get",
"(",
"Spectator",
".",
"globalRegistry",
"(",
")",
",",
"id",
",",
"f",
")",
";",
"}"
] | Creates a distribution summary object that manages a set of distribution summaries based on
the bucket function supplied. Calling record will be mapped to the record on the appropriate
distribution summary.
@param id
Identifier for the metric being registered.
@param f
Function to map values to buckets.
@return
Distri... | [
"Creates",
"a",
"distribution",
"summary",
"object",
"that",
"manages",
"a",
"set",
"of",
"distribution",
"summaries",
"based",
"on",
"the",
"bucket",
"function",
"supplied",
".",
"Calling",
"record",
"will",
"be",
"mapped",
"to",
"the",
"record",
"on",
"the",... | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/BucketDistributionSummary.java#L44-L46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.