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 |
|---|---|---|---|---|---|---|---|---|---|---|
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java | ContentCryptoMaterial.create | static ContentCryptoMaterial create(SecretKey cek, byte[] iv,
EncryptionMaterials kekMaterials,
S3CryptoScheme scheme,
CryptoConfiguration config, AWSKMS kms,
A... | java | static ContentCryptoMaterial create(SecretKey cek, byte[] iv,
EncryptionMaterials kekMaterials,
S3CryptoScheme scheme,
CryptoConfiguration config, AWSKMS kms,
A... | [
"static",
"ContentCryptoMaterial",
"create",
"(",
"SecretKey",
"cek",
",",
"byte",
"[",
"]",
"iv",
",",
"EncryptionMaterials",
"kekMaterials",
",",
"S3CryptoScheme",
"scheme",
",",
"CryptoConfiguration",
"config",
",",
"AWSKMS",
"kms",
",",
"AmazonWebServiceRequest",
... | Returns a new instance of <code>ContentCryptoMaterial</code>
for the input parameters using the specified s3 crypto scheme.
Note network calls are involved if the CEK is to be protected by KMS.
@param cek content encrypting key
@param iv initialization vector
@param kekMaterials kek encryption material used to secure ... | [
"Returns",
"a",
"new",
"instance",
"of",
"<code",
">",
"ContentCryptoMaterial<",
"/",
"code",
">",
"for",
"the",
"input",
"parameters",
"using",
"the",
"specified",
"s3",
"crypto",
"scheme",
".",
"Note",
"network",
"calls",
"are",
"involved",
"if",
"the",
"C... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/ContentCryptoMaterial.java#L768-L775 |
powermock/powermock | powermock-core/src/main/java/org/powermock/core/ClassReplicaCreator.java | ClassReplicaCreator.getReplicaMethodDelegationCode | private String getReplicaMethodDelegationCode(Class<?> clazz, CtMethod ctMethod, String classOrInstanceToDelegateTo)
throws NotFoundException {
"""
/*
Invokes a instance method of the original instance. This enables partial
mocking of system classes.
"""
StringBuilder builder = new String... | java | private String getReplicaMethodDelegationCode(Class<?> clazz, CtMethod ctMethod, String classOrInstanceToDelegateTo)
throws NotFoundException {
StringBuilder builder = new StringBuilder();
builder.append("{java.lang.reflect.Method originalMethod = ");
builder.append(clazz.getName());... | [
"private",
"String",
"getReplicaMethodDelegationCode",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"CtMethod",
"ctMethod",
",",
"String",
"classOrInstanceToDelegateTo",
")",
"throws",
"NotFoundException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(... | /*
Invokes a instance method of the original instance. This enables partial
mocking of system classes. | [
"/",
"*",
"Invokes",
"a",
"instance",
"method",
"of",
"the",
"original",
"instance",
".",
"This",
"enables",
"partial",
"mocking",
"of",
"system",
"classes",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-core/src/main/java/org/powermock/core/ClassReplicaCreator.java#L147-L179 |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/util/CanonicalStore.java | CanonicalStore.retrieveOrCreate | public V retrieveOrCreate(K key, Factory<V> factory) {
"""
Create a value for the given key iff one has not already been stored.
This method is safe to be called concurrently from multiple threads.
It will ensure that only one thread succeeds to create the value for the given key.
@return the created/retrieve... | java | public V retrieveOrCreate(K key, Factory<V> factory) {
// Clean up stale entries on every put.
// This should avoid a slow memory leak of reference objects.
this.cleanUpStaleEntries();
return retrieveOrCreate(key, factory, new FutureRef<V>());
} | [
"public",
"V",
"retrieveOrCreate",
"(",
"K",
"key",
",",
"Factory",
"<",
"V",
">",
"factory",
")",
"{",
"// Clean up stale entries on every put.",
"// This should avoid a slow memory leak of reference objects.",
"this",
".",
"cleanUpStaleEntries",
"(",
")",
";",
"return",... | Create a value for the given key iff one has not already been stored.
This method is safe to be called concurrently from multiple threads.
It will ensure that only one thread succeeds to create the value for the given key.
@return the created/retrieved {@link AppClassLoader} | [
"Create",
"a",
"value",
"for",
"the",
"given",
"key",
"iff",
"one",
"has",
"not",
"already",
"been",
"stored",
".",
"This",
"method",
"is",
"safe",
"to",
"be",
"called",
"concurrently",
"from",
"multiple",
"threads",
".",
"It",
"will",
"ensure",
"that",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/util/CanonicalStore.java#L70-L75 |
windup/windup | utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java | FurnaceClasspathScanner.handleDirectory | private void handleDirectory(final Predicate<String> filter, final File rootDir, final List<String> discoveredFiles) {
"""
Scans given directory for files passing given filter, adds the results into given list.
"""
try
{
new DirectoryWalker<String>()
{
pr... | java | private void handleDirectory(final Predicate<String> filter, final File rootDir, final List<String> discoveredFiles)
{
try
{
new DirectoryWalker<String>()
{
private Path startDir;
public void walk() throws IOException
{
... | [
"private",
"void",
"handleDirectory",
"(",
"final",
"Predicate",
"<",
"String",
">",
"filter",
",",
"final",
"File",
"rootDir",
",",
"final",
"List",
"<",
"String",
">",
"discoveredFiles",
")",
"{",
"try",
"{",
"new",
"DirectoryWalker",
"<",
"String",
">",
... | Scans given directory for files passing given filter, adds the results into given list. | [
"Scans",
"given",
"directory",
"for",
"files",
"passing",
"given",
"filter",
"adds",
"the",
"results",
"into",
"given",
"list",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java#L172-L200 |
joniles/mpxj | src/main/java/net/sf/mpxj/ResourceAssignment.java | ResourceAssignment.setNumber | public void setNumber(int index, Number value) {
"""
Set a number value.
@param index number index (1-20)
@param value number value
"""
set(selectField(AssignmentFieldLists.CUSTOM_NUMBER, index), value);
} | java | public void setNumber(int index, Number value)
{
set(selectField(AssignmentFieldLists.CUSTOM_NUMBER, index), value);
} | [
"public",
"void",
"setNumber",
"(",
"int",
"index",
",",
"Number",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"AssignmentFieldLists",
".",
"CUSTOM_NUMBER",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a number value.
@param index number index (1-20)
@param value number value | [
"Set",
"a",
"number",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1606-L1609 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/PoolWatchThread.java | PoolWatchThread.fillConnections | private void fillConnections(int connectionsToCreate) throws InterruptedException {
"""
Adds new connections to the partition.
@param connectionsToCreate number of connections to create
@throws InterruptedException
"""
try {
for (int i=0; i < connectionsToCreate; i++){
// boolean dbDown = this.poo... | java | private void fillConnections(int connectionsToCreate) throws InterruptedException {
try {
for (int i=0; i < connectionsToCreate; i++){
// boolean dbDown = this.pool.getDbIsDown().get();
if (this.pool.poolShuttingDown){
break;
}
this.partition.addFreeConnection(new ConnectionHandle(null,... | [
"private",
"void",
"fillConnections",
"(",
"int",
"connectionsToCreate",
")",
"throws",
"InterruptedException",
"{",
"try",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"connectionsToCreate",
";",
"i",
"++",
")",
"{",
"//\tboolean dbDown = this.pool.get... | Adds new connections to the partition.
@param connectionsToCreate number of connections to create
@throws InterruptedException | [
"Adds",
"new",
"connections",
"to",
"the",
"partition",
"."
] | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/PoolWatchThread.java#L108-L122 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java | MultipleOutputs.getCollector | @SuppressWarnings( {
"""
Gets the output collector for a named output.
<p/>
@param namedOutput the named output name
@param reporter the reporter
@return the output collector for the given named output
@throws IOException thrown if output collector could not be created
""""unchecked"})
public Outpu... | java | @SuppressWarnings({"unchecked"})
public OutputCollector getCollector(String namedOutput, Reporter reporter)
throws IOException {
return getCollector(namedOutput, null, reporter);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"OutputCollector",
"getCollector",
"(",
"String",
"namedOutput",
",",
"Reporter",
"reporter",
")",
"throws",
"IOException",
"{",
"return",
"getCollector",
"(",
"namedOutput",
",",
"null",
",",... | Gets the output collector for a named output.
<p/>
@param namedOutput the named output name
@param reporter the reporter
@return the output collector for the given named output
@throws IOException thrown if output collector could not be created | [
"Gets",
"the",
"output",
"collector",
"for",
"a",
"named",
"output",
".",
"<p",
"/",
">"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputs.java#L473-L477 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/Sort.java | Sort.swapReferences | private static <T> void swapReferences( T[] arr, int idx1, int idx2 ) {
"""
method to swap elements in an array
@param arr an array of Objects
@param idx1 the index of the first element
@param idx2 the index of the second element
"""
T tmp = arr[idx1];
arr[idx1] = arr[idx2];
arr[id... | java | private static <T> void swapReferences( T[] arr, int idx1, int idx2 )
{
T tmp = arr[idx1];
arr[idx1] = arr[idx2];
arr[idx2] = tmp;
} | [
"private",
"static",
"<",
"T",
">",
"void",
"swapReferences",
"(",
"T",
"[",
"]",
"arr",
",",
"int",
"idx1",
",",
"int",
"idx2",
")",
"{",
"T",
"tmp",
"=",
"arr",
"[",
"idx1",
"]",
";",
"arr",
"[",
"idx1",
"]",
"=",
"arr",
"[",
"idx2",
"]",
"... | method to swap elements in an array
@param arr an array of Objects
@param idx1 the index of the first element
@param idx2 the index of the second element | [
"method",
"to",
"swap",
"elements",
"in",
"an",
"array"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/Sort.java#L194-L199 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java | Indexer.getMetricIterators | public static Collection<IteratorSetting> getMetricIterators(AccumuloTable table) {
"""
Gets a collection of iterator settings that should be added to the metric table for the given Accumulo table. Don't forget! Please!
@param table Table for retrieving metrics iterators, see AccumuloClient#getTable
@return Co... | java | public static Collection<IteratorSetting> getMetricIterators(AccumuloTable table)
{
String cardQualifier = new String(CARDINALITY_CQ);
String rowsFamily = new String(METRICS_TABLE_ROWS_CF.array());
// Build a string for all columns where the summing combiner should be applied,
// i.... | [
"public",
"static",
"Collection",
"<",
"IteratorSetting",
">",
"getMetricIterators",
"(",
"AccumuloTable",
"table",
")",
"{",
"String",
"cardQualifier",
"=",
"new",
"String",
"(",
"CARDINALITY_CQ",
")",
";",
"String",
"rowsFamily",
"=",
"new",
"String",
"(",
"ME... | Gets a collection of iterator settings that should be added to the metric table for the given Accumulo table. Don't forget! Please!
@param table Table for retrieving metrics iterators, see AccumuloClient#getTable
@return Collection of iterator settings | [
"Gets",
"a",
"collection",
"of",
"iterator",
"settings",
"that",
"should",
"be",
"added",
"to",
"the",
"metric",
"table",
"for",
"the",
"given",
"Accumulo",
"table",
".",
"Don",
"t",
"forget!",
"Please!"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java#L363-L388 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java | JobsInner.beginTerminate | public void beginTerminate(String resourceGroupName, String workspaceName, String experimentName, String jobName) {
"""
Terminates a job.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combina... | java | public void beginTerminate(String resourceGroupName, String workspaceName, String experimentName, String jobName) {
beginTerminateWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName, jobName).toBlocking().single().body();
} | [
"public",
"void",
"beginTerminate",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"experimentName",
",",
"String",
"jobName",
")",
"{",
"beginTerminateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workspaceName",
",",
"e... | Terminates a job.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
@par... | [
"Terminates",
"a",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java#L1256-L1258 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/ParameterizedJobMixIn.java | ParameterizedJobMixIn.scheduleBuild2 | public static @CheckForNull Queue.Item scheduleBuild2(final Job<?,?> job, int quietPeriod, Action... actions) {
"""
Convenience method to schedule a build.
Useful for {@link Trigger} implementations, for example.
If you need to wait for the build to start (or finish), use {@link Queue.Item#getFuture}.
@param jo... | java | public static @CheckForNull Queue.Item scheduleBuild2(final Job<?,?> job, int quietPeriod, Action... actions) {
if (!(job instanceof ParameterizedJob)) {
return null;
}
return new ParameterizedJobMixIn() {
@Override protected Job asJob() {
return job;
... | [
"public",
"static",
"@",
"CheckForNull",
"Queue",
".",
"Item",
"scheduleBuild2",
"(",
"final",
"Job",
"<",
"?",
",",
"?",
">",
"job",
",",
"int",
"quietPeriod",
",",
"Action",
"...",
"actions",
")",
"{",
"if",
"(",
"!",
"(",
"job",
"instanceof",
"Param... | Convenience method to schedule a build.
Useful for {@link Trigger} implementations, for example.
If you need to wait for the build to start (or finish), use {@link Queue.Item#getFuture}.
@param job a job which might be schedulable
@param quietPeriod seconds to wait before starting; use {@code -1} to use the job’s defau... | [
"Convenience",
"method",
"to",
"schedule",
"a",
"build",
".",
"Useful",
"for",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/ParameterizedJobMixIn.java#L137-L146 |
google/closure-compiler | src/com/google/javascript/jscomp/graph/FixedPointGraphTraversal.java | FixedPointGraphTraversal.computeFixedPoint | public void computeFixedPoint(DiGraph<N, E> graph, Set<N> entrySet) {
"""
Compute a fixed point for the given graph, entering from the given nodes.
@param graph The graph to traverse.
@param entrySet The nodes to begin traversing from.
"""
int cycleCount = 0;
long nodeCount = graph.getNodeCount();
... | java | public void computeFixedPoint(DiGraph<N, E> graph, Set<N> entrySet) {
int cycleCount = 0;
long nodeCount = graph.getNodeCount();
// Choose a bail-out heuristically in case the computation
// doesn't converge.
long maxIterations = Math.max(nodeCount * nodeCount * nodeCount, 100);
// Use a Linke... | [
"public",
"void",
"computeFixedPoint",
"(",
"DiGraph",
"<",
"N",
",",
"E",
">",
"graph",
",",
"Set",
"<",
"N",
">",
"entrySet",
")",
"{",
"int",
"cycleCount",
"=",
"0",
";",
"long",
"nodeCount",
"=",
"graph",
".",
"getNodeCount",
"(",
")",
";",
"// C... | Compute a fixed point for the given graph, entering from the given nodes.
@param graph The graph to traverse.
@param entrySet The nodes to begin traversing from. | [
"Compute",
"a",
"fixed",
"point",
"for",
"the",
"given",
"graph",
"entering",
"from",
"the",
"given",
"nodes",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/graph/FixedPointGraphTraversal.java#L91-L124 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ClickableIconOverlay.java | ClickableIconOverlay.onLongPress | public boolean onLongPress(final MotionEvent event, final MapView mapView) {
"""
By default does nothing ({@code return false}). If you handled the Event, return {@code true}
, otherwise return {@code false}. If you returned {@code true} none of the following Overlays
or the underlying {@link MapView} has the ch... | java | public boolean onLongPress(final MotionEvent event, final MapView mapView) {
boolean touched = hitTest(event, mapView);
if (touched) {
return onMarkerLongPress(mapView, mId, mPosition, mData);
} else {
return super.onLongPress(event, mapView);
}
} | [
"public",
"boolean",
"onLongPress",
"(",
"final",
"MotionEvent",
"event",
",",
"final",
"MapView",
"mapView",
")",
"{",
"boolean",
"touched",
"=",
"hitTest",
"(",
"event",
",",
"mapView",
")",
";",
"if",
"(",
"touched",
")",
"{",
"return",
"onMarkerLongPress... | By default does nothing ({@code return false}). If you handled the Event, return {@code true}
, otherwise return {@code false}. If you returned {@code true} none of the following Overlays
or the underlying {@link MapView} has the chance to handle this event. | [
"By",
"default",
"does",
"nothing",
"(",
"{"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ClickableIconOverlay.java#L87-L94 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/xml/pom/PomUtils.java | PomUtils.analyzePOM | public static void analyzePOM(Dependency dependency, File pomFile) throws AnalysisException {
"""
Reads in the pom file and adds elements as evidence to the given
dependency.
@param dependency the dependency being analyzed
@param pomFile the pom file to read
@throws AnalysisException is thrown if there is an... | java | public static void analyzePOM(Dependency dependency, File pomFile) throws AnalysisException {
final Model pom = PomUtils.readPom(pomFile);
JarAnalyzer.setPomEvidence(dependency, pom, null, true);
} | [
"public",
"static",
"void",
"analyzePOM",
"(",
"Dependency",
"dependency",
",",
"File",
"pomFile",
")",
"throws",
"AnalysisException",
"{",
"final",
"Model",
"pom",
"=",
"PomUtils",
".",
"readPom",
"(",
"pomFile",
")",
";",
"JarAnalyzer",
".",
"setPomEvidence",
... | Reads in the pom file and adds elements as evidence to the given
dependency.
@param dependency the dependency being analyzed
@param pomFile the pom file to read
@throws AnalysisException is thrown if there is an exception parsing the
pom | [
"Reads",
"in",
"the",
"pom",
"file",
"and",
"adds",
"elements",
"as",
"evidence",
"to",
"the",
"given",
"dependency",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/pom/PomUtils.java#L139-L142 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java | Duration.minus | public Duration minus(Duration duration) {
"""
Returns a copy of this duration with the specified duration subtracted.
<p>
This instance is immutable and unaffected by this method call.
@param duration the duration to subtract, positive or negative, not null
@return a {@code Duration} based on this duration... | java | public Duration minus(Duration duration) {
long secsToSubtract = duration.getSeconds();
int nanosToSubtract = duration.getNano();
if (secsToSubtract == Long.MIN_VALUE) {
return plus(Long.MAX_VALUE, -nanosToSubtract).plus(1, 0);
}
return plus(-secsToSubtract, -nanosToS... | [
"public",
"Duration",
"minus",
"(",
"Duration",
"duration",
")",
"{",
"long",
"secsToSubtract",
"=",
"duration",
".",
"getSeconds",
"(",
")",
";",
"int",
"nanosToSubtract",
"=",
"duration",
".",
"getNano",
"(",
")",
";",
"if",
"(",
"secsToSubtract",
"==",
... | Returns a copy of this duration with the specified duration subtracted.
<p>
This instance is immutable and unaffected by this method call.
@param duration the duration to subtract, positive or negative, not null
@return a {@code Duration} based on this duration with the specified duration subtracted, not null
@throws... | [
"Returns",
"a",
"copy",
"of",
"this",
"duration",
"with",
"the",
"specified",
"duration",
"subtracted",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java#L826-L833 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/table/TableSliceGroup.java | TableSliceGroup.aggregate | @SuppressWarnings( {
"""
Applies the given aggregations to the given columns.
The apply and combine steps of a split-apply-combine.
@param functions map from column name to aggregation to apply on that function
""" "unchecked", "rawtypes" })
public Table aggregate(ListMultimap<String, AggregateFunction... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public Table aggregate(ListMultimap<String, AggregateFunction<?,?>> functions) {
Preconditions.checkArgument(!getSlices().isEmpty());
Table groupTable = summaryTableName(sourceTable);
StringColumn groupColumn = StringColumn.create("Group");
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"Table",
"aggregate",
"(",
"ListMultimap",
"<",
"String",
",",
"AggregateFunction",
"<",
"?",
",",
"?",
">",
">",
"functions",
")",
"{",
"Preconditions",
".",
"check... | Applies the given aggregations to the given columns.
The apply and combine steps of a split-apply-combine.
@param functions map from column name to aggregation to apply on that function | [
"Applies",
"the",
"given",
"aggregations",
"to",
"the",
"given",
"columns",
".",
"The",
"apply",
"and",
"combine",
"steps",
"of",
"a",
"split",
"-",
"apply",
"-",
"combine",
"."
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/table/TableSliceGroup.java#L150-L180 |
VoltDB/voltdb | src/frontend/org/voltcore/messaging/SocketJoiner.java | SocketJoiner.initializeSocket | private SslHandshakeResult initializeSocket(SocketChannel sc, boolean clientMode, List<Long> clockSkews)
throws IOException {
"""
Initialize a new {@link SocketChannel} either as a client or server
@return {@link SslHandshakeResult} instance. Never {@code null}
"""
ByteBuffer timeBuffer ... | java | private SslHandshakeResult initializeSocket(SocketChannel sc, boolean clientMode, List<Long> clockSkews)
throws IOException {
ByteBuffer timeBuffer = ByteBuffer.allocate(Long.BYTES);
if (clientMode) {
synchronized (sc.blockingLock()) {
boolean isBlocking = sc.isBl... | [
"private",
"SslHandshakeResult",
"initializeSocket",
"(",
"SocketChannel",
"sc",
",",
"boolean",
"clientMode",
",",
"List",
"<",
"Long",
">",
"clockSkews",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"timeBuffer",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"Lon... | Initialize a new {@link SocketChannel} either as a client or server
@return {@link SslHandshakeResult} instance. Never {@code null} | [
"Initialize",
"a",
"new",
"{",
"@link",
"SocketChannel",
"}",
"either",
"as",
"a",
"client",
"or",
"server"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/SocketJoiner.java#L440-L464 |
recommenders/rival | rival-examples/src/main/java/net/recommenders/rival/examples/movielens100k/IterativeCrossValidatedMahoutKNNRecommenderEvaluator.java | IterativeCrossValidatedMahoutKNNRecommenderEvaluator.prepareSplits | public static void prepareSplits(final String url, final int nFolds, final String inFile, final String folder, final String outPath) {
"""
Downloads a dataset and stores the splits generated from it.
@param url url where dataset can be downloaded from
@param nFolds number of folds
@param inFile file to be use... | java | public static void prepareSplits(final String url, final int nFolds, final String inFile, final String folder, final String outPath) {
DataDownloader dd = new DataDownloader(url, folder);
dd.downloadAndUnzip();
boolean perUser = true;
long seed = SEED;
Parser<Long, Long> parser ... | [
"public",
"static",
"void",
"prepareSplits",
"(",
"final",
"String",
"url",
",",
"final",
"int",
"nFolds",
",",
"final",
"String",
"inFile",
",",
"final",
"String",
"folder",
",",
"final",
"String",
"outPath",
")",
"{",
"DataDownloader",
"dd",
"=",
"new",
... | Downloads a dataset and stores the splits generated from it.
@param url url where dataset can be downloaded from
@param nFolds number of folds
@param inFile file to be used once the dataset has been downloaded
@param folder folder where dataset will be stored
@param outPath path where the splits will be stored | [
"Downloads",
"a",
"dataset",
"and",
"stores",
"the",
"splits",
"generated",
"from",
"it",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-examples/src/main/java/net/recommenders/rival/examples/movielens100k/IterativeCrossValidatedMahoutKNNRecommenderEvaluator.java#L117-L141 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntityManagerImpl.java | ExecutionEntityManagerImpl.createChildExecution | @Override
public ExecutionEntity createChildExecution(ExecutionEntity parentExecutionEntity) {
"""
Creates a new execution. properties processDefinition, processInstance and activity will be initialized.
"""
ExecutionEntity childExecution = executionDataManager.create();
inheritCommonProperties(paren... | java | @Override
public ExecutionEntity createChildExecution(ExecutionEntity parentExecutionEntity) {
ExecutionEntity childExecution = executionDataManager.create();
inheritCommonProperties(parentExecutionEntity, childExecution);
childExecution.setParent(parentExecutionEntity);
childExecution.setProcessDefin... | [
"@",
"Override",
"public",
"ExecutionEntity",
"createChildExecution",
"(",
"ExecutionEntity",
"parentExecutionEntity",
")",
"{",
"ExecutionEntity",
"childExecution",
"=",
"executionDataManager",
".",
"create",
"(",
")",
";",
"inheritCommonProperties",
"(",
"parentExecutionE... | Creates a new execution. properties processDefinition, processInstance and activity will be initialized. | [
"Creates",
"a",
"new",
"execution",
".",
"properties",
"processDefinition",
"processInstance",
"and",
"activity",
"will",
"be",
"initialized",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntityManagerImpl.java#L258-L286 |
crawljax/crawljax | core/src/main/java/com/crawljax/util/UrlUtils.java | UrlUtils.getVarFromQueryString | public static String getVarFromQueryString(String varName, String haystack) {
"""
Retrieve the var value for varName from a HTTP query string (format is
"var1=val1&var2=val2").
@param varName the name.
@param haystack the haystack.
@return variable value for varName
"""
if (haystack == null || hay... | java | public static String getVarFromQueryString(String varName, String haystack) {
if (haystack == null || haystack.length() == 0) {
return null;
}
String modifiedHaystack = haystack;
if (modifiedHaystack.charAt(0) == '?') {
modifiedHaystack = modifiedHaystack.substring(1);
}
String[] vars = modifiedHays... | [
"public",
"static",
"String",
"getVarFromQueryString",
"(",
"String",
"varName",
",",
"String",
"haystack",
")",
"{",
"if",
"(",
"haystack",
"==",
"null",
"||",
"haystack",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"String... | Retrieve the var value for varName from a HTTP query string (format is
"var1=val1&var2=val2").
@param varName the name.
@param haystack the haystack.
@return variable value for varName | [
"Retrieve",
"the",
"var",
"value",
"for",
"varName",
"from",
"a",
"HTTP",
"query",
"string",
"(",
"format",
"is",
"var1",
"=",
"val1&",
";",
"var2",
"=",
"val2",
")",
"."
] | train | https://github.com/crawljax/crawljax/blob/d339f4f622ca902ccd35322065821e52a62ec543/core/src/main/java/com/crawljax/util/UrlUtils.java#L58-L77 |
auth0/auth0-java | src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java | AuthorizeUrlBuilder.withParameter | public AuthorizeUrlBuilder withParameter(String name, String value) {
"""
Sets an additional parameter.
@param name name of the parameter
@param value value of the parameter to set
@return the builder instance
"""
assertNotNull(name, "name");
assertNotNull(value, "value");
paramet... | java | public AuthorizeUrlBuilder withParameter(String name, String value) {
assertNotNull(name, "name");
assertNotNull(value, "value");
parameters.put(name, value);
return this;
} | [
"public",
"AuthorizeUrlBuilder",
"withParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"assertNotNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"assertNotNull",
"(",
"value",
",",
"\"value\"",
")",
";",
"parameters",
".",
"put",
"(",
"nam... | Sets an additional parameter.
@param name name of the parameter
@param value value of the parameter to set
@return the builder instance | [
"Sets",
"an",
"additional",
"parameter",
"."
] | train | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java#L111-L116 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionRangeConfig.java | CollisionRangeConfig.exports | public static void exports(Xml root, CollisionRange range) {
"""
Export the collision range as a node.
@param root The node root (must not be <code>null</code>).
@param range The collision range to export (must not be <code>null</code>).
@throws LionEngineException If error on writing.
"""
Check.... | java | public static void exports(Xml root, CollisionRange range)
{
Check.notNull(root);
Check.notNull(range);
final Xml node = root.createChild(NODE_RANGE);
node.writeString(ATT_AXIS, range.getOutput().name());
node.writeInteger(ATT_MIN_X, range.getMinX());
node.wr... | [
"public",
"static",
"void",
"exports",
"(",
"Xml",
"root",
",",
"CollisionRange",
"range",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"Check",
".",
"notNull",
"(",
"range",
")",
";",
"final",
"Xml",
"node",
"=",
"root",
".",
"createChild... | Export the collision range as a node.
@param root The node root (must not be <code>null</code>).
@param range The collision range to export (must not be <code>null</code>).
@throws LionEngineException If error on writing. | [
"Export",
"the",
"collision",
"range",
"as",
"a",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionRangeConfig.java#L86-L97 |
StripesFramework/stripes-stuff | src/main/java/org/stripesstuff/plugin/security/J2EESecurityManager.java | J2EESecurityManager.isUserAuthenticated | protected Boolean isUserAuthenticated(ActionBean bean, Method handler) {
"""
Determine if the user is authenticated. The default implementation is to use {@code getUserPrincipal() != null}
on the HttpServletRequest in the ActionBeanContext.
@param bean the current action bean; used for security decisions
@... | java | protected Boolean isUserAuthenticated(ActionBean bean, Method handler)
{
return bean.getContext().getRequest().getUserPrincipal() != null;
} | [
"protected",
"Boolean",
"isUserAuthenticated",
"(",
"ActionBean",
"bean",
",",
"Method",
"handler",
")",
"{",
"return",
"bean",
".",
"getContext",
"(",
")",
".",
"getRequest",
"(",
")",
".",
"getUserPrincipal",
"(",
")",
"!=",
"null",
";",
"}"
] | Determine if the user is authenticated. The default implementation is to use {@code getUserPrincipal() != null}
on the HttpServletRequest in the ActionBeanContext.
@param bean the current action bean; used for security decisions
@param handler the current event handler; used for security decisions
@return {@link Bo... | [
"Determine",
"if",
"the",
"user",
"is",
"authenticated",
".",
"The",
"default",
"implementation",
"is",
"to",
"use",
"{",
"@code",
"getUserPrincipal",
"()",
"!",
"=",
"null",
"}",
"on",
"the",
"HttpServletRequest",
"in",
"the",
"ActionBeanContext",
"."
] | train | https://github.com/StripesFramework/stripes-stuff/blob/51ad92b4bd5862ba34d7c18c5829fb00ea3a3811/src/main/java/org/stripesstuff/plugin/security/J2EESecurityManager.java#L149-L152 |
icode/ameba | src/main/java/ameba/db/ebean/support/ModelResourceStructure.java | ModelResourceStructure.findByIds | public Response findByIds(@NotNull @PathParam("ids") URI_ID id,
@NotNull @PathParam("ids") final PathSegment ids,
@QueryParam("include_deleted") final boolean includeDeleted) throws Exception {
"""
Find a model or model list given its Ids.
@param id ... | java | public Response findByIds(@NotNull @PathParam("ids") URI_ID id,
@NotNull @PathParam("ids") final PathSegment ids,
@QueryParam("include_deleted") final boolean includeDeleted) throws Exception {
final Query<MODEL> query = server.find(modelType);
... | [
"public",
"Response",
"findByIds",
"(",
"@",
"NotNull",
"@",
"PathParam",
"(",
"\"ids\"",
")",
"URI_ID",
"id",
",",
"@",
"NotNull",
"@",
"PathParam",
"(",
"\"ids\"",
")",
"final",
"PathSegment",
"ids",
",",
"@",
"QueryParam",
"(",
"\"include_deleted\"",
")",... | Find a model or model list given its Ids.
@param id The id use for path matching type
@param ids the id of the model.
@param includeDeleted a boolean.
@return a {@link javax.ws.rs.core.Response} object.
@throws java.lang.Exception if any.
@see javax.ws.rs.GET
@see AbstractModelResource#findByIds | [
"Find",
"a",
"model",
"or",
"model",
"list",
"given",
"its",
"Ids",
"."
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/support/ModelResourceStructure.java#L552-L591 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BreakIterator.java | BreakIterator.registerInstance | public static Object registerInstance(BreakIterator iter, Locale locale, int kind) {
"""
<strong>[icu]</strong> Registers a new break iterator of the indicated kind, to use in the given
locale. Clones of the iterator will be returned if a request for a break iterator
of the given kind matches or falls back to t... | java | public static Object registerInstance(BreakIterator iter, Locale locale, int kind) {
return registerInstance(iter, ULocale.forLocale(locale), kind);
} | [
"public",
"static",
"Object",
"registerInstance",
"(",
"BreakIterator",
"iter",
",",
"Locale",
"locale",
",",
"int",
"kind",
")",
"{",
"return",
"registerInstance",
"(",
"iter",
",",
"ULocale",
".",
"forLocale",
"(",
"locale",
")",
",",
"kind",
")",
";",
"... | <strong>[icu]</strong> Registers a new break iterator of the indicated kind, to use in the given
locale. Clones of the iterator will be returned if a request for a break iterator
of the given kind matches or falls back to this locale.
<p>Because ICU may choose to cache BreakIterator objects internally, this must
be c... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Registers",
"a",
"new",
"break",
"iterator",
"of",
"the",
"indicated",
"kind",
"to",
"use",
"in",
"the",
"given",
"locale",
".",
"Clones",
"of",
"the",
"iterator",
"will",
"be",
"returned",
"if... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BreakIterator.java#L729-L731 |
alkacon/opencms-core | src/org/opencms/cache/CmsVfsDiskCache.java | CmsVfsDiskCache.getCacheName | public String getCacheName(boolean online, String rootPath, String parameters) {
"""
Returns the RFS name to use for caching the given VFS resource with parameters in the disk cache.<p>
@param online if true, the online disk cache is used, the offline disk cache otherwise
@param rootPath the VFS resource root ... | java | public String getCacheName(boolean online, String rootPath, String parameters) {
String rfsName = CmsFileUtil.getRepositoryName(m_rfsRepository, rootPath, online);
if (CmsStringUtil.isNotEmpty(parameters)) {
String extension = CmsFileUtil.getExtension(rfsName);
// build the RFS ... | [
"public",
"String",
"getCacheName",
"(",
"boolean",
"online",
",",
"String",
"rootPath",
",",
"String",
"parameters",
")",
"{",
"String",
"rfsName",
"=",
"CmsFileUtil",
".",
"getRepositoryName",
"(",
"m_rfsRepository",
",",
"rootPath",
",",
"online",
")",
";",
... | Returns the RFS name to use for caching the given VFS resource with parameters in the disk cache.<p>
@param online if true, the online disk cache is used, the offline disk cache otherwise
@param rootPath the VFS resource root path to get the RFS cache name for
@param parameters the parameters of the request to the VFS... | [
"Returns",
"the",
"RFS",
"name",
"to",
"use",
"for",
"caching",
"the",
"given",
"VFS",
"resource",
"with",
"parameters",
"in",
"the",
"disk",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cache/CmsVfsDiskCache.java#L124-L134 |
google/closure-compiler | src/com/google/javascript/jscomp/RenameProperties.java | RenameProperties.generateNames | private void generateNames(Set<Property> props, Set<String> reservedNames) {
"""
Generates new names for properties.
@param props Properties to generate new names for
@param reservedNames A set of names to which properties should not be
renamed
"""
nameGenerator.reset(reservedNames, "", reservedFirstC... | java | private void generateNames(Set<Property> props, Set<String> reservedNames) {
nameGenerator.reset(reservedNames, "", reservedFirstCharacters, reservedNonFirstCharacters);
for (Property p : props) {
if (generatePseudoNames) {
p.newName = "$" + p.oldName + "$";
} else {
// If we haven't... | [
"private",
"void",
"generateNames",
"(",
"Set",
"<",
"Property",
">",
"props",
",",
"Set",
"<",
"String",
">",
"reservedNames",
")",
"{",
"nameGenerator",
".",
"reset",
"(",
"reservedNames",
",",
"\"\"",
",",
"reservedFirstCharacters",
",",
"reservedNonFirstChar... | Generates new names for properties.
@param props Properties to generate new names for
@param reservedNames A set of names to which properties should not be
renamed | [
"Generates",
"new",
"names",
"for",
"properties",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RenameProperties.java#L293-L306 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java | Configuration.getProperty | public String getProperty(String category, String key, String defaultValue) {
"""
Gets a property
@param category The category in which the property is
@param key The key of the property
@param defaultValue If the property couldn't be found, this will be returned
@return The value associated wit... | java | public String getProperty(String category, String key, String defaultValue) {
category = (this.compressedSpaces ? category.replaceAll("\\s+", " ") : category).trim();
if (Strings.isNullOrEmpty(category)) category = "Main";
key = (this.compressedSpaces ? key.replaceAll("\\s+", " ") : key).trim().replace(" ", "_");... | [
"public",
"String",
"getProperty",
"(",
"String",
"category",
",",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"category",
"=",
"(",
"this",
".",
"compressedSpaces",
"?",
"category",
".",
"replaceAll",
"(",
"\"\\\\s+\"",
",",
"\" \"",
")",
":",... | Gets a property
@param category The category in which the property is
@param key The key of the property
@param defaultValue If the property couldn't be found, this will be returned
@return The value associated with {@code key} in {@code category}, or {@code defaultValue} if not found | [
"Gets",
"a",
"property"
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java#L298-L307 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/loader/entity/impl/BatchingEntityLoaderBuilder.java | BatchingEntityLoaderBuilder.buildLoader | public UniqueEntityLoader buildLoader(
OuterJoinLoadable persister,
int batchSize,
LockMode lockMode,
SessionFactoryImplementor factory,
LoadQueryInfluencers influencers,
BatchableEntityLoaderBuilder innerEntityLoaderBuilder) {
"""
Builds a batch-fetch capable loader based on the given persister,... | java | public UniqueEntityLoader buildLoader(
OuterJoinLoadable persister,
int batchSize,
LockMode lockMode,
SessionFactoryImplementor factory,
LoadQueryInfluencers influencers,
BatchableEntityLoaderBuilder innerEntityLoaderBuilder) {
if ( batchSize <= 1 ) {
// no batching
return buildNonBatchingLoad... | [
"public",
"UniqueEntityLoader",
"buildLoader",
"(",
"OuterJoinLoadable",
"persister",
",",
"int",
"batchSize",
",",
"LockMode",
"lockMode",
",",
"SessionFactoryImplementor",
"factory",
",",
"LoadQueryInfluencers",
"influencers",
",",
"BatchableEntityLoaderBuilder",
"innerEnti... | Builds a batch-fetch capable loader based on the given persister, lock-mode, etc.
@param persister The entity persister
@param batchSize The maximum number of ids to batch-fetch at once
@param lockMode The lock mode
@param factory The SessionFactory
@param influencers Any influencers that should affect the built query... | [
"Builds",
"a",
"batch",
"-",
"fetch",
"capable",
"loader",
"based",
"on",
"the",
"given",
"persister",
"lock",
"-",
"mode",
"etc",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/loader/entity/impl/BatchingEntityLoaderBuilder.java#L89-L101 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/SparseHashMatrix.java | SparseHashMatrix.checkIndices | private void checkIndices(int row, int col) {
"""
Checks that the indices are within the bounds of this matrix or throws an
{@link IndexOutOfBoundsException} if not.
"""
if (row < 0 || col < 0 || row >= rows || col >= columns) {
throw new IndexOutOfBoundsException();
}
} | java | private void checkIndices(int row, int col) {
if (row < 0 || col < 0 || row >= rows || col >= columns) {
throw new IndexOutOfBoundsException();
}
} | [
"private",
"void",
"checkIndices",
"(",
"int",
"row",
",",
"int",
"col",
")",
"{",
"if",
"(",
"row",
"<",
"0",
"||",
"col",
"<",
"0",
"||",
"row",
">=",
"rows",
"||",
"col",
">=",
"columns",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",... | Checks that the indices are within the bounds of this matrix or throws an
{@link IndexOutOfBoundsException} if not. | [
"Checks",
"that",
"the",
"indices",
"are",
"within",
"the",
"bounds",
"of",
"this",
"matrix",
"or",
"throws",
"an",
"{"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/SparseHashMatrix.java#L78-L82 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/actions/FindBugsAction.java | FindBugsAction.work | protected void work(IWorkbenchPart part, final IResource resource, final List<WorkItem> resources) {
"""
Run a FindBugs analysis on the given resource, displaying a progress
monitor.
@param part
@param resources
The resource to run the analysis on.
"""
FindBugsJob runFindBugs = new StartedFromV... | java | protected void work(IWorkbenchPart part, final IResource resource, final List<WorkItem> resources) {
FindBugsJob runFindBugs = new StartedFromViewJob("Finding bugs in " + resource.getName() + "...", resource, resources, part);
runFindBugs.scheduleInteractive();
} | [
"protected",
"void",
"work",
"(",
"IWorkbenchPart",
"part",
",",
"final",
"IResource",
"resource",
",",
"final",
"List",
"<",
"WorkItem",
">",
"resources",
")",
"{",
"FindBugsJob",
"runFindBugs",
"=",
"new",
"StartedFromViewJob",
"(",
"\"Finding bugs in \"",
"+",
... | Run a FindBugs analysis on the given resource, displaying a progress
monitor.
@param part
@param resources
The resource to run the analysis on. | [
"Run",
"a",
"FindBugs",
"analysis",
"on",
"the",
"given",
"resource",
"displaying",
"a",
"progress",
"monitor",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/FindBugsAction.java#L167-L170 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerAccountUrl.java | CustomerAccountUrl.getCustomersPurchaseOrderAccountsUrl | public static MozuUrl getCustomersPurchaseOrderAccountsUrl(String accountType, Integer pageSize, String responseFields, String sortBy, Integer startIndex) {
"""
Get Resource Url for GetCustomersPurchaseOrderAccounts
@param accountType
@param pageSize When creating paged results from a query, this value indicates... | java | public static MozuUrl getCustomersPurchaseOrderAccountsUrl(String accountType, Integer pageSize, String responseFields, String sortBy, Integer startIndex)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/purchaseOrderAccounts?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&a... | [
"public",
"static",
"MozuUrl",
"getCustomersPurchaseOrderAccountsUrl",
"(",
"String",
"accountType",
",",
"Integer",
"pageSize",
",",
"String",
"responseFields",
",",
"String",
"sortBy",
",",
"Integer",
"startIndex",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
... | Get Resource Url for GetCustomersPurchaseOrderAccounts
@param accountType
@param pageSize When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with this parameter set to 25, to get the 51st through the 75th items,... | [
"Get",
"Resource",
"Url",
"for",
"GetCustomersPurchaseOrderAccounts"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerAccountUrl.java#L235-L244 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanO.java | StatefulBeanO.updateFailoverEntry | public void updateFailoverEntry(byte[] beanData, long lastAccessTime) throws RemoteException //LIDB2018 {
"""
Update failover entry for this SFSB with the replicated data for this SFSB
and indicate SFSB status is passivated.
@param beanData is the replicated data for this SFSB.
@param lastAccessTime is the la... | java | public void updateFailoverEntry(byte[] beanData, long lastAccessTime) throws RemoteException //LIDB2018
{
try {
// Note, updating failover entry for a SFSB only occurs when
// the bean is passivated. Therefore, the updateEntry
// method implicitly sets the passivated fla... | [
"public",
"void",
"updateFailoverEntry",
"(",
"byte",
"[",
"]",
"beanData",
",",
"long",
"lastAccessTime",
")",
"throws",
"RemoteException",
"//LIDB2018",
"{",
"try",
"{",
"// Note, updating failover entry for a SFSB only occurs when",
"// the bean is passivated. Therefore, th... | Update failover entry for this SFSB with the replicated data for this SFSB
and indicate SFSB status is passivated.
@param beanData is the replicated data for this SFSB.
@param lastAccessTime is the last access time for this SFSB. | [
"Update",
"failover",
"entry",
"for",
"this",
"SFSB",
"with",
"the",
"replicated",
"data",
"for",
"this",
"SFSB",
"and",
"indicate",
"SFSB",
"status",
"is",
"passivated",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanO.java#L1718-L1729 |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/session/AbstractSession.java | AbstractSession.executeSendCommand | protected Command executeSendCommand(SendCommandTask task, long timeout)
throws PDUException, ResponseTimeoutException,
InvalidResponseException, NegativeResponseException, IOException {
"""
Execute send command command task.
@param task is the task.
@param timeout is the timeout in mil... | java | protected Command executeSendCommand(SendCommandTask task, long timeout)
throws PDUException, ResponseTimeoutException,
InvalidResponseException, NegativeResponseException, IOException {
int seqNum = sequence.nextValue();
PendingResponse<Command> pendingResp = new PendingRespons... | [
"protected",
"Command",
"executeSendCommand",
"(",
"SendCommandTask",
"task",
",",
"long",
"timeout",
")",
"throws",
"PDUException",
",",
"ResponseTimeoutException",
",",
"InvalidResponseException",
",",
"NegativeResponseException",
",",
"IOException",
"{",
"int",
"seqNum... | Execute send command command task.
@param task is the task.
@param timeout is the timeout in millisecond.
@return the command response.
@throws PDUException if there is invalid PDU parameter found.
@throws ResponseTimeoutException if the response has reach it timeout.
@throws InvalidResponseException if invalid respon... | [
"Execute",
"send",
"command",
"command",
"task",
"."
] | train | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/session/AbstractSession.java#L269-L307 |
alkacon/opencms-core | src/org/opencms/db/CmsUserSettings.java | CmsUserSettings.getAdditionalPreference | public String getAdditionalPreference(String name, boolean useDefault) {
"""
Gets the value for a user defined preference.<p>
@param name the name of the preference
@param useDefault true if the default value should be returned in case the preference is not set
@return the preference value
"""
... | java | public String getAdditionalPreference(String name, boolean useDefault) {
String value = m_additionalPreferences.get(name);
if ((value == null) && useDefault) {
I_CmsPreference pref = OpenCms.getWorkplaceManager().getDefaultUserSettings().getPreferences().get(name);
if (pref != n... | [
"public",
"String",
"getAdditionalPreference",
"(",
"String",
"name",
",",
"boolean",
"useDefault",
")",
"{",
"String",
"value",
"=",
"m_additionalPreferences",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"(",
"value",
"==",
"null",
")",
"&&",
"useDefault"... | Gets the value for a user defined preference.<p>
@param name the name of the preference
@param useDefault true if the default value should be returned in case the preference is not set
@return the preference value | [
"Gets",
"the",
"value",
"for",
"a",
"user",
"defined",
"preference",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsUserSettings.java#L489-L499 |
alkacon/opencms-core | src/org/opencms/security/CmsOrgUnitManager.java | CmsOrgUnitManager.writeOrganizationalUnit | public void writeOrganizationalUnit(CmsObject cms, CmsOrganizationalUnit organizationalUnit) throws CmsException {
"""
Writes an already existing organizational unit.<p>
The organizational unit has to be a valid OpenCms organizational unit.<br>
The organizational unit will be completely overridden by the giv... | java | public void writeOrganizationalUnit(CmsObject cms, CmsOrganizationalUnit organizationalUnit) throws CmsException {
m_securityManager.writeOrganizationalUnit(cms.getRequestContext(), organizationalUnit);
} | [
"public",
"void",
"writeOrganizationalUnit",
"(",
"CmsObject",
"cms",
",",
"CmsOrganizationalUnit",
"organizationalUnit",
")",
"throws",
"CmsException",
"{",
"m_securityManager",
".",
"writeOrganizationalUnit",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
",",
"organ... | Writes an already existing organizational unit.<p>
The organizational unit has to be a valid OpenCms organizational unit.<br>
The organizational unit will be completely overridden by the given data.<p>
@param cms the opencms context
@param organizationalUnit the organizational unit that should be written
@throws Cm... | [
"Writes",
"an",
"already",
"existing",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsOrgUnitManager.java#L375-L378 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java | BridgeUtils.createPropertyControlDataObject | protected void createPropertyControlDataObject(Root inputRootDataObject, String inputProperty) {
"""
Create a DataObject for the property request.
@param inputRootDataObject The root DataObject.
@param inputProperty The property to request
@pre inputRootDataObject != null
@pre inputProperty != null
@pre i... | java | protected void createPropertyControlDataObject(Root inputRootDataObject, String inputProperty) {
// use the root DataGraph to create a PropertyControl DataGraph
List<Control> propertyControls = inputRootDataObject.getControls();
PropertyControl propCtrl = null;
if (propertyControls != nu... | [
"protected",
"void",
"createPropertyControlDataObject",
"(",
"Root",
"inputRootDataObject",
",",
"String",
"inputProperty",
")",
"{",
"// use the root DataGraph to create a PropertyControl DataGraph",
"List",
"<",
"Control",
">",
"propertyControls",
"=",
"inputRootDataObject",
... | Create a DataObject for the property request.
@param inputRootDataObject The root DataObject.
@param inputProperty The property to request
@pre inputRootDataObject != null
@pre inputProperty != null
@pre inputProperty != "" | [
"Create",
"a",
"DataObject",
"for",
"the",
"property",
"request",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java#L370-L382 |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java | TwoColumnTable.get | @Nullable
public ByteIterable get(@NotNull final Transaction txn, @NotNull final ByteIterable first) {
"""
Search for the first entry in the first database. Use this method for databases configured with no duplicates.
@param txn enclosing transaction
@param first first key.
@return null if no entry foun... | java | @Nullable
public ByteIterable get(@NotNull final Transaction txn, @NotNull final ByteIterable first) {
return this.first.get(txn, first);
} | [
"@",
"Nullable",
"public",
"ByteIterable",
"get",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"final",
"ByteIterable",
"first",
")",
"{",
"return",
"this",
".",
"first",
".",
"get",
"(",
"txn",
",",
"first",
")",
";",
"}"
] | Search for the first entry in the first database. Use this method for databases configured with no duplicates.
@param txn enclosing transaction
@param first first key.
@return null if no entry found, otherwise the value. | [
"Search",
"for",
"the",
"first",
"entry",
"in",
"the",
"first",
"database",
".",
"Use",
"this",
"method",
"for",
"databases",
"configured",
"with",
"no",
"duplicates",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/tables/TwoColumnTable.java#L54-L57 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/context/ContextHolder.java | ContextHolder.getInstance | public static synchronized ContextHolder getInstance() {
"""
Singleton pattern
@return the instance for the context holder.
"""
if (INSTANCE == null) {
Properties props = new Properties();
try {
props.load(new ClassPathResource("/cudafunctions.properties", Co... | java | public static synchronized ContextHolder getInstance() {
if (INSTANCE == null) {
Properties props = new Properties();
try {
props.load(new ClassPathResource("/cudafunctions.properties", ContextHolder.class.getClassLoader()).getInputStream());
} catch (IOExcep... | [
"public",
"static",
"synchronized",
"ContextHolder",
"getInstance",
"(",
")",
"{",
"if",
"(",
"INSTANCE",
"==",
"null",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"{",
"props",
".",
"load",
"(",
"new",
"ClassPathResour... | Singleton pattern
@return the instance for the context holder. | [
"Singleton",
"pattern"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/context/ContextHolder.java#L63-L86 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.addLocalVariable | public LocalVariableInfo addLocalVariable(String typeQualifiedName, String name) {
"""
Add a local variable in the current context.
@param typeQualifiedName The type of the variable
@param name The name of the variable
@return {@link LocalVariableInfo} for the added variable
"""
return contextLayers.g... | java | public LocalVariableInfo addLocalVariable(String typeQualifiedName, String name) {
return contextLayers.getFirst().addLocalVariable(typeQualifiedName, name);
} | [
"public",
"LocalVariableInfo",
"addLocalVariable",
"(",
"String",
"typeQualifiedName",
",",
"String",
"name",
")",
"{",
"return",
"contextLayers",
".",
"getFirst",
"(",
")",
".",
"addLocalVariable",
"(",
"typeQualifiedName",
",",
"name",
")",
";",
"}"
] | Add a local variable in the current context.
@param typeQualifiedName The type of the variable
@param name The name of the variable
@return {@link LocalVariableInfo} for the added variable | [
"Add",
"a",
"local",
"variable",
"in",
"the",
"current",
"context",
"."
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L117-L119 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolActivitiesInner.java | ElasticPoolActivitiesInner.listByElasticPoolAsync | public Observable<List<ElasticPoolActivityInner>> listByElasticPoolAsync(String resourceGroupName, String serverName, String elasticPoolName) {
"""
Returns elastic pool activities.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resour... | java | public Observable<List<ElasticPoolActivityInner>> listByElasticPoolAsync(String resourceGroupName, String serverName, String elasticPoolName) {
return listByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).map(new Func1<ServiceResponse<List<ElasticPoolActivityInner>>, List<Ela... | [
"public",
"Observable",
"<",
"List",
"<",
"ElasticPoolActivityInner",
">",
">",
"listByElasticPoolAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"elasticPoolName",
")",
"{",
"return",
"listByElasticPoolWithServiceResponseAsync",
"(... | Returns elastic pool activities.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param elasticPoolName The name of the elastic pool for which to get the current ac... | [
"Returns",
"elastic",
"pool",
"activities",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolActivitiesInner.java#L99-L106 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/RTPBridge.java | RTPBridge.relaySession | @SuppressWarnings("deprecation")
public static RTPBridge relaySession(XMPPConnection connection, String sessionID, String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate) throws NotConnectedException, InterruptedException {
"""
Check if the server support RTPBridge Service.
@param... | java | @SuppressWarnings("deprecation")
public static RTPBridge relaySession(XMPPConnection connection, String sessionID, String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate) throws NotConnectedException, InterruptedException {
if (!connection.isConnected()) {
return null... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"RTPBridge",
"relaySession",
"(",
"XMPPConnection",
"connection",
",",
"String",
"sessionID",
",",
"String",
"pass",
",",
"TransportCandidate",
"proxyCandidate",
",",
"TransportCandidate",
"localC... | Check if the server support RTPBridge Service.
@param connection
@return the RTPBridge
@throws NotConnectedException
@throws InterruptedException | [
"Check",
"if",
"the",
"server",
"support",
"RTPBridge",
"Service",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/RTPBridge.java#L467-L494 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatioTemporal/paths/TrajectoryEnvelope.java | TrajectoryEnvelope.setTrajectory | public void setTrajectory(Trajectory traj) {
"""
Set the {@link Trajectory} of this {@link TrajectoryEnvelope}.
@param traj The {@link Trajectory} of this {@link TrajectoryEnvelope}.
"""
if (this.footprint == null) {
throw new NoFootprintException("No footprint set for " + this + ", please specify one be... | java | public void setTrajectory(Trajectory traj) {
if (this.footprint == null) {
throw new NoFootprintException("No footprint set for " + this + ", please specify one before setting the trajecotry.");
}
else{
createOuterEnvelope(traj);
}
if(this.innerFootprint != null){
createInnerEnvelope(traj);
}
} | [
"public",
"void",
"setTrajectory",
"(",
"Trajectory",
"traj",
")",
"{",
"if",
"(",
"this",
".",
"footprint",
"==",
"null",
")",
"{",
"throw",
"new",
"NoFootprintException",
"(",
"\"No footprint set for \"",
"+",
"this",
"+",
"\", please specify one before setting th... | Set the {@link Trajectory} of this {@link TrajectoryEnvelope}.
@param traj The {@link Trajectory} of this {@link TrajectoryEnvelope}. | [
"Set",
"the",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatioTemporal/paths/TrajectoryEnvelope.java#L761-L772 |
jenkinsci/jenkins | core/src/main/java/jenkins/util/JSONSignatureValidator.java | JSONSignatureValidator.digestMatches | private boolean digestMatches(byte[] digest, String providedDigest) {
"""
Utility method supporting both possible digest formats: Base64 and Hex
"""
return providedDigest.equalsIgnoreCase(Hex.encodeHexString(digest)) || providedDigest.equalsIgnoreCase(new String(Base64.getEncoder().encode(digest)));
... | java | private boolean digestMatches(byte[] digest, String providedDigest) {
return providedDigest.equalsIgnoreCase(Hex.encodeHexString(digest)) || providedDigest.equalsIgnoreCase(new String(Base64.getEncoder().encode(digest)));
} | [
"private",
"boolean",
"digestMatches",
"(",
"byte",
"[",
"]",
"digest",
",",
"String",
"providedDigest",
")",
"{",
"return",
"providedDigest",
".",
"equalsIgnoreCase",
"(",
"Hex",
".",
"encodeHexString",
"(",
"digest",
")",
")",
"||",
"providedDigest",
".",
"e... | Utility method supporting both possible digest formats: Base64 and Hex | [
"Utility",
"method",
"supporting",
"both",
"possible",
"digest",
"formats",
":",
"Base64",
"and",
"Hex"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/JSONSignatureValidator.java#L238-L240 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/UserApi.java | UserApi.deleteCustomAttribute | public void deleteCustomAttribute(final Object userIdOrUsername, final CustomAttribute customAttribute) throws GitLabApiException {
"""
Delete a custom attribute for the given user
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param customAttribute to remov... | java | public void deleteCustomAttribute(final Object userIdOrUsername, final CustomAttribute customAttribute) throws GitLabApiException {
if (Objects.isNull(customAttribute)) {
throw new IllegalArgumentException("customAttributes can't be null");
}
deleteCustomAttribute(userIdOrUsername, ... | [
"public",
"void",
"deleteCustomAttribute",
"(",
"final",
"Object",
"userIdOrUsername",
",",
"final",
"CustomAttribute",
"customAttribute",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"Objects",
".",
"isNull",
"(",
"customAttribute",
")",
")",
"{",
"throw",
... | Delete a custom attribute for the given user
@param userIdOrUsername the user in the form of an Integer(ID), String(username), or User instance
@param customAttribute to remove
@throws GitLabApiException on failure while deleting customAttributes | [
"Delete",
"a",
"custom",
"attribute",
"for",
"the",
"given",
"user"
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/UserApi.java#L965-L971 |
pippo-java/pippo | pippo-server-parent/pippo-jetty/src/main/java/ro/pippo/jetty/JettyServer.java | JettyServer.asJettyFriendlyPath | private String asJettyFriendlyPath(String path, String name) {
"""
Jetty treats non-URL paths are file paths interpreted in the current working directory.
Provide ability to accept paths to resources on the Classpath.
@param path
@param name Descriptive name of what is for. Used in logs, error messages
@retur... | java | private String asJettyFriendlyPath(String path, String name) {
try {
new URL(path);
log.debug("Defer interpretation of {} URL '{}' to Jetty", name, path);
return path;
} catch (MalformedURLException e) {
//Expected. We've got a path and not a URL
... | [
"private",
"String",
"asJettyFriendlyPath",
"(",
"String",
"path",
",",
"String",
"name",
")",
"{",
"try",
"{",
"new",
"URL",
"(",
"path",
")",
";",
"log",
".",
"debug",
"(",
"\"Defer interpretation of {} URL '{}' to Jetty\"",
",",
"name",
",",
"path",
")",
... | Jetty treats non-URL paths are file paths interpreted in the current working directory.
Provide ability to accept paths to resources on the Classpath.
@param path
@param name Descriptive name of what is for. Used in logs, error messages
@return Path in a format Jetty will understand, even if it is a Classpath-relative... | [
"Jetty",
"treats",
"non",
"-",
"URL",
"paths",
"are",
"file",
"paths",
"interpreted",
"in",
"the",
"current",
"working",
"directory",
".",
"Provide",
"ability",
"to",
"accept",
"paths",
"to",
"resources",
"on",
"the",
"Classpath",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-server-parent/pippo-jetty/src/main/java/ro/pippo/jetty/JettyServer.java#L134-L158 |
aws/aws-sdk-java | aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/SendMessageBatchRequestEntry.java | SendMessageBatchRequestEntry.withMessageAttributes | public SendMessageBatchRequestEntry withMessageAttributes(java.util.Map<String, MessageAttributeValue> messageAttributes) {
"""
<p>
Each message attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>. For more
information, see <a
href="http://docs.aws.amazon.com/AWSSimpleQueueServi... | java | public SendMessageBatchRequestEntry withMessageAttributes(java.util.Map<String, MessageAttributeValue> messageAttributes) {
setMessageAttributes(messageAttributes);
return this;
} | [
"public",
"SendMessageBatchRequestEntry",
"withMessageAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"MessageAttributeValue",
">",
"messageAttributes",
")",
"{",
"setMessageAttributes",
"(",
"messageAttributes",
")",
";",
"return",
"this",
";",... | <p>
Each message attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>. For more
information, see <a
href="http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html"
>Amazon SQS Message Attributes</a> in the <i>Amazon Simple Queue Service Develo... | [
"<p",
">",
"Each",
"message",
"attribute",
"consists",
"of",
"a",
"<code",
">",
"Name<",
"/",
"code",
">",
"<code",
">",
"Type<",
"/",
"code",
">",
"and",
"<code",
">",
"Value<",
"/",
"code",
">",
".",
"For",
"more",
"information",
"see",
"<a",
"href... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/SendMessageBatchRequestEntry.java#L498-L501 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/Assert.java | Assert.assertTree | public static void assertTree(String rootText, String preorder, ParseResults parseResults) {
"""
Asserts a parse tree.
@param rootText the text of the root of the tree.
@param preorder the preorder traversal of the tree.
@param parseResults a helper class
"""
assertTree(rootText, preorder,... | java | public static void assertTree(String rootText, String preorder, ParseResults parseResults)
{
assertTree(rootText, preorder, parseResults.getTree());
} | [
"public",
"static",
"void",
"assertTree",
"(",
"String",
"rootText",
",",
"String",
"preorder",
",",
"ParseResults",
"parseResults",
")",
"{",
"assertTree",
"(",
"rootText",
",",
"preorder",
",",
"parseResults",
".",
"getTree",
"(",
")",
")",
";",
"}"
] | Asserts a parse tree.
@param rootText the text of the root of the tree.
@param preorder the preorder traversal of the tree.
@param parseResults a helper class | [
"Asserts",
"a",
"parse",
"tree",
"."
] | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/Assert.java#L284-L287 |
landawn/AbacusUtil | src/com/landawn/abacus/util/BiIterator.java | BiIterator.generate | public static <A, B> BiIterator<A, B> generate(final Consumer<Pair<A, B>> output) {
"""
Returns an infinite {@code BiIterator}.
@param output transfer the next values.
@return
"""
return generate(BooleanSupplier.TRUE, output);
} | java | public static <A, B> BiIterator<A, B> generate(final Consumer<Pair<A, B>> output) {
return generate(BooleanSupplier.TRUE, output);
} | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"BiIterator",
"<",
"A",
",",
"B",
">",
"generate",
"(",
"final",
"Consumer",
"<",
"Pair",
"<",
"A",
",",
"B",
">",
">",
"output",
")",
"{",
"return",
"generate",
"(",
"BooleanSupplier",
".",
"TRUE",
",",... | Returns an infinite {@code BiIterator}.
@param output transfer the next values.
@return | [
"Returns",
"an",
"infinite",
"{",
"@code",
"BiIterator",
"}",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/BiIterator.java#L133-L135 |
samskivert/samskivert | src/main/java/com/samskivert/swing/RadialLabelSausage.java | RadialLabelSausage.layout | public void layout (Graphics2D gfx, Font font) {
"""
Computes the dimensions of this label based on the specified font
and in the specified graphics context.
"""
_label.setFont(font);
layout(gfx, BORDER_THICKNESS);
openBounds.width = _size.width;
openBounds.height = _size.heig... | java | public void layout (Graphics2D gfx, Font font)
{
_label.setFont(font);
layout(gfx, BORDER_THICKNESS);
openBounds.width = _size.width;
openBounds.height = _size.height;
// and closed up, we're just a circle
closedBounds.height = closedBounds.width = _size.height;
... | [
"public",
"void",
"layout",
"(",
"Graphics2D",
"gfx",
",",
"Font",
"font",
")",
"{",
"_label",
".",
"setFont",
"(",
"font",
")",
";",
"layout",
"(",
"gfx",
",",
"BORDER_THICKNESS",
")",
";",
"openBounds",
".",
"width",
"=",
"_size",
".",
"width",
";",
... | Computes the dimensions of this label based on the specified font
and in the specified graphics context. | [
"Computes",
"the",
"dimensions",
"of",
"this",
"label",
"based",
"on",
"the",
"specified",
"font",
"and",
"in",
"the",
"specified",
"graphics",
"context",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialLabelSausage.java#L89-L99 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getLeagueEntries | public Future<List<LeagueItem>> getLeagueEntries(String teamId) {
"""
Get a listing of all league entries in the team's leagues
@param teamId The id of the team
@return A list of league entries
@see <a href=https://developer.riotgames.com/api/methods#!/593/1861>Official API documentation</a>
"""
ret... | java | public Future<List<LeagueItem>> getLeagueEntries(String teamId) {
return new ApiFuture<>(() -> handler.getLeagueEntries(teamId));
} | [
"public",
"Future",
"<",
"List",
"<",
"LeagueItem",
">",
">",
"getLeagueEntries",
"(",
"String",
"teamId",
")",
"{",
"return",
"new",
"ApiFuture",
"<>",
"(",
"(",
")",
"->",
"handler",
".",
"getLeagueEntries",
"(",
"teamId",
")",
")",
";",
"}"
] | Get a listing of all league entries in the team's leagues
@param teamId The id of the team
@return A list of league entries
@see <a href=https://developer.riotgames.com/api/methods#!/593/1861>Official API documentation</a> | [
"Get",
"a",
"listing",
"of",
"all",
"league",
"entries",
"in",
"the",
"team",
"s",
"leagues"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L285-L287 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java | JBBPBitOutputStream.writeLong | public void writeLong(final long value, final JBBPByteOrder byteOrder) throws IOException {
"""
Write a long value into the output stream.
@param value a value to be written into the output stream.
@param byteOrder the byte order of the value bytes to be used for writing.
@throws IOException it will be th... | java | public void writeLong(final long value, final JBBPByteOrder byteOrder) throws IOException {
if (byteOrder == JBBPByteOrder.BIG_ENDIAN) {
this.writeInt((int) (value >>> 32), byteOrder);
this.writeInt((int) value, byteOrder);
} else {
this.writeInt((int) value, byteOrder);
this.writeInt((i... | [
"public",
"void",
"writeLong",
"(",
"final",
"long",
"value",
",",
"final",
"JBBPByteOrder",
"byteOrder",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteOrder",
"==",
"JBBPByteOrder",
".",
"BIG_ENDIAN",
")",
"{",
"this",
".",
"writeInt",
"(",
"(",
"int",... | Write a long value into the output stream.
@param value a value to be written into the output stream.
@param byteOrder the byte order of the value bytes to be used for writing.
@throws IOException it will be thrown for transport errors
@see JBBPByteOrder#BIG_ENDIAN
@see JBBPByteOrder#LITTLE_ENDIAN | [
"Write",
"a",
"long",
"value",
"into",
"the",
"output",
"stream",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java#L151-L159 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java | EscapedFunctions.sqlcurdate | public static String sqlcurdate(List<?> parsedArgs) throws SQLException {
"""
curdate to current_date translation.
@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens
"""
if (!parsedArgs.isEmpty()) {
throw new PSQLException(GT.tr("{0} function doesn''t ta... | java | public static String sqlcurdate(List<?> parsedArgs) throws SQLException {
if (!parsedArgs.isEmpty()) {
throw new PSQLException(GT.tr("{0} function doesn''t take any argument.", "curdate"),
PSQLState.SYNTAX_ERROR);
}
return "current_date";
} | [
"public",
"static",
"String",
"sqlcurdate",
"(",
"List",
"<",
"?",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"!",
"parsedArgs",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"PSQLException",
"(",
"GT",
".",
"tr",
"(",
"\"{... | curdate to current_date translation.
@param parsedArgs arguments
@return sql call
@throws SQLException if something wrong happens | [
"curdate",
"to",
"current_date",
"translation",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions.java#L407-L413 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationRuleParser.java | CollationRuleParser.parseSpecialPosition | private int parseSpecialPosition(int i, StringBuilder str) throws ParseException {
"""
Sets str to a contraction of U+FFFE and (U+2800 + Position).
@return rule index after the special reset position
@throws ParseException
"""
int j = readWords(i + 1, rawBuilder);
if(j > i && rules.charAt(j) ... | java | private int parseSpecialPosition(int i, StringBuilder str) throws ParseException {
int j = readWords(i + 1, rawBuilder);
if(j > i && rules.charAt(j) == 0x5d && rawBuilder.length() != 0) { // words end with ]
++j;
String raw = rawBuilder.toString();
str.setLength(0);
... | [
"private",
"int",
"parseSpecialPosition",
"(",
"int",
"i",
",",
"StringBuilder",
"str",
")",
"throws",
"ParseException",
"{",
"int",
"j",
"=",
"readWords",
"(",
"i",
"+",
"1",
",",
"rawBuilder",
")",
";",
"if",
"(",
"j",
">",
"i",
"&&",
"rules",
".",
... | Sets str to a contraction of U+FFFE and (U+2800 + Position).
@return rule index after the special reset position
@throws ParseException | [
"Sets",
"str",
"to",
"a",
"contraction",
"of",
"U",
"+",
"FFFE",
"and",
"(",
"U",
"+",
"2800",
"+",
"Position",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationRuleParser.java#L501-L524 |
UrielCh/ovh-java-sdk | ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java | ApiOvhHorizonView.serviceName_customerNetwork_customerNetworkId_DELETE | public ArrayList<OvhTask> serviceName_customerNetwork_customerNetworkId_DELETE(String serviceName, Long customerNetworkId) throws IOException {
"""
Delete this Customer Network
REST: DELETE /horizonView/{serviceName}/customerNetwork/{customerNetworkId}
@param serviceName [required] Domain of the service
@para... | java | public ArrayList<OvhTask> serviceName_customerNetwork_customerNetworkId_DELETE(String serviceName, Long customerNetworkId) throws IOException {
String qPath = "/horizonView/{serviceName}/customerNetwork/{customerNetworkId}";
StringBuilder sb = path(qPath, serviceName, customerNetworkId);
String resp = exec(qPath,... | [
"public",
"ArrayList",
"<",
"OvhTask",
">",
"serviceName_customerNetwork_customerNetworkId_DELETE",
"(",
"String",
"serviceName",
",",
"Long",
"customerNetworkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/horizonView/{serviceName}/customerNetwork/{customer... | Delete this Customer Network
REST: DELETE /horizonView/{serviceName}/customerNetwork/{customerNetworkId}
@param serviceName [required] Domain of the service
@param customerNetworkId [required] Customer Network id | [
"Delete",
"this",
"Customer",
"Network"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java#L445-L450 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/memory/MemoryRemoteTable.java | MemoryRemoteTable.doRemoteAction | public Object doRemoteAction(String strCommand, Map<String, Object> properties) throws DBException, RemoteException {
"""
Do a remote action.
Not implemented.
@param strCommand Command to perform remotely.
@param properties Properties for this command (optional).
@return boolean success.
"""
return... | java | public Object doRemoteAction(String strCommand, Map<String, Object> properties) throws DBException, RemoteException
{
return null; // Not supported
} | [
"public",
"Object",
"doRemoteAction",
"(",
"String",
"strCommand",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"return",
"null",
";",
"// Not supported",
"}"
] | Do a remote action.
Not implemented.
@param strCommand Command to perform remotely.
@param properties Properties for this command (optional).
@return boolean success. | [
"Do",
"a",
"remote",
"action",
".",
"Not",
"implemented",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/memory/MemoryRemoteTable.java#L304-L307 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java | AccumuloClient.renameIndexTables | private void renameIndexTables(AccumuloTable oldTable, AccumuloTable newTable) {
"""
Renames the index tables (if applicable) for the old table to the new table.
@param oldTable Old AccumuloTable
@param newTable New AccumuloTable
"""
if (!oldTable.isIndexed()) {
return;
}
... | java | private void renameIndexTables(AccumuloTable oldTable, AccumuloTable newTable)
{
if (!oldTable.isIndexed()) {
return;
}
if (!tableManager.exists(oldTable.getIndexTableName())) {
throw new PrestoException(ACCUMULO_TABLE_DNE, format("Table %s does not exist", oldTable.... | [
"private",
"void",
"renameIndexTables",
"(",
"AccumuloTable",
"oldTable",
",",
"AccumuloTable",
"newTable",
")",
"{",
"if",
"(",
"!",
"oldTable",
".",
"isIndexed",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"tableManager",
".",
"exists",
"(",
... | Renames the index tables (if applicable) for the old table to the new table.
@param oldTable Old AccumuloTable
@param newTable New AccumuloTable | [
"Renames",
"the",
"index",
"tables",
"(",
"if",
"applicable",
")",
"for",
"the",
"old",
"table",
"to",
"the",
"new",
"table",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java#L515-L539 |
apereo/cas | support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v2/ScimV2PrincipalProvisioner.java | ScimV2PrincipalProvisioner.createUserResource | @SneakyThrows
protected boolean createUserResource(final Principal p, final Credential credential) {
"""
Create user resource boolean.
@param p the p
@param credential the credential
@return the boolean
"""
val user = new UserResource();
this.mapper.map(user, p, credential);
... | java | @SneakyThrows
protected boolean createUserResource(final Principal p, final Credential credential) {
val user = new UserResource();
this.mapper.map(user, p, credential);
return scimService.create("Users", user) != null;
} | [
"@",
"SneakyThrows",
"protected",
"boolean",
"createUserResource",
"(",
"final",
"Principal",
"p",
",",
"final",
"Credential",
"credential",
")",
"{",
"val",
"user",
"=",
"new",
"UserResource",
"(",
")",
";",
"this",
".",
"mapper",
".",
"map",
"(",
"user",
... | Create user resource boolean.
@param p the p
@param credential the credential
@return the boolean | [
"Create",
"user",
"resource",
"boolean",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-scim/src/main/java/org/apereo/cas/scim/v2/ScimV2PrincipalProvisioner.java#L90-L95 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZKShell.java | AvatarZKShell.updateZooKeeper | public void updateZooKeeper(boolean force, boolean toOverwrite, String serviceName, String primary)
throws IOException {
"""
/*
This method tries to update the information in ZooKeeper For every address
of the NameNode it is being run for (fs.default.name,
dfs.namenode.dn-address, dfs.namenode.http.addres... | java | public void updateZooKeeper(boolean force, boolean toOverwrite, String serviceName, String primary)
throws IOException {
if (!force) {
initAvatarRPC();
Avatar avatar = avatarnode.getAvatar();
if (avatar != Avatar.ACTIVE) {
throw new IOException(
"Cannot update ZooKeeper i... | [
"public",
"void",
"updateZooKeeper",
"(",
"boolean",
"force",
",",
"boolean",
"toOverwrite",
",",
"String",
"serviceName",
",",
"String",
"primary",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"force",
")",
"{",
"initAvatarRPC",
"(",
")",
";",
"Avatar... | /*
This method tries to update the information in ZooKeeper For every address
of the NameNode it is being run for (fs.default.name,
dfs.namenode.dn-address, dfs.namenode.http.address) if they are present. It
also creates information for aliases in ZooKeeper for lists of strings in
fs.default.name.aliases, dfs.namenode.... | [
"/",
"*",
"This",
"method",
"tries",
"to",
"update",
"the",
"information",
"in",
"ZooKeeper",
"For",
"every",
"address",
"of",
"the",
"NameNode",
"it",
"is",
"being",
"run",
"for",
"(",
"fs",
".",
"default",
".",
"name",
"dfs",
".",
"namenode",
".",
"d... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/AvatarZKShell.java#L373-L385 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java | TwitterEndpointServices.createAuthorizationHeaderString | public String createAuthorizationHeaderString(Map<String, String> parameters) {
"""
Per {@link https://dev.twitter.com/oauth/overview/authorizing-requests}, the authorization header for requests must be
built the following way:
<ol type="1">
<li>Append the string "OAuth " (including the space at the end) to DST... | java | public String createAuthorizationHeaderString(Map<String, String> parameters) {
StringBuilder authzHeaderString = new StringBuilder();
// Step 1: Append "OAuth "
authzHeaderString.append("OAuth ");
if (parameters == null) {
return authzHeaderString.toString();
}
... | [
"public",
"String",
"createAuthorizationHeaderString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"StringBuilder",
"authzHeaderString",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// Step 1: Append \"OAuth \"",
"authzHeaderString",
".",
"a... | Per {@link https://dev.twitter.com/oauth/overview/authorizing-requests}, the authorization header for requests must be
built the following way:
<ol type="1">
<li>Append the string "OAuth " (including the space at the end) to DST.</li>
<li>For each key/value pair of the 7 parameters* listed below:
<ol type="a">
<li>Perc... | [
"Per",
"{",
"@link",
"https",
":",
"//",
"dev",
".",
"twitter",
".",
"com",
"/",
"oauth",
"/",
"overview",
"/",
"authorizing",
"-",
"requests",
"}",
"the",
"authorization",
"header",
"for",
"requests",
"must",
"be",
"built",
"the",
"following",
"way",
":... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java#L320-L361 |
gallandarakhneorg/afc | core/text/src/main/java/org/arakhne/afc/text/TextUtil.java | TextUtil.splitBrackets | @Pure
@Inline(value = "textUtil.split(' {
"""
Split the given string according to brackets.
The brackets are used to delimit the groups
of characters.
<p>Examples:
<ul>
<li><code>splitBrackets("{a}{b}{cd}")</code> returns the array
<code>["a","b","cd"]</code></li>
<li><code>splitBrackets("abcd")</code> r... | java | @Pure
@Inline(value = "textUtil.split('{', '}', $1)", imported = {TextUtil.class})
public static String[] splitBrackets(String str) {
return split('{', '}', str);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"textUtil.split('{', '}', $1)\"",
",",
"imported",
"=",
"{",
"TextUtil",
".",
"class",
"}",
")",
"public",
"static",
"String",
"[",
"]",
"splitBrackets",
"(",
"String",
"str",
")",
"{",
"return",
"split",
"(... | Split the given string according to brackets.
The brackets are used to delimit the groups
of characters.
<p>Examples:
<ul>
<li><code>splitBrackets("{a}{b}{cd}")</code> returns the array
<code>["a","b","cd"]</code></li>
<li><code>splitBrackets("abcd")</code> returns the array
<code>["abcd"]</code></li>
<li><code>splitB... | [
"Split",
"the",
"given",
"string",
"according",
"to",
"brackets",
".",
"The",
"brackets",
"are",
"used",
"to",
"delimit",
"the",
"groups",
"of",
"characters",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/text/src/main/java/org/arakhne/afc/text/TextUtil.java#L613-L617 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendHavingClause | protected void appendHavingClause(StringBuffer having, Criteria crit, StringBuffer stmt) {
"""
appends a HAVING-clause to the Statement
@param having
@param crit
@param stmt
"""
if (having.length() == 0)
{
having = null;
}
if (having != null || crit != null... | java | protected void appendHavingClause(StringBuffer having, Criteria crit, StringBuffer stmt)
{
if (having.length() == 0)
{
having = null;
}
if (having != null || crit != null)
{
stmt.append(" HAVING ");
appendClause(having, crit, stm... | [
"protected",
"void",
"appendHavingClause",
"(",
"StringBuffer",
"having",
",",
"Criteria",
"crit",
",",
"StringBuffer",
"stmt",
")",
"{",
"if",
"(",
"having",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"having",
"=",
"null",
";",
"}",
"if",
"(",
"ha... | appends a HAVING-clause to the Statement
@param having
@param crit
@param stmt | [
"appends",
"a",
"HAVING",
"-",
"clause",
"to",
"the",
"Statement"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L561-L573 |
haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTUtil.java | PICTUtil.readRGBColor | public static Color readRGBColor(final DataInput pStream) throws IOException {
"""
/*
http://developer.apple.com/DOCUMENTATION/mac/QuickDraw/QuickDraw-269.html#HEADING269-11
RGBColor =
RECORD
red: Integer; {red component}
green: Integer; {green component}
blue: Integer; {blue componen... | java | public static Color readRGBColor(final DataInput pStream) throws IOException {
short r = pStream.readShort();
short g = pStream.readShort();
short b = pStream.readShort();
return new RGBColor(r, g, b);
} | [
"public",
"static",
"Color",
"readRGBColor",
"(",
"final",
"DataInput",
"pStream",
")",
"throws",
"IOException",
"{",
"short",
"r",
"=",
"pStream",
".",
"readShort",
"(",
")",
";",
"short",
"g",
"=",
"pStream",
".",
"readShort",
"(",
")",
";",
"short",
"... | /*
http://developer.apple.com/DOCUMENTATION/mac/QuickDraw/QuickDraw-269.html#HEADING269-11
RGBColor =
RECORD
red: Integer; {red component}
green: Integer; {green component}
blue: Integer; {blue component}
END; | [
"/",
"*",
"http",
":",
"//",
"developer",
".",
"apple",
".",
"com",
"/",
"DOCUMENTATION",
"/",
"mac",
"/",
"QuickDraw",
"/",
"QuickDraw",
"-",
"269",
".",
"html#HEADING269",
"-",
"11",
"RGBColor",
"=",
"RECORD",
"red",
":",
"Integer",
";",
"{",
"red",
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTUtil.java#L223-L229 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java | CommerceShippingMethodPersistenceImpl.findByG_E | @Override
public CommerceShippingMethod findByG_E(long groupId, String engineKey)
throws NoSuchShippingMethodException {
"""
Returns the commerce shipping method where groupId = ? and engineKey = ? or throws a {@link NoSuchShippingMethodException} if it could not be found.
@param groupId the group ID... | java | @Override
public CommerceShippingMethod findByG_E(long groupId, String engineKey)
throws NoSuchShippingMethodException {
CommerceShippingMethod commerceShippingMethod = fetchByG_E(groupId,
engineKey);
if (commerceShippingMethod == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_... | [
"@",
"Override",
"public",
"CommerceShippingMethod",
"findByG_E",
"(",
"long",
"groupId",
",",
"String",
"engineKey",
")",
"throws",
"NoSuchShippingMethodException",
"{",
"CommerceShippingMethod",
"commerceShippingMethod",
"=",
"fetchByG_E",
"(",
"groupId",
",",
"engineKe... | Returns the commerce shipping method where groupId = ? and engineKey = ? or throws a {@link NoSuchShippingMethodException} if it could not be found.
@param groupId the group ID
@param engineKey the engine key
@return the matching commerce shipping method
@throws NoSuchShippingMethodException if a matching comm... | [
"Returns",
"the",
"commerce",
"shipping",
"method",
"where",
"groupId",
"=",
"?",
";",
"and",
"engineKey",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchShippingMethodException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java#L625-L652 |
demidenko05/beigesoft-accounting | src/main/java/org/beigesoft/accounting/processor/PrcManufactureSave.java | PrcManufactureSave.makeOtherEntries | @Override
public final void makeOtherEntries(final Map<String, Object> pAddParam,
final Manufacture pEntity, final IRequestData pRequestData,
final boolean pIsNew) throws Exception {
"""
<p>Make other entries include reversing if it's need when save.</p>
@param pAddParam additional param
@param pEnti... | java | @Override
public final void makeOtherEntries(final Map<String, Object> pAddParam,
final Manufacture pEntity, final IRequestData pRequestData,
final boolean pIsNew) throws Exception {
//always new
ManufactureForDraw manufactureForDraw = new ManufactureForDraw(pEntity);
if (pEntity.getReversedId()... | [
"@",
"Override",
"public",
"final",
"void",
"makeOtherEntries",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
",",
"final",
"Manufacture",
"pEntity",
",",
"final",
"IRequestData",
"pRequestData",
",",
"final",
"boolean",
"pIsNew",
")",
"... | <p>Make other entries include reversing if it's need when save.</p>
@param pAddParam additional param
@param pEntity entity
@param pRequestData Request Data
@param pIsNew if entity was new
@throws Exception - an exception | [
"<p",
">",
"Make",
"other",
"entries",
"include",
"reversing",
"if",
"it",
"s",
"need",
"when",
"save",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-accounting/blob/e6f423949008218ddd05953b078f1ea8805095c1/src/main/java/org/beigesoft/accounting/processor/PrcManufactureSave.java#L116-L139 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java | IndexImage.applyAlpha | private static void applyAlpha(BufferedImage pImage, BufferedImage pAlpha) {
"""
Applies the alpha-component of the alpha image to the given image.
The given image is modified in place.
@param pImage the image to apply alpha to
@param pAlpha the image containing the alpha
"""
// Apply alpha as tr... | java | private static void applyAlpha(BufferedImage pImage, BufferedImage pAlpha) {
// Apply alpha as transparency, using threshold of 25%
for (int y = 0; y < pAlpha.getHeight(); y++) {
for (int x = 0; x < pAlpha.getWidth(); x++) {
// Get alpha component of pixel, if less than... | [
"private",
"static",
"void",
"applyAlpha",
"(",
"BufferedImage",
"pImage",
",",
"BufferedImage",
"pAlpha",
")",
"{",
"// Apply alpha as transparency, using threshold of 25%\r",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"pAlpha",
".",
"getHeight",
"(",
")",
... | Applies the alpha-component of the alpha image to the given image.
The given image is modified in place.
@param pImage the image to apply alpha to
@param pAlpha the image containing the alpha | [
"Applies",
"the",
"alpha",
"-",
"component",
"of",
"the",
"alpha",
"image",
"to",
"the",
"given",
"image",
".",
"The",
"given",
"image",
"is",
"modified",
"in",
"place",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java#L1189-L1201 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/StateUtils.java | StateUtils.main | public static void main (String[] args) throws UnsupportedEncodingException {
"""
Utility method for generating base 64 encoded strings.
@param args
@throws UnsupportedEncodingException
"""
byte[] bytes = encode(args[0].getBytes(ZIP_CHARSET));
System.out.println(new String(bytes, ZIP_CHAR... | java | public static void main (String[] args) throws UnsupportedEncodingException
{
byte[] bytes = encode(args[0].getBytes(ZIP_CHARSET));
System.out.println(new String(bytes, ZIP_CHARSET));
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"UnsupportedEncodingException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"encode",
"(",
"args",
"[",
"0",
"]",
".",
"getBytes",
"(",
"ZIP_CHARSET",
")",
")",
";",
"System",
... | Utility method for generating base 64 encoded strings.
@param args
@throws UnsupportedEncodingException | [
"Utility",
"method",
"for",
"generating",
"base",
"64",
"encoded",
"strings",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/StateUtils.java#L654-L658 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ArrayExtractor.java | ArrayExtractor.setObjectValue | public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue)
throws IllegalAccessException, InvocationTargetException {
"""
Set a value in an array
@param pConverter the global converter in order to be able do dispatch for
serializing inner data typ... | java | public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue)
throws IllegalAccessException, InvocationTargetException {
Class clazz = pInner.getClass();
if (!clazz.isArray()) {
throw new IllegalArgumentException("Not an array to s... | [
"public",
"Object",
"setObjectValue",
"(",
"StringToObjectConverter",
"pConverter",
",",
"Object",
"pInner",
",",
"String",
"pIndex",
",",
"Object",
"pValue",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Class",
"clazz",
"=",
"pInne... | Set a value in an array
@param pConverter the global converter in order to be able do dispatch for
serializing inner data types
@param pInner object on which to set the value (which must be a {@link List})
@param pIndex index (as string) where to set the value within the array
@param pValue the new value to set
@retu... | [
"Set",
"a",
"value",
"in",
"an",
"array"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ArrayExtractor.java#L82-L101 |
kiegroup/jbpm | jbpm-query-jpa/src/main/java/org/jbpm/query/jpa/impl/QueryCriteriaUtil.java | QueryCriteriaUtil.fillCriteriaQuery | protected <R,T> void fillCriteriaQuery( CriteriaQuery<R> query, QueryWhere queryWhere, CriteriaBuilder builder, Class<T> queryType ) {
"""
This is the main ("highest"? "most abstract"?) method that is used to create a {@link CriteriaQuery} from a {@link QueryWhere} instance.
@param query The (empty) {@link Crit... | java | protected <R,T> void fillCriteriaQuery( CriteriaQuery<R> query, QueryWhere queryWhere, CriteriaBuilder builder, Class<T> queryType ) {
Predicate queryPredicate = createPredicateFromCriteriaList(query, builder, queryType, queryWhere.getCriteria(), queryWhere );
if( queryPredicate != null ) {
... | [
"protected",
"<",
"R",
",",
"T",
">",
"void",
"fillCriteriaQuery",
"(",
"CriteriaQuery",
"<",
"R",
">",
"query",
",",
"QueryWhere",
"queryWhere",
",",
"CriteriaBuilder",
"builder",
",",
"Class",
"<",
"T",
">",
"queryType",
")",
"{",
"Predicate",
"queryPredic... | This is the main ("highest"? "most abstract"?) method that is used to create a {@link CriteriaQuery} from a {@link QueryWhere} instance.
@param query The (empty) {@link CriteriaQuery} that will be filled using the {@link QueryCriteria} and other information in the {@link QueryWhere} instance
@param queryWhere The {@li... | [
"This",
"is",
"the",
"main",
"(",
"highest",
"?",
"most",
"abstract",
"?",
")",
"method",
"that",
"is",
"used",
"to",
"create",
"a",
"{",
"@link",
"CriteriaQuery",
"}",
"from",
"a",
"{",
"@link",
"QueryWhere",
"}",
"instance",
"."
] | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-query-jpa/src/main/java/org/jbpm/query/jpa/impl/QueryCriteriaUtil.java#L161-L181 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java | ServerSentEvents.fromStream | public static HttpResponse fromStream(HttpHeaders headers,
Stream<? extends ServerSentEvent> contentStream,
HttpHeaders trailingHeaders, Executor executor) {
"""
Creates a new Server-Sent Events stream from the specified {@link Str... | java | public static HttpResponse fromStream(HttpHeaders headers,
Stream<? extends ServerSentEvent> contentStream,
HttpHeaders trailingHeaders, Executor executor) {
requireNonNull(headers, "headers");
requireNonNull(contentStre... | [
"public",
"static",
"HttpResponse",
"fromStream",
"(",
"HttpHeaders",
"headers",
",",
"Stream",
"<",
"?",
"extends",
"ServerSentEvent",
">",
"contentStream",
",",
"HttpHeaders",
"trailingHeaders",
",",
"Executor",
"executor",
")",
"{",
"requireNonNull",
"(",
"header... | Creates a new Server-Sent Events stream from the specified {@link Stream}.
@param headers the HTTP headers supposed to send
@param contentStream the {@link Stream} which publishes the objects supposed to send as contents
@param trailingHeaders the trailing HTTP headers supposed to send
@param executor the executor whi... | [
"Creates",
"a",
"new",
"Server",
"-",
"Sent",
"Events",
"stream",
"from",
"the",
"specified",
"{",
"@link",
"Stream",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java#L195-L204 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java | TransactionManager.mergeRolledBackTransaction | void mergeRolledBackTransaction(Object[] list, int start, int limit) {
"""
merge a given list of transaction rollback action with given timestamp
"""
for (int i = start; i < limit; i++) {
RowAction rowact = (RowAction) list[i];
if (rowact == null || rowact.type == RowActionBas... | java | void mergeRolledBackTransaction(Object[] list, int start, int limit) {
for (int i = start; i < limit; i++) {
RowAction rowact = (RowAction) list[i];
if (rowact == null || rowact.type == RowActionBase.ACTION_NONE
|| rowact.type == RowActionBase.ACTION_DELETE_FINAL) {... | [
"void",
"mergeRolledBackTransaction",
"(",
"Object",
"[",
"]",
"list",
",",
"int",
"start",
",",
"int",
"limit",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"limit",
";",
"i",
"++",
")",
"{",
"RowAction",
"rowact",
"=",
"(",
"Row... | merge a given list of transaction rollback action with given timestamp | [
"merge",
"a",
"given",
"list",
"of",
"transaction",
"rollback",
"action",
"with",
"given",
"timestamp"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TransactionManager.java#L625-L657 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamidentifier_binding.java | streamidentifier_binding.get | public static streamidentifier_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch streamidentifier_binding resource of given name .
"""
streamidentifier_binding obj = new streamidentifier_binding();
obj.set_name(name);
streamidentifier_binding response = (streami... | java | public static streamidentifier_binding get(nitro_service service, String name) throws Exception{
streamidentifier_binding obj = new streamidentifier_binding();
obj.set_name(name);
streamidentifier_binding response = (streamidentifier_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"streamidentifier_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"streamidentifier_binding",
"obj",
"=",
"new",
"streamidentifier_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"... | Use this API to fetch streamidentifier_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"streamidentifier_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamidentifier_binding.java#L103-L108 |
aragozin/jvm-tools | mxdump/src/main/java/org/gridkit/jvmtool/jackson/JsonGenerator.java | JsonGenerator.configure | public JsonGenerator configure(Feature f, boolean state) {
"""
Method for enabling or disabling specified feature:
check {@link Feature} for list of available features.
@return Generator itself (this), to allow chaining
@since 1.2
"""
if (state) {
enable(f);
} else {
... | java | public JsonGenerator configure(Feature f, boolean state)
{
if (state) {
enable(f);
} else {
disable(f);
}
return this;
} | [
"public",
"JsonGenerator",
"configure",
"(",
"Feature",
"f",
",",
"boolean",
"state",
")",
"{",
"if",
"(",
"state",
")",
"{",
"enable",
"(",
"f",
")",
";",
"}",
"else",
"{",
"disable",
"(",
"f",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Method for enabling or disabling specified feature:
check {@link Feature} for list of available features.
@return Generator itself (this), to allow chaining
@since 1.2 | [
"Method",
"for",
"enabling",
"or",
"disabling",
"specified",
"feature",
":",
"check",
"{",
"@link",
"Feature",
"}",
"for",
"list",
"of",
"available",
"features",
"."
] | train | https://github.com/aragozin/jvm-tools/blob/d3a4d0c6a47fb9317f274988569655f30dcd2f76/mxdump/src/main/java/org/gridkit/jvmtool/jackson/JsonGenerator.java#L240-L248 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/QueryUtil.java | QueryUtil.packageResult | public static <T> IQueryResult<T> packageResult(List<T> results) {
"""
Convenience method for packaging query results.
@param <T> Class of query result.
@param results Results to package.
@return Packaged results.
"""
return packageResult(results, null);
} | java | public static <T> IQueryResult<T> packageResult(List<T> results) {
return packageResult(results, null);
} | [
"public",
"static",
"<",
"T",
">",
"IQueryResult",
"<",
"T",
">",
"packageResult",
"(",
"List",
"<",
"T",
">",
"results",
")",
"{",
"return",
"packageResult",
"(",
"results",
",",
"null",
")",
";",
"}"
] | Convenience method for packaging query results.
@param <T> Class of query result.
@param results Results to package.
@return Packaged results. | [
"Convenience",
"method",
"for",
"packaging",
"query",
"results",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/query/QueryUtil.java#L103-L105 |
playn/playn | scene/src/playn/scene/LayerUtil.java | LayerUtil.screenToLayer | public static Point screenToLayer(Layer layer, float x, float y) {
"""
Converts the supplied point from screen coordinates to coordinates
relative to the specified layer.
"""
Point into = new Point(x, y);
return screenToLayer(layer, into, into);
} | java | public static Point screenToLayer(Layer layer, float x, float y) {
Point into = new Point(x, y);
return screenToLayer(layer, into, into);
} | [
"public",
"static",
"Point",
"screenToLayer",
"(",
"Layer",
"layer",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"Point",
"into",
"=",
"new",
"Point",
"(",
"x",
",",
"y",
")",
";",
"return",
"screenToLayer",
"(",
"layer",
",",
"into",
",",
"into"... | Converts the supplied point from screen coordinates to coordinates
relative to the specified layer. | [
"Converts",
"the",
"supplied",
"point",
"from",
"screen",
"coordinates",
"to",
"coordinates",
"relative",
"to",
"the",
"specified",
"layer",
"."
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/LayerUtil.java#L94-L97 |
networknt/light-4j | http-url/src/main/java/com/networknt/url/HttpURL.java | HttpURL.toURI | public URI toURI() {
"""
Converts this HttpURL to a {@link URI}, making sure
appropriate characters are escaped properly.
@return a URI
@since 1.7.0
@throws RuntimeException when URL is malformed
"""
String url = toString();
try {
return new URI(url);
} catch (URISyntaxE... | java | public URI toURI() {
String url = toString();
try {
return new URI(url);
} catch (URISyntaxException e) {
throw new RuntimeException("Cannot convert to URI: " + url, e);
}
} | [
"public",
"URI",
"toURI",
"(",
")",
"{",
"String",
"url",
"=",
"toString",
"(",
")",
";",
"try",
"{",
"return",
"new",
"URI",
"(",
"url",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Ca... | Converts this HttpURL to a {@link URI}, making sure
appropriate characters are escaped properly.
@return a URI
@since 1.7.0
@throws RuntimeException when URL is malformed | [
"Converts",
"this",
"HttpURL",
"to",
"a",
"{"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/http-url/src/main/java/com/networknt/url/HttpURL.java#L299-L306 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java | AnnotationTypeRequiredMemberBuilder.buildTagInfo | public void buildTagInfo(XMLNode node, Content annotationDocTree) {
"""
Build the tag information.
@param node the XML element that specifies which components to document
@param annotationDocTree the content tree to which the documentation will be added
"""
writer.addTags((MemberDoc) members.get(cu... | java | public void buildTagInfo(XMLNode node, Content annotationDocTree) {
writer.addTags((MemberDoc) members.get(currentMemberIndex),
annotationDocTree);
} | [
"public",
"void",
"buildTagInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"annotationDocTree",
")",
"{",
"writer",
".",
"addTags",
"(",
"(",
"MemberDoc",
")",
"members",
".",
"get",
"(",
"currentMemberIndex",
")",
",",
"annotationDocTree",
")",
";",
"}"
] | Build the tag information.
@param node the XML element that specifies which components to document
@param annotationDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"tag",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java#L227-L230 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_SharedRendererUtils.java | _SharedRendererUtils.log | private static void log(FacesContext context, String msg, Exception e) {
"""
This method is different in the two versions of _SharedRendererUtils.
"""
context.getExternalContext().log(msg, e);
} | java | private static void log(FacesContext context, String msg, Exception e)
{
context.getExternalContext().log(msg, e);
} | [
"private",
"static",
"void",
"log",
"(",
"FacesContext",
"context",
",",
"String",
"msg",
",",
"Exception",
"e",
")",
"{",
"context",
".",
"getExternalContext",
"(",
")",
".",
"log",
"(",
"msg",
",",
"e",
")",
";",
"}"
] | This method is different in the two versions of _SharedRendererUtils. | [
"This",
"method",
"is",
"different",
"in",
"the",
"two",
"versions",
"of",
"_SharedRendererUtils",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_SharedRendererUtils.java#L489-L492 |
weld/core | impl/src/main/java/org/jboss/weld/bootstrap/BeanDeploymentModule.java | BeanDeploymentModule.fireEvent | public void fireEvent(Type eventType, Object event, Annotation... qualifiers) {
"""
Fire an event and notify observers that belong to this module.
@param eventType
@param event
@param qualifiers
"""
final EventMetadata metadata = new EventMetadataImpl(eventType, null, qualifiers);
notifier.f... | java | public void fireEvent(Type eventType, Object event, Annotation... qualifiers) {
final EventMetadata metadata = new EventMetadataImpl(eventType, null, qualifiers);
notifier.fireEvent(eventType, event, metadata, qualifiers);
} | [
"public",
"void",
"fireEvent",
"(",
"Type",
"eventType",
",",
"Object",
"event",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"final",
"EventMetadata",
"metadata",
"=",
"new",
"EventMetadataImpl",
"(",
"eventType",
",",
"null",
",",
"qualifiers",
")",
";"... | Fire an event and notify observers that belong to this module.
@param eventType
@param event
@param qualifiers | [
"Fire",
"an",
"event",
"and",
"notify",
"observers",
"that",
"belong",
"to",
"this",
"module",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeploymentModule.java#L91-L94 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/dispatcher/DataContextUtils.java | DataContextUtils.replaceTokensInScript | public static File replaceTokensInScript(
final String script,
final Map<String, Map<String, String>> dataContext,
final Framework framework,
final ScriptfileUtils.LineEndingStyle style,
final File destination
)
throws IOException {
"""
Co... | java | public static File replaceTokensInScript(
final String script,
final Map<String, Map<String, String>> dataContext,
final Framework framework,
final ScriptfileUtils.LineEndingStyle style,
final File destination
)
throws IOException
{
... | [
"public",
"static",
"File",
"replaceTokensInScript",
"(",
"final",
"String",
"script",
",",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"dataContext",
",",
"final",
"Framework",
"framework",
",",
"final",
"ScriptfileUtils... | Copies the source file to a file, replacing the @key.X@ tokens with the values from the data
context
@param script source file path
@param dataContext input data context
@param framework the framework
@param style line ending style
@param destination destination file, or null to create a temp file
@retur... | [
"Copies",
"the",
"source",
"file",
"to",
"a",
"file",
"replacing",
"the",
"@key",
".",
"X@",
"tokens",
"with",
"the",
"values",
"from",
"the",
"data",
"context"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/dispatcher/DataContextUtils.java#L101-L129 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/http/HttpHeaders.java | HttpHeaders.getFirstDate | public long getFirstDate(String headerName) {
"""
Parse the first header value for the given header name as a date,
return -1 if there is no value, or raise {@link IllegalArgumentException}
if the value cannot be parsed as a date.
"""
String headerValue = getFirst(headerName);
if (headerValue == null) {
... | java | public long getFirstDate(String headerName) {
String headerValue = getFirst(headerName);
if (headerValue == null) {
return -1;
}
for (String dateFormat : DATE_FORMATS) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat, Locale.US);
simpleDateFormat.setTimeZone(GMT);
try {
retu... | [
"public",
"long",
"getFirstDate",
"(",
"String",
"headerName",
")",
"{",
"String",
"headerValue",
"=",
"getFirst",
"(",
"headerName",
")",
";",
"if",
"(",
"headerValue",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"for",
"(",
"String",
"dateFor... | Parse the first header value for the given header name as a date,
return -1 if there is no value, or raise {@link IllegalArgumentException}
if the value cannot be parsed as a date. | [
"Parse",
"the",
"first",
"header",
"value",
"for",
"the",
"given",
"header",
"name",
"as",
"a",
"date",
"return",
"-",
"1",
"if",
"there",
"is",
"no",
"value",
"or",
"raise",
"{"
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/HttpHeaders.java#L886-L903 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeFactor.java | ProjDepTreeFactor.getMsgs | private Tensor getMsgs(VarTensor[] inMsgs, int tf) {
"""
Gets messages from the Messages[].
@param inMsgs The input messages.
@param tf Whether to get TRUE or FALSE messages.
@return The messages as a Tensor.
"""
Algebra s = inMsgs[0].getAlgebra();
EdgeScores es = new EdgeScores(n, s.zero(... | java | private Tensor getMsgs(VarTensor[] inMsgs, int tf) {
Algebra s = inMsgs[0].getAlgebra();
EdgeScores es = new EdgeScores(n, s.zero());
for (VarTensor inMsg : inMsgs) {
LinkVar link = (LinkVar) inMsg.getVars().get(0);
double val = inMsg.getValue(tf);
... | [
"private",
"Tensor",
"getMsgs",
"(",
"VarTensor",
"[",
"]",
"inMsgs",
",",
"int",
"tf",
")",
"{",
"Algebra",
"s",
"=",
"inMsgs",
"[",
"0",
"]",
".",
"getAlgebra",
"(",
")",
";",
"EdgeScores",
"es",
"=",
"new",
"EdgeScores",
"(",
"n",
",",
"s",
".",... | Gets messages from the Messages[].
@param inMsgs The input messages.
@param tf Whether to get TRUE or FALSE messages.
@return The messages as a Tensor. | [
"Gets",
"messages",
"from",
"the",
"Messages",
"[]",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeFactor.java#L283-L292 |
nextreports/nextreports-engine | src/ro/nextreports/engine/chart/ChartRunner.java | ChartRunner.setConnection | public void setConnection(Connection connection, boolean csv) {
"""
Set database connection
@param connection database connection
@param csv true for a csv file connection
"""
this.connection = connection;
this.csv = csv;
try {
dialect = DialectUtil.getDialect(connection);
}... | java | public void setConnection(Connection connection, boolean csv) {
this.connection = connection;
this.csv = csv;
try {
dialect = DialectUtil.getDialect(connection);
} catch (Exception e) {
e.printStackTrace();
}
if (chart != null) {
if (chart.getRepo... | [
"public",
"void",
"setConnection",
"(",
"Connection",
"connection",
",",
"boolean",
"csv",
")",
"{",
"this",
".",
"connection",
"=",
"connection",
";",
"this",
".",
"csv",
"=",
"csv",
";",
"try",
"{",
"dialect",
"=",
"DialectUtil",
".",
"getDialect",
"(",
... | Set database connection
@param connection database connection
@param csv true for a csv file connection | [
"Set",
"database",
"connection"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/ChartRunner.java#L100-L113 |
aws/aws-sdk-java | aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/AssessmentRun.java | AssessmentRun.withFindingCounts | public AssessmentRun withFindingCounts(java.util.Map<String, Integer> findingCounts) {
"""
<p>
Provides a total count of generated findings per severity.
</p>
@param findingCounts
Provides a total count of generated findings per severity.
@return Returns a reference to this object so that method calls can b... | java | public AssessmentRun withFindingCounts(java.util.Map<String, Integer> findingCounts) {
setFindingCounts(findingCounts);
return this;
} | [
"public",
"AssessmentRun",
"withFindingCounts",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Integer",
">",
"findingCounts",
")",
"{",
"setFindingCounts",
"(",
"findingCounts",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Provides a total count of generated findings per severity.
</p>
@param findingCounts
Provides a total count of generated findings per severity.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Provides",
"a",
"total",
"count",
"of",
"generated",
"findings",
"per",
"severity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/AssessmentRun.java#L906-L909 |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/config/YamlConfigReader.java | YamlConfigReader.readObject | public static Object readObject(String correlationId, String path, ConfigParams parameters)
throws ApplicationException {
"""
Reads configuration file, parameterizes its content and converts it into JSON
object.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param p... | java | public static Object readObject(String correlationId, String path, ConfigParams parameters)
throws ApplicationException {
return new YamlConfigReader(path).readObject(correlationId, parameters);
} | [
"public",
"static",
"Object",
"readObject",
"(",
"String",
"correlationId",
",",
"String",
"path",
",",
"ConfigParams",
"parameters",
")",
"throws",
"ApplicationException",
"{",
"return",
"new",
"YamlConfigReader",
"(",
"path",
")",
".",
"readObject",
"(",
"correl... | Reads configuration file, parameterizes its content and converts it into JSON
object.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param path a path to configuration file.
@param parameters values to parameters the configuration.
@return a JSON object with configur... | [
"Reads",
"configuration",
"file",
"parameterizes",
"its",
"content",
"and",
"converts",
"it",
"into",
"JSON",
"object",
"."
] | train | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/config/YamlConfigReader.java#L113-L116 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java | RequestProgressManager.dontNotifyRequestListenersForRequest | public void dontNotifyRequestListenersForRequest(final CachedSpiceRequest<?> request, final Collection<RequestListener<?>> listRequestListener) {
"""
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@para... | java | public void dontNotifyRequestListenersForRequest(final CachedSpiceRequest<?> request, final Collection<RequestListener<?>> listRequestListener) {
final Set<RequestListener<?>> setRequestListener = mapRequestToRequestListener.get(request);
requestListenerNotifier.clearNotificationsForRequest(request, se... | [
"public",
"void",
"dontNotifyRequestListenersForRequest",
"(",
"final",
"CachedSpiceRequest",
"<",
"?",
">",
"request",
",",
"final",
"Collection",
"<",
"RequestListener",
"<",
"?",
">",
">",
"listRequestListener",
")",
"{",
"final",
"Set",
"<",
"RequestListener",
... | Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified | [
"Disable",
"request",
"listeners",
"notifications",
"for",
"a",
"specific",
"request",
".",
"<br",
"/",
">",
"All",
"listeners",
"associated",
"to",
"this",
"request",
"won",
"t",
"be",
"called",
"when",
"request",
"will",
"finish",
".",
"<br",
"/",
">"
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java#L141-L150 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabaseVulnerabilityAssessmentRuleBaselinesInner.java | DatabaseVulnerabilityAssessmentRuleBaselinesInner.delete | public void delete(String resourceGroupName, String serverName, String databaseName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) {
"""
Removes the database's vulnerability assessment rule baseline.
@param resourceGroupName The name of the resource group that contains the resource. You... | java | public void delete(String resourceGroupName, String serverName, String databaseName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) {
deleteWithServiceResponseAsync(resourceGroupName, serverName, databaseName, ruleId, baselineName).toBlocking().single().body();
} | [
"public",
"void",
"delete",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"ruleId",
",",
"VulnerabilityAssessmentPolicyBaselineName",
"baselineName",
")",
"{",
"deleteWithServiceResponseAsync",
"(",
"resourc... | Removes the database's vulnerability assessment rule baseline.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database for whic... | [
"Removes",
"the",
"database",
"s",
"vulnerability",
"assessment",
"rule",
"baseline",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabaseVulnerabilityAssessmentRuleBaselinesInner.java#L313-L315 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/ExpressionAggregate.java | ExpressionAggregate.getAggregatedValue | public Object getAggregatedValue(Session session, Object currValue) {
"""
Get the result of a SetFunction or an ordinary value
@param currValue instance of set function or value
@param session context
@return object
"""
if (currValue == null) {
// A VoltDB extension APPROX_COUNT_DISTI... | java | public Object getAggregatedValue(Session session, Object currValue) {
if (currValue == null) {
// A VoltDB extension APPROX_COUNT_DISTINCT
return opType == OpTypes.COUNT || opType == OpTypes.APPROX_COUNT_DISTINCT ?
ValuePool.INTEGER_0: null;
/* disable 2 ... | [
"public",
"Object",
"getAggregatedValue",
"(",
"Session",
"session",
",",
"Object",
"currValue",
")",
"{",
"if",
"(",
"currValue",
"==",
"null",
")",
"{",
"// A VoltDB extension APPROX_COUNT_DISTINCT",
"return",
"opType",
"==",
"OpTypes",
".",
"COUNT",
"||",
"opTy... | Get the result of a SetFunction or an ordinary value
@param currValue instance of set function or value
@param session context
@return object | [
"Get",
"the",
"result",
"of",
"a",
"SetFunction",
"or",
"an",
"ordinary",
"value"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/ExpressionAggregate.java#L293-L307 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/obl/StateSet.java | StateSet.deleteObligation | public void deleteObligation(final Obligation obligation, int basicBlockId)
throws ObligationAcquiredOrReleasedInLoopException {
"""
Remove an Obligation from every State in the StateSet.
@param obligation
the obligation to remove
@param basicBlockId
the id of the basic block (path component) rem... | java | public void deleteObligation(final Obligation obligation, int basicBlockId)
throws ObligationAcquiredOrReleasedInLoopException {
Map<ObligationSet, State> updatedStateMap = new HashMap<>();
for (Iterator<State> i = stateIterator(); i.hasNext();) {
State state = i.next();
... | [
"public",
"void",
"deleteObligation",
"(",
"final",
"Obligation",
"obligation",
",",
"int",
"basicBlockId",
")",
"throws",
"ObligationAcquiredOrReleasedInLoopException",
"{",
"Map",
"<",
"ObligationSet",
",",
"State",
">",
"updatedStateMap",
"=",
"new",
"HashMap",
"<>... | Remove an Obligation from every State in the StateSet.
@param obligation
the obligation to remove
@param basicBlockId
the id of the basic block (path component) removing the
obligation
@throws ObligationAcquiredOrReleasedInLoopException | [
"Remove",
"an",
"Obligation",
"from",
"every",
"State",
"in",
"the",
"StateSet",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/obl/StateSet.java#L216-L229 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/api/ApiImplementor.java | ApiImplementor.handleApiOther | public HttpMessage handleApiOther(HttpMessage msg, String name, JSONObject params) throws ApiException {
"""
Override if implementing one or more 'other' operations - these are operations that _dont_ return structured data
@param msg the HTTP message containing the API request
@param name the name of the request... | java | public HttpMessage handleApiOther(HttpMessage msg, String name, JSONObject params) throws ApiException {
throw new ApiException(ApiException.Type.BAD_OTHER, name);
} | [
"public",
"HttpMessage",
"handleApiOther",
"(",
"HttpMessage",
"msg",
",",
"String",
"name",
",",
"JSONObject",
"params",
")",
"throws",
"ApiException",
"{",
"throw",
"new",
"ApiException",
"(",
"ApiException",
".",
"Type",
".",
"BAD_OTHER",
",",
"name",
")",
... | Override if implementing one or more 'other' operations - these are operations that _dont_ return structured data
@param msg the HTTP message containing the API request
@param name the name of the requested other endpoint
@param params the API request parameters
@return the HTTP message with the API response
@throws Ap... | [
"Override",
"if",
"implementing",
"one",
"or",
"more",
"other",
"operations",
"-",
"these",
"are",
"operations",
"that",
"_dont_",
"return",
"structured",
"data"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/ApiImplementor.java#L347-L349 |
stevespringett/Alpine | alpine/src/main/java/alpine/crypto/DataEncryption.java | DataEncryption.decryptAsString | public static String decryptAsString(final SecretKey secretKey, final String encryptedText) throws Exception {
"""
Decrypts the specified string using AES-256. The encryptedText is
expected to be the Base64 encoded representation of the encrypted bytes
generated from {@link #encryptAsString(String)}.
@param sec... | java | public static String decryptAsString(final SecretKey secretKey, final String encryptedText) throws Exception {
return new String(decryptAsBytes(secretKey, Base64.getDecoder().decode(encryptedText)));
} | [
"public",
"static",
"String",
"decryptAsString",
"(",
"final",
"SecretKey",
"secretKey",
",",
"final",
"String",
"encryptedText",
")",
"throws",
"Exception",
"{",
"return",
"new",
"String",
"(",
"decryptAsBytes",
"(",
"secretKey",
",",
"Base64",
".",
"getDecoder",... | Decrypts the specified string using AES-256. The encryptedText is
expected to be the Base64 encoded representation of the encrypted bytes
generated from {@link #encryptAsString(String)}.
@param secretKey the secret key to decrypt with
@param encryptedText the text to decrypt
@return the decrypted string
@throws Excepti... | [
"Decrypts",
"the",
"specified",
"string",
"using",
"AES",
"-",
"256",
".",
"The",
"encryptedText",
"is",
"expected",
"to",
"be",
"the",
"Base64",
"encoded",
"representation",
"of",
"the",
"encrypted",
"bytes",
"generated",
"from",
"{"
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/crypto/DataEncryption.java#L161-L163 |
bbottema/simple-java-mail | modules/simple-java-mail/src/main/java/org/simplejavamail/mailer/internal/mailsender/MailSenderImpl.java | MailSenderImpl.configureSessionWithTimeout | private void configureSessionWithTimeout(final Session session, final int sessionTimeout) {
"""
Configures the {@link Session} with the same timeout for socket connection timeout, read and write timeout.
"""
if (transportStrategy != null) {
// socket timeouts handling
final Properties sessionProperties... | java | private void configureSessionWithTimeout(final Session session, final int sessionTimeout) {
if (transportStrategy != null) {
// socket timeouts handling
final Properties sessionProperties = session.getProperties();
sessionProperties.put(transportStrategy.propertyNameConnectionTimeout(), String.valueOf(sessio... | [
"private",
"void",
"configureSessionWithTimeout",
"(",
"final",
"Session",
"session",
",",
"final",
"int",
"sessionTimeout",
")",
"{",
"if",
"(",
"transportStrategy",
"!=",
"null",
")",
"{",
"// socket timeouts handling",
"final",
"Properties",
"sessionProperties",
"=... | Configures the {@link Session} with the same timeout for socket connection timeout, read and write timeout. | [
"Configures",
"the",
"{"
] | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/mailer/internal/mailsender/MailSenderImpl.java#L198-L208 |
antopen/alipay-sdk-java | src/main/java/com/alipay/api/internal/util/AlipaySignature.java | AlipaySignature.rsaDecrypt | public static String rsaDecrypt(String content, String privateKey,
String charset) throws AlipayApiException {
"""
私钥解密
@param content 待解密内容
@param privateKey 私钥
@param charset 字符集,如UTF-8, GBK, GB2312
@return 明文内容
@throws AlipayApiException
"""
try {
... | java | public static String rsaDecrypt(String content, String privateKey,
String charset) throws AlipayApiException {
try {
PrivateKey priKey = getPrivateKeyFromPKCS8(AlipayConstants.SIGN_TYPE_RSA,
new ByteArrayInputStream(privateKey.getBytes()));
... | [
"public",
"static",
"String",
"rsaDecrypt",
"(",
"String",
"content",
",",
"String",
"privateKey",
",",
"String",
"charset",
")",
"throws",
"AlipayApiException",
"{",
"try",
"{",
"PrivateKey",
"priKey",
"=",
"getPrivateKeyFromPKCS8",
"(",
"AlipayConstants",
".",
"... | 私钥解密
@param content 待解密内容
@param privateKey 私钥
@param charset 字符集,如UTF-8, GBK, GB2312
@return 明文内容
@throws AlipayApiException | [
"私钥解密"
] | train | https://github.com/antopen/alipay-sdk-java/blob/e82aeac7d0239330ee173c7e393596e51e41c1cd/src/main/java/com/alipay/api/internal/util/AlipaySignature.java#L598-L632 |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/query/UserMetadata/RiakUserMetadata.java | RiakUserMetadata.put | public void put(String key, String value) {
"""
Set a user metadata entry.
<p>
This method and its {@link RiakUserMetadata#get(java.lang.String) }
counterpart use the default {@code Charset} to convert the {@code String}s.
</p>
@param key the key for the user metadata entry as a {@code String} encoded usi... | java | public void put(String key, String value)
{
put(key, value, DefaultCharset.get());
} | [
"public",
"void",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"put",
"(",
"key",
",",
"value",
",",
"DefaultCharset",
".",
"get",
"(",
")",
")",
";",
"}"
] | Set a user metadata entry.
<p>
This method and its {@link RiakUserMetadata#get(java.lang.String) }
counterpart use the default {@code Charset} to convert the {@code String}s.
</p>
@param key the key for the user metadata entry as a {@code String} encoded using the default {@code Charset}
@param value the value for t... | [
"Set",
"a",
"user",
"metadata",
"entry",
".",
"<p",
">",
"This",
"method",
"and",
"its",
"{",
"@link",
"RiakUserMetadata#get",
"(",
"java",
".",
"lang",
".",
"String",
")",
"}",
"counterpart",
"use",
"the",
"default",
"{",
"@code",
"Charset",
"}",
"to",
... | train | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/UserMetadata/RiakUserMetadata.java#L165-L168 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java | DBCleanService.getRepositoryDBCleaner | public static DBCleanerTool getRepositoryDBCleaner(Connection jdbcConn, RepositoryEntry rEntry)
throws DBCleanException {
"""
Returns database cleaner for repository.
@param jdbcConn
database connection which need to use
@param rEntry
repository configuration
@return DBCleanerTool
@throws DBCleanExc... | java | public static DBCleanerTool getRepositoryDBCleaner(Connection jdbcConn, RepositoryEntry rEntry)
throws DBCleanException
{
SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
WorkspaceEntry wsEntry = rEntry.getWorkspaceEntries().get(0);
boole... | [
"public",
"static",
"DBCleanerTool",
"getRepositoryDBCleaner",
"(",
"Connection",
"jdbcConn",
",",
"RepositoryEntry",
"rEntry",
")",
"throws",
"DBCleanException",
"{",
"SecurityHelper",
".",
"validateSecurityPermission",
"(",
"JCRRuntimePermissions",
".",
"MANAGE_REPOSITORY_P... | Returns database cleaner for repository.
@param jdbcConn
database connection which need to use
@param rEntry
repository configuration
@return DBCleanerTool
@throws DBCleanException | [
"Returns",
"database",
"cleaner",
"for",
"repository",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java#L158-L179 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSX509KeyManager.java | WSX509KeyManager.chooseEngineServerAlias | @Override
public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine) {
"""
Handshakes that use the SSLEngine and not an SSLSocket require this method
from the extended X509KeyManager.
@see javax.net.ssl.X509ExtendedKeyManager#chooseEngineServerAlias(java.lang.String, java.... | java | @Override
public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "chooseEngineServerAlias", new Object[] { keyType, issuers, engine });
String rc = null;
if (nul... | [
"@",
"Override",
"public",
"String",
"chooseEngineServerAlias",
"(",
"String",
"keyType",
",",
"Principal",
"[",
"]",
"issuers",
",",
"SSLEngine",
"engine",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryE... | Handshakes that use the SSLEngine and not an SSLSocket require this method
from the extended X509KeyManager.
@see javax.net.ssl.X509ExtendedKeyManager#chooseEngineServerAlias(java.lang.String, java.security.Principal[], javax.net.ssl.SSLEngine) | [
"Handshakes",
"that",
"use",
"the",
"SSLEngine",
"and",
"not",
"an",
"SSLSocket",
"require",
"this",
"method",
"from",
"the",
"extended",
"X509KeyManager",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSX509KeyManager.java#L313-L329 |
michael-rapp/AndroidMaterialDialog | example/src/main/java/de/mrapp/android/dialog/example/PreferenceFragment.java | PreferenceFragment.createPositiveButtonListener | private OnClickListener createPositiveButtonListener() {
"""
Creates and returns a listener, which allows to show a toast, when the positive button of a
dialog has been clicked.
@return The listener, which has been created, as an instance of the class {@link
OnClickListener}
"""
return new OnClick... | java | private OnClickListener createPositiveButtonListener() {
return new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getActivity(), R.string.positive_button_toast, Toast.LENGTH_SHORT)
.show();
... | [
"private",
"OnClickListener",
"createPositiveButtonListener",
"(",
")",
"{",
"return",
"new",
"OnClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"DialogInterface",
"dialog",
",",
"int",
"which",
")",
"{",
"Toast",
".",
"makeText... | Creates and returns a listener, which allows to show a toast, when the positive button of a
dialog has been clicked.
@return The listener, which has been created, as an instance of the class {@link
OnClickListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"show",
"a",
"toast",
"when",
"the",
"positive",
"button",
"of",
"a",
"dialog",
"has",
"been",
"clicked",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/example/src/main/java/de/mrapp/android/dialog/example/PreferenceFragment.java#L791-L801 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/copy/CopyFileExtensions.java | CopyFileExtensions.copyFile | public static boolean copyFile(final File source, final File destination,
final boolean lastModified) throws IOException {
"""
Copies the given source file to the given destination file with the option to set the
lastModified time from the given destination file.
@param source
The source file.
@param desti... | java | public static boolean copyFile(final File source, final File destination,
final boolean lastModified) throws IOException
{
return copyFile(source, destination, null, null, lastModified);
} | [
"public",
"static",
"boolean",
"copyFile",
"(",
"final",
"File",
"source",
",",
"final",
"File",
"destination",
",",
"final",
"boolean",
"lastModified",
")",
"throws",
"IOException",
"{",
"return",
"copyFile",
"(",
"source",
",",
"destination",
",",
"null",
",... | Copies the given source file to the given destination file with the option to set the
lastModified time from the given destination file.
@param source
The source file.
@param destination
The destination file.
@param lastModified
Flag the tells if the attribute lastModified has to be set with the attribute from
the des... | [
"Copies",
"the",
"given",
"source",
"file",
"to",
"the",
"given",
"destination",
"file",
"with",
"the",
"option",
"to",
"set",
"the",
"lastModified",
"time",
"from",
"the",
"given",
"destination",
"file",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/copy/CopyFileExtensions.java#L507-L511 |
banq/jdonframework | src/main/java/com/jdon/util/UtilDateTime.java | UtilDateTime.toSqlDate | public static java.sql.Date toSqlDate(int month, int day, int year) {
"""
Makes a java.sql.Date from separate ints for month, day, year
@param month
The month int
@param day
The day int
@param year
The year int
@return A java.sql.Date made from separate ints for month, day, year
"""
java.util.Date ... | java | public static java.sql.Date toSqlDate(int month, int day, int year) {
java.util.Date newDate = toDate(month, day, year, 0, 0, 0);
if (newDate != null)
return new java.sql.Date(newDate.getTime());
else
return null;
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Date",
"toSqlDate",
"(",
"int",
"month",
",",
"int",
"day",
",",
"int",
"year",
")",
"{",
"java",
".",
"util",
".",
"Date",
"newDate",
"=",
"toDate",
"(",
"month",
",",
"day",
",",
"year",
",",
"0",
"... | Makes a java.sql.Date from separate ints for month, day, year
@param month
The month int
@param day
The day int
@param year
The year int
@return A java.sql.Date made from separate ints for month, day, year | [
"Makes",
"a",
"java",
".",
"sql",
".",
"Date",
"from",
"separate",
"ints",
"for",
"month",
"day",
"year"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilDateTime.java#L137-L144 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/tenant/TenantService.java | TenantService.deleteTenant | public void deleteTenant(String tenantName, Map<String, String> options) {
"""
Delete an existing tenant with the given options. The tenant's keyspace is dropped,
which deletes all user and system tables, and the tenant's users are deleted. The
given options are currently used for testing only. This method is a ... | java | public void deleteTenant(String tenantName, Map<String, String> options) {
checkServiceState();
TenantDefinition tenantDef = getTenantDef(tenantName);
if (tenantDef == null) {
return;
}
Tenant tenant = new Tenant(tenantDef);
try {
DBServic... | [
"public",
"void",
"deleteTenant",
"(",
"String",
"tenantName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"checkServiceState",
"(",
")",
";",
"TenantDefinition",
"tenantDef",
"=",
"getTenantDef",
"(",
"tenantName",
")",
";",
"if",
"(... | Delete an existing tenant with the given options. The tenant's keyspace is dropped,
which deletes all user and system tables, and the tenant's users are deleted. The
given options are currently used for testing only. This method is a no-op if the
given tenant does not exist.
@param tenantName Name of tenant to dele... | [
"Delete",
"an",
"existing",
"tenant",
"with",
"the",
"given",
"options",
".",
"The",
"tenant",
"s",
"keyspace",
"is",
"dropped",
"which",
"deletes",
"all",
"user",
"and",
"system",
"tables",
"and",
"the",
"tenant",
"s",
"users",
"are",
"deleted",
".",
"The... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/tenant/TenantService.java#L315-L338 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.