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 |
|---|---|---|---|---|---|---|---|---|---|---|
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java | IOUtils.pollFile | public static Object pollFile(File file, int timeout, int interval)
throws InterruptedException {
"""
Polls a file periodically until it 1) exists or 2) the timeout is
exceeded (returns null) Reads the file as a java Object
"""
// Convert time from s to ms for Thread
int fullTim... | java | public static Object pollFile(File file, int timeout, int interval)
throws InterruptedException {
// Convert time from s to ms for Thread
int fullTimeout = Math.round(timeout * 1000);
// Split up the timeout to poll every x amount of time
int timeoutShard = Math.round(... | [
"public",
"static",
"Object",
"pollFile",
"(",
"File",
"file",
",",
"int",
"timeout",
",",
"int",
"interval",
")",
"throws",
"InterruptedException",
"{",
"// Convert time from s to ms for Thread\r",
"int",
"fullTimeout",
"=",
"Math",
".",
"round",
"(",
"timeout",
... | Polls a file periodically until it 1) exists or 2) the timeout is
exceeded (returns null) Reads the file as a java Object | [
"Polls",
"a",
"file",
"periodically",
"until",
"it",
"1",
")",
"exists",
"or",
"2",
")",
"the",
"timeout",
"is",
"exceeded",
"(",
"returns",
"null",
")",
"Reads",
"the",
"file",
"as",
"a",
"java",
"Object"
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/IOUtils.java#L208-L226 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/BatchItemResponseDeserializer.java | BatchItemResponseDeserializer.getCDCQueryResponse | private CDCResponse getCDCQueryResponse(JsonNode jsonNode) throws IOException {
"""
Method to deserialize the CDCQueryResponse object
@param jsonNode
@return CDCResponse
"""
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule("CDCQueryResponseDeserializer", new Versi... | java | private CDCResponse getCDCQueryResponse(JsonNode jsonNode) throws IOException {
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule("CDCQueryResponseDeserializer", new Version(1, 0, 0, null));
simpleModule.addDeserializer(CDCResponse.class, new CDCQueryResponseDeserializer());
... | [
"private",
"CDCResponse",
"getCDCQueryResponse",
"(",
"JsonNode",
"jsonNode",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"SimpleModule",
"simpleModule",
"=",
"new",
"SimpleModule",
"(",
"\"CDCQueryResponseDe... | Method to deserialize the CDCQueryResponse object
@param jsonNode
@return CDCResponse | [
"Method",
"to",
"deserialize",
"the",
"CDCQueryResponse",
"object"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/BatchItemResponseDeserializer.java#L174-L183 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleImageItem.java | SimpleImageItem.bindView | @Override
public void bindView(SimpleImageItem.ViewHolder viewHolder, List<Object> payloads) {
"""
binds the data of this item onto the viewHolder
@param viewHolder the viewHolder of this item
"""
super.bindView(viewHolder, payloads);
//get the context
Context ctx = viewHolder.i... | java | @Override
public void bindView(SimpleImageItem.ViewHolder viewHolder, List<Object> payloads) {
super.bindView(viewHolder, payloads);
//get the context
Context ctx = viewHolder.itemView.getContext();
//define our data for the view
viewHolder.imageName.setText(mName);
... | [
"@",
"Override",
"public",
"void",
"bindView",
"(",
"SimpleImageItem",
".",
"ViewHolder",
"viewHolder",
",",
"List",
"<",
"Object",
">",
"payloads",
")",
"{",
"super",
".",
"bindView",
"(",
"viewHolder",
",",
"payloads",
")",
";",
"//get the context",
"Context... | binds the data of this item onto the viewHolder
@param viewHolder the viewHolder of this item | [
"binds",
"the",
"data",
"of",
"this",
"item",
"onto",
"the",
"viewHolder"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/items/SimpleImageItem.java#L70-L91 |
groovy/groovy-core | subprojects/groovy-json/src/main/java/groovy/json/JsonDelegate.java | JsonDelegate.invokeMethod | public Object invokeMethod(String name, Object args) {
"""
Intercepts calls for setting a key and value for a JSON object
@param name the key name
@param args the value associated with the key
"""
Object val = null;
if (args != null && Object[].class.isAssignableFrom(args.getClass())) {
... | java | public Object invokeMethod(String name, Object args) {
Object val = null;
if (args != null && Object[].class.isAssignableFrom(args.getClass())) {
Object[] arr = (Object[]) args;
if (arr.length == 1) {
val = arr[0];
} else if (arr.length == 2 && arr[0]... | [
"public",
"Object",
"invokeMethod",
"(",
"String",
"name",
",",
"Object",
"args",
")",
"{",
"Object",
"val",
"=",
"null",
";",
"if",
"(",
"args",
"!=",
"null",
"&&",
"Object",
"[",
"]",
".",
"class",
".",
"isAssignableFrom",
"(",
"args",
".",
"getClass... | Intercepts calls for setting a key and value for a JSON object
@param name the key name
@param args the value associated with the key | [
"Intercepts",
"calls",
"for",
"setting",
"a",
"key",
"and",
"value",
"for",
"a",
"JSON",
"object"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/subprojects/groovy-json/src/main/java/groovy/json/JsonDelegate.java#L43-L65 |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/map/MapDataDao.java | MapDataDao.updateChangeset | public void updateChangeset(long changesetId, final Map<String, String> tags) {
"""
Set new the tags of a changeset (the old set of tags is deleted)
@param tags the new tags of this changeset
@throws OsmConflictException if the changeset has already been closed
@throws OsmNotFoundException if the changeset ... | java | public void updateChangeset(long changesetId, final Map<String, String> tags)
{
osm.makeAuthenticatedRequest("changeset/"+changesetId, "PUT",
createOsmChangesetTagsWriter(tags), null);
} | [
"public",
"void",
"updateChangeset",
"(",
"long",
"changesetId",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"osm",
".",
"makeAuthenticatedRequest",
"(",
"\"changeset/\"",
"+",
"changesetId",
",",
"\"PUT\"",
",",
"createOsmChangeset... | Set new the tags of a changeset (the old set of tags is deleted)
@param tags the new tags of this changeset
@throws OsmConflictException if the changeset has already been closed
@throws OsmNotFoundException if the changeset does not exist (yet)
@throws OsmAuthorizationException if the application does not have permis... | [
"Set",
"new",
"the",
"tags",
"of",
"a",
"changeset",
"(",
"the",
"old",
"set",
"of",
"tags",
"is",
"deleted",
")"
] | train | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/map/MapDataDao.java#L146-L150 |
eyp/serfj | src/main/java/net/sf/serfj/UrlInspector.java | UrlInspector.getSerializerClass | protected String getSerializerClass(String resource, String urlLastElement) {
"""
Gets serializer class for a resource. If the last part of the URL has an
extension, then could be a Serializer class to render the result in a
specific way. If the extension is .xml it hopes that a
ResourceNameXmlSerializer exists... | java | protected String getSerializerClass(String resource, String urlLastElement) {
String serializerClass = null;
String extension = this.utils.getExtension(urlLastElement);
if (extension != null) {
SerializerFinder finder = new SerializerFinder(config, extension);
serializerClass = finder.findResource(resource)... | [
"protected",
"String",
"getSerializerClass",
"(",
"String",
"resource",
",",
"String",
"urlLastElement",
")",
"{",
"String",
"serializerClass",
"=",
"null",
";",
"String",
"extension",
"=",
"this",
".",
"utils",
".",
"getExtension",
"(",
"urlLastElement",
")",
"... | Gets serializer class for a resource. If the last part of the URL has an
extension, then could be a Serializer class to render the result in a
specific way. If the extension is .xml it hopes that a
ResourceNameXmlSerializer exists to render the resource as Xml. The
extension can be anything.
@param resource
Resource t... | [
"Gets",
"serializer",
"class",
"for",
"a",
"resource",
".",
"If",
"the",
"last",
"part",
"of",
"the",
"URL",
"has",
"an",
"extension",
"then",
"could",
"be",
"a",
"Serializer",
"class",
"to",
"render",
"the",
"result",
"in",
"a",
"specific",
"way",
".",
... | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/UrlInspector.java#L237-L245 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java | MetadataFinder.deliverTrackMetadataUpdate | private void deliverTrackMetadataUpdate(int player, TrackMetadata metadata) {
"""
Send a track metadata update announcement to all registered listeners.
"""
if (!getTrackMetadataListeners().isEmpty()) {
final TrackMetadataUpdate update = new TrackMetadataUpdate(player, metadata);
... | java | private void deliverTrackMetadataUpdate(int player, TrackMetadata metadata) {
if (!getTrackMetadataListeners().isEmpty()) {
final TrackMetadataUpdate update = new TrackMetadataUpdate(player, metadata);
for (final TrackMetadataListener listener : getTrackMetadataListeners()) {
... | [
"private",
"void",
"deliverTrackMetadataUpdate",
"(",
"int",
"player",
",",
"TrackMetadata",
"metadata",
")",
"{",
"if",
"(",
"!",
"getTrackMetadataListeners",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"TrackMetadataUpdate",
"update",
"=",
"new",
... | Send a track metadata update announcement to all registered listeners. | [
"Send",
"a",
"track",
"metadata",
"update",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataFinder.java#L1023-L1035 |
mojohaus/aspectj-maven-plugin | src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java | AjcHelper.getBuildFilesForSourceDirs | public static Set<String> getBuildFilesForSourceDirs( List<String> sourceDirs, String[] includes, String[] excludes )
throws MojoExecutionException {
"""
Based on a set of sourcedirs, apply include and exclude statements and
returns a set of all the files to be compiled and weaved.
@param sourceDirs
@... | java | public static Set<String> getBuildFilesForSourceDirs( List<String> sourceDirs, String[] includes, String[] excludes )
throws MojoExecutionException
{
Set<String> result = new LinkedHashSet<String>();
for ( String sourceDir : sourceDirs )
{
try
{
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"getBuildFilesForSourceDirs",
"(",
"List",
"<",
"String",
">",
"sourceDirs",
",",
"String",
"[",
"]",
"includes",
",",
"String",
"[",
"]",
"excludes",
")",
"throws",
"MojoExecutionException",
"{",
"Set",
"<",
"S... | Based on a set of sourcedirs, apply include and exclude statements and
returns a set of all the files to be compiled and weaved.
@param sourceDirs
@param includes
@param excludes
@return
@throws MojoExecutionException | [
"Based",
"on",
"a",
"set",
"of",
"sourcedirs",
"apply",
"include",
"and",
"exclude",
"statements",
"and",
"returns",
"a",
"set",
"of",
"all",
"the",
"files",
"to",
"be",
"compiled",
"and",
"weaved",
"."
] | train | https://github.com/mojohaus/aspectj-maven-plugin/blob/120ee1ce08b93873931035ed98cd70e3ccceeefb/src/main/java/org/codehaus/mojo/aspectj/AjcHelper.java#L171-L198 |
groovy/groovy-core | src/main/groovy/util/ProxyGenerator.java | ProxyGenerator.instantiateDelegateWithBaseClass | @SuppressWarnings("unchecked")
public GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass, String name) {
"""
Creates a proxy with a delegate object.
@param closureMap the closure for methods not handled by the delegate
@param interfaces in... | java | @SuppressWarnings("unchecked")
public GroovyObject instantiateDelegateWithBaseClass(Map closureMap, List<Class> interfaces, Object delegate, Class baseClass, String name) {
Map<Object,Object> map = closureMap!=null?closureMap: EMPTY_CLOSURE_MAP;
Class[] intfs = interfaces!=null? interfaces.toArray(n... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"GroovyObject",
"instantiateDelegateWithBaseClass",
"(",
"Map",
"closureMap",
",",
"List",
"<",
"Class",
">",
"interfaces",
",",
"Object",
"delegate",
",",
"Class",
"baseClass",
",",
"String",
"name",
"... | Creates a proxy with a delegate object.
@param closureMap the closure for methods not handled by the delegate
@param interfaces interfaces to be implemented
@param delegate the delegate object
@param baseClass the base class
@param name the name of the proxy, unused, but kept for compatibility with previous versions o... | [
"Creates",
"a",
"proxy",
"with",
"a",
"delegate",
"object",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/util/ProxyGenerator.java#L206-L229 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.findIdentInPackage | Symbol findIdentInPackage(Env<AttrContext> env, TypeSymbol pck,
Name name, KindSelector kind) {
"""
Find an identifier in a package which matches a specified kind set.
@param env The current environment.
@param name The identifier's name.
@param kind Indicates the p... | java | Symbol findIdentInPackage(Env<AttrContext> env, TypeSymbol pck,
Name name, KindSelector kind) {
Name fullname = TypeSymbol.formFullName(name, pck);
Symbol bestSoFar = typeNotFound;
if (kind.contains(KindSelector.TYP)) {
RecoveryLoadClass recoveryLoadClas... | [
"Symbol",
"findIdentInPackage",
"(",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"TypeSymbol",
"pck",
",",
"Name",
"name",
",",
"KindSelector",
"kind",
")",
"{",
"Name",
"fullname",
"=",
"TypeSymbol",
".",
"formFullName",
"(",
"name",
",",
"pck",
")",
";",... | Find an identifier in a package which matches a specified kind set.
@param env The current environment.
@param name The identifier's name.
@param kind Indicates the possible symbol kinds
(a nonempty subset of TYP, PCK). | [
"Find",
"an",
"identifier",
"in",
"a",
"package",
"which",
"matches",
"a",
"specified",
"kind",
"set",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java#L2363-L2383 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java | CommonOps_DDF6.fill | public static void fill( DMatrix6 a , double v ) {
"""
<p>
Sets every element in the vector to the specified value.<br>
<br>
a<sub>i</sub> = value
<p>
@param a A vector whose elements are about to be set. Modified.
@param v The value each element will have.
"""
a.a1 = v;
a.a2 = v;
... | java | public static void fill( DMatrix6 a , double v ) {
a.a1 = v;
a.a2 = v;
a.a3 = v;
a.a4 = v;
a.a5 = v;
a.a6 = v;
} | [
"public",
"static",
"void",
"fill",
"(",
"DMatrix6",
"a",
",",
"double",
"v",
")",
"{",
"a",
".",
"a1",
"=",
"v",
";",
"a",
".",
"a2",
"=",
"v",
";",
"a",
".",
"a3",
"=",
"v",
";",
"a",
".",
"a4",
"=",
"v",
";",
"a",
".",
"a5",
"=",
"v"... | <p>
Sets every element in the vector to the specified value.<br>
<br>
a<sub>i</sub> = value
<p>
@param a A vector whose elements are about to be set. Modified.
@param v The value each element will have. | [
"<p",
">",
"Sets",
"every",
"element",
"in",
"the",
"vector",
"to",
"the",
"specified",
"value",
".",
"<br",
">",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"value",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java#L2133-L2140 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadManager.java | HttpFileUploadManager.uploadFile | public URL uploadFile(File file, UploadProgressListener listener) throws InterruptedException,
XMPPException.XMPPErrorException, SmackException, IOException {
"""
Request slot and uploaded file to HTTP file upload service with progress callback.
You don't need to request slot and upload file separat... | java | public URL uploadFile(File file, UploadProgressListener listener) throws InterruptedException,
XMPPException.XMPPErrorException, SmackException, IOException {
if (!file.isFile()) {
throw new FileNotFoundException("The path " + file.getAbsolutePath() + " is not a file");
}
... | [
"public",
"URL",
"uploadFile",
"(",
"File",
"file",
",",
"UploadProgressListener",
"listener",
")",
"throws",
"InterruptedException",
",",
"XMPPException",
".",
"XMPPErrorException",
",",
"SmackException",
",",
"IOException",
"{",
"if",
"(",
"!",
"file",
".",
"isF... | Request slot and uploaded file to HTTP file upload service with progress callback.
You don't need to request slot and upload file separately, this method will do both.
Note that this is a synchronous call -- Smack must wait for the server response.
@param file file to be uploaded
@param listener upload progress liste... | [
"Request",
"slot",
"and",
"uploaded",
"file",
"to",
"HTTP",
"file",
"upload",
"service",
"with",
"progress",
"callback",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadManager.java#L256-L266 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricFilterWithInteralReducerTransform.java | MetricFilterWithInteralReducerTransform.internalReducer | public static String internalReducer(Metric metric, String reducerType) {
"""
Reduces the give metric to a single value based on the specified reducer.
@param metric The metric to reduce.
@param reducerType The type of reduction to perform.
@return The reduced value.
@throws UnsupportedOpera... | java | public static String internalReducer(Metric metric, String reducerType) {
Map<Long, Double> sortedDatapoints = new TreeMap<>();
List<Double> operands = new ArrayList<Double>();
if(!reducerType.equals(InternalReducerType.NAME.getName())) {
if(metric.getDatapoints()!=null && metric.getDatapoints().size()>0) {
... | [
"public",
"static",
"String",
"internalReducer",
"(",
"Metric",
"metric",
",",
"String",
"reducerType",
")",
"{",
"Map",
"<",
"Long",
",",
"Double",
">",
"sortedDatapoints",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"List",
"<",
"Double",
">",
"operands"... | Reduces the give metric to a single value based on the specified reducer.
@param metric The metric to reduce.
@param reducerType The type of reduction to perform.
@return The reduced value.
@throws UnsupportedOperationException If an unknown reducer type is specified. | [
"Reduces",
"the",
"give",
"metric",
"to",
"a",
"single",
"value",
"based",
"on",
"the",
"specified",
"reducer",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricFilterWithInteralReducerTransform.java#L92-L135 |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/CachingESRegistry.java | CachingESRegistry.getApiIdx | private String getApiIdx(String orgId, String apiId, String version) {
"""
Generates an in-memory key for an API, used to index the app for later quick
retrieval.
@param orgId
@param apiId
@param version
@return a API key
"""
return "API::" + orgId + "|" + apiId + "|" + version; //$NON-NLS-1$ //$N... | java | private String getApiIdx(String orgId, String apiId, String version) {
return "API::" + orgId + "|" + apiId + "|" + version; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} | [
"private",
"String",
"getApiIdx",
"(",
"String",
"orgId",
",",
"String",
"apiId",
",",
"String",
"version",
")",
"{",
"return",
"\"API::\"",
"+",
"orgId",
"+",
"\"|\"",
"+",
"apiId",
"+",
"\"|\"",
"+",
"version",
";",
"//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$",... | Generates an in-memory key for an API, used to index the app for later quick
retrieval.
@param orgId
@param apiId
@param version
@return a API key | [
"Generates",
"an",
"in",
"-",
"memory",
"key",
"for",
"an",
"API",
"used",
"to",
"index",
"the",
"app",
"for",
"later",
"quick",
"retrieval",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/CachingESRegistry.java#L196-L198 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JesqueUtils.java | JesqueUtils.recreateThrowable | public static Throwable recreateThrowable(final String type, final String message, final List<String> backtrace)
throws ParseException, ClassNotFoundException, NoSuchConstructorException,
AmbiguousConstructorException, ReflectiveOperationException {
"""
Recreate an exception from a type nam... | java | public static Throwable recreateThrowable(final String type, final String message, final List<String> backtrace)
throws ParseException, ClassNotFoundException, NoSuchConstructorException,
AmbiguousConstructorException, ReflectiveOperationException {
final LinkedList<String> bTrace = new ... | [
"public",
"static",
"Throwable",
"recreateThrowable",
"(",
"final",
"String",
"type",
",",
"final",
"String",
"message",
",",
"final",
"List",
"<",
"String",
">",
"backtrace",
")",
"throws",
"ParseException",
",",
"ClassNotFoundException",
",",
"NoSuchConstructorExc... | Recreate an exception from a type name, a message and a backtrace
(created from <code>JesqueUtils.createBacktrace(Throwable)</code>).
<p>
<b>Limitations:</b><br>
This method cannot recreate Throwables with unusual/custom Constructors.
<ul>
<li>If the message is non-null and the cause is null, there must be a
Constructo... | [
"Recreate",
"an",
"exception",
"from",
"a",
"type",
"name",
"a",
"message",
"and",
"a",
"backtrace",
"(",
"created",
"from",
"<code",
">",
"JesqueUtils",
".",
"createBacktrace",
"(",
"Throwable",
")",
"<",
"/",
"code",
">",
")",
".",
"<p",
">",
"<b",
"... | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JesqueUtils.java#L210-L226 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SFTrustManager.java | SFTrustManager.encodeCacheKey | private static String encodeCacheKey(OcspResponseCacheKey ocsp_cache_key) {
"""
Convert cache key to base64 encoded
cert id
@param ocsp_cache_key Cache key to encode
"""
try
{
DigestCalculator digest = new SHA1DigestCalculator();
AlgorithmIdentifier algo = digest.getAlgorithmIdentifier(... | java | private static String encodeCacheKey(OcspResponseCacheKey ocsp_cache_key)
{
try
{
DigestCalculator digest = new SHA1DigestCalculator();
AlgorithmIdentifier algo = digest.getAlgorithmIdentifier();
ASN1OctetString nameHash = ASN1OctetString.getInstance(ocsp_cache_key.nameHash);
ASN1Octet... | [
"private",
"static",
"String",
"encodeCacheKey",
"(",
"OcspResponseCacheKey",
"ocsp_cache_key",
")",
"{",
"try",
"{",
"DigestCalculator",
"digest",
"=",
"new",
"SHA1DigestCalculator",
"(",
")",
";",
"AlgorithmIdentifier",
"algo",
"=",
"digest",
".",
"getAlgorithmIdent... | Convert cache key to base64 encoded
cert id
@param ocsp_cache_key Cache key to encode | [
"Convert",
"cache",
"key",
"to",
"base64",
"encoded",
"cert",
"id"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SFTrustManager.java#L663-L680 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/GetOpenIdTokenRequest.java | GetOpenIdTokenRequest.withLogins | public GetOpenIdTokenRequest withLogins(java.util.Map<String, String> logins) {
"""
<p>
A set of optional name-value pairs that map provider names to provider tokens. When using graph.facebook.com and
www.amazon.com, supply the access_token returned from the provider's authflow. For accounts.google.com, an Amazo... | java | public GetOpenIdTokenRequest withLogins(java.util.Map<String, String> logins) {
setLogins(logins);
return this;
} | [
"public",
"GetOpenIdTokenRequest",
"withLogins",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"logins",
")",
"{",
"setLogins",
"(",
"logins",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A set of optional name-value pairs that map provider names to provider tokens. When using graph.facebook.com and
www.amazon.com, supply the access_token returned from the provider's authflow. For accounts.google.com, an Amazon
Cognito user pool provider, or any other OpenId Connect provider, always include the <cod... | [
"<p",
">",
"A",
"set",
"of",
"optional",
"name",
"-",
"value",
"pairs",
"that",
"map",
"provider",
"names",
"to",
"provider",
"tokens",
".",
"When",
"using",
"graph",
".",
"facebook",
".",
"com",
"and",
"www",
".",
"amazon",
".",
"com",
"supply",
"the"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/GetOpenIdTokenRequest.java#L136-L139 |
LearnLib/learnlib | algorithms/active/nlstar/src/main/java/de/learnlib/algorithms/nlstar/NLStarLearner.java | NLStarLearner.asDFALearner | public DFALearner<I> asDFALearner() {
"""
Retrieves a view of this learner as a DFA learner. The DFA is obtained by determinizing and minimizing the NFA
hypothesis.
@return a DFA learner view of this learner
@see #getDeterminizedHypothesis()
"""
return new DFALearner<I>() {
@Overrid... | java | public DFALearner<I> asDFALearner() {
return new DFALearner<I>() {
@Override
public String toString() {
return NLStarLearner.this.toString();
}
@Override
public void startLearning() {
NLStarLearner.this.startLearning()... | [
"public",
"DFALearner",
"<",
"I",
">",
"asDFALearner",
"(",
")",
"{",
"return",
"new",
"DFALearner",
"<",
"I",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"toString",
"(",
")",
"{",
"return",
"NLStarLearner",
".",
"this",
".",
"toString",
... | Retrieves a view of this learner as a DFA learner. The DFA is obtained by determinizing and minimizing the NFA
hypothesis.
@return a DFA learner view of this learner
@see #getDeterminizedHypothesis() | [
"Retrieves",
"a",
"view",
"of",
"this",
"learner",
"as",
"a",
"DFA",
"learner",
".",
"The",
"DFA",
"is",
"obtained",
"by",
"determinizing",
"and",
"minimizing",
"the",
"NFA",
"hypothesis",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/nlstar/src/main/java/de/learnlib/algorithms/nlstar/NLStarLearner.java#L83-L107 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.sendText | public WebSocket sendText(String payload, boolean fin) {
"""
Send a text frame to the server.
<p>
This method is an alias of {@link #sendFrame(WebSocketFrame)
sendFrame}{@code (WebSocketFrame.}{@link
WebSocketFrame#createTextFrame(String)
createTextFrame}{@code (payload).}{@link
WebSocketFrame#setFin(boole... | java | public WebSocket sendText(String payload, boolean fin)
{
return sendFrame(WebSocketFrame.createTextFrame(payload).setFin(fin));
} | [
"public",
"WebSocket",
"sendText",
"(",
"String",
"payload",
",",
"boolean",
"fin",
")",
"{",
"return",
"sendFrame",
"(",
"WebSocketFrame",
".",
"createTextFrame",
"(",
"payload",
")",
".",
"setFin",
"(",
"fin",
")",
")",
";",
"}"
] | Send a text frame to the server.
<p>
This method is an alias of {@link #sendFrame(WebSocketFrame)
sendFrame}{@code (WebSocketFrame.}{@link
WebSocketFrame#createTextFrame(String)
createTextFrame}{@code (payload).}{@link
WebSocketFrame#setFin(boolean) setFin}{@code (fin))}.
</p>
@param payload
The payload of a text fra... | [
"Send",
"a",
"text",
"frame",
"to",
"the",
"server",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L2968-L2971 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.removeAll | @SafeVarargs
public static boolean[] removeAll(final boolean[] a, final boolean... elements) {
"""
Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection)
"""
if (N.isNullOrEmpty(a)... | java | @SafeVarargs
public static boolean[] removeAll(final boolean[] a, final boolean... elements) {
if (N.isNullOrEmpty(a)) {
return N.EMPTY_BOOLEAN_ARRAY;
} else if (N.isNullOrEmpty(elements)) {
return a.clone();
} else if (elements.length == 1) {
retur... | [
"@",
"SafeVarargs",
"public",
"static",
"boolean",
"[",
"]",
"removeAll",
"(",
"final",
"boolean",
"[",
"]",
"a",
",",
"final",
"boolean",
"...",
"elements",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"a",
")",
")",
"{",
"return",
"N",
".",... | Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection) | [
"Returns",
"a",
"new",
"array",
"with",
"removes",
"all",
"the",
"occurrences",
"of",
"specified",
"elements",
"from",
"<code",
">",
"a<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L23351-L23364 |
xebia/Xebium | src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java | SeleniumDriverFixture.addAliasForLocator | public void addAliasForLocator(String alias, String locator) {
"""
Add a new locator alias to the fixture.
@param alias
@param locator
"""
LOG.info("Add alias: '" + alias + "' for '" + locator + "'");
aliases.put(alias, locator);
} | java | public void addAliasForLocator(String alias, String locator) {
LOG.info("Add alias: '" + alias + "' for '" + locator + "'");
aliases.put(alias, locator);
} | [
"public",
"void",
"addAliasForLocator",
"(",
"String",
"alias",
",",
"String",
"locator",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Add alias: '\"",
"+",
"alias",
"+",
"\"' for '\"",
"+",
"locator",
"+",
"\"'\"",
")",
";",
"aliases",
".",
"put",
"(",
"alias",
... | Add a new locator alias to the fixture.
@param alias
@param locator | [
"Add",
"a",
"new",
"locator",
"alias",
"to",
"the",
"fixture",
"."
] | train | https://github.com/xebia/Xebium/blob/594f6d9e65622acdbd03dba0700b17645981da1f/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java#L446-L449 |
alkacon/opencms-core | src/org/opencms/security/CmsAccessControlList.java | CmsAccessControlList.getPermissionString | public String getPermissionString(CmsUser user, List<CmsGroup> groups, List<CmsRole> roles) {
"""
Calculates the permissions of the given user and his groups from the access control list.<p>
The permissions are returned as permission string in the format {{+|-}{r|w|v|c|i}}*.
@param user the user
@param groups... | java | public String getPermissionString(CmsUser user, List<CmsGroup> groups, List<CmsRole> roles) {
return getPermissions(user, groups, roles).getPermissionString();
} | [
"public",
"String",
"getPermissionString",
"(",
"CmsUser",
"user",
",",
"List",
"<",
"CmsGroup",
">",
"groups",
",",
"List",
"<",
"CmsRole",
">",
"roles",
")",
"{",
"return",
"getPermissions",
"(",
"user",
",",
"groups",
",",
"roles",
")",
".",
"getPermiss... | Calculates the permissions of the given user and his groups from the access control list.<p>
The permissions are returned as permission string in the format {{+|-}{r|w|v|c|i}}*.
@param user the user
@param groups the groups of this user
@param roles the roles of this user
@return a string that displays the permission... | [
"Calculates",
"the",
"permissions",
"of",
"the",
"given",
"user",
"and",
"his",
"groups",
"from",
"the",
"access",
"control",
"list",
".",
"<p",
">",
"The",
"permissions",
"are",
"returned",
"as",
"permission",
"string",
"in",
"the",
"format",
"{{",
"+",
"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsAccessControlList.java#L191-L194 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java | GVRLight.setVec2 | public void setVec2(String key, float x, float y) {
"""
Set the value for a floating point vector of length 2.
@param key name of uniform to set.
@param x new X value
@param y new Y value
@see #getVec2
@see #getFloatVec(String)
"""
checkKeyIsUniform(key);
NativeLight.setVec2(getNative(), k... | java | public void setVec2(String key, float x, float y)
{
checkKeyIsUniform(key);
NativeLight.setVec2(getNative(), key, x, y);
} | [
"public",
"void",
"setVec2",
"(",
"String",
"key",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"checkKeyIsUniform",
"(",
"key",
")",
";",
"NativeLight",
".",
"setVec2",
"(",
"getNative",
"(",
")",
",",
"key",
",",
"x",
",",
"y",
")",
";",
"}"
] | Set the value for a floating point vector of length 2.
@param key name of uniform to set.
@param x new X value
@param y new Y value
@see #getVec2
@see #getFloatVec(String) | [
"Set",
"the",
"value",
"for",
"a",
"floating",
"point",
"vector",
"of",
"length",
"2",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java#L400-L404 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsyncThrowing | public static <T1, T2, T3, T4, R> Func4<T1, T2, T3, T4, Observable<R>> toAsyncThrowing(ThrowingFunc4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> func) {
"""
Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.... | java | public static <T1, T2, T3, T4, R> Func4<T1, T2, T3, T4, Observable<R>> toAsyncThrowing(ThrowingFunc4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> func) {
return toAsyncThrowing(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"R",
">",
"Func4",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"Observable",
"<",
"R",
">",
">",
"toAsyncThrowing",
"(",
"ThrowingFunc4",
"<",
"?",
"super",
"T1",
",",
"?... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
@... | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L382-L384 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java | BatchFraction.jdbcJobRepository | public BatchFraction jdbcJobRepository(final String name, final DatasourcesFraction datasource) {
"""
Creates a new JDBC job repository.
@param name the name for the job repository
@param datasource the datasource to use to connect to the database
@return this fraction
"""
return jdbcJobRepo... | java | public BatchFraction jdbcJobRepository(final String name, final DatasourcesFraction datasource) {
return jdbcJobRepository(new JDBCJobRepository<>(name).dataSource(datasource.getKey()));
} | [
"public",
"BatchFraction",
"jdbcJobRepository",
"(",
"final",
"String",
"name",
",",
"final",
"DatasourcesFraction",
"datasource",
")",
"{",
"return",
"jdbcJobRepository",
"(",
"new",
"JDBCJobRepository",
"<>",
"(",
"name",
")",
".",
"dataSource",
"(",
"datasource",... | Creates a new JDBC job repository.
@param name the name for the job repository
@param datasource the datasource to use to connect to the database
@return this fraction | [
"Creates",
"a",
"new",
"JDBC",
"job",
"repository",
"."
] | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java#L130-L132 |
threerings/narya | core/src/main/java/com/threerings/presents/client/Client.java | Client.registerFlushDelay | public void registerFlushDelay (Class<?> objclass, long delay) {
"""
Instructs the distributed object manager associated with this client to allow objects of the
specified class to linger around the specified number of milliseconds after their last
subscriber has been removed before the client finally removes it... | java | public void registerFlushDelay (Class<?> objclass, long delay)
{
ClientDObjectMgr omgr = (ClientDObjectMgr)getDObjectManager();
omgr.registerFlushDelay(objclass, delay);
} | [
"public",
"void",
"registerFlushDelay",
"(",
"Class",
"<",
"?",
">",
"objclass",
",",
"long",
"delay",
")",
"{",
"ClientDObjectMgr",
"omgr",
"=",
"(",
"ClientDObjectMgr",
")",
"getDObjectManager",
"(",
")",
";",
"omgr",
".",
"registerFlushDelay",
"(",
"objclas... | Instructs the distributed object manager associated with this client to allow objects of the
specified class to linger around the specified number of milliseconds after their last
subscriber has been removed before the client finally removes its object proxy and flushes
the object. Normally, objects are flushed immedia... | [
"Instructs",
"the",
"distributed",
"object",
"manager",
"associated",
"with",
"this",
"client",
"to",
"allow",
"objects",
"of",
"the",
"specified",
"class",
"to",
"linger",
"around",
"the",
"specified",
"number",
"of",
"milliseconds",
"after",
"their",
"last",
"... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L344-L348 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/genia/Event.java | Event.setCauses_protein | public void setCauses_protein(int i, Protein v) {
"""
indexed setter for causes_protein - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_causes_protein == null)
jcasType.jcas... | java | public void setCauses_protein(int i, Protein v) {
if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_causes_protein == null)
jcasType.jcas.throwFeatMissing("causes_protein", "ch.epfl.bbp.uima.genia.Event");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Event_Type)jcasType)... | [
"public",
"void",
"setCauses_protein",
"(",
"int",
"i",
",",
"Protein",
"v",
")",
"{",
"if",
"(",
"Event_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Event_Type",
")",
"jcasType",
")",
".",
"casFeat_causes_protein",
"==",
"null",
")",
"jcasType",
".",
"jcas",... | indexed setter for causes_protein - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"causes_protein",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/genia/Event.java#L185-L189 |
apache/incubator-heron | heron/packing/src/java/org/apache/heron/packing/roundrobin/ResourceCompliantRRPacking.java | ResourceCompliantRRPacking.removeRRInstance | private void removeRRInstance(PackingPlanBuilder packingPlanBuilder,
String componentName) throws RuntimeException {
"""
Remove an instance of a particular component from the containers
"""
List<Scorer<Container>> scorers = new ArrayList<>();
scorers.add(new HomogeneityS... | java | private void removeRRInstance(PackingPlanBuilder packingPlanBuilder,
String componentName) throws RuntimeException {
List<Scorer<Container>> scorers = new ArrayList<>();
scorers.add(new HomogeneityScorer(componentName, true)); // all-same-component containers first
scorers.a... | [
"private",
"void",
"removeRRInstance",
"(",
"PackingPlanBuilder",
"packingPlanBuilder",
",",
"String",
"componentName",
")",
"throws",
"RuntimeException",
"{",
"List",
"<",
"Scorer",
"<",
"Container",
">>",
"scorers",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
... | Remove an instance of a particular component from the containers | [
"Remove",
"an",
"instance",
"of",
"a",
"particular",
"component",
"from",
"the",
"containers"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/packing/src/java/org/apache/heron/packing/roundrobin/ResourceCompliantRRPacking.java#L330-L339 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.calcLamda | private static String calcLamda(String slsnd, String slcly, String omPct) {
"""
Equation 15 for calculating Slope of logarithmic tension-moisture curve
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage ... | java | private static String calcLamda(String slsnd, String slcly, String omPct) {
String mt33 = divide(calcMoisture33Kpa(slsnd, slcly, omPct), "100");
String mt1500 = divide(calcMoisture1500Kpa(slsnd, slcly, omPct), "100");
String ret = divide(substract(log(mt33), log(mt1500)), CONST_LN1500_LN33);
... | [
"private",
"static",
"String",
"calcLamda",
"(",
"String",
"slsnd",
",",
"String",
"slcly",
",",
"String",
"omPct",
")",
"{",
"String",
"mt33",
"=",
"divide",
"(",
"calcMoisture33Kpa",
"(",
"slsnd",
",",
"slcly",
",",
"omPct",
")",
",",
"\"100\"",
")",
"... | Equation 15 for calculating Slope of logarithmic tension-moisture curve
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,100]%), (=
SLOC * 1.72) | [
"Equation",
"15",
"for",
"calculating",
"Slope",
"of",
"logarithmic",
"tension",
"-",
"moisture",
"curve"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L320-L327 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setCc | public void setCc(Object cc) throws ApplicationException {
"""
set the value cc Indicates addresses to copy the e-mail message to; "cc" stands for "carbon
copy."
@param strCc value to set
@throws ApplicationException
"""
if (StringUtil.isEmpty(cc)) return;
try {
smtp.addCC(cc);
}
catch (Exception... | java | public void setCc(Object cc) throws ApplicationException {
if (StringUtil.isEmpty(cc)) return;
try {
smtp.addCC(cc);
}
catch (Exception e) {
throw new ApplicationException("attribute [cc] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setCc",
"(",
"Object",
"cc",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"cc",
")",
")",
"return",
";",
"try",
"{",
"smtp",
".",
"addCC",
"(",
"cc",
")",
";",
"}",
"catch",
"(",
"Except... | set the value cc Indicates addresses to copy the e-mail message to; "cc" stands for "carbon
copy."
@param strCc value to set
@throws ApplicationException | [
"set",
"the",
"value",
"cc",
"Indicates",
"addresses",
"to",
"copy",
"the",
"e",
"-",
"mail",
"message",
"to",
";",
"cc",
"stands",
"for",
"carbon",
"copy",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L218-L226 |
apache/reef | lang/java/reef-examples-clr/src/main/java/org/apache/reef/examples/helloCLR/HelloDriver.java | HelloDriver.onNextJVM | void onNextJVM(final AllocatedEvaluator allocatedEvaluator) {
"""
Uses the AllocatedEvaluator to launch a JVM task.
@param allocatedEvaluator
"""
try {
final Configuration contextConfiguration = ContextConfiguration.CONF
.set(ContextConfiguration.IDENTIFIER, "HelloREEFContext")
... | java | void onNextJVM(final AllocatedEvaluator allocatedEvaluator) {
try {
final Configuration contextConfiguration = ContextConfiguration.CONF
.set(ContextConfiguration.IDENTIFIER, "HelloREEFContext")
.build();
final Configuration taskConfiguration = TaskConfiguration.CONF
.set(... | [
"void",
"onNextJVM",
"(",
"final",
"AllocatedEvaluator",
"allocatedEvaluator",
")",
"{",
"try",
"{",
"final",
"Configuration",
"contextConfiguration",
"=",
"ContextConfiguration",
".",
"CONF",
".",
"set",
"(",
"ContextConfiguration",
".",
"IDENTIFIER",
",",
"\"HelloRE... | Uses the AllocatedEvaluator to launch a JVM task.
@param allocatedEvaluator | [
"Uses",
"the",
"AllocatedEvaluator",
"to",
"launch",
"a",
"JVM",
"task",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples-clr/src/main/java/org/apache/reef/examples/helloCLR/HelloDriver.java#L138-L155 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/SerializationUtil.java | SerializationUtil.pipe | public static Object pipe(final Object in) {
"""
Takes a copy of an input object via serialization.
@param in the object to copy
@return the copied object
"""
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream os = new ObjectOutputStream(bos);
os.writeObject(in);
... | java | public static Object pipe(final Object in) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream os = new ObjectOutputStream(bos);
os.writeObject(in);
os.close();
byte[] bytes = bos.toByteArray();
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
ObjectInp... | [
"public",
"static",
"Object",
"pipe",
"(",
"final",
"Object",
"in",
")",
"{",
"try",
"{",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"os",
"=",
"new",
"ObjectOutputStream",
"(",
"bos",
")",
";",
... | Takes a copy of an input object via serialization.
@param in the object to copy
@return the copied object | [
"Takes",
"a",
"copy",
"of",
"an",
"input",
"object",
"via",
"serialization",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/SerializationUtil.java#L27-L42 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/juel/ExpressionFactoryImpl.java | ExpressionFactoryImpl.createTypeConverter | protected TypeConverter createTypeConverter(Properties properties) {
"""
Create the factory's type converter. This implementation takes the
<code>de.odysseus.el.misc.TypeConverter</code> property as the name of a class implementing
the <code>de.odysseus.el.misc.TypeConverter</code> interface. If the property is ... | java | protected TypeConverter createTypeConverter(Properties properties) {
Class<?> clazz = load(TypeConverter.class, properties);
if (clazz == null) {
return TypeConverter.DEFAULT;
}
try {
return TypeConverter.class.cast(clazz.newInstance());
} catch (Exception e) {
throw new ELException("TypeConverter " ... | [
"protected",
"TypeConverter",
"createTypeConverter",
"(",
"Properties",
"properties",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"load",
"(",
"TypeConverter",
".",
"class",
",",
"properties",
")",
";",
"if",
"(",
"clazz",
"==",
"null",
")",
"{",
"retu... | Create the factory's type converter. This implementation takes the
<code>de.odysseus.el.misc.TypeConverter</code> property as the name of a class implementing
the <code>de.odysseus.el.misc.TypeConverter</code> interface. If the property is not set, the
default converter (<code>TypeConverter.DEFAULT</code>) is used. | [
"Create",
"the",
"factory",
"s",
"type",
"converter",
".",
"This",
"implementation",
"takes",
"the",
"<code",
">",
"de",
".",
"odysseus",
".",
"el",
".",
"misc",
".",
"TypeConverter<",
"/",
"code",
">",
"property",
"as",
"the",
"name",
"of",
"a",
"class"... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/ExpressionFactoryImpl.java#L348-L358 |
alkacon/opencms-core | src-gwt/org/opencms/ade/editprovider/client/CmsDirectEditEntryPoint.java | CmsDirectEditEntryPoint.processEditableElement | protected CmsDirectEditButtons processEditableElement(Element elem) {
"""
Adds the direct edit buttons for a single editable element.<p>
@param elem the data container element
@return the direct edit buttons widget which was created for the element
"""
RootPanel root = RootPanel.get();
C... | java | protected CmsDirectEditButtons processEditableElement(Element elem) {
RootPanel root = RootPanel.get();
CmsDirectEditButtons result = new CmsDirectEditButtons(elem, null);
root.add(result);
result.setPosition(m_positions.get(elem.getId()), m_buttonPositions.get(elem.getId()), elem.getPa... | [
"protected",
"CmsDirectEditButtons",
"processEditableElement",
"(",
"Element",
"elem",
")",
"{",
"RootPanel",
"root",
"=",
"RootPanel",
".",
"get",
"(",
")",
";",
"CmsDirectEditButtons",
"result",
"=",
"new",
"CmsDirectEditButtons",
"(",
"elem",
",",
"null",
")",
... | Adds the direct edit buttons for a single editable element.<p>
@param elem the data container element
@return the direct edit buttons widget which was created for the element | [
"Adds",
"the",
"direct",
"edit",
"buttons",
"for",
"a",
"single",
"editable",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/editprovider/client/CmsDirectEditEntryPoint.java#L232-L239 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setFeatureStyle | public static boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureStyleExtension featureStyleExtension, FeatureRow featureRow, float density) {
"""
Set the feature row style into the polygon options
@param polygonOptions polygon options
@param featureStyleExtension feature style extension
@pa... | java | public static boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureStyleExtension featureStyleExtension, FeatureRow featureRow, float density) {
FeatureStyle featureStyle = featureStyleExtension.getFeatureStyle(featureRow);
return setFeatureStyle(polygonOptions, featureStyle, density);
} | [
"public",
"static",
"boolean",
"setFeatureStyle",
"(",
"PolygonOptions",
"polygonOptions",
",",
"FeatureStyleExtension",
"featureStyleExtension",
",",
"FeatureRow",
"featureRow",
",",
"float",
"density",
")",
"{",
"FeatureStyle",
"featureStyle",
"=",
"featureStyleExtension"... | Set the feature row style into the polygon options
@param polygonOptions polygon options
@param featureStyleExtension feature style extension
@param featureRow feature row
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if style was set into the ... | [
"Set",
"the",
"feature",
"row",
"style",
"into",
"the",
"polygon",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L537-L542 |
nobuoka/android-lib-ZXingCaptureActivity | src/main/java/info/vividcode/android/zxing/camera/CameraManager.java | CameraManager.requestPreviewFrame | public synchronized void requestPreviewFrame(Handler handler, int message) {
"""
A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
respectively.
@param handler The handler to... | java | public synchronized void requestPreviewFrame(Handler handler, int message) {
Camera theCamera = camera;
if (theCamera != null && previewing) {
previewCallback.setHandler(handler, message);
theCamera.setOneShotPreviewCallback(previewCallback);
}
} | [
"public",
"synchronized",
"void",
"requestPreviewFrame",
"(",
"Handler",
"handler",
",",
"int",
"message",
")",
"{",
"Camera",
"theCamera",
"=",
"camera",
";",
"if",
"(",
"theCamera",
"!=",
"null",
"&&",
"previewing",
")",
"{",
"previewCallback",
".",
"setHand... | A single preview frame will be returned to the handler supplied. The data will arrive as byte[]
in the message.obj field, with width and height encoded as message.arg1 and message.arg2,
respectively.
@param handler The handler to send the message to.
@param message The what field of the message to be sent. | [
"A",
"single",
"preview",
"frame",
"will",
"be",
"returned",
"to",
"the",
"handler",
"supplied",
".",
"The",
"data",
"will",
"arrive",
"as",
"byte",
"[]",
"in",
"the",
"message",
".",
"obj",
"field",
"with",
"width",
"and",
"height",
"encoded",
"as",
"me... | train | https://github.com/nobuoka/android-lib-ZXingCaptureActivity/blob/17aaa7cf75520d3f2e03db9796b7e8c1d1f1b1e6/src/main/java/info/vividcode/android/zxing/camera/CameraManager.java#L192-L198 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/googlecode/eyesfree/utils/ScreenshotUtils.java | ScreenshotUtils.writeBitmap | public static File writeBitmap(Context context, Bitmap bitmap, String dir, String filename) {
"""
Writes a {@link Bitmap} object to a file in the current context's files directory.
@param context The current context.
@param bitmap The bitmap object to output.
@param dir The output directory name within the fi... | java | public static File writeBitmap(Context context, Bitmap bitmap, String dir, String filename) {
if ((bitmap == null) || TextUtils.isEmpty(dir) || TextUtils.isEmpty(filename)) {
return null;
}
final File dirFile = new File(context.getFilesDir(), dir);
return writeBitmapToDirecto... | [
"public",
"static",
"File",
"writeBitmap",
"(",
"Context",
"context",
",",
"Bitmap",
"bitmap",
",",
"String",
"dir",
",",
"String",
"filename",
")",
"{",
"if",
"(",
"(",
"bitmap",
"==",
"null",
")",
"||",
"TextUtils",
".",
"isEmpty",
"(",
"dir",
")",
"... | Writes a {@link Bitmap} object to a file in the current context's files directory.
@param context The current context.
@param bitmap The bitmap object to output.
@param dir The output directory name within the files directory.
@param filename The name of the file to output.
@return A file where the Bitmap was stored, ... | [
"Writes",
"a",
"{",
"@link",
"Bitmap",
"}",
"object",
"to",
"a",
"file",
"in",
"the",
"current",
"context",
"s",
"files",
"directory",
"."
] | train | https://github.com/google/Accessibility-Test-Framework-for-Android/blob/a6117fe0059c82dd764fa628d3817d724570f69e/src/main/java/com/googlecode/eyesfree/utils/ScreenshotUtils.java#L194-L200 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java | PatternMatchingFunctions.regexpLike | public static Expression regexpLike(Expression expression, String pattern) {
"""
Returned expression results in True if the string value matches the regular expression pattern
"""
return x("REGEXP_LIKE(" + expression.toString() + ", \"" + pattern + "\")");
} | java | public static Expression regexpLike(Expression expression, String pattern) {
return x("REGEXP_LIKE(" + expression.toString() + ", \"" + pattern + "\")");
} | [
"public",
"static",
"Expression",
"regexpLike",
"(",
"Expression",
"expression",
",",
"String",
"pattern",
")",
"{",
"return",
"x",
"(",
"\"REGEXP_LIKE(\"",
"+",
"expression",
".",
"toString",
"(",
")",
"+",
"\", \\\"\"",
"+",
"pattern",
"+",
"\"\\\")\"",
")",... | Returned expression results in True if the string value matches the regular expression pattern | [
"Returned",
"expression",
"results",
"in",
"True",
"if",
"the",
"string",
"value",
"matches",
"the",
"regular",
"expression",
"pattern"
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java#L56-L58 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/ajax/editable/tabs/AjaxAddableTabbedPanel.java | AjaxAddableTabbedPanel.newTitle | protected Component newTitle(final String titleId, final IModel<?> titleModel, final int index) {
"""
Factory method for tab titles. Returned component can be anything that can attach to span
tags such as a fragment, panel, or a label
@param titleId
id of title component
@param titleModel
model containing t... | java | protected Component newTitle(final String titleId, final IModel<?> titleModel, final int index)
{
return new Label(titleId, titleModel);
} | [
"protected",
"Component",
"newTitle",
"(",
"final",
"String",
"titleId",
",",
"final",
"IModel",
"<",
"?",
">",
"titleModel",
",",
"final",
"int",
"index",
")",
"{",
"return",
"new",
"Label",
"(",
"titleId",
",",
"titleModel",
")",
";",
"}"
] | Factory method for tab titles. Returned component can be anything that can attach to span
tags such as a fragment, panel, or a label
@param titleId
id of title component
@param titleModel
model containing tab title
@param index
index of tab
@return title component | [
"Factory",
"method",
"for",
"tab",
"titles",
".",
"Returned",
"component",
"can",
"be",
"anything",
"that",
"can",
"attach",
"to",
"span",
"tags",
"such",
"as",
"a",
"fragment",
"panel",
"or",
"a",
"label"
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/ajax/editable/tabs/AjaxAddableTabbedPanel.java#L643-L646 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.swapColumns | public void swapColumns(int i, int j) {
"""
Swaps the specified columns of this matrix.
@param i the column index
@param j the column index
"""
if (i != j) {
Vector ii = getColumn(i);
Vector jj = getColumn(j);
setColumn(i, jj);
setColumn(j, ii);
... | java | public void swapColumns(int i, int j) {
if (i != j) {
Vector ii = getColumn(i);
Vector jj = getColumn(j);
setColumn(i, jj);
setColumn(j, ii);
}
} | [
"public",
"void",
"swapColumns",
"(",
"int",
"i",
",",
"int",
"j",
")",
"{",
"if",
"(",
"i",
"!=",
"j",
")",
"{",
"Vector",
"ii",
"=",
"getColumn",
"(",
"i",
")",
";",
"Vector",
"jj",
"=",
"getColumn",
"(",
"j",
")",
";",
"setColumn",
"(",
"i",... | Swaps the specified columns of this matrix.
@param i the column index
@param j the column index | [
"Swaps",
"the",
"specified",
"columns",
"of",
"this",
"matrix",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L489-L497 |
infinispan/infinispan | server/hotrod/src/main/java/org/infinispan/server/hotrod/tx/PrepareCoordinator.java | PrepareCoordinator.onePhaseCommitRemoteTransaction | public int onePhaseCommitRemoteTransaction(GlobalTransaction gtx, List<WriteCommand> modifications) {
"""
Commits a remote 1PC transaction that is already in MARK_COMMIT state
"""
RpcManager rpcManager = cache.getRpcManager();
CommandsFactory factory = cache.getComponentRegistry().getCommandsFactor... | java | public int onePhaseCommitRemoteTransaction(GlobalTransaction gtx, List<WriteCommand> modifications) {
RpcManager rpcManager = cache.getRpcManager();
CommandsFactory factory = cache.getComponentRegistry().getCommandsFactory();
try {
//only pessimistic tx are committed in 1PC and it doesn't use... | [
"public",
"int",
"onePhaseCommitRemoteTransaction",
"(",
"GlobalTransaction",
"gtx",
",",
"List",
"<",
"WriteCommand",
">",
"modifications",
")",
"{",
"RpcManager",
"rpcManager",
"=",
"cache",
".",
"getRpcManager",
"(",
")",
";",
"CommandsFactory",
"factory",
"=",
... | Commits a remote 1PC transaction that is already in MARK_COMMIT state | [
"Commits",
"a",
"remote",
"1PC",
"transaction",
"that",
"is",
"already",
"in",
"MARK_COMMIT",
"state"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/tx/PrepareCoordinator.java#L217-L235 |
threerings/narya | core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java | PresentsDObjectMgr.clearProxyObject | public void clearProxyObject (int origObjectId, DObject object) {
"""
Clears a proxy object reference from our local distributed object space. This merely removes
it from our internal tables, the caller is responsible for coordinating the deregistration
of the object with the proxying client.
"""
if ... | java | public void clearProxyObject (int origObjectId, DObject object)
{
if (_proxies.remove(object.getOid()) == null) {
log.warning("Missing proxy mapping for cleared proxy", "ooid", origObjectId);
}
_objects.remove(object.getOid());
} | [
"public",
"void",
"clearProxyObject",
"(",
"int",
"origObjectId",
",",
"DObject",
"object",
")",
"{",
"if",
"(",
"_proxies",
".",
"remove",
"(",
"object",
".",
"getOid",
"(",
")",
")",
"==",
"null",
")",
"{",
"log",
".",
"warning",
"(",
"\"Missing proxy ... | Clears a proxy object reference from our local distributed object space. This merely removes
it from our internal tables, the caller is responsible for coordinating the deregistration
of the object with the proxying client. | [
"Clears",
"a",
"proxy",
"object",
"reference",
"from",
"our",
"local",
"distributed",
"object",
"space",
".",
"This",
"merely",
"removes",
"it",
"from",
"our",
"internal",
"tables",
"the",
"caller",
"is",
"responsible",
"for",
"coordinating",
"the",
"deregistrat... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L186-L192 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlign.java | QsAlign.getAlignedAtomsForClusterSubunitMap | private static Pair<Atom[]> getAlignedAtomsForClusterSubunitMap(
List<SubunitCluster> clusters,
Map<Integer, Map<Integer, Integer>> clusterSubunitMap) {
"""
Returns a pair of Atom arrays corresponding to the alignment of subunit
matchings, in order of appearance. Superposition of the two Atom sets
gives th... | java | private static Pair<Atom[]> getAlignedAtomsForClusterSubunitMap(
List<SubunitCluster> clusters,
Map<Integer, Map<Integer, Integer>> clusterSubunitMap) {
List<Atom> atomArray1 = new ArrayList<Atom>();
List<Atom> atomArray2 = new ArrayList<Atom>();
// For each cluster of subunits
for (int key : clusterSub... | [
"private",
"static",
"Pair",
"<",
"Atom",
"[",
"]",
">",
"getAlignedAtomsForClusterSubunitMap",
"(",
"List",
"<",
"SubunitCluster",
">",
"clusters",
",",
"Map",
"<",
"Integer",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
">",
"clusterSubunitMap",
")",
"... | Returns a pair of Atom arrays corresponding to the alignment of subunit
matchings, in order of appearance. Superposition of the two Atom sets
gives the transformation of the complex.
<p>
Utility method to cumulative calculate the alignment Atoms.
@param clusters
List of SubunitClusters
@param clusterSubunitMap
map fro... | [
"Returns",
"a",
"pair",
"of",
"Atom",
"arrays",
"corresponding",
"to",
"the",
"alignment",
"of",
"subunit",
"matchings",
"in",
"order",
"of",
"appearance",
".",
"Superposition",
"of",
"the",
"two",
"Atom",
"sets",
"gives",
"the",
"transformation",
"of",
"the",... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlign.java#L323-L354 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPChainer.java | AFPChainer.calAfpDis | private static double calAfpDis(int afp1, int afp2, FatCatParameters params, AFPChain afpChain) {
"""
return the root mean square of the distance matrix between the residues
from the segments that form the given AFP list
this value can be a measurement (2) for the connectivity of the AFPs
and its calculation is... | java | private static double calAfpDis(int afp1, int afp2, FatCatParameters params, AFPChain afpChain)
{
List<AFP> afpSet = afpChain.getAfpSet();
Matrix disTable1 = afpChain.getDisTable1();
Matrix disTable2 = afpChain.getDisTable2();
int fragLen = params.getFragLen();
double afpDisCut = params.getAfpDisCut();
... | [
"private",
"static",
"double",
"calAfpDis",
"(",
"int",
"afp1",
",",
"int",
"afp2",
",",
"FatCatParameters",
"params",
",",
"AFPChain",
"afpChain",
")",
"{",
"List",
"<",
"AFP",
">",
"afpSet",
"=",
"afpChain",
".",
"getAfpSet",
"(",
")",
";",
"Matrix",
"... | return the root mean square of the distance matrix between the residues
from the segments that form the given AFP list
this value can be a measurement (2) for the connectivity of the AFPs
and its calculation is quicker than the measurement (1), rmsd
currently only deal with AFP pair
|-d1--|
|--d2---|
|---d3----|
-----... | [
"return",
"the",
"root",
"mean",
"square",
"of",
"the",
"distance",
"matrix",
"between",
"the",
"residues",
"from",
"the",
"segments",
"that",
"form",
"the",
"given",
"AFP",
"list",
"this",
"value",
"can",
"be",
"a",
"measurement",
"(",
"2",
")",
"for",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPChainer.java#L406-L434 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/base64/Base64Slow.java | Base64Slow.decodeToString | public static String decodeToString(byte[] bytes, String enc)
throws UnsupportedEncodingException {
"""
Decode Base64 encoded bytes. Characters that are not part of the Base64 alphabet are ignored in
the input.
@param bytes The data to decode.
@param enc Character encoding to use when converting to and ... | java | public static String decodeToString(byte[] bytes, String enc)
throws UnsupportedEncodingException {
return new String(decode(bytes), enc);
} | [
"public",
"static",
"String",
"decodeToString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"enc",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"new",
"String",
"(",
"decode",
"(",
"bytes",
")",
",",
"enc",
")",
";",
"}"
] | Decode Base64 encoded bytes. Characters that are not part of the Base64 alphabet are ignored in
the input.
@param bytes The data to decode.
@param enc Character encoding to use when converting to and from bytes.
@return A decoded String.
@throws UnsupportedEncodingException if the character encoding specified is not s... | [
"Decode",
"Base64",
"encoded",
"bytes",
".",
"Characters",
"that",
"are",
"not",
"part",
"of",
"the",
"Base64",
"alphabet",
"are",
"ignored",
"in",
"the",
"input",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/base64/Base64Slow.java#L586-L589 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java | MultiLineString.fromLngLats | public static MultiLineString fromLngLats(@NonNull List<List<Point>> points) {
"""
Create a new instance of this class by defining a list of a list of {@link Point}s which follow
the correct specifications described in the Point documentation. Note that there should not be
any duplicate points inside the list an... | java | public static MultiLineString fromLngLats(@NonNull List<List<Point>> points) {
return new MultiLineString(TYPE, null, points);
} | [
"public",
"static",
"MultiLineString",
"fromLngLats",
"(",
"@",
"NonNull",
"List",
"<",
"List",
"<",
"Point",
">",
">",
"points",
")",
"{",
"return",
"new",
"MultiLineString",
"(",
"TYPE",
",",
"null",
",",
"points",
")",
";",
"}"
] | Create a new instance of this class by defining a list of a list of {@link Point}s which follow
the correct specifications described in the Point documentation. Note that there should not be
any duplicate points inside the list and the points combined should create a LineString with a
distance greater than 0.
@param p... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"list",
"of",
"a",
"list",
"of",
"{",
"@link",
"Point",
"}",
"s",
"which",
"follow",
"the",
"correct",
"specifications",
"described",
"in",
"the",
"Point",
"documentation",
"."... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java#L161-L163 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_paymentMethods_GET | public OvhPaymentMethods order_orderId_paymentMethods_GET(Long orderId) throws IOException {
"""
List of registered payment method you can use to pay this order
REST: GET /me/order/{orderId}/paymentMethods
@param orderId [required]
API beta
"""
String qPath = "/me/order/{orderId}/paymentMethods";
St... | java | public OvhPaymentMethods order_orderId_paymentMethods_GET(Long orderId) throws IOException {
String qPath = "/me/order/{orderId}/paymentMethods";
StringBuilder sb = path(qPath, orderId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPaymentMethods.class);
} | [
"public",
"OvhPaymentMethods",
"order_orderId_paymentMethods_GET",
"(",
"Long",
"orderId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/paymentMethods\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"orderId",
")",
... | List of registered payment method you can use to pay this order
REST: GET /me/order/{orderId}/paymentMethods
@param orderId [required]
API beta | [
"List",
"of",
"registered",
"payment",
"method",
"you",
"can",
"use",
"to",
"pay",
"this",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1972-L1977 |
mangstadt/biweekly | src/main/java/biweekly/io/TimezoneInfo.java | TimezoneInfo.containsIdentity | private static <T> boolean containsIdentity(List<T> list, T object) {
"""
Searches for an item in a list using reference equality.
@param list the list
@param object the object to search for
@return true if the object was found, false if not
"""
for (T item : list) {
if (item == object) {
return tr... | java | private static <T> boolean containsIdentity(List<T> list, T object) {
for (T item : list) {
if (item == object) {
return true;
}
}
return false;
} | [
"private",
"static",
"<",
"T",
">",
"boolean",
"containsIdentity",
"(",
"List",
"<",
"T",
">",
"list",
",",
"T",
"object",
")",
"{",
"for",
"(",
"T",
"item",
":",
"list",
")",
"{",
"if",
"(",
"item",
"==",
"object",
")",
"{",
"return",
"true",
";... | Searches for an item in a list using reference equality.
@param list the list
@param object the object to search for
@return true if the object was found, false if not | [
"Searches",
"for",
"an",
"item",
"in",
"a",
"list",
"using",
"reference",
"equality",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/TimezoneInfo.java#L297-L304 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java | MemberSummaryBuilder.buildAnnotationTypeOptionalMemberSummary | public void buildAnnotationTypeOptionalMemberSummary(XMLNode node, Content memberSummaryTree) {
"""
Build the summary for the optional members.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added
"""
... | java | public void buildAnnotationTypeOptionalMemberSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL];
VisibleMemberMap visibleMemberMap =
visibleMemberMaps[VisibleMemberMap.ANNO... | [
"public",
"void",
"buildAnnotationTypeOptionalMemberSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"memberSummaryTree",
")",
"{",
"MemberSummaryWriter",
"writer",
"=",
"memberSummaryWriters",
"[",
"VisibleMemberMap",
".",
"ANNOTATION_TYPE_MEMBER_OPTIONAL",
"]",
";",
"Vis... | Build the summary for the optional members.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added | [
"Build",
"the",
"summary",
"for",
"the",
"optional",
"members",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java#L236-L242 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java | DomHelper.bringToFront | public void bringToFront(Object parent, String name) {
"""
Within a certain group, bring an element to the front. This will make sure it's visible (within that group).
@param object
The group wherein to search for the element.
@param name
The name of the element to bring to the front.
@since 1.10.0
"""
... | java | public void bringToFront(Object parent, String name) {
Element parentElement = getGroup(parent);
if (parentElement == null) {
throw new IllegalArgumentException("bringToFront failed: could not find parent group.");
}
Element element = getElement(parent, name);
if (element == null) {
throw new IllegalAr... | [
"public",
"void",
"bringToFront",
"(",
"Object",
"parent",
",",
"String",
"name",
")",
"{",
"Element",
"parentElement",
"=",
"getGroup",
"(",
"parent",
")",
";",
"if",
"(",
"parentElement",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Within a certain group, bring an element to the front. This will make sure it's visible (within that group).
@param object
The group wherein to search for the element.
@param name
The name of the element to bring to the front.
@since 1.10.0 | [
"Within",
"a",
"certain",
"group",
"bring",
"an",
"element",
"to",
"the",
"front",
".",
"This",
"will",
"make",
"sure",
"it",
"s",
"visible",
"(",
"within",
"that",
"group",
")",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L357-L370 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.minByLong | public OptionalInt minByLong(IntToLongFunction keyExtractor) {
"""
Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing some element... | java | public OptionalInt minByLong(IntToLongFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, i) -> {
long key = keyExtractor.applyAsLong(i);
if (!box.b || box.l > key) {
box.b = true;
box.l = key;
box.i = i;
}
... | [
"public",
"OptionalInt",
"minByLong",
"(",
"IntToLongFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"i",
")",
"->",
"{",
"long",
"key",
"=",
"keyExtractor",
".",
"applyAsLong",
"(",
"i",
")... | Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing some element of this stream for
which the lowest value was returned by key extractor, or an... | [
"Returns",
"the",
"minimum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L1037-L1046 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/AssetRendition.java | AssetRendition.getDimensionFromOriginal | private static @Nullable Dimension getDimensionFromOriginal(@NotNull Rendition rendition) {
"""
Read dimension for original rendition from asset metadata.
@param rendition Rendition
@return Dimension or null
"""
Asset asset = rendition.getAsset();
// asset may have stored dimension in different prope... | java | private static @Nullable Dimension getDimensionFromOriginal(@NotNull Rendition rendition) {
Asset asset = rendition.getAsset();
// asset may have stored dimension in different property names
long width = getAssetMetadataValueAsLong(asset, TIFF_IMAGEWIDTH, EXIF_PIXELXDIMENSION);
long height = getAssetMet... | [
"private",
"static",
"@",
"Nullable",
"Dimension",
"getDimensionFromOriginal",
"(",
"@",
"NotNull",
"Rendition",
"rendition",
")",
"{",
"Asset",
"asset",
"=",
"rendition",
".",
"getAsset",
"(",
")",
";",
"// asset may have stored dimension in different property names",
... | Read dimension for original rendition from asset metadata.
@param rendition Rendition
@return Dimension or null | [
"Read",
"dimension",
"for",
"original",
"rendition",
"from",
"asset",
"metadata",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/AssetRendition.java#L135-L141 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/AbstractSailthruClient.java | AbstractSailthruClient.httpRequest | protected Object httpRequest(HttpRequestMethod method, ApiParams apiParams) throws IOException {
"""
Make HTTP Request to Sailthru API but with Api Params rather than generalized Map, this is recommended way to make request if data structure is complex
@param method HTTP method
@param apiParams
@return Object
... | java | protected Object httpRequest(HttpRequestMethod method, ApiParams apiParams) throws IOException {
ApiAction action = apiParams.getApiCall();
String url = apiUrl + "/" + action.toString().toLowerCase();
String json = GSON.toJson(apiParams, apiParams.getType());
Map<String, String> params =... | [
"protected",
"Object",
"httpRequest",
"(",
"HttpRequestMethod",
"method",
",",
"ApiParams",
"apiParams",
")",
"throws",
"IOException",
"{",
"ApiAction",
"action",
"=",
"apiParams",
".",
"getApiCall",
"(",
")",
";",
"String",
"url",
"=",
"apiUrl",
"+",
"\"/\"",
... | Make HTTP Request to Sailthru API but with Api Params rather than generalized Map, this is recommended way to make request if data structure is complex
@param method HTTP method
@param apiParams
@return Object
@throws IOException | [
"Make",
"HTTP",
"Request",
"to",
"Sailthru",
"API",
"but",
"with",
"Api",
"Params",
"rather",
"than",
"generalized",
"Map",
"this",
"is",
"recommended",
"way",
"to",
"make",
"request",
"if",
"data",
"structure",
"is",
"complex"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/AbstractSailthruClient.java#L170-L178 |
tcurdt/jdeb | src/main/java/org/vafer/jdeb/utils/Utils.java | Utils.toUnixLineEndings | public static byte[] toUnixLineEndings( InputStream input ) throws IOException {
"""
Replaces new line delimiters in the input stream with the Unix line feed.
@param input
"""
String encoding = "ISO-8859-1";
FixCrLfFilter filter = new FixCrLfFilter(new InputStreamReader(input, encoding));
... | java | public static byte[] toUnixLineEndings( InputStream input ) throws IOException {
String encoding = "ISO-8859-1";
FixCrLfFilter filter = new FixCrLfFilter(new InputStreamReader(input, encoding));
filter.setEol(FixCrLfFilter.CrLf.newInstance("unix"));
ByteArrayOutputStream filteredFile = ... | [
"public",
"static",
"byte",
"[",
"]",
"toUnixLineEndings",
"(",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"String",
"encoding",
"=",
"\"ISO-8859-1\"",
";",
"FixCrLfFilter",
"filter",
"=",
"new",
"FixCrLfFilter",
"(",
"new",
"InputStreamReader",
"(... | Replaces new line delimiters in the input stream with the Unix line feed.
@param input | [
"Replaces",
"new",
"line",
"delimiters",
"in",
"the",
"input",
"stream",
"with",
"the",
"Unix",
"line",
"feed",
"."
] | train | https://github.com/tcurdt/jdeb/blob/b899a7b1b3391356aafc491ab601f258961f67f0/src/main/java/org/vafer/jdeb/utils/Utils.java#L220-L229 |
Canadensys/canadensys-core | src/main/java/net/canadensys/utils/NumberUtils.java | NumberUtils.parseNumber | public static <T> T parseNumber(String value, Class<T> targetClass, T defaultValue) {
"""
Tries to parse value into the targetClass.
The implementation is no elegant, but it's faster than
targetClass.getConstructor(String.class).newInstance(value);
@param value
@param targetClass
@param defaultValue default v... | java | public static <T> T parseNumber(String value, Class<T> targetClass, T defaultValue){
T number = parseNumber(value,targetClass);
if(number == null){
return defaultValue;
}
return number;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"parseNumber",
"(",
"String",
"value",
",",
"Class",
"<",
"T",
">",
"targetClass",
",",
"T",
"defaultValue",
")",
"{",
"T",
"number",
"=",
"parseNumber",
"(",
"value",
",",
"targetClass",
")",
";",
"if",
"(",
"... | Tries to parse value into the targetClass.
The implementation is no elegant, but it's faster than
targetClass.getConstructor(String.class).newInstance(value);
@param value
@param targetClass
@param defaultValue default value to return if the value can not be parsed.
@return T instance of value or defaultValue if the pa... | [
"Tries",
"to",
"parse",
"value",
"into",
"the",
"targetClass",
".",
"The",
"implementation",
"is",
"no",
"elegant",
"but",
"it",
"s",
"faster",
"than",
"targetClass",
".",
"getConstructor",
"(",
"String",
".",
"class",
")",
".",
"newInstance",
"(",
"value",
... | train | https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/utils/NumberUtils.java#L60-L66 |
unbescape/unbescape | src/main/java/org/unbescape/xml/XmlEscape.java | XmlEscape.escapeXml11Attribute | public static void escapeXml11Attribute(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform an XML 1.1 level 2 (markup-significant and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input meant to be an XML attribute value, writing results to a ... | java | public static void escapeXml11Attribute(final Reader reader, final Writer writer)
throws IOException {
escapeXml(reader, writer, XmlEscapeSymbols.XML11_ATTRIBUTE_SYMBOLS,
XmlEscapeType.CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA,
XmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_P... | [
"public",
"static",
"void",
"escapeXml11Attribute",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeXml",
"(",
"reader",
",",
"writer",
",",
"XmlEscapeSymbols",
".",
"XML11_ATTRIBUTE_SYMBOLS",
",",
"Xml... | <p>
Perform an XML 1.1 level 2 (markup-significant and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input meant to be an XML attribute value, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The five markup-significant characters... | [
"<p",
">",
"Perform",
"an",
"XML",
"1",
".",
"1",
"level",
"2",
"(",
"markup",
"-",
"significant",
"and",
"all",
"non",
"-",
"ASCII",
"chars",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L1554-L1559 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/MessageProcessor.java | MessageProcessor.setCustomProperty | @Override
public void setCustomProperty(String propertyName, String propertyValue) {
"""
setCustomProperty is implemented from the interface JsEngineComponent and
is used to set properties on the MP
@param propertyName
The name of the Attribute
@param propertyValue
The value of the Attribute
@see com... | java | @Override
public void setCustomProperty(String propertyName, String propertyValue) {
if (TraceComponent.isAnyTracingEnabled()
&& tc.isEntryEnabled())
SibTr.entry(tc, "setCustomProperty", new Object[] { propertyName,
prope... | [
"@",
"Override",
"public",
"void",
"setCustomProperty",
"(",
"String",
"propertyName",
",",
"String",
"propertyValue",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
... | setCustomProperty is implemented from the interface JsEngineComponent and
is used to set properties on the MP
@param propertyName
The name of the Attribute
@param propertyValue
The value of the Attribute
@see com.ibm.ws.sib.admin.JsEngineComponent.setCustomProperty | [
"setCustomProperty",
"is",
"implemented",
"from",
"the",
"interface",
"JsEngineComponent",
"and",
"is",
"used",
"to",
"set",
"properties",
"on",
"the",
"MP"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/MessageProcessor.java#L2728-L2740 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.handleNewStreamID | private void handleNewStreamID(AbstractMessage aMessage, MessageItem msgItem) throws SIResourceException {
"""
Handle a new stream ID and cache a MessageItem for replay later.
msgItem can be null, for example if this was triggered by a control message.
@param msgItem
"""
if (TraceComponent.isAnyTracing... | java | private void handleNewStreamID(AbstractMessage aMessage, MessageItem msgItem) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleNewStreamID", new Object[] { aMessage, msgItem });
SIBUuid12 streamID = aMessage.getGuaranteedStreamUUID();
... | [
"private",
"void",
"handleNewStreamID",
"(",
"AbstractMessage",
"aMessage",
",",
"MessageItem",
"msgItem",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")... | Handle a new stream ID and cache a MessageItem for replay later.
msgItem can be null, for example if this was triggered by a control message.
@param msgItem | [
"Handle",
"a",
"new",
"stream",
"ID",
"and",
"cache",
"a",
"MessageItem",
"for",
"replay",
"later",
".",
"msgItem",
"can",
"be",
"null",
"for",
"example",
"if",
"this",
"was",
"triggered",
"by",
"a",
"control",
"message",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L348-L400 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphDump.java | ObjectGraphDump.visitComplexType | private void visitComplexType(final ObjectGraphNode node) {
"""
Visits all the fields in the given complex object.
@param node the ObjectGraphNode containing the object.
"""
Field[] fields = getAllInstanceFields(node.getValue());
for (int i = 0; i < fields.length; i++) {
Object fieldValue = readFiel... | java | private void visitComplexType(final ObjectGraphNode node) {
Field[] fields = getAllInstanceFields(node.getValue());
for (int i = 0; i < fields.length; i++) {
Object fieldValue = readField(fields[i], node.getValue());
String fieldType = fields[i].getType().getName();
ObjectGraphNode childNode = new Object... | [
"private",
"void",
"visitComplexType",
"(",
"final",
"ObjectGraphNode",
"node",
")",
"{",
"Field",
"[",
"]",
"fields",
"=",
"getAllInstanceFields",
"(",
"node",
".",
"getValue",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fiel... | Visits all the fields in the given complex object.
@param node the ObjectGraphNode containing the object. | [
"Visits",
"all",
"the",
"fields",
"in",
"the",
"given",
"complex",
"object",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphDump.java#L119-L131 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/DateUtils.java | DateUtils.toDate | public static final Date toDate(String date, String pattern) {
"""
Specified <code>pattern</code> match specified parameter
<code>date</code>.
@param date
@param pattern
@return date
"""
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
return format.parse(date);
} catch (ParseExcep... | java | public static final Date toDate(String date, String pattern) {
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
return format.parse(date);
} catch (ParseException e) {
throw new KnifeUtilsException(e);
}
} | [
"public",
"static",
"final",
"Date",
"toDate",
"(",
"String",
"date",
",",
"String",
"pattern",
")",
"{",
"SimpleDateFormat",
"format",
"=",
"new",
"SimpleDateFormat",
"(",
"pattern",
")",
";",
"try",
"{",
"return",
"format",
".",
"parse",
"(",
"date",
")"... | Specified <code>pattern</code> match specified parameter
<code>date</code>.
@param date
@param pattern
@return date | [
"Specified",
"<code",
">",
"pattern<",
"/",
"code",
">",
"match",
"specified",
"parameter",
"<code",
">",
"date<",
"/",
"code",
">",
"."
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/DateUtils.java#L77-L84 |
canoo/dolphin-platform | platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/mbean/DolphinContextMBeanRegistry.java | DolphinContextMBeanRegistry.registerDolphinContext | public Subscription registerDolphinContext(ClientSession session, GarbageCollector garbageCollector) {
"""
Register a new dolphin session as a MBean
@param session the session
@return the subscription for deregistration
"""
Assert.requireNonNull(session, "session");
Assert.requireNonNull(garb... | java | public Subscription registerDolphinContext(ClientSession session, GarbageCollector garbageCollector) {
Assert.requireNonNull(session, "session");
Assert.requireNonNull(garbageCollector, "garbageCollector");
DolphinSessionInfoMBean mBean = new DolphinSessionInfo(session, garbageCollector);
... | [
"public",
"Subscription",
"registerDolphinContext",
"(",
"ClientSession",
"session",
",",
"GarbageCollector",
"garbageCollector",
")",
"{",
"Assert",
".",
"requireNonNull",
"(",
"session",
",",
"\"session\"",
")",
";",
"Assert",
".",
"requireNonNull",
"(",
"garbageCol... | Register a new dolphin session as a MBean
@param session the session
@return the subscription for deregistration | [
"Register",
"a",
"new",
"dolphin",
"session",
"as",
"a",
"MBean"
] | train | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/mbean/DolphinContextMBeanRegistry.java#L48-L53 |
weld/core | environments/se/core/src/main/java/org/jboss/weld/environment/se/Weld.java | Weld.getInstanceByType | protected <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings) {
"""
Utility method allowing managed instances of beans to provide entry points for non-managed beans (such as {@link WeldContainer}). Should only called once
Weld has finished booting.
@param manager the BeanManager... | java | protected <T> T getInstanceByType(BeanManager manager, Class<T> type, Annotation... bindings) {
final Bean<?> bean = manager.resolve(manager.getBeans(type, bindings));
if (bean == null) {
throw CommonLogger.LOG.unableToResolveBean(type, Arrays.asList(bindings));
}
CreationalC... | [
"protected",
"<",
"T",
">",
"T",
"getInstanceByType",
"(",
"BeanManager",
"manager",
",",
"Class",
"<",
"T",
">",
"type",
",",
"Annotation",
"...",
"bindings",
")",
"{",
"final",
"Bean",
"<",
"?",
">",
"bean",
"=",
"manager",
".",
"resolve",
"(",
"mana... | Utility method allowing managed instances of beans to provide entry points for non-managed beans (such as {@link WeldContainer}). Should only called once
Weld has finished booting.
@param manager the BeanManager to use to access the managed instance
@param type the type of the Bean
@param bindings the bean's qualifier... | [
"Utility",
"method",
"allowing",
"managed",
"instances",
"of",
"beans",
"to",
"provide",
"entry",
"points",
"for",
"non",
"-",
"managed",
"beans",
"(",
"such",
"as",
"{",
"@link",
"WeldContainer",
"}",
")",
".",
"Should",
"only",
"called",
"once",
"Weld",
... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/se/core/src/main/java/org/jboss/weld/environment/se/Weld.java#L1027-L1034 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.vps_serviceName_upgrade_duration_GET | public OvhOrder vps_serviceName_upgrade_duration_GET(String serviceName, String duration, String model) throws IOException {
"""
Get prices and contracts information
REST: GET /order/vps/{serviceName}/upgrade/{duration}
@param model [required] Model
@param serviceName [required] The internal name of your VPS ... | java | public OvhOrder vps_serviceName_upgrade_duration_GET(String serviceName, String duration, String model) throws IOException {
String qPath = "/order/vps/{serviceName}/upgrade/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "model", model);
String resp = exec(qPath, "GET", sb.toStrin... | [
"public",
"OvhOrder",
"vps_serviceName_upgrade_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"String",
"model",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/vps/{serviceName}/upgrade/{duration}\"",
";",
"StringBuilder",... | Get prices and contracts information
REST: GET /order/vps/{serviceName}/upgrade/{duration}
@param model [required] Model
@param serviceName [required] The internal name of your VPS offer
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3469-L3475 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapApi.java | MapApi.getNullableMap | public static <A, B> Map<A, B> getNullableMap(final Map map, final Object... path) {
"""
Get map value by path.
@param <A> map key type
@param <B> map value type
@param map subject
@param path nodes to walk in map
@return value
"""
return getNullable(map, Map.class, path);
} | java | public static <A, B> Map<A, B> getNullableMap(final Map map, final Object... path) {
return getNullable(map, Map.class, path);
} | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"Map",
"<",
"A",
",",
"B",
">",
"getNullableMap",
"(",
"final",
"Map",
"map",
",",
"final",
"Object",
"...",
"path",
")",
"{",
"return",
"getNullable",
"(",
"map",
",",
"Map",
".",
"class",
",",
"path",
... | Get map value by path.
@param <A> map key type
@param <B> map value type
@param map subject
@param path nodes to walk in map
@return value | [
"Get",
"map",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapApi.java#L211-L213 |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/FileSet.java | FileSet.copyTo | void copyTo(final File destinationFolder) throws IOException {
"""
Copies all files in the current FileSet to the given destinationFolder.
@param destinationFolder the folder where the files shall be copied to.
@throws IOException
"""
for (final File f : this.theFiles) {
final File destinationFil... | java | void copyTo(final File destinationFolder) throws IOException {
for (final File f : this.theFiles) {
final File destinationFile = new File(destinationFolder, f.getName());
Files.copy(f.toPath(), destinationFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
}
} | [
"void",
"copyTo",
"(",
"final",
"File",
"destinationFolder",
")",
"throws",
"IOException",
"{",
"for",
"(",
"final",
"File",
"f",
":",
"this",
".",
"theFiles",
")",
"{",
"final",
"File",
"destinationFile",
"=",
"new",
"File",
"(",
"destinationFolder",
",",
... | Copies all files in the current FileSet to the given destinationFolder.
@param destinationFolder the folder where the files shall be copied to.
@throws IOException | [
"Copies",
"all",
"files",
"in",
"the",
"current",
"FileSet",
"to",
"the",
"given",
"destinationFolder",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/FileSet.java#L79-L84 |
validator/validator | src/nu/validator/gnu/xml/aelfred2/XmlParser.java | XmlParser.tryEncodingDecl | private String tryEncodingDecl(String encoding) throws SAXException,
IOException {
"""
Check for an encoding declaration. This is the second part of the XML
encoding autodetection algorithm, relying on detectEncoding to get to the
point that this part can read any encoding declaration in the document... | java | private String tryEncodingDecl(String encoding) throws SAXException,
IOException {
// Read the XML/text declaration.
if (tryRead("<?xml")) {
if (tryWhitespace()) {
if (inputStack.size() > 0) {
return parseTextDecl(encoding);
} e... | [
"private",
"String",
"tryEncodingDecl",
"(",
"String",
"encoding",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"// Read the XML/text declaration.",
"if",
"(",
"tryRead",
"(",
"\"<?xml\"",
")",
")",
"{",
"if",
"(",
"tryWhitespace",
"(",
")",
")",
"{",... | Check for an encoding declaration. This is the second part of the XML
encoding autodetection algorithm, relying on detectEncoding to get to the
point that this part can read any encoding declaration in the document
(using only US-ASCII characters).
<p>
Because this part starts to fill parser buffers with this data, it... | [
"Check",
"for",
"an",
"encoding",
"declaration",
".",
"This",
"is",
"the",
"second",
"part",
"of",
"the",
"XML",
"encoding",
"autodetection",
"algorithm",
"relying",
"on",
"detectEncoding",
"to",
"get",
"to",
"the",
"point",
"that",
"this",
"part",
"can",
"r... | train | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/gnu/xml/aelfred2/XmlParser.java#L3902-L3925 |
f2prateek/rx-preferences | rx-preferences/src/main/java/com/f2prateek/rx/preferences2/RxSharedPreferences.java | RxSharedPreferences.getStringSet | @RequiresApi(HONEYCOMB)
@CheckResult @NonNull
public Preference<Set<String>> getStringSet(@NonNull String key) {
"""
Create a string set preference for {@code key}. Default is an empty set. Note that returned set
value will always be unmodifiable.
"""
return getStringSet(key, Collections.<String>empty... | java | @RequiresApi(HONEYCOMB)
@CheckResult @NonNull
public Preference<Set<String>> getStringSet(@NonNull String key) {
return getStringSet(key, Collections.<String>emptySet());
} | [
"@",
"RequiresApi",
"(",
"HONEYCOMB",
")",
"@",
"CheckResult",
"@",
"NonNull",
"public",
"Preference",
"<",
"Set",
"<",
"String",
">",
">",
"getStringSet",
"(",
"@",
"NonNull",
"String",
"key",
")",
"{",
"return",
"getStringSet",
"(",
"key",
",",
"Collecti... | Create a string set preference for {@code key}. Default is an empty set. Note that returned set
value will always be unmodifiable. | [
"Create",
"a",
"string",
"set",
"preference",
"for",
"{"
] | train | https://github.com/f2prateek/rx-preferences/blob/e338b4e6cee9c0c7b850be86ab41ed7b39a3637e/rx-preferences/src/main/java/com/f2prateek/rx/preferences2/RxSharedPreferences.java#L157-L161 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java | CrystalCell.checkScaleMatrix | public boolean checkScaleMatrix(Matrix4d scaleMatrix) {
"""
Given a scale matrix parsed from a PDB entry (SCALE1,2,3 records),
compares it to our calculated Mtranspose matrix to see if they coincide and
returns true if they do.
If they don't that means that the PDB entry is not in the standard
orthogonalisatio... | java | public boolean checkScaleMatrix(Matrix4d scaleMatrix) {
Matrix3d mtranspose = getMTranspose();
for (int i=0;i<3;i++) {
for (int j=0;j<3;j++) {
if (!deltaComp(mtranspose.getElement(i, j),scaleMatrix.getElement(i, j))) {
//System.out.println("Our value ("+i+","+j+"): "+getM().getElement(i,j));
//S... | [
"public",
"boolean",
"checkScaleMatrix",
"(",
"Matrix4d",
"scaleMatrix",
")",
"{",
"Matrix3d",
"mtranspose",
"=",
"getMTranspose",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
... | Given a scale matrix parsed from a PDB entry (SCALE1,2,3 records),
compares it to our calculated Mtranspose matrix to see if they coincide and
returns true if they do.
If they don't that means that the PDB entry is not in the standard
orthogonalisation (NCODE=1 in ccp4).
In 2011's remediation only 148 PDB entries were ... | [
"Given",
"a",
"scale",
"matrix",
"parsed",
"from",
"a",
"PDB",
"entry",
"(",
"SCALE1",
"2",
"3",
"records",
")",
"compares",
"it",
"to",
"our",
"calculated",
"Mtranspose",
"matrix",
"to",
"see",
"if",
"they",
"coincide",
"and",
"returns",
"true",
"if",
"... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java#L548-L566 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/operations/complex/AComplexOperation.java | AComplexOperation.genericFlow | private final StringBuilder genericFlow(boolean newInstance) {
"""
This method specifies the general flow of the complex mapping.
@param newInstance true if you need to create a new instance, false otherwise
@return a StringBuilder containing the mapping
"""
// if newInstance is true or mapping type... | java | private final StringBuilder genericFlow(boolean newInstance){
// if newInstance is true or mapping type of newField is ONLY_NULL_FIELDS
// write the mapping for the new field
if(newInstance || getMtd() == ONLY_NULL_FIELDS)
return sourceControl(fieldToCreate());
// if is enrichment case and ma... | [
"private",
"final",
"StringBuilder",
"genericFlow",
"(",
"boolean",
"newInstance",
")",
"{",
"// if newInstance is true or mapping type of newField is ONLY_NULL_FIELDS\r",
"// write the mapping for the new field\r",
"if",
"(",
"newInstance",
"||",
"getMtd",
"(",
")",
"==",
"ONL... | This method specifies the general flow of the complex mapping.
@param newInstance true if you need to create a new instance, false otherwise
@return a StringBuilder containing the mapping | [
"This",
"method",
"specifies",
"the",
"general",
"flow",
"of",
"the",
"complex",
"mapping",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/operations/complex/AComplexOperation.java#L117-L134 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.renamePath | public static void renamePath(FileSystem fs, Path oldName, Path newName) throws IOException {
"""
A wrapper around {@link FileSystem#rename(Path, Path)} which throws {@link IOException} if
{@link FileSystem#rename(Path, Path)} returns False.
"""
renamePath(fs, oldName, newName, false);
} | java | public static void renamePath(FileSystem fs, Path oldName, Path newName) throws IOException {
renamePath(fs, oldName, newName, false);
} | [
"public",
"static",
"void",
"renamePath",
"(",
"FileSystem",
"fs",
",",
"Path",
"oldName",
",",
"Path",
"newName",
")",
"throws",
"IOException",
"{",
"renamePath",
"(",
"fs",
",",
"oldName",
",",
"newName",
",",
"false",
")",
";",
"}"
] | A wrapper around {@link FileSystem#rename(Path, Path)} which throws {@link IOException} if
{@link FileSystem#rename(Path, Path)} returns False. | [
"A",
"wrapper",
"around",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L260-L262 |
OpenVidu/openvidu | openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java | SessionManager.getParticipants | public Set<Participant> getParticipants(String sessionId) throws OpenViduException {
"""
Returns all the participants inside a session.
@param sessionId identifier of the session
@return set of {@link Participant}
@throws OpenViduException in case the session doesn't exist
"""
Session session = sessions... | java | public Set<Participant> getParticipants(String sessionId) throws OpenViduException {
Session session = sessions.get(sessionId);
if (session == null) {
throw new OpenViduException(Code.ROOM_NOT_FOUND_ERROR_CODE, "Session '" + sessionId + "' not found");
}
Set<Participant> participants = session.getParticipant... | [
"public",
"Set",
"<",
"Participant",
">",
"getParticipants",
"(",
"String",
"sessionId",
")",
"throws",
"OpenViduException",
"{",
"Session",
"session",
"=",
"sessions",
".",
"get",
"(",
"sessionId",
")",
";",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"... | Returns all the participants inside a session.
@param sessionId identifier of the session
@return set of {@link Participant}
@throws OpenViduException in case the session doesn't exist | [
"Returns",
"all",
"the",
"participants",
"inside",
"a",
"session",
"."
] | train | https://github.com/OpenVidu/openvidu/blob/89db47dd37949ceab29e5228371a8fcab04d8d55/openvidu-server/src/main/java/io/openvidu/server/core/SessionManager.java#L169-L177 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java | TopicsInner.getByResourceGroupAsync | public Observable<TopicInner> getByResourceGroupAsync(String resourceGroupName, String topicName) {
"""
Get a topic.
Get properties of a topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@throws IllegalArgumentException thrown if... | java | public Observable<TopicInner> getByResourceGroupAsync(String resourceGroupName, String topicName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, topicName).map(new Func1<ServiceResponse<TopicInner>, TopicInner>() {
@Override
public TopicInner call(ServiceResponse<... | [
"public",
"Observable",
"<",
"TopicInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"topicName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"topicName",
")",
".",
"map",
"(",... | Get a topic.
Get properties of a topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param topicName Name of the topic
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the TopicInner object | [
"Get",
"a",
"topic",
".",
"Get",
"properties",
"of",
"a",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2019_01_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_01_01/implementation/TopicsInner.java#L157-L164 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/KerasLayer.java | KerasLayer.registerCustomLayer | public static void registerCustomLayer(String layerName, Class<? extends KerasLayer> configClass) {
"""
Register a custom layer
@param layerName name of custom layer class
@param configClass class of custom layer
"""
customLayers.put(layerName, configClass);
} | java | public static void registerCustomLayer(String layerName, Class<? extends KerasLayer> configClass) {
customLayers.put(layerName, configClass);
} | [
"public",
"static",
"void",
"registerCustomLayer",
"(",
"String",
"layerName",
",",
"Class",
"<",
"?",
"extends",
"KerasLayer",
">",
"configClass",
")",
"{",
"customLayers",
".",
"put",
"(",
"layerName",
",",
"configClass",
")",
";",
"}"
] | Register a custom layer
@param layerName name of custom layer class
@param configClass class of custom layer | [
"Register",
"a",
"custom",
"layer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/KerasLayer.java#L171-L173 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ControlsNotParticipant.java | ControlsNotParticipant.satisfies | @Override
public boolean satisfies(Match match, int... ind) {
"""
Checks if the controlled Interaction contains a controller as a participant. This constraint
filters out such cases.
@param match current pattern match
@param ind mapped indices
@return true if participants of teh controlled Interactions not al... | java | @Override
public boolean satisfies(Match match, int... ind)
{
Control ctrl = (Control) match.get(ind[0]);
for (Process process : ctrl.getControlled())
{
if (process instanceof Interaction)
{
Interaction inter = (Interaction) process;
Set<Entity> participant = inter.getParticipant();
for (Cont... | [
"@",
"Override",
"public",
"boolean",
"satisfies",
"(",
"Match",
"match",
",",
"int",
"...",
"ind",
")",
"{",
"Control",
"ctrl",
"=",
"(",
"Control",
")",
"match",
".",
"get",
"(",
"ind",
"[",
"0",
"]",
")",
";",
"for",
"(",
"Process",
"process",
"... | Checks if the controlled Interaction contains a controller as a participant. This constraint
filters out such cases.
@param match current pattern match
@param ind mapped indices
@return true if participants of teh controlled Interactions not also a controller of the
Control. | [
"Checks",
"if",
"the",
"controlled",
"Interaction",
"contains",
"a",
"controller",
"as",
"a",
"participant",
".",
"This",
"constraint",
"filters",
"out",
"such",
"cases",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/ControlsNotParticipant.java#L35-L53 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateUtils.java | DateUtils.toCalendar | @GwtIncompatible("incompatible method")
public static Calendar toCalendar(final Date date, final TimeZone tz) {
"""
Converts a {@code Date} of a given {@code TimeZone} into a {@code Calendar}
@param date the date to convert to a Calendar
@param tz the time zone of the {@code date}
@return the created Calend... | java | @GwtIncompatible("incompatible method")
public static Calendar toCalendar(final Date date, final TimeZone tz) {
final Calendar c = Calendar.getInstance(tz);
c.setTime(date);
return c;
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"Calendar",
"toCalendar",
"(",
"final",
"Date",
"date",
",",
"final",
"TimeZone",
"tz",
")",
"{",
"final",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
"tz",
")",
... | Converts a {@code Date} of a given {@code TimeZone} into a {@code Calendar}
@param date the date to convert to a Calendar
@param tz the time zone of the {@code date}
@return the created Calendar
@throws NullPointerException if {@code date} or {@code tz} is null | [
"Converts",
"a",
"{"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L681-L686 |
threerings/narya | core/src/main/java/com/threerings/presents/data/ClientObject.java | ClientObject.checkAccess | public String checkAccess (Permission perm, Object context) {
"""
Checks whether or not this client has the specified permission.
@return null if the user has access, a fully-qualified translatable message string
indicating the reason for denial of access.
@see ClientObject.PermissionPolicy
"""
... | java | public String checkAccess (Permission perm, Object context)
{
if (_permPolicy == null) {
_permPolicy = createPermissionPolicy();
}
return _permPolicy.checkAccess(perm, context);
} | [
"public",
"String",
"checkAccess",
"(",
"Permission",
"perm",
",",
"Object",
"context",
")",
"{",
"if",
"(",
"_permPolicy",
"==",
"null",
")",
"{",
"_permPolicy",
"=",
"createPermissionPolicy",
"(",
")",
";",
"}",
"return",
"_permPolicy",
".",
"checkAccess",
... | Checks whether or not this client has the specified permission.
@return null if the user has access, a fully-qualified translatable message string
indicating the reason for denial of access.
@see ClientObject.PermissionPolicy | [
"Checks",
"whether",
"or",
"not",
"this",
"client",
"has",
"the",
"specified",
"permission",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/data/ClientObject.java#L73-L79 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/DateUtils.java | DateUtils.subMonths | public static long subMonths(final String dateString1, final String dateString2) {
"""
Get how many months between two date, the date pattern is 'yyyy-MM-dd'.
@param dateString1 date string to be tested.
@param dateString2 date string to be tested.
@return how many months between two date.
@throws DateExcept... | java | public static long subMonths(final String dateString1, final String dateString2) {
Date date1 = getDateFromString(dateString1, DEFAULT_DATE_SIMPLE_PATTERN);
Date date2 = getDateFromString(dateString2, DEFAULT_DATE_SIMPLE_PATTERN);
return subMonths(date1, date2);
} | [
"public",
"static",
"long",
"subMonths",
"(",
"final",
"String",
"dateString1",
",",
"final",
"String",
"dateString2",
")",
"{",
"Date",
"date1",
"=",
"getDateFromString",
"(",
"dateString1",
",",
"DEFAULT_DATE_SIMPLE_PATTERN",
")",
";",
"Date",
"date2",
"=",
"g... | Get how many months between two date, the date pattern is 'yyyy-MM-dd'.
@param dateString1 date string to be tested.
@param dateString2 date string to be tested.
@return how many months between two date.
@throws DateException | [
"Get",
"how",
"many",
"months",
"between",
"two",
"date",
"the",
"date",
"pattern",
"is",
"yyyy",
"-",
"MM",
"-",
"dd",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DateUtils.java#L475-L480 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/TagList.java | TagList.addTag | public Tag addTag(String theScheme, String theTerm) {
"""
Add a new tag instance
@param theScheme
The tag scheme (the system)
@param theTerm
The tag term (the code)
@return Returns the newly created tag instance. Note that the tag is added to the list by this method, so you
generally do not need to interac... | java | public Tag addTag(String theScheme, String theTerm) {
Tag retVal = new Tag(theScheme, theTerm);
add(retVal);
myOrderedTags = null;
return retVal;
} | [
"public",
"Tag",
"addTag",
"(",
"String",
"theScheme",
",",
"String",
"theTerm",
")",
"{",
"Tag",
"retVal",
"=",
"new",
"Tag",
"(",
"theScheme",
",",
"theTerm",
")",
";",
"add",
"(",
"retVal",
")",
";",
"myOrderedTags",
"=",
"null",
";",
"return",
"ret... | Add a new tag instance
@param theScheme
The tag scheme (the system)
@param theTerm
The tag term (the code)
@return Returns the newly created tag instance. Note that the tag is added to the list by this method, so you
generally do not need to interact directly with the added tag. | [
"Add",
"a",
"new",
"tag",
"instance"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/TagList.java#L113-L118 |
bingoohuang/asmvalidator | src/main/java/com/github/bingoohuang/asmvalidator/asm/AsmValidatorMethodGenerator.java | AsmValidatorMethodGenerator.createValueLocal | protected void createValueLocal(LocalIndices localIndices, MethodVisitor mv, Field f) {
"""
为待校验的值(原值及转换后的字符串值)创建字节码局部变量。
@param localIndices 局部变量索引
@param mv 方法访问器
@param f 字段
"""
visitGetter(mv, f);
localIndices.incrementAndSetOriginalLocalIndex();
mv.visitV... | java | protected void createValueLocal(LocalIndices localIndices, MethodVisitor mv, Field f) {
visitGetter(mv, f);
localIndices.incrementAndSetOriginalLocalIndex();
mv.visitVarInsn(storeOpCode(f.getType()), localIndices.getLocalIndex());
mv.visitVarInsn(loadOpCode(f.getType()), localIndices.ge... | [
"protected",
"void",
"createValueLocal",
"(",
"LocalIndices",
"localIndices",
",",
"MethodVisitor",
"mv",
",",
"Field",
"f",
")",
"{",
"visitGetter",
"(",
"mv",
",",
"f",
")",
";",
"localIndices",
".",
"incrementAndSetOriginalLocalIndex",
"(",
")",
";",
"mv",
... | 为待校验的值(原值及转换后的字符串值)创建字节码局部变量。
@param localIndices 局部变量索引
@param mv 方法访问器
@param f 字段 | [
"为待校验的值(原值及转换后的字符串值)创建字节码局部变量。"
] | train | https://github.com/bingoohuang/asmvalidator/blob/6e1c2564e04f8d3cb68bbebe1a07a25d7d419c8c/src/main/java/com/github/bingoohuang/asmvalidator/asm/AsmValidatorMethodGenerator.java#L92-L113 |
Netflix/zeno | src/main/java/com/netflix/zeno/diff/history/DiffHistoricalState.java | DiffHistoricalState.checkEquality | @SuppressWarnings("unchecked")
private boolean checkEquality(Object o1, Object o2, boolean isGroupOfObjects) {
"""
Equality is different depending on whether or not we are keying by a unique key.<p/>
<ul>
<li>If the key is unique, then we simply compare equality with ==.</li>
<li>If the key is not unique,... | java | @SuppressWarnings("unchecked")
private boolean checkEquality(Object o1, Object o2, boolean isGroupOfObjects) {
if(isGroupOfObjects) {
/// equality for a List, in this case, means that for each list, at each element the items are == to one another.
/// we know that the element orderin... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"boolean",
"checkEquality",
"(",
"Object",
"o1",
",",
"Object",
"o2",
",",
"boolean",
"isGroupOfObjects",
")",
"{",
"if",
"(",
"isGroupOfObjects",
")",
"{",
"/// equality for a List, in this case, means th... | Equality is different depending on whether or not we are keying by a unique key.<p/>
<ul>
<li>If the key is unique, then we simply compare equality with ==.</li>
<li>If the key is not unique, then we have grouped these elements by the key (in Lists).
In this case, we check equality of each element with ==.</li>
</ul> | [
"Equality",
"is",
"different",
"depending",
"on",
"whether",
"or",
"not",
"we",
"are",
"keying",
"by",
"a",
"unique",
"key",
".",
"<p",
"/",
">"
] | train | https://github.com/Netflix/zeno/blob/e571a3f1e304942724d454408fe6417fe18c20fd/src/main/java/com/netflix/zeno/diff/history/DiffHistoricalState.java#L150-L171 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java | CouchDBSchemaManager.createDesignDocForAggregations | private void createDesignDocForAggregations() throws URISyntaxException, UnsupportedEncodingException, IOException,
ClientProtocolException {
"""
Creates the design doc for aggregations.
@throws URISyntaxException
the URI syntax exception
@throws UnsupportedEncodingException
the unsupported encod... | java | private void createDesignDocForAggregations() throws URISyntaxException, UnsupportedEncodingException, IOException,
ClientProtocolException
{
HttpResponse response = null;
URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(),
Couch... | [
"private",
"void",
"createDesignDocForAggregations",
"(",
")",
"throws",
"URISyntaxException",
",",
"UnsupportedEncodingException",
",",
"IOException",
",",
"ClientProtocolException",
"{",
"HttpResponse",
"response",
"=",
"null",
";",
"URI",
"uri",
"=",
"new",
"URI",
... | Creates the design doc for aggregations.
@throws URISyntaxException
the URI syntax exception
@throws UnsupportedEncodingException
the unsupported encoding exception
@throws IOException
Signals that an I/O exception has occurred.
@throws ClientProtocolException
the client protocol exception | [
"Creates",
"the",
"design",
"doc",
"for",
"aggregations",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java#L453-L482 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/SubstructureIdentifier.java | SubstructureIdentifier.copyLigandsByProximity | protected static void copyLigandsByProximity(Structure full, Structure reduced) {
"""
Supplements the reduced structure with ligands from the full structure based on
a distance cutoff. Ligand groups are moved (destructively) from full to reduced
if they fall within the cutoff of any atom in the reduced structure... | java | protected static void copyLigandsByProximity(Structure full, Structure reduced) {
// Normal case where all models should be copied from full to reduced
assert full.nrModels() >= reduced.nrModels();
for(int model = 0; model< reduced.nrModels(); model++) {
copyLigandsByProximity(full, reduced, StructureTools.DEF... | [
"protected",
"static",
"void",
"copyLigandsByProximity",
"(",
"Structure",
"full",
",",
"Structure",
"reduced",
")",
"{",
"// Normal case where all models should be copied from full to reduced",
"assert",
"full",
".",
"nrModels",
"(",
")",
">=",
"reduced",
".",
"nrModels"... | Supplements the reduced structure with ligands from the full structure based on
a distance cutoff. Ligand groups are moved (destructively) from full to reduced
if they fall within the cutoff of any atom in the reduced structure.
The {@link StructureTools#DEFAULT_LIGAND_PROXIMITY_CUTOFF default cutoff}
is used.
@param f... | [
"Supplements",
"the",
"reduced",
"structure",
"with",
"ligands",
"from",
"the",
"full",
"structure",
"based",
"on",
"a",
"distance",
"cutoff",
".",
"Ligand",
"groups",
"are",
"moved",
"(",
"destructively",
")",
"from",
"full",
"to",
"reduced",
"if",
"they",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/SubstructureIdentifier.java#L309-L315 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/diagrams/panels/ScatterChartPanel.java | ScatterChartPanel.paintTicks | protected void paintTicks(Graphics g, ValueDimension dim) {
"""
Paints tick information for the coordinate axis of the given dimension.
@param g Graphics context
@param dim Reference dimension for tick painting
"""
for(int i=0; i<getTickInfo(dim).getTickNumber(); i++) {
if(i % getTickInfo(dim).getTick... | java | protected void paintTicks(Graphics g, ValueDimension dim) {
for(int i=0; i<getTickInfo(dim).getTickNumber(); i++) {
if(i % getTickInfo(dim).getTickMultiplicator() != 0)
paintTick(g, dim, getTickInfo(dim).getFirstTick()+i*getTickInfo(dim).getMinorTickSpacing(), getTickInfo(dim).getMinorTickLength());
els... | [
"protected",
"void",
"paintTicks",
"(",
"Graphics",
"g",
",",
"ValueDimension",
"dim",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getTickInfo",
"(",
"dim",
")",
".",
"getTickNumber",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
... | Paints tick information for the coordinate axis of the given dimension.
@param g Graphics context
@param dim Reference dimension for tick painting | [
"Paints",
"tick",
"information",
"for",
"the",
"coordinate",
"axis",
"of",
"the",
"given",
"dimension",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/diagrams/panels/ScatterChartPanel.java#L324-L330 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.getFilePropertiesFromComputeNode | public FileProperties getFilePropertiesFromComputeNode(String poolId, String nodeId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Gets information about a file on a compute node.
@param poolId The ID of the pool that contains the compute node.... | java | public FileProperties getFilePropertiesFromComputeNode(String poolId, String nodeId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
FileGetPropertiesFromComputeNodeOptions options = new FileGetPropertiesFromComputeNodeOptions();
BehaviorMana... | [
"public",
"FileProperties",
"getFilePropertiesFromComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"fileName",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
... | Gets information about a file on a compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId the ID of the compute node.
@param fileName The name of the file to retrieve.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch se... | [
"Gets",
"information",
"about",
"a",
"file",
"on",
"a",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L386-L400 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java | GeneratedDi18nDaoImpl.queryByCreatedBy | public Iterable<Di18n> queryByCreatedBy(java.lang.String createdBy) {
"""
query-by method for field createdBy
@param createdBy the specified attribute
@return an Iterable of Di18ns for the specified createdBy
"""
return queryByField(null, Di18nMapper.Field.CREATEDBY.getFieldName(), createdBy);
} | java | public Iterable<Di18n> queryByCreatedBy(java.lang.String createdBy) {
return queryByField(null, Di18nMapper.Field.CREATEDBY.getFieldName(), createdBy);
} | [
"public",
"Iterable",
"<",
"Di18n",
">",
"queryByCreatedBy",
"(",
"java",
".",
"lang",
".",
"String",
"createdBy",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"Di18nMapper",
".",
"Field",
".",
"CREATEDBY",
".",
"getFieldName",
"(",
")",
",",
"cre... | query-by method for field createdBy
@param createdBy the specified attribute
@return an Iterable of Di18ns for the specified createdBy | [
"query",
"-",
"by",
"method",
"for",
"field",
"createdBy"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java#L52-L54 |
opensourceBIM/BIMserver | PluginBase/src/org/bimserver/shared/GuidCompressor.java | GuidCompressor.cv_to_64 | private static boolean cv_to_64(long number, char[] code, int len ) {
"""
Conversion of an integer into a number with base 64
using the table cConversionTable
@param number
@param code
@param len
@return true if no error occurred
"""
long act;
int iDigit, nDigits;
char[] result = new... | java | private static boolean cv_to_64(long number, char[] code, int len )
{
long act;
int iDigit, nDigits;
char[] result = new char[5];
if (len > 5)
return false;
act = number;
nDigits = len - 1;
for (iDigit = 0; iDigit < nDigits; iDigit++) {
result[nDigits - iDig... | [
"private",
"static",
"boolean",
"cv_to_64",
"(",
"long",
"number",
",",
"char",
"[",
"]",
"code",
",",
"int",
"len",
")",
"{",
"long",
"act",
";",
"int",
"iDigit",
",",
"nDigits",
";",
"char",
"[",
"]",
"result",
"=",
"new",
"char",
"[",
"5",
"]",
... | Conversion of an integer into a number with base 64
using the table cConversionTable
@param number
@param code
@param len
@return true if no error occurred | [
"Conversion",
"of",
"an",
"integer",
"into",
"a",
"number",
"with",
"base",
"64",
"using",
"the",
"table",
"cConversionTable"
] | train | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/src/org/bimserver/shared/GuidCompressor.java#L139-L164 |
alkacon/opencms-core | src/org/opencms/scheduler/jobs/CmsImageCacheCleanupJob.java | CmsImageCacheCleanupJob.cleanImageCache | public static int cleanImageCache(float maxAge) {
"""
Removes all expired image cache entries from the RFS cache.<p>
Empty directories are removed as well.<p>
@param maxAge the maximum age of the image cache files in hours (or fractions of hours)
@return the total number of deleted resources
"""
... | java | public static int cleanImageCache(float maxAge) {
// calculate oldest possible date for the cache files
long expireDate = System.currentTimeMillis() - (long)(maxAge * 60f * 60f * 1000f);
File basedir = new File(CmsImageLoader.getImageRepositoryPath());
// perform the cache cleanup
... | [
"public",
"static",
"int",
"cleanImageCache",
"(",
"float",
"maxAge",
")",
"{",
"// calculate oldest possible date for the cache files",
"long",
"expireDate",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"(",
"long",
")",
"(",
"maxAge",
"*",
"60f",
"*",... | Removes all expired image cache entries from the RFS cache.<p>
Empty directories are removed as well.<p>
@param maxAge the maximum age of the image cache files in hours (or fractions of hours)
@return the total number of deleted resources | [
"Removes",
"all",
"expired",
"image",
"cache",
"entries",
"from",
"the",
"RFS",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/scheduler/jobs/CmsImageCacheCleanupJob.java#L70-L77 |
mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java | RenderTheme.scaleStrokeWidth | public synchronized void scaleStrokeWidth(float scaleFactor, byte zoomLevel) {
"""
Scales the stroke width of this RenderTheme by the given factor for a given zoom level
@param scaleFactor the factor by which the stroke width should be scaled.
@param zoomLevel the zoom level to which this is applied.
"""... | java | public synchronized void scaleStrokeWidth(float scaleFactor, byte zoomLevel) {
if (!strokeScales.containsKey(zoomLevel) || scaleFactor != strokeScales.get(zoomLevel)) {
for (int i = 0, n = this.rulesList.size(); i < n; ++i) {
Rule rule = this.rulesList.get(i);
if (rul... | [
"public",
"synchronized",
"void",
"scaleStrokeWidth",
"(",
"float",
"scaleFactor",
",",
"byte",
"zoomLevel",
")",
"{",
"if",
"(",
"!",
"strokeScales",
".",
"containsKey",
"(",
"zoomLevel",
")",
"||",
"scaleFactor",
"!=",
"strokeScales",
".",
"get",
"(",
"zoomL... | Scales the stroke width of this RenderTheme by the given factor for a given zoom level
@param scaleFactor the factor by which the stroke width should be scaled.
@param zoomLevel the zoom level to which this is applied. | [
"Scales",
"the",
"stroke",
"width",
"of",
"this",
"RenderTheme",
"by",
"the",
"given",
"factor",
"for",
"a",
"given",
"zoom",
"level"
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java#L160-L170 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/threadContext/ModuleMetaDataAccessorImpl.java | ModuleMetaDataAccessorImpl.beginContext | public Object beginContext(Map<URL, ModuleMetaData> mmdi) {
"""
Begin the context for the map of ModuleMetaData provided.
@param Map<URL, ModuleMetaData> It Must not be null. Tr.error will be logged if it is null.
@return Previous Object, which was on the stack. It can be null.
"""
if (TraceCompone... | java | public Object beginContext(Map<URL, ModuleMetaData> mmdi) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
if (mmdi != null && !mmdi.isEmpty())
Tr.debug(tc, "begin context " + mmdi.values().iterator().next().getJ2EEName());
else
Tr.debu... | [
"public",
"Object",
"beginContext",
"(",
"Map",
"<",
"URL",
",",
"ModuleMetaData",
">",
"mmdi",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"if",
"(",
"mmdi",
"!=",
... | Begin the context for the map of ModuleMetaData provided.
@param Map<URL, ModuleMetaData> It Must not be null. Tr.error will be logged if it is null.
@return Previous Object, which was on the stack. It can be null. | [
"Begin",
"the",
"context",
"for",
"the",
"map",
"of",
"ModuleMetaData",
"provided",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/threadContext/ModuleMetaDataAccessorImpl.java#L67-L76 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriPath | public static String escapeUriPath(final String text, final String encoding) {
"""
<p>
Perform am URI path <strong>escape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
The following are the only allowed chars in an URI path (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>-... | java | public static String escapeUriPath(final String text, final String encoding) {
if (encoding == null) {
throw new IllegalArgumentException("Argument 'encoding' cannot be null");
}
return UriEscapeUtil.escape(text, UriEscapeUtil.UriEscapeType.PATH, encoding);
} | [
"public",
"static",
"String",
"escapeUriPath",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'encoding' cannot be null\"",
"... | <p>
Perform am URI path <strong>escape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
The following are the only allowed chars in an URI path (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>- . _ ~</tt></li>
<li><tt>! $ & ' ( ) * + , ; =</tt></li>
<li><tt>: @</tt></li>
<li><tt>/</tt>... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"following",
"are",
"the",
"only",
"allowed... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L179-L184 |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java | SqlValidatorImpl.expandSelectItem | private boolean expandSelectItem(
final SqlNode selectItem,
SqlSelect select,
RelDataType targetType,
List<SqlNode> selectItems,
Set<String> aliases,
List<Map.Entry<String, RelDataType>> fields,
final boolean includeSystemVars) {
"""
If <code>selectItem</code> is "*" or "TABLE.*", expands it and retu... | java | private boolean expandSelectItem(
final SqlNode selectItem,
SqlSelect select,
RelDataType targetType,
List<SqlNode> selectItems,
Set<String> aliases,
List<Map.Entry<String, RelDataType>> fields,
final boolean includeSystemVars) {
final SelectScope scope = (SelectScope) getWhereScope(select);
if (expan... | [
"private",
"boolean",
"expandSelectItem",
"(",
"final",
"SqlNode",
"selectItem",
",",
"SqlSelect",
"select",
",",
"RelDataType",
"targetType",
",",
"List",
"<",
"SqlNode",
">",
"selectItems",
",",
"Set",
"<",
"String",
">",
"aliases",
",",
"List",
"<",
"Map",
... | If <code>selectItem</code> is "*" or "TABLE.*", expands it and returns
true; otherwise writes the unexpanded item.
@param selectItem Select-list item
@param select Containing select clause
@param selectItems List that expanded items are written to
@param aliases Set of aliases
@param ... | [
"If",
"<code",
">",
"selectItem<",
"/",
"code",
">",
"is",
"*",
"or",
"TABLE",
".",
"*",
"expands",
"it",
"and",
"returns",
"true",
";",
"otherwise",
"writes",
"the",
"unexpanded",
"item",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L420-L470 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/TabbedPanel2.java | TabbedPanel2.removeTabAt | @Override
public void removeTabAt(int index) {
"""
Removes the tab at the given index and the corresponding panel.
"""
if (index < 0 || index >= getTabCount()) {
throw new IndexOutOfBoundsException("Index: " + index + ", Tab count: " + getTabCount());
}
Component component = getComponentAt(index);
... | java | @Override
public void removeTabAt(int index) {
if (index < 0 || index >= getTabCount()) {
throw new IndexOutOfBoundsException("Index: " + index + ", Tab count: " + getTabCount());
}
Component component = getComponentAt(index);
super.removeTabAt(index);
if (!(component instanceof AbstractPanel)) {
ret... | [
"@",
"Override",
"public",
"void",
"removeTabAt",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"getTabCount",
"(",
")",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Index: \"",
"+",
"index",
"+",
"\"... | Removes the tab at the given index and the corresponding panel. | [
"Removes",
"the",
"tab",
"at",
"the",
"given",
"index",
"and",
"the",
"corresponding",
"panel",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/TabbedPanel2.java#L483-L497 |
GeoLatte/geolatte-common-hibernate | src/main/java/org/geolatte/common/cql/hibernate/CqlHibernate.java | CqlHibernate.toCriteria | public static DetachedCriteria toCriteria(String cqlExpression, Class forClass) throws ParseException {
"""
Constructs a Hibernate <tt>DetachedCriteria</tt> based on the given CQL expression, for the given class.
Use the <tt>DetachedCriteria.getExecutableCriteria(mySession)</tt> to get an executable <tt>Criteria<... | java | public static DetachedCriteria toCriteria(String cqlExpression, Class forClass) throws ParseException {
try {
Parser p = new Parser( new CqlLexer( new PushbackReader(new StringReader(cqlExpression), 1024)));
// Parse the input.
Start tree = p.parse();
// Build t... | [
"public",
"static",
"DetachedCriteria",
"toCriteria",
"(",
"String",
"cqlExpression",
",",
"Class",
"forClass",
")",
"throws",
"ParseException",
"{",
"try",
"{",
"Parser",
"p",
"=",
"new",
"Parser",
"(",
"new",
"CqlLexer",
"(",
"new",
"PushbackReader",
"(",
"n... | Constructs a Hibernate <tt>DetachedCriteria</tt> based on the given CQL expression, for the given class.
Use the <tt>DetachedCriteria.getExecutableCriteria(mySession)</tt> to get an executable <tt>Criteria<tt>.
@param cqlExpression The CQL expression
@param forClass The class of the objects on which the CQL expression ... | [
"Constructs",
"a",
"Hibernate",
"<tt",
">",
"DetachedCriteria<",
"/",
"tt",
">",
"based",
"on",
"the",
"given",
"CQL",
"expression",
"for",
"the",
"given",
"class",
".",
"Use",
"the",
"<tt",
">",
"DetachedCriteria",
".",
"getExecutableCriteria",
"(",
"mySessio... | train | https://github.com/GeoLatte/geolatte-common-hibernate/blob/2e871c70e506df2485d91152fbd0955c94de1d39/src/main/java/org/geolatte/common/cql/hibernate/CqlHibernate.java#L36-L67 |
spotify/ssh-agent-proxy | src/main/java/com/spotify/sshagentproxy/AgentReplyHeaders.java | AgentReplyHeaders.intFromSubArray | private static int intFromSubArray(final byte[] bytes, final int from, final int to) {
"""
Take a slice of an array of bytes and interpret it as an int.
@param bytes Array of bytes
@param from Start index in the array
@param to End index in the array
@return int
"""
final byte[] subBytes = Arrays.c... | java | private static int intFromSubArray(final byte[] bytes, final int from, final int to) {
final byte[] subBytes = Arrays.copyOfRange(bytes, from, to);
final ByteBuffer wrap = ByteBuffer.wrap(subBytes);
return wrap.getInt();
} | [
"private",
"static",
"int",
"intFromSubArray",
"(",
"final",
"byte",
"[",
"]",
"bytes",
",",
"final",
"int",
"from",
",",
"final",
"int",
"to",
")",
"{",
"final",
"byte",
"[",
"]",
"subBytes",
"=",
"Arrays",
".",
"copyOfRange",
"(",
"bytes",
",",
"from... | Take a slice of an array of bytes and interpret it as an int.
@param bytes Array of bytes
@param from Start index in the array
@param to End index in the array
@return int | [
"Take",
"a",
"slice",
"of",
"an",
"array",
"of",
"bytes",
"and",
"interpret",
"it",
"as",
"an",
"int",
"."
] | train | https://github.com/spotify/ssh-agent-proxy/blob/b678792750c0157bd5ed3fb6a18895ff95effbc4/src/main/java/com/spotify/sshagentproxy/AgentReplyHeaders.java#L83-L87 |
apache/groovy | subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java | SwingGroovyMethods.leftShift | public static TableColumnModel leftShift(TableColumnModel self, TableColumn column) {
"""
Overloads the left shift operator to provide an easy way to add
columns to a TableColumnModel.
@param self a TableColumnModel
@param column a TableColumn to be added to the model.
@return same model, after the value w... | java | public static TableColumnModel leftShift(TableColumnModel self, TableColumn column) {
self.addColumn(column);
return self;
} | [
"public",
"static",
"TableColumnModel",
"leftShift",
"(",
"TableColumnModel",
"self",
",",
"TableColumn",
"column",
")",
"{",
"self",
".",
"addColumn",
"(",
"column",
")",
";",
"return",
"self",
";",
"}"
] | Overloads the left shift operator to provide an easy way to add
columns to a TableColumnModel.
@param self a TableColumnModel
@param column a TableColumn to be added to the model.
@return same model, after the value was added to it.
@since 1.6.4 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"easy",
"way",
"to",
"add",
"columns",
"to",
"a",
"TableColumnModel",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L593-L596 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml5 | public static void escapeHtml5(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform an HTML5 level 2 (result is ASCII) <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will esca... | java | public static void escapeHtml5(final Reader reader, final Writer writer)
throws IOException {
escapeHtml(reader, writer, HtmlEscapeType.HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT);
} | [
"public",
"static",
"void",
"escapeHtml5",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeHtml",
"(",
"reader",
",",
"writer",
",",
"HtmlEscapeType",
".",
"HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL",
","... | <p>
Perform an HTML5 level 2 (result is ASCII) <strong>escape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The five markup-significant characters: <tt><</tt>, <tt>></tt>, <tt>&</tt>,
<tt>"</tt> ... | [
"<p",
">",
"Perform",
"an",
"HTML5",
"level",
"2",
"(",
"result",
"is",
"ASCII",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L637-L641 |
bushidowallet/bushido-java-service | bushido-wallet-service/src/main/java/com/authy/api/Users.java | Users.requestSms | public Hash requestSms(int userId, Map<String, String> options) {
"""
Send token via sms to a user with some options defined.
@param userId
@param options
@return Hash instance with API's response.
"""
String url = "";
try {
url = URLEncoder.encode(Integer.toString(userId), ENCODE);
}
catch(Ex... | java | public Hash requestSms(int userId, Map<String, String> options) {
String url = "";
try {
url = URLEncoder.encode(Integer.toString(userId), ENCODE);
}
catch(Exception e) {
e.printStackTrace();
}
MapToResponse opt = new MapToResponse(options);
String content = this.get(SMS_PATH + url, opt);
... | [
"public",
"Hash",
"requestSms",
"(",
"int",
"userId",
",",
"Map",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"String",
"url",
"=",
"\"\"",
";",
"try",
"{",
"url",
"=",
"URLEncoder",
".",
"encode",
"(",
"Integer",
".",
"toString",
"(",
"u... | Send token via sms to a user with some options defined.
@param userId
@param options
@return Hash instance with API's response. | [
"Send",
"token",
"via",
"sms",
"to",
"a",
"user",
"with",
"some",
"options",
"defined",
"."
] | train | https://github.com/bushidowallet/bushido-java-service/blob/e1a0157527e57459b509718044d2df44084876a2/bushido-wallet-service/src/main/java/com/authy/api/Users.java#L76-L90 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/PrintStreamMonitor.java | PrintStreamMonitor.notifyUpdate | public void notifyUpdate( URL resource, int expected, int count ) {
"""
Notify the monitor of the update in the download status.
@param resource the name of the remote resource being downloaded.
@param expected the expected number of bytes to be downloaded.
@param count the number of bytes downloaded.
... | java | public void notifyUpdate( URL resource, int expected, int count )
{
if( m_first )
{
m_expected = expected;
m_start = System.currentTimeMillis();
m_first = false;
}
int completed = ( count * 100 ) / expected;
m_out.print( resource.toExternal... | [
"public",
"void",
"notifyUpdate",
"(",
"URL",
"resource",
",",
"int",
"expected",
",",
"int",
"count",
")",
"{",
"if",
"(",
"m_first",
")",
"{",
"m_expected",
"=",
"expected",
";",
"m_start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"m_fir... | Notify the monitor of the update in the download status.
@param resource the name of the remote resource being downloaded.
@param expected the expected number of bytes to be downloaded.
@param count the number of bytes downloaded. | [
"Notify",
"the",
"monitor",
"of",
"the",
"update",
"in",
"the",
"download",
"status",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/PrintStreamMonitor.java#L60-L70 |
feedzai/pdb | src/main/java/com/feedzai/commons/sql/abstraction/dml/dialect/SqlBuilder.java | SqlBuilder.alterColumn | public static AlterColumn alterColumn(Expression table, Name column, DbColumnType dbColumnType, DbColumnConstraint... constraints) {
"""
Alter column operator.
@param table The table containing the column.
@param column The column of the table.
@param dbColumnType The db column type.
@param cons... | java | public static AlterColumn alterColumn(Expression table, Name column, DbColumnType dbColumnType, DbColumnConstraint... constraints) {
return alterColumn(
table,
dbColumn().name(column.getName()).type(dbColumnType).addConstraints(constraints).build());
} | [
"public",
"static",
"AlterColumn",
"alterColumn",
"(",
"Expression",
"table",
",",
"Name",
"column",
",",
"DbColumnType",
"dbColumnType",
",",
"DbColumnConstraint",
"...",
"constraints",
")",
"{",
"return",
"alterColumn",
"(",
"table",
",",
"dbColumn",
"(",
")",
... | Alter column operator.
@param table The table containing the column.
@param column The column of the table.
@param dbColumnType The db column type.
@param constraints The constraints of the column.
@return The alter column operator. | [
"Alter",
"column",
"operator",
"."
] | train | https://github.com/feedzai/pdb/blob/fe07ca08417e0ddcd620a36aa1fdbca7f338be98/src/main/java/com/feedzai/commons/sql/abstraction/dml/dialect/SqlBuilder.java#L803-L807 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/Client.java | Client.createApplication | public ApplicationDefinition createApplication(String text, ContentType contentType) {
"""
Create a new application in the connected Doradus server as defined by the given
schema text. The text must be formatted in JSON or XML as defined by the content
type. If the given application already exists, its schema is... | java | public ApplicationDefinition createApplication(String text, ContentType contentType) {
Utils.require(!m_restClient.isClosed(), "Client has been closed");
Utils.require(text != null && text.length() > 0, "text");
Utils.require(contentType != null, "contentType");
Application... | [
"public",
"ApplicationDefinition",
"createApplication",
"(",
"String",
"text",
",",
"ContentType",
"contentType",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"m_restClient",
".",
"isClosed",
"(",
")",
",",
"\"Client has been closed\"",
")",
";",
"Utils",
".",
"... | Create a new application in the connected Doradus server as defined by the given
schema text. The text must be formatted in JSON or XML as defined by the content
type. If the given application already exists, its schema is replaced with the
given definition. The {@link ApplicationDefinition} for the same application is... | [
"Create",
"a",
"new",
"application",
"in",
"the",
"connected",
"Doradus",
"server",
"as",
"defined",
"by",
"the",
"given",
"schema",
"text",
".",
"The",
"text",
"must",
"be",
"formatted",
"in",
"JSON",
"or",
"XML",
"as",
"defined",
"by",
"the",
"content",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/Client.java#L319-L327 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.