repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
vatbub/common | updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java | UpdateChecker.getMavenMetadata | private static Document getMavenMetadata(URL repoBaseURL, String mavenGroupID, String mavenArtifactID)
throws JDOMException, IOException {
return new SAXBuilder().build(new URL(repoBaseURL.toString() + "/" + mavenGroupID.replace('.', '/')
+ "/" + mavenArtifactID + "/maven-metadata.xm... | java | private static Document getMavenMetadata(URL repoBaseURL, String mavenGroupID, String mavenArtifactID)
throws JDOMException, IOException {
return new SAXBuilder().build(new URL(repoBaseURL.toString() + "/" + mavenGroupID.replace('.', '/')
+ "/" + mavenArtifactID + "/maven-metadata.xm... | [
"private",
"static",
"Document",
"getMavenMetadata",
"(",
"URL",
"repoBaseURL",
",",
"String",
"mavenGroupID",
",",
"String",
"mavenArtifactID",
")",
"throws",
"JDOMException",
",",
"IOException",
"{",
"return",
"new",
"SAXBuilder",
"(",
")",
".",
"build",
"(",
... | Get a DOM of mavens {@code maven-metadata.xml}-file of the specified
artifact.
@param repoBaseURL The base url where the repo can be reached. For Maven Central,
this is <a href="http://repo1.maven.org/maven/">http://repo1.maven.org/maven/</a>
@param mavenGroupID The groupID of the artifact to be looked up.
@par... | [
"Get",
"a",
"DOM",
"of",
"mavens",
"{",
"@code",
"maven",
"-",
"metadata",
".",
"xml",
"}",
"-",
"file",
"of",
"the",
"specified",
"artifact",
"."
] | train | https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java#L369-L373 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRecordBrowser.java | LogRecordBrowser.restartRecordsInProcess | private OnePidRecordListImpl restartRecordsInProcess(final RepositoryPointer after, long max, final IInternalRecordFilter recFilter) {
if (!(after instanceof RepositoryPointerImpl)) {
throw new IllegalArgumentException("Specified location does not belong to this repository.");
}
return new OnePidRecordListLoca... | java | private OnePidRecordListImpl restartRecordsInProcess(final RepositoryPointer after, long max, final IInternalRecordFilter recFilter) {
if (!(after instanceof RepositoryPointerImpl)) {
throw new IllegalArgumentException("Specified location does not belong to this repository.");
}
return new OnePidRecordListLoca... | [
"private",
"OnePidRecordListImpl",
"restartRecordsInProcess",
"(",
"final",
"RepositoryPointer",
"after",
",",
"long",
"max",
",",
"final",
"IInternalRecordFilter",
"recFilter",
")",
"{",
"if",
"(",
"!",
"(",
"after",
"instanceof",
"RepositoryPointerImpl",
")",
")",
... | continue the list of the records in the process filtered with <code>recFilter</code> | [
"continue",
"the",
"list",
"of",
"the",
"records",
"in",
"the",
"process",
"filtered",
"with",
"<code",
">",
"recFilter<",
"/",
"code",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRecordBrowser.java#L172-L177 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java | XMLUtils.extractXML | public static String extractXML(Node node, int start, int length)
{
ExtractHandler handler = null;
try {
handler = new ExtractHandler(start, length);
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(new DOMSource(node), ne... | java | public static String extractXML(Node node, int start, int length)
{
ExtractHandler handler = null;
try {
handler = new ExtractHandler(start, length);
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(new DOMSource(node), ne... | [
"public",
"static",
"String",
"extractXML",
"(",
"Node",
"node",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"ExtractHandler",
"handler",
"=",
"null",
";",
"try",
"{",
"handler",
"=",
"new",
"ExtractHandler",
"(",
"start",
",",
"length",
")",
";... | Extracts a well-formed XML fragment from the given DOM tree.
@param node the root of the DOM tree where the extraction takes place
@param start the index of the first character
@param length the maximum number of characters in text nodes to include in the returned fragment
@return a well-formed XML fragment starting a... | [
"Extracts",
"a",
"well",
"-",
"formed",
"XML",
"fragment",
"from",
"the",
"given",
"DOM",
"tree",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java#L137-L152 |
HeidelTime/heideltime | src/de/unihd/dbs/uima/annotator/heideltime/ProcessorManager.java | ProcessorManager.registerProcessor | public void registerProcessor(String processor, Priority prio) {
this.processorNames.get(prio).add(processor);
} | java | public void registerProcessor(String processor, Priority prio) {
this.processorNames.get(prio).add(processor);
} | [
"public",
"void",
"registerProcessor",
"(",
"String",
"processor",
",",
"Priority",
"prio",
")",
"{",
"this",
".",
"processorNames",
".",
"get",
"(",
"prio",
")",
".",
"add",
"(",
"processor",
")",
";",
"}"
] | method to register a processor
@param processor processor to be registered in the processormanager's list
@param p priority for the process to take | [
"method",
"to",
"register",
"a",
"processor"
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/ProcessorManager.java#L51-L53 |
jglobus/JGlobus | gram/src/main/java/org/globus/gram/Gram.java | Gram.jobSignal | public static int jobSignal(GramJob job, int signal, String arg)
throws GramException, GSSException {
GlobusURL jobURL = job.getID();
GSSCredential cred = getJobCredentials(job);
String msg = GRAMProtocol.SIGNAL(jobURL.getURL(),
jobURL.getHost(),
signal,
arg);
GatekeeperReply hd = null;
hd ... | java | public static int jobSignal(GramJob job, int signal, String arg)
throws GramException, GSSException {
GlobusURL jobURL = job.getID();
GSSCredential cred = getJobCredentials(job);
String msg = GRAMProtocol.SIGNAL(jobURL.getURL(),
jobURL.getHost(),
signal,
arg);
GatekeeperReply hd = null;
hd ... | [
"public",
"static",
"int",
"jobSignal",
"(",
"GramJob",
"job",
",",
"int",
"signal",
",",
"String",
"arg",
")",
"throws",
"GramException",
",",
"GSSException",
"{",
"GlobusURL",
"jobURL",
"=",
"job",
".",
"getID",
"(",
")",
";",
"GSSCredential",
"cred",
"=... | This function sends a signal to a job.
@throws GramException if an error occurs during cancel
@param job the signaled job
@param signal type of the signal
@param arg argument of the signal | [
"This",
"function",
"sends",
"a",
"signal",
"to",
"a",
"job",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/gram/Gram.java#L686-L725 |
GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java | GoogleHadoopFileSystemBase.listStatus | @Override
public FileStatus[] listStatus(Path hadoopPath)
throws IOException {
long startTime = System.nanoTime();
Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null");
checkOpen();
logger.atFine().log("GHFS.listStatus: %s", hadoopPath);
URI gcsPath = getGcsPath(... | java | @Override
public FileStatus[] listStatus(Path hadoopPath)
throws IOException {
long startTime = System.nanoTime();
Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null");
checkOpen();
logger.atFine().log("GHFS.listStatus: %s", hadoopPath);
URI gcsPath = getGcsPath(... | [
"@",
"Override",
"public",
"FileStatus",
"[",
"]",
"listStatus",
"(",
"Path",
"hadoopPath",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"hadoopPath",
"!=",
... | Lists file status. If the given path points to a directory then the status
of children is returned, otherwise the status of the given file is returned.
@param hadoopPath Given path.
@return File status list or null if path does not exist.
@throws IOException if an error occurs. | [
"Lists",
"file",
"status",
".",
"If",
"the",
"given",
"path",
"points",
"to",
"a",
"directory",
"then",
"the",
"status",
"of",
"children",
"is",
"returned",
"otherwise",
"the",
"status",
"of",
"the",
"given",
"file",
"is",
"returned",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java#L968-L997 |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/error/ErrorUtil.java | ErrorUtil.throwInternalError | public static void throwInternalError(String message, UriInfo uriInfo) {
GenericError error = new GenericError(
message,
ErrorCode.INTERNAL.getCode(),
uriInfo.getAbsolutePath().toString());
throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR)
... | java | public static void throwInternalError(String message, UriInfo uriInfo) {
GenericError error = new GenericError(
message,
ErrorCode.INTERNAL.getCode(),
uriInfo.getAbsolutePath().toString());
throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR)
... | [
"public",
"static",
"void",
"throwInternalError",
"(",
"String",
"message",
",",
"UriInfo",
"uriInfo",
")",
"{",
"GenericError",
"error",
"=",
"new",
"GenericError",
"(",
"message",
",",
"ErrorCode",
".",
"INTERNAL",
".",
"getCode",
"(",
")",
",",
"uriInfo",
... | Wraps the error as {@link WebApplicationException} with error mapped as JSON Response
@param message {@link String} representing internal error
@param uriInfo {@link UriInfo} used for forming link | [
"Wraps",
"the",
"error",
"as",
"{"
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/error/ErrorUtil.java#L72-L82 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.roundedCornersRxDp | @NonNull
public IconicsDrawable roundedCornersRxDp(@Dimension(unit = DP) int sizeDp) {
return roundedCornersRxPx(Utils.convertDpToPx(mContext, sizeDp));
} | java | @NonNull
public IconicsDrawable roundedCornersRxDp(@Dimension(unit = DP) int sizeDp) {
return roundedCornersRxPx(Utils.convertDpToPx(mContext, sizeDp));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"roundedCornersRxDp",
"(",
"@",
"Dimension",
"(",
"unit",
"=",
"DP",
")",
"int",
"sizeDp",
")",
"{",
"return",
"roundedCornersRxPx",
"(",
"Utils",
".",
"convertDpToPx",
"(",
"mContext",
",",
"sizeDp",
")",
")",
";... | Set rounded corner from dp
@return The current IconicsDrawable for chaining. | [
"Set",
"rounded",
"corner",
"from",
"dp"
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L912-L915 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java | SeleniumHelper.doInCurrentContext | public <R> R doInCurrentContext(Function<SearchContext, ? extends R> function) {
try {
return function.apply(getCurrentContext());
} catch (WebDriverException e) {
if (isStaleElementException(e)) {
// current context was no good to search in
curren... | java | public <R> R doInCurrentContext(Function<SearchContext, ? extends R> function) {
try {
return function.apply(getCurrentContext());
} catch (WebDriverException e) {
if (isStaleElementException(e)) {
// current context was no good to search in
curren... | [
"public",
"<",
"R",
">",
"R",
"doInCurrentContext",
"(",
"Function",
"<",
"SearchContext",
",",
"?",
"extends",
"R",
">",
"function",
")",
"{",
"try",
"{",
"return",
"function",
".",
"apply",
"(",
"getCurrentContext",
"(",
")",
")",
";",
"}",
"catch",
... | Perform action/supplier in current context.
@param function function to perform.
@param <R> type of result.
@return function result.
@throws StaleContextException if function threw stale element exception (i.e. current context could not be used) | [
"Perform",
"action",
"/",
"supplier",
"in",
"current",
"context",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L749-L761 |
mgormley/prim | src/main/java/edu/jhu/prim/util/math/FastMath.java | FastMath.logSubtractExact | public static double logSubtractExact(double x, double y) {
if (x < y) {
throw new IllegalStateException("x must be >= y. x=" + x + " y=" + y);
}
// p = 0 or q = 0, where x = log(p), y = log(q)
if (Double.NEGATIVE_INFINITY == y) {
return x;
} else... | java | public static double logSubtractExact(double x, double y) {
if (x < y) {
throw new IllegalStateException("x must be >= y. x=" + x + " y=" + y);
}
// p = 0 or q = 0, where x = log(p), y = log(q)
if (Double.NEGATIVE_INFINITY == y) {
return x;
} else... | [
"public",
"static",
"double",
"logSubtractExact",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"x",
"<",
"y",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"x must be >= y. x=\"",
"+",
"x",
"+",
"\" y=\"",
"+",
"y",
")",
";",
... | Subtracts two probabilities that are stored as log probabilities.
Note that x >= y.
@param x log(p)
@param y log(q)
@return log(p - q) = log(exp(p) - exp(q))
@throws IllegalStateException if x < y | [
"Subtracts",
"two",
"probabilities",
"that",
"are",
"stored",
"as",
"log",
"probabilities",
".",
"Note",
"that",
"x",
">",
"=",
"y",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/util/math/FastMath.java#L82-L102 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/variant/VariantUtils.java | VariantUtils.getVariantKey | public static String getVariantKey(Map<String, String> variants) {
String variantKey = "";
if (variants != null) {
variantKey = getVariantKey(variants, variants.keySet());
}
return variantKey;
} | java | public static String getVariantKey(Map<String, String> variants) {
String variantKey = "";
if (variants != null) {
variantKey = getVariantKey(variants, variants.keySet());
}
return variantKey;
} | [
"public",
"static",
"String",
"getVariantKey",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"variants",
")",
"{",
"String",
"variantKey",
"=",
"\"\"",
";",
"if",
"(",
"variants",
"!=",
"null",
")",
"{",
"variantKey",
"=",
"getVariantKey",
"(",
"variants"... | Returns the variant key from the variants given in parameter
@param variants
the variants
@return the variant key | [
"Returns",
"the",
"variant",
"key",
"from",
"the",
"variants",
"given",
"in",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/variant/VariantUtils.java#L191-L199 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java | Whitebox.setInternalStateFromContext | public static void setInternalStateFromContext(Object instance, Object context, Object... additionalContexts) {
WhiteboxImpl.setInternalStateFromContext(instance, context, additionalContexts);
} | java | public static void setInternalStateFromContext(Object instance, Object context, Object... additionalContexts) {
WhiteboxImpl.setInternalStateFromContext(instance, context, additionalContexts);
} | [
"public",
"static",
"void",
"setInternalStateFromContext",
"(",
"Object",
"instance",
",",
"Object",
"context",
",",
"Object",
"...",
"additionalContexts",
")",
"{",
"WhiteboxImpl",
".",
"setInternalStateFromContext",
"(",
"instance",
",",
"context",
",",
"additionalC... | Set the values of multiple instance fields defined in a context using
reflection. The values in the context will be assigned to values on the
{@code instance}. This method will traverse the class hierarchy when
searching for the fields. Example usage:
<p>
Given:
<pre>
public class MyContext {
private String myString =... | [
"Set",
"the",
"values",
"of",
"multiple",
"instance",
"fields",
"defined",
"in",
"a",
"context",
"using",
"reflection",
".",
"The",
"values",
"in",
"the",
"context",
"will",
"be",
"assigned",
"to",
"values",
"on",
"the",
"{",
"@code",
"instance",
"}",
".",... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java#L733-L735 |
geomajas/geomajas-project-client-gwt | plugin/javascript-api/javascript-api-gwt/src/main/java/org/geomajas/plugin/jsapi/gwt/client/exporter/map/feature/FeatureSearchServiceImpl.java | FeatureSearchServiceImpl.searchById | public void searchById(final FeaturesSupported layer, final String[] ids, final FeatureArrayCallback callback) {
Layer<?> gwtLayer = map.getMapWidget().getMapModel().getLayer(layer.getId());
if (gwtLayer != null && gwtLayer instanceof VectorLayer) {
VectorLayer vLayer = (VectorLayer) gwtLayer;
SearchCriterion... | java | public void searchById(final FeaturesSupported layer, final String[] ids, final FeatureArrayCallback callback) {
Layer<?> gwtLayer = map.getMapWidget().getMapModel().getLayer(layer.getId());
if (gwtLayer != null && gwtLayer instanceof VectorLayer) {
VectorLayer vLayer = (VectorLayer) gwtLayer;
SearchCriterion... | [
"public",
"void",
"searchById",
"(",
"final",
"FeaturesSupported",
"layer",
",",
"final",
"String",
"[",
"]",
"ids",
",",
"final",
"FeatureArrayCallback",
"callback",
")",
"{",
"Layer",
"<",
"?",
">",
"gwtLayer",
"=",
"map",
".",
"getMapWidget",
"(",
")",
... | Search features within a certain layer, using the feature IDs.
@param layer
The features supported layer wherein to search.
@param ids
The unique IDs of the feature within the layer.
@param callback
Call-back method executed on return (when the feature has been found). | [
"Search",
"features",
"within",
"a",
"certain",
"layer",
"using",
"the",
"feature",
"IDs",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/javascript-api/javascript-api-gwt/src/main/java/org/geomajas/plugin/jsapi/gwt/client/exporter/map/feature/FeatureSearchServiceImpl.java#L71-L104 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java | FileUtilities.deleteDirContents | public static boolean deleteDirContents(final File dir) {
if (dir.isDirectory()) {
final String[] children = dir.list();
for (final String aChildren : children) {
final File child = new File(dir, aChildren);
if (child.isDirectory()) {
... | java | public static boolean deleteDirContents(final File dir) {
if (dir.isDirectory()) {
final String[] children = dir.list();
for (final String aChildren : children) {
final File child = new File(dir, aChildren);
if (child.isDirectory()) {
... | [
"public",
"static",
"boolean",
"deleteDirContents",
"(",
"final",
"File",
"dir",
")",
"{",
"if",
"(",
"dir",
".",
"isDirectory",
"(",
")",
")",
"{",
"final",
"String",
"[",
"]",
"children",
"=",
"dir",
".",
"list",
"(",
")",
";",
"for",
"(",
"final",... | Delete the contents of a directory and all of its sub directories/files
@param dir The directory whose content is to be deleted.
@return True if the directories contents were deleted otherwise false if an error occurred. | [
"Delete",
"the",
"contents",
"of",
"a",
"directory",
"and",
"all",
"of",
"its",
"sub",
"directories",
"/",
"files"
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/FileUtilities.java#L195-L214 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java | BitfinexApiCallbackListeners.onTickEvent | public Closeable onTickEvent(final BiConsumer<BitfinexTickerSymbol, BitfinexTick> listener) {
tickConsumers.offer(listener);
return () -> tickConsumers.remove(listener);
} | java | public Closeable onTickEvent(final BiConsumer<BitfinexTickerSymbol, BitfinexTick> listener) {
tickConsumers.offer(listener);
return () -> tickConsumers.remove(listener);
} | [
"public",
"Closeable",
"onTickEvent",
"(",
"final",
"BiConsumer",
"<",
"BitfinexTickerSymbol",
",",
"BitfinexTick",
">",
"listener",
")",
"{",
"tickConsumers",
".",
"offer",
"(",
"listener",
")",
";",
"return",
"(",
")",
"->",
"tickConsumers",
".",
"remove",
"... | registers listener for tick events
@param listener of event
@return hook of this listener | [
"registers",
"listener",
"for",
"tick",
"events"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java#L188-L191 |
aws/aws-sdk-java | aws-java-sdk-codestar/src/main/java/com/amazonaws/services/codestar/model/TagProjectResult.java | TagProjectResult.withTags | public TagProjectResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | java | public TagProjectResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"TagProjectResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags for the project.
</p>
@param tags
The tags for the project.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"tags",
"for",
"the",
"project",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codestar/src/main/java/com/amazonaws/services/codestar/model/TagProjectResult.java#L68-L71 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java | SphereUtil.cosineOrHaversineDeg | public static double cosineOrHaversineDeg(double lat1, double lon1, double lat2, double lon2) {
return cosineOrHaversineRad(deg2rad(lat1), deg2rad(lon1), deg2rad(lat2), deg2rad(lon2));
} | java | public static double cosineOrHaversineDeg(double lat1, double lon1, double lat2, double lon2) {
return cosineOrHaversineRad(deg2rad(lat1), deg2rad(lon1), deg2rad(lat2), deg2rad(lon2));
} | [
"public",
"static",
"double",
"cosineOrHaversineDeg",
"(",
"double",
"lat1",
",",
"double",
"lon1",
",",
"double",
"lat2",
",",
"double",
"lon2",
")",
"{",
"return",
"cosineOrHaversineRad",
"(",
"deg2rad",
"(",
"lat1",
")",
",",
"deg2rad",
"(",
"lon1",
")",
... | Use cosine or haversine dynamically.
Complexity: 4-5 trigonometric functions, 1 sqrt.
@param lat1 Latitude of first point in degree
@param lon1 Longitude of first point in degree
@param lat2 Latitude of second point in degree
@param lon2 Longitude of second point in degree
@return Distance on unit sphere | [
"Use",
"cosine",
"or",
"haversine",
"dynamically",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L200-L202 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.incorrectMethodDefinition | public static void incorrectMethodDefinition(String methodName, String className){
throw new DynamicConversionMethodException(MSG.INSTANCE.message(dynamicConversionMethodException,methodName,className));
} | java | public static void incorrectMethodDefinition(String methodName, String className){
throw new DynamicConversionMethodException(MSG.INSTANCE.message(dynamicConversionMethodException,methodName,className));
} | [
"public",
"static",
"void",
"incorrectMethodDefinition",
"(",
"String",
"methodName",
",",
"String",
"className",
")",
"{",
"throw",
"new",
"DynamicConversionMethodException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"dynamicConversionMethodException",
",",
"... | Thrown when the method don't respects the convetions beloging to the dynamic conversion implementation.
@param methodName method name
@param className class name | [
"Thrown",
"when",
"the",
"method",
"don",
"t",
"respects",
"the",
"convetions",
"beloging",
"to",
"the",
"dynamic",
"conversion",
"implementation",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L222-L224 |
pravega/pravega | controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java | RecordHelper.validateStreamCut | public static void validateStreamCut(List<Map.Entry<Double, Double>> streamCutSegments) {
// verify that stream cut covers the entire range of 0.0 to 1.0 keyspace without overlaps.
List<Map.Entry<Double, Double>> reduced = reduce(streamCutSegments);
Exceptions.checkArgument(reduced.size() == 1 &... | java | public static void validateStreamCut(List<Map.Entry<Double, Double>> streamCutSegments) {
// verify that stream cut covers the entire range of 0.0 to 1.0 keyspace without overlaps.
List<Map.Entry<Double, Double>> reduced = reduce(streamCutSegments);
Exceptions.checkArgument(reduced.size() == 1 &... | [
"public",
"static",
"void",
"validateStreamCut",
"(",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Double",
",",
"Double",
">",
">",
"streamCutSegments",
")",
"{",
"// verify that stream cut covers the entire range of 0.0 to 1.0 keyspace without overlaps.",
"List",
"<",
"Map",... | Method to validate a given stream Cut.
A stream cut is valid if it covers the entire key space without any overlaps in ranges for segments that form the
streamcut. It throws {@link IllegalArgumentException} if the supplied stream cut does not satisfy the invariants.
@param streamCutSegments supplied stream cut. | [
"Method",
"to",
"validate",
"a",
"given",
"stream",
"Cut",
".",
"A",
"stream",
"cut",
"is",
"valid",
"if",
"it",
"covers",
"the",
"entire",
"key",
"space",
"without",
"any",
"overlaps",
"in",
"ranges",
"for",
"segments",
"that",
"form",
"the",
"streamcut",... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/records/RecordHelper.java#L174-L180 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.findByUUID_G | @Override
public CommerceCountry findByUUID_G(String uuid, long groupId)
throws NoSuchCountryException {
CommerceCountry commerceCountry = fetchByUUID_G(uuid, groupId);
if (commerceCountry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
... | java | @Override
public CommerceCountry findByUUID_G(String uuid, long groupId)
throws NoSuchCountryException {
CommerceCountry commerceCountry = fetchByUUID_G(uuid, groupId);
if (commerceCountry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
... | [
"@",
"Override",
"public",
"CommerceCountry",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCountryException",
"{",
"CommerceCountry",
"commerceCountry",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"if",
"(",... | Returns the commerce country where uuid = ? and groupId = ? or throws a {@link NoSuchCountryException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce country
@throws NoSuchCountryException if a matching commerce country could not be found | [
"Returns",
"the",
"commerce",
"country",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCountryException",
"}",
"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/CommerceCountryPersistenceImpl.java#L666-L692 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/db/record/ODatabaseRecordAbstract.java | ODatabaseRecordAbstract.callbackHooks | public boolean callbackHooks(final TYPE iType, final OIdentifiable id) {
if (!OHookThreadLocal.INSTANCE.push(id))
return false;
try {
final ORecord<?> rec = id.getRecord();
if (rec == null)
return false;
boolean recordChanged = false;
for (ORecordHook hook : hoo... | java | public boolean callbackHooks(final TYPE iType, final OIdentifiable id) {
if (!OHookThreadLocal.INSTANCE.push(id))
return false;
try {
final ORecord<?> rec = id.getRecord();
if (rec == null)
return false;
boolean recordChanged = false;
for (ORecordHook hook : hoo... | [
"public",
"boolean",
"callbackHooks",
"(",
"final",
"TYPE",
"iType",
",",
"final",
"OIdentifiable",
"id",
")",
"{",
"if",
"(",
"!",
"OHookThreadLocal",
".",
"INSTANCE",
".",
"push",
"(",
"id",
")",
")",
"return",
"false",
";",
"try",
"{",
"final",
"OReco... | Callback the registeted hooks if any.
@param iType
@param id
Record received in the callback
@return True if the input record is changed, otherwise false | [
"Callback",
"the",
"registeted",
"hooks",
"if",
"any",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/db/record/ODatabaseRecordAbstract.java#L869-L887 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java | AbstractSearchStructure.getInternalId | public int getInternalId(String id) {
DatabaseEntry key = new DatabaseEntry();
StringBinding.stringToEntry(id, key);
DatabaseEntry data = new DatabaseEntry();
// check if the id already exists in id to iid database
if ((idToIidDB.get(null, key, data, null) == OperationStatus.SUCCESS)) {
return Intege... | java | public int getInternalId(String id) {
DatabaseEntry key = new DatabaseEntry();
StringBinding.stringToEntry(id, key);
DatabaseEntry data = new DatabaseEntry();
// check if the id already exists in id to iid database
if ((idToIidDB.get(null, key, data, null) == OperationStatus.SUCCESS)) {
return Intege... | [
"public",
"int",
"getInternalId",
"(",
"String",
"id",
")",
"{",
"DatabaseEntry",
"key",
"=",
"new",
"DatabaseEntry",
"(",
")",
";",
"StringBinding",
".",
"stringToEntry",
"(",
"id",
",",
"key",
")",
";",
"DatabaseEntry",
"data",
"=",
"new",
"DatabaseEntry",... | Returns the internal id assigned to the vector with the given id or -1 if the id is not found. Accesses
the BDB store!
@param id
The id of the vector
@return The internal id assigned to this vector or -1 if the id is not found. | [
"Returns",
"the",
"internal",
"id",
"assigned",
"to",
"the",
"vector",
"with",
"the",
"given",
"id",
"or",
"-",
"1",
"if",
"the",
"id",
"is",
"not",
"found",
".",
"Accesses",
"the",
"BDB",
"store!"
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java#L383-L393 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/config/DefaultMemcachedBucketConfig.java | DefaultMemcachedBucketConfig.calculateKetamaHash | private static long calculateKetamaHash(final byte[] key) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(key);
byte[] digest = md5.digest();
long rv = ((long) (digest[3] & 0xFF) << 24)
| ((long) (digest[2] & 0xFF) << 1... | java | private static long calculateKetamaHash(final byte[] key) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(key);
byte[] digest = md5.digest();
long rv = ((long) (digest[3] & 0xFF) << 24)
| ((long) (digest[2] & 0xFF) << 1... | [
"private",
"static",
"long",
"calculateKetamaHash",
"(",
"final",
"byte",
"[",
"]",
"key",
")",
"{",
"try",
"{",
"MessageDigest",
"md5",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"MD5\"",
")",
";",
"md5",
".",
"update",
"(",
"key",
")",
";",
"byte... | Calculates the ketama hash for the given key.
@param key the key to calculate.
@return the calculated hash. | [
"Calculates",
"the",
"ketama",
"hash",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/DefaultMemcachedBucketConfig.java#L144-L157 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/reflection/Types.java | Types.isOfClass | public static boolean isOfClass(Type type, Class<?> clazz) {
if(isSimple(type)) {
logger.trace("simple: {}", ((Class<?>)type));
return ((Class<?>)type) == clazz;
} else if(isGeneric(type)) {
logger.trace("generic: {}", (((ParameterizedType)type).getRawType()));
return (((ParameterizedType)type).getRawTy... | java | public static boolean isOfClass(Type type, Class<?> clazz) {
if(isSimple(type)) {
logger.trace("simple: {}", ((Class<?>)type));
return ((Class<?>)type) == clazz;
} else if(isGeneric(type)) {
logger.trace("generic: {}", (((ParameterizedType)type).getRawType()));
return (((ParameterizedType)type).getRawTy... | [
"public",
"static",
"boolean",
"isOfClass",
"(",
"Type",
"type",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"isSimple",
"(",
"type",
")",
")",
"{",
"logger",
".",
"trace",
"(",
"\"simple: {}\"",
",",
"(",
"(",
"Class",
"<",
"?",
">"... | Checks if the given type and the give class are the same; this check is
trivial for simple types (such as <code>java.lang.String</code>), less so
for generic types (say, <code>List<String></code>), whereby the
generic (<code>List</code> in the example) is extracted before testing
against the other class.
@param ... | [
"Checks",
"if",
"the",
"given",
"type",
"and",
"the",
"give",
"class",
"are",
"the",
"same",
";",
"this",
"check",
"is",
"trivial",
"for",
"simple",
"types",
"(",
"such",
"as",
"<code",
">",
"java",
".",
"lang",
".",
"String<",
"/",
"code",
">",
")",... | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/reflection/Types.java#L199-L208 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/xml/XmlIO.java | XmlIO.load | public static AnnotationMappingInfo load(final File file, final String encoding) throws XmlOperateException {
ArgUtils.notNull(file, "file");
ArgUtils.notEmpty(encoding, "encoding");
final AnnotationMappingInfo xmlInfo;
try(Reader reader = new InputStreamReader(ne... | java | public static AnnotationMappingInfo load(final File file, final String encoding) throws XmlOperateException {
ArgUtils.notNull(file, "file");
ArgUtils.notEmpty(encoding, "encoding");
final AnnotationMappingInfo xmlInfo;
try(Reader reader = new InputStreamReader(ne... | [
"public",
"static",
"AnnotationMappingInfo",
"load",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"encoding",
")",
"throws",
"XmlOperateException",
"{",
"ArgUtils",
".",
"notNull",
"(",
"file",
",",
"\"file\"",
")",
";",
"ArgUtils",
".",
"notEmpty",
"... | XMLファイルを読み込み、{@link AnnotationMappingInfo}として取得する。
@param file 読み込むファイル
@param encoding 読み込むファイルの文字コード
@return
@throws XmlOperateException XMLの読み込みに失敗した場合。
@throws IllegalArgumentException file is null or encoding is empty. | [
"XMLファイルを読み込み、",
"{"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/xml/XmlIO.java#L84-L98 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java | ConfigUtils.getAbsoluteFile | public static File getAbsoluteFile(AbstractConfig config, String key) {
Preconditions.checkNotNull(config, "config cannot be null");
String path = config.getString(key);
File file = new File(path);
if (!file.isAbsolute()) {
throw new ConfigException(
key,
path,
"Must ... | java | public static File getAbsoluteFile(AbstractConfig config, String key) {
Preconditions.checkNotNull(config, "config cannot be null");
String path = config.getString(key);
File file = new File(path);
if (!file.isAbsolute()) {
throw new ConfigException(
key,
path,
"Must ... | [
"public",
"static",
"File",
"getAbsoluteFile",
"(",
"AbstractConfig",
"config",
",",
"String",
"key",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"config",
",",
"\"config cannot be null\"",
")",
";",
"String",
"path",
"=",
"config",
".",
"getString",
"(... | Method is used to return a File checking to ensure that it is an absolute path.
@param config config to read the value from
@param key key for the value
@return File for the config value. | [
"Method",
"is",
"used",
"to",
"return",
"a",
"File",
"checking",
"to",
"ensure",
"that",
"it",
"is",
"an",
"absolute",
"path",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java#L86-L98 |
librato/metrics-librato | src/main/java/com/librato/metrics/reporter/DeltaTracker.java | DeltaTracker.getDelta | public Long getDelta(String name, long count) {
Long previous = lookup.put(name, count);
return calculateDelta(name, previous, count);
} | java | public Long getDelta(String name, long count) {
Long previous = lookup.put(name, count);
return calculateDelta(name, previous, count);
} | [
"public",
"Long",
"getDelta",
"(",
"String",
"name",
",",
"long",
"count",
")",
"{",
"Long",
"previous",
"=",
"lookup",
".",
"put",
"(",
"name",
",",
"count",
")",
";",
"return",
"calculateDelta",
"(",
"name",
",",
"previous",
",",
"count",
")",
";",
... | Calculates the delta. If this is a new value that has not been seen before, zero will be assumed to be the
initial value. Updates the internal map with the supplied count.
@param name the name of the counter
@param count the counter value
@return the delta | [
"Calculates",
"the",
"delta",
".",
"If",
"this",
"is",
"a",
"new",
"value",
"that",
"has",
"not",
"been",
"seen",
"before",
"zero",
"will",
"be",
"assumed",
"to",
"be",
"the",
"initial",
"value",
".",
"Updates",
"the",
"internal",
"map",
"with",
"the",
... | train | https://github.com/librato/metrics-librato/blob/10713643cf7d80e0f9741a7e1e81d1f6d68dc3f6/src/main/java/com/librato/metrics/reporter/DeltaTracker.java#L62-L65 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/core/layout/Dj2JrCrosstabBuilder.java | Dj2JrCrosstabBuilder.registerColumns | private void registerColumns() {
for (int i = 0; i < cols.length; i++) {
DJCrosstabColumn crosstabColumn = cols[i];
JRDesignCrosstabColumnGroup ctColGroup = new JRDesignCrosstabColumnGroup();
ctColGroup.setName(crosstabColumn.getProperty().getProperty());
ctColGroup.setHeight(crosstabColumn.getHeaderHeig... | java | private void registerColumns() {
for (int i = 0; i < cols.length; i++) {
DJCrosstabColumn crosstabColumn = cols[i];
JRDesignCrosstabColumnGroup ctColGroup = new JRDesignCrosstabColumnGroup();
ctColGroup.setName(crosstabColumn.getProperty().getProperty());
ctColGroup.setHeight(crosstabColumn.getHeaderHeig... | [
"private",
"void",
"registerColumns",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cols",
".",
"length",
";",
"i",
"++",
")",
"{",
"DJCrosstabColumn",
"crosstabColumn",
"=",
"cols",
"[",
"i",
"]",
";",
"JRDesignCrosstabColumnGroup",
... | Registers the Columngroup Buckets and creates the header cell for the columns | [
"Registers",
"the",
"Columngroup",
"Buckets",
"and",
"creates",
"the",
"header",
"cell",
"for",
"the",
"columns"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/core/layout/Dj2JrCrosstabBuilder.java#L864-L923 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/merge/VariantMerger.java | VariantMerger.mergeNew | public Variant mergeNew(Variant template, Collection<Variant> load) {
Variant current = createFromTemplate(template);
merge(current, load);
return current;
} | java | public Variant mergeNew(Variant template, Collection<Variant> load) {
Variant current = createFromTemplate(template);
merge(current, load);
return current;
} | [
"public",
"Variant",
"mergeNew",
"(",
"Variant",
"template",
",",
"Collection",
"<",
"Variant",
">",
"load",
")",
"{",
"Variant",
"current",
"=",
"createFromTemplate",
"(",
"template",
")",
";",
"merge",
"(",
"current",
",",
"load",
")",
";",
"return",
"cu... | Create and returns a new Variant using the target as a
position template ONLY and merges the provided variants
for this position. <b> The target is not present in the
merged output!!!</b>
@param template Template for position and study only
@param load Variants to merge for position
@return Variant new Variant obj... | [
"Create",
"and",
"returns",
"a",
"new",
"Variant",
"using",
"the",
"target",
"as",
"a",
"position",
"template",
"ONLY",
"and",
"merges",
"the",
"provided",
"variants",
"for",
"this",
"position",
".",
"<b",
">",
"The",
"target",
"is",
"not",
"present",
"in"... | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/merge/VariantMerger.java#L253-L257 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/handler/file/FileHandlerUtil.java | FileHandlerUtil.addDate | public static Date addDate(final Date date, final Integer different) {
final Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, different);
return cal.getTime();
} | java | public static Date addDate(final Date date, final Integer different) {
final Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, different);
return cal.getTime();
} | [
"public",
"static",
"Date",
"addDate",
"(",
"final",
"Date",
"date",
",",
"final",
"Integer",
"different",
")",
"{",
"final",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"date",
")",
";",
"cal",
".... | Add days.
@param date the date
@param different the different
@return the date | [
"Add",
"days",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/handler/file/FileHandlerUtil.java#L196-L201 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/VarConfig.java | VarConfig.getState | public int getState(Var var, int defaultState) {
Integer state = config.get(var);
if (state == null) {
return defaultState;
} else {
return state;
}
} | java | public int getState(Var var, int defaultState) {
Integer state = config.get(var);
if (state == null) {
return defaultState;
} else {
return state;
}
} | [
"public",
"int",
"getState",
"(",
"Var",
"var",
",",
"int",
"defaultState",
")",
"{",
"Integer",
"state",
"=",
"config",
".",
"get",
"(",
"var",
")",
";",
"if",
"(",
"state",
"==",
"null",
")",
"{",
"return",
"defaultState",
";",
"}",
"else",
"{",
... | Gets the state (in this config) for a given variable if it exists, or the default otherwise. | [
"Gets",
"the",
"state",
"(",
"in",
"this",
"config",
")",
"for",
"a",
"given",
"variable",
"if",
"it",
"exists",
"or",
"the",
"default",
"otherwise",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/VarConfig.java#L118-L125 |
calrissian/mango | mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java | NodeUtils.criteriaFromNode | public static Criteria criteriaFromNode(Node node, Comparator rangeComparator) {
return criteriaFromNode(node, rangeComparator, null);
} | java | public static Criteria criteriaFromNode(Node node, Comparator rangeComparator) {
return criteriaFromNode(node, rangeComparator, null);
} | [
"public",
"static",
"Criteria",
"criteriaFromNode",
"(",
"Node",
"node",
",",
"Comparator",
"rangeComparator",
")",
"{",
"return",
"criteriaFromNode",
"(",
"node",
",",
"rangeComparator",
",",
"null",
")",
";",
"}"
] | Creates criteria from a node. A Comparator is injected into all nodes which need to determine order or equality. | [
"Creates",
"criteria",
"from",
"a",
"node",
".",
"A",
"Comparator",
"is",
"injected",
"into",
"all",
"nodes",
"which",
"need",
"to",
"determine",
"order",
"or",
"equality",
"."
] | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java#L71-L73 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java | GuildWars2.setInstance | public static void setInstance(OkHttpClient client) throws GuildWars2Exception {
if (instance != null)
throw new GuildWars2Exception(ErrorCode.Other, "Instance already initialized");
instance = new GuildWars2(client);
} | java | public static void setInstance(OkHttpClient client) throws GuildWars2Exception {
if (instance != null)
throw new GuildWars2Exception(ErrorCode.Other, "Instance already initialized");
instance = new GuildWars2(client);
} | [
"public",
"static",
"void",
"setInstance",
"(",
"OkHttpClient",
"client",
")",
"throws",
"GuildWars2Exception",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"throw",
"new",
"GuildWars2Exception",
"(",
"ErrorCode",
".",
"Other",
",",
"\"Instance already initialized... | You need to call {@link #setInstance(Cache)} to create instance with custom
caching<br/>
This method will create instance with your custom Client
@param client
your custom client | [
"You",
"need",
"to",
"call",
"{"
] | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java#L62-L66 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkDoWhile | private Environment checkDoWhile(Stmt.DoWhile stmt, Environment environment, EnclosingScope scope) {
// Type check loop body
environment = checkBlock(stmt.getBody(), environment, scope);
// Type check invariants
checkConditions(stmt.getInvariant(), true, environment);
// Determine and update modified variable... | java | private Environment checkDoWhile(Stmt.DoWhile stmt, Environment environment, EnclosingScope scope) {
// Type check loop body
environment = checkBlock(stmt.getBody(), environment, scope);
// Type check invariants
checkConditions(stmt.getInvariant(), true, environment);
// Determine and update modified variable... | [
"private",
"Environment",
"checkDoWhile",
"(",
"Stmt",
".",
"DoWhile",
"stmt",
",",
"Environment",
"environment",
",",
"EnclosingScope",
"scope",
")",
"{",
"// Type check loop body",
"environment",
"=",
"checkBlock",
"(",
"stmt",
".",
"getBody",
"(",
")",
",",
"... | Type check a do-while statement.
@param stmt
Statement to type check
@param environment
Determines the type of all variables immediately going into this
block
@return
@throws ResolveError
If a named type within this statement cannot be resolved within
the enclosing project. | [
"Type",
"check",
"a",
"do",
"-",
"while",
"statement",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L518-L530 |
wcm-io/wcm-io-tooling | netbeans/sightly/src/main/java/io/wcm/tooling/netbeans/sightly/completion/classLookup/MemberLookupCompleter.java | MemberLookupCompleter.resolveClass | private Set<String> resolveClass(String variableName, String text, Document document) {
Set<String> items = new LinkedHashSet<>();
FileObject fo = getFileObject(document);
ClassPath sourcePath = ClassPath.getClassPath(fo, ClassPath.SOURCE);
ClassPath compilePath = ClassPath.getClassPath(fo, ClassPath.CO... | java | private Set<String> resolveClass(String variableName, String text, Document document) {
Set<String> items = new LinkedHashSet<>();
FileObject fo = getFileObject(document);
ClassPath sourcePath = ClassPath.getClassPath(fo, ClassPath.SOURCE);
ClassPath compilePath = ClassPath.getClassPath(fo, ClassPath.CO... | [
"private",
"Set",
"<",
"String",
">",
"resolveClass",
"(",
"String",
"variableName",
",",
"String",
"text",
",",
"Document",
"document",
")",
"{",
"Set",
"<",
"String",
">",
"items",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"FileObject",
"fo",
"... | This method tries to find the class which is defined for the given filter and returns a set with all methods and fields of the class
@param variableName
@param text
@param document
@return Set of methods and fields, never null | [
"This",
"method",
"tries",
"to",
"find",
"the",
"class",
"which",
"is",
"defined",
"for",
"the",
"given",
"filter",
"and",
"returns",
"a",
"set",
"with",
"all",
"methods",
"and",
"fields",
"of",
"the",
"class"
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/netbeans/sightly/src/main/java/io/wcm/tooling/netbeans/sightly/completion/classLookup/MemberLookupCompleter.java#L117-L139 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/api/Table.java | Table.sampleX | public Table sampleX(double proportion) {
Preconditions.checkArgument(proportion <= 1 && proportion >= 0,
"The sample proportion must be between 0 and 1");
int tableSize = (int) Math.round(rowCount() * proportion);
return where(selectNRowsAtRandom(tableSize, rowCount()));
} | java | public Table sampleX(double proportion) {
Preconditions.checkArgument(proportion <= 1 && proportion >= 0,
"The sample proportion must be between 0 and 1");
int tableSize = (int) Math.round(rowCount() * proportion);
return where(selectNRowsAtRandom(tableSize, rowCount()));
} | [
"public",
"Table",
"sampleX",
"(",
"double",
"proportion",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"proportion",
"<=",
"1",
"&&",
"proportion",
">=",
"0",
",",
"\"The sample proportion must be between 0 and 1\"",
")",
";",
"int",
"tableSize",
"=",
"(... | Returns a table consisting of randomly selected records from this table. The sample size is based on the
given proportion
@param proportion The proportion to go in the sample | [
"Returns",
"a",
"table",
"consisting",
"of",
"randomly",
"selected",
"records",
"from",
"this",
"table",
".",
"The",
"sample",
"size",
"is",
"based",
"on",
"the",
"given",
"proportion"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/api/Table.java#L464-L470 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java | PnPInfinitesimalPlanePoseEstimation.estimateTranslation | void estimateTranslation( DMatrixRMaj R , List<AssociatedPair> points , Vector3D_F64 T )
{
final int N = points.size();
W.reshape(N*2,3);
y.reshape(N*2,1);
Wty.reshape(3,1);
DMatrix3x3 Rtmp = new DMatrix3x3();
ConvertDMatrixStruct.convert(R,Rtmp);
int indexY = 0,indexW = 0;
for (int i = 0; i < N; i++... | java | void estimateTranslation( DMatrixRMaj R , List<AssociatedPair> points , Vector3D_F64 T )
{
final int N = points.size();
W.reshape(N*2,3);
y.reshape(N*2,1);
Wty.reshape(3,1);
DMatrix3x3 Rtmp = new DMatrix3x3();
ConvertDMatrixStruct.convert(R,Rtmp);
int indexY = 0,indexW = 0;
for (int i = 0; i < N; i++... | [
"void",
"estimateTranslation",
"(",
"DMatrixRMaj",
"R",
",",
"List",
"<",
"AssociatedPair",
">",
"points",
",",
"Vector3D_F64",
"T",
")",
"{",
"final",
"int",
"N",
"=",
"points",
".",
"size",
"(",
")",
";",
"W",
".",
"reshape",
"(",
"N",
"*",
"2",
",... | Estimate's the translation given the previously found rotation
@param R Rotation matrix
@param T (Output) estimated translation | [
"Estimate",
"s",
"the",
"translation",
"given",
"the",
"previously",
"found",
"rotation"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPInfinitesimalPlanePoseEstimation.java#L213-L258 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getRepositoryArchive | public InputStream getRepositoryArchive(Object projectIdOrPath, String sha, String format) throws GitLabApiException {
ArchiveFormat archiveFormat = ArchiveFormat.forValue(format);
return (getRepositoryArchive(projectIdOrPath, sha, archiveFormat));
} | java | public InputStream getRepositoryArchive(Object projectIdOrPath, String sha, String format) throws GitLabApiException {
ArchiveFormat archiveFormat = ArchiveFormat.forValue(format);
return (getRepositoryArchive(projectIdOrPath, sha, archiveFormat));
} | [
"public",
"InputStream",
"getRepositoryArchive",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"sha",
",",
"String",
"format",
")",
"throws",
"GitLabApiException",
"{",
"ArchiveFormat",
"archiveFormat",
"=",
"ArchiveFormat",
".",
"forValue",
"(",
"format",
")",
"... | Get an archive of the complete repository by SHA (optional).
<pre><code>GitLab Endpoint: GET /projects/:id/repository/archive</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param sha the SHA of the archive to get
@param format The archive format, defa... | [
"Get",
"an",
"archive",
"of",
"the",
"complete",
"repository",
"by",
"SHA",
"(",
"optional",
")",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L537-L540 |
awin/rabbiteasy | rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/consumer/ConsumerContainer.java | ConsumerContainer.addConsumer | public synchronized void addConsumer(Consumer consumer, ConsumerConfiguration configuration, int instances) {
for (int i=0; i < instances; i++) {
this.consumerHolders.add(new ConsumerHolder(consumer, configuration));
}
} | java | public synchronized void addConsumer(Consumer consumer, ConsumerConfiguration configuration, int instances) {
for (int i=0; i < instances; i++) {
this.consumerHolders.add(new ConsumerHolder(consumer, configuration));
}
} | [
"public",
"synchronized",
"void",
"addConsumer",
"(",
"Consumer",
"consumer",
",",
"ConsumerConfiguration",
"configuration",
",",
"int",
"instances",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"instances",
";",
"i",
"++",
")",
"{",
"this",
... | Adds a consumer to the container and configures it according to the consumer
configuration. Does NOT enable the consumer to consume from the message broker until the container is started.
<p>Registers the same consumer N times at the queue according to the number of specified instances.
Use this for scaling your consu... | [
"Adds",
"a",
"consumer",
"to",
"the",
"container",
"and",
"configures",
"it",
"according",
"to",
"the",
"consumer",
"configuration",
".",
"Does",
"NOT",
"enable",
"the",
"consumer",
"to",
"consume",
"from",
"the",
"message",
"broker",
"until",
"the",
"containe... | train | https://github.com/awin/rabbiteasy/blob/c161efda6c0f7ef319aedf09dfe40a4a90165510/rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/consumer/ConsumerContainer.java#L155-L159 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/results/JavaTypeAnalyzer.java | JavaTypeAnalyzer.isRelevant | private static boolean isRelevant(final Method method, final XmlAccessType accessType) {
if (method.isSynthetic() || !isGetter(method))
return false;
final boolean propertyIgnored = ignoredFieldNames.contains(extractPropertyName(method.getName()));
if (propertyIgnored || hasIgnoreAn... | java | private static boolean isRelevant(final Method method, final XmlAccessType accessType) {
if (method.isSynthetic() || !isGetter(method))
return false;
final boolean propertyIgnored = ignoredFieldNames.contains(extractPropertyName(method.getName()));
if (propertyIgnored || hasIgnoreAn... | [
"private",
"static",
"boolean",
"isRelevant",
"(",
"final",
"Method",
"method",
",",
"final",
"XmlAccessType",
"accessType",
")",
"{",
"if",
"(",
"method",
".",
"isSynthetic",
"(",
")",
"||",
"!",
"isGetter",
"(",
"method",
")",
")",
"return",
"false",
";"... | Checks if the method is public and non-static and that the method is a Getter.
Does not allow methods with ignored names.
Does also not take methods annotated with {@link XmlTransient}.
@param method The method
@return {@code true} if the method should be analyzed further | [
"Checks",
"if",
"the",
"method",
"is",
"public",
"and",
"non",
"-",
"static",
"and",
"that",
"the",
"method",
"is",
"a",
"Getter",
".",
"Does",
"not",
"allow",
"methods",
"with",
"ignored",
"names",
".",
"Does",
"also",
"not",
"take",
"methods",
"annotat... | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/results/JavaTypeAnalyzer.java#L175-L193 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsxmlnamespace.java | nsxmlnamespace.get | public static nsxmlnamespace get(nitro_service service, String prefix) throws Exception{
nsxmlnamespace obj = new nsxmlnamespace();
obj.set_prefix(prefix);
nsxmlnamespace response = (nsxmlnamespace) obj.get_resource(service);
return response;
} | java | public static nsxmlnamespace get(nitro_service service, String prefix) throws Exception{
nsxmlnamespace obj = new nsxmlnamespace();
obj.set_prefix(prefix);
nsxmlnamespace response = (nsxmlnamespace) obj.get_resource(service);
return response;
} | [
"public",
"static",
"nsxmlnamespace",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"prefix",
")",
"throws",
"Exception",
"{",
"nsxmlnamespace",
"obj",
"=",
"new",
"nsxmlnamespace",
"(",
")",
";",
"obj",
".",
"set_prefix",
"(",
"prefix",
")",
";",
"... | Use this API to fetch nsxmlnamespace resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"nsxmlnamespace",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsxmlnamespace.java#L297-L302 |
lagom/lagom | service/javadsl/server/src/main/java/com/lightbend/lagom/javadsl/server/status/Latency.java | Latency.withPercentile999th | public final Latency withPercentile999th(double value) {
double newValue = value;
return new Latency(this.median, this.percentile98th, this.percentile99th, newValue, this.mean, this.min, this.max);
} | java | public final Latency withPercentile999th(double value) {
double newValue = value;
return new Latency(this.median, this.percentile98th, this.percentile99th, newValue, this.mean, this.min, this.max);
} | [
"public",
"final",
"Latency",
"withPercentile999th",
"(",
"double",
"value",
")",
"{",
"double",
"newValue",
"=",
"value",
";",
"return",
"new",
"Latency",
"(",
"this",
".",
"median",
",",
"this",
".",
"percentile98th",
",",
"this",
".",
"percentile99th",
",... | Copy the current immutable object by setting a value for the {@link AbstractLatency#getPercentile999th() percentile999th} attribute.
@param value A new value for percentile999th
@return A modified copy of the {@code this} object | [
"Copy",
"the",
"current",
"immutable",
"object",
"by",
"setting",
"a",
"value",
"for",
"the",
"{"
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/server/src/main/java/com/lightbend/lagom/javadsl/server/status/Latency.java#L157-L160 |
epam/parso | src/main/java/com/epam/parso/DataWriterUtil.java | DataWriterUtil.getRowValues | public static List<String> getRowValues(List<Column> columns, Object[] row,
Map<Integer, Format> columnFormatters) throws IOException {
return getRowValues(columns, row, DEFAULT_LOCALE, columnFormatters);
} | java | public static List<String> getRowValues(List<Column> columns, Object[] row,
Map<Integer, Format> columnFormatters) throws IOException {
return getRowValues(columns, row, DEFAULT_LOCALE, columnFormatters);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getRowValues",
"(",
"List",
"<",
"Column",
">",
"columns",
",",
"Object",
"[",
"]",
"row",
",",
"Map",
"<",
"Integer",
",",
"Format",
">",
"columnFormatters",
")",
"throws",
"IOException",
"{",
"return",
"... | The method to convert the Objects array that stores data from the sas7bdat file to list of string.
@param columns the {@link Column} class variables list that stores columns
description from the sas7bdat file.
@param row the Objects arrays that stores data from the sas7bdat file.
@param columnFor... | [
"The",
"method",
"to",
"convert",
"the",
"Objects",
"array",
"that",
"stores",
"data",
"from",
"the",
"sas7bdat",
"file",
"to",
"list",
"of",
"string",
"."
] | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/DataWriterUtil.java#L356-L359 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/restli/GobblinServiceFlowConfigResourceHandler.java | GobblinServiceFlowConfigResourceHandler.updateFlowConfig | @Override
public UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig)
throws FlowConfigLoggedException {
String flowName = flowId.getFlowName();
String flowGroup = flowId.getFlowGroup();
if (!flowGroup.equals(flowConfig.getId().getFlowGroup()) || !flowName.equals(flowConfig.getId()... | java | @Override
public UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig)
throws FlowConfigLoggedException {
String flowName = flowId.getFlowName();
String flowGroup = flowId.getFlowGroup();
if (!flowGroup.equals(flowConfig.getId().getFlowGroup()) || !flowName.equals(flowConfig.getId()... | [
"@",
"Override",
"public",
"UpdateResponse",
"updateFlowConfig",
"(",
"FlowId",
"flowId",
",",
"FlowConfig",
"flowConfig",
")",
"throws",
"FlowConfigLoggedException",
"{",
"String",
"flowName",
"=",
"flowId",
".",
"getFlowName",
"(",
")",
";",
"String",
"flowGroup",... | Updating {@link FlowConfig} should check if current node is active (master).
If current node is active, call {@link FlowConfigResourceLocalHandler#updateFlowConfig(FlowId, FlowConfig)} directly.
If current node is standby, forward {@link ServiceConfigKeys#HELIX_FLOWSPEC_UPDATE} to active. The remote active will
then ca... | [
"Updating",
"{",
"@link",
"FlowConfig",
"}",
"should",
"check",
"if",
"current",
"node",
"is",
"active",
"(",
"master",
")",
".",
"If",
"current",
"node",
"is",
"active",
"call",
"{",
"@link",
"FlowConfigResourceLocalHandler#updateFlowConfig",
"(",
"FlowId",
"Fl... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/restli/GobblinServiceFlowConfigResourceHandler.java#L135-L169 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/BaseOutputLayer.java | BaseOutputLayer.computeScoreForExamples | @Override
public INDArray computeScoreForExamples(double fullNetRegTerm, LayerWorkspaceMgr workspaceMgr) {
if (input == null || labels == null)
throw new IllegalStateException("Cannot calculate score without input and labels " + layerId());
INDArray preOut = preOutput2d(false, workspaceM... | java | @Override
public INDArray computeScoreForExamples(double fullNetRegTerm, LayerWorkspaceMgr workspaceMgr) {
if (input == null || labels == null)
throw new IllegalStateException("Cannot calculate score without input and labels " + layerId());
INDArray preOut = preOutput2d(false, workspaceM... | [
"@",
"Override",
"public",
"INDArray",
"computeScoreForExamples",
"(",
"double",
"fullNetRegTerm",
",",
"LayerWorkspaceMgr",
"workspaceMgr",
")",
"{",
"if",
"(",
"input",
"==",
"null",
"||",
"labels",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"("... | Compute the score for each example individually, after labels and input have been set.
@param fullNetRegTerm Regularization score term for the entire network (or, 0.0 to not include regularization)
@return A column INDArray of shape [numExamples,1], where entry i is the score of the ith example | [
"Compute",
"the",
"score",
"for",
"each",
"example",
"individually",
"after",
"labels",
"and",
"input",
"have",
"been",
"set",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/BaseOutputLayer.java#L104-L118 |
bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/nio/BufferUtils.java | BufferUtils.getString | public static String getString(ByteBuffer buf, int offset, int length, Charset encoding) {
buf = buf.duplicate();
buf.position(buf.position() + offset);
if (buf.hasArray()) {
return new String(buf.array(), buf.arrayOffset() + buf.position(), length, encoding);
} else {
... | java | public static String getString(ByteBuffer buf, int offset, int length, Charset encoding) {
buf = buf.duplicate();
buf.position(buf.position() + offset);
if (buf.hasArray()) {
return new String(buf.array(), buf.arrayOffset() + buf.position(), length, encoding);
} else {
... | [
"public",
"static",
"String",
"getString",
"(",
"ByteBuffer",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
",",
"Charset",
"encoding",
")",
"{",
"buf",
"=",
"buf",
".",
"duplicate",
"(",
")",
";",
"buf",
".",
"position",
"(",
"buf",
".",
"positio... | Converts the specified number of bytes in the buffer and converts them to a String using
the specified encoding. Does not move the buffer position. | [
"Converts",
"the",
"specified",
"number",
"of",
"bytes",
"in",
"the",
"buffer",
"and",
"converts",
"them",
"to",
"a",
"String",
"using",
"the",
"specified",
"encoding",
".",
"Does",
"not",
"move",
"the",
"buffer",
"position",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/nio/BufferUtils.java#L22-L32 |
jenkinsci/jenkins | core/src/main/java/hudson/model/queue/WorkUnitContext.java | WorkUnitContext.synchronizeEnd | public void synchronizeEnd(Executor e, Queue.Executable executable, Throwable problems, long duration) throws InterruptedException {
endLatch.synchronize();
// the main thread will send a notification
WorkUnit wu = e.getCurrentWorkUnit();
if (wu.isMainWork()) {
if (problems ... | java | public void synchronizeEnd(Executor e, Queue.Executable executable, Throwable problems, long duration) throws InterruptedException {
endLatch.synchronize();
// the main thread will send a notification
WorkUnit wu = e.getCurrentWorkUnit();
if (wu.isMainWork()) {
if (problems ... | [
"public",
"void",
"synchronizeEnd",
"(",
"Executor",
"e",
",",
"Queue",
".",
"Executable",
"executable",
",",
"Throwable",
"problems",
",",
"long",
"duration",
")",
"throws",
"InterruptedException",
"{",
"endLatch",
".",
"synchronize",
"(",
")",
";",
"// the mai... | All the {@link Executor}s that jointly execute a {@link Task} call this method to synchronize on the end of the task.
@throws InterruptedException
If any of the member thread is interrupted while waiting for other threads to join, all
the member threads will report {@link InterruptedException}. | [
"All",
"the",
"{",
"@link",
"Executor",
"}",
"s",
"that",
"jointly",
"execute",
"a",
"{",
"@link",
"Task",
"}",
"call",
"this",
"method",
"to",
"synchronize",
"on",
"the",
"end",
"of",
"the",
"task",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/queue/WorkUnitContext.java#L132-L146 |
jeremylong/DependencyCheck | cli/src/main/java/org/owasp/dependencycheck/App.java | App.determineReturnCode | private int determineReturnCode(Engine engine, int cvssFailScore) {
int retCode = 0;
//Set the exit code based on whether we found a high enough vulnerability
for (Dependency dep : engine.getDependencies()) {
if (!dep.getVulnerabilities().isEmpty()) {
for (Vulnerabili... | java | private int determineReturnCode(Engine engine, int cvssFailScore) {
int retCode = 0;
//Set the exit code based on whether we found a high enough vulnerability
for (Dependency dep : engine.getDependencies()) {
if (!dep.getVulnerabilities().isEmpty()) {
for (Vulnerabili... | [
"private",
"int",
"determineReturnCode",
"(",
"Engine",
"engine",
",",
"int",
"cvssFailScore",
")",
"{",
"int",
"retCode",
"=",
"0",
";",
"//Set the exit code based on whether we found a high enough vulnerability",
"for",
"(",
"Dependency",
"dep",
":",
"engine",
".",
... | Determines the return code based on if one of the dependencies scanned
has a vulnerability with a CVSS score above the cvssFailScore.
@param engine the engine used during analysis
@param cvssFailScore the max allowed CVSS score
@return returns <code>1</code> if a severe enough vulnerability is
identified; otherwise <c... | [
"Determines",
"the",
"return",
"code",
"based",
"on",
"if",
"one",
"of",
"the",
"dependencies",
"scanned",
"has",
"a",
"vulnerability",
"with",
"a",
"CVSS",
"score",
"above",
"the",
"cvssFailScore",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/cli/src/main/java/org/owasp/dependencycheck/App.java#L292-L307 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceSettings.java | CmsWorkplaceSettings.setLastUsedGallery | public void setLastUsedGallery(String galleryKey, String gallerypath) {
m_lastUsedGalleries.put(galleryKey, gallerypath);
LOG.info("user=" + m_user.getName() + ": setLastUsedGallery " + galleryKey + " -> " + gallerypath);
} | java | public void setLastUsedGallery(String galleryKey, String gallerypath) {
m_lastUsedGalleries.put(galleryKey, gallerypath);
LOG.info("user=" + m_user.getName() + ": setLastUsedGallery " + galleryKey + " -> " + gallerypath);
} | [
"public",
"void",
"setLastUsedGallery",
"(",
"String",
"galleryKey",
",",
"String",
"gallerypath",
")",
"{",
"m_lastUsedGalleries",
".",
"put",
"(",
"galleryKey",
",",
"gallerypath",
")",
";",
"LOG",
".",
"info",
"(",
"\"user=\"",
"+",
"m_user",
".",
"getName"... | Saves the last gallery for a given key.<p>
@param galleryKey the gallery key
@param gallerypath the resourcepath of the gallery | [
"Saves",
"the",
"last",
"gallery",
"for",
"a",
"given",
"key",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceSettings.java#L669-L673 |
leancloud/java-sdk-all | android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/push/GetPushStateApi.java | GetPushStateApi.onConnect | @Override
public void onConnect(final int rst, final HuaweiApiClient client) {
//需要在子线程中执行获取push状态的操作
ThreadUtil.INST.excute(new Runnable() {
@Override
public void run() {
if (client == null || !ApiClientMgr.INST.isConnect(client)) {
... | java | @Override
public void onConnect(final int rst, final HuaweiApiClient client) {
//需要在子线程中执行获取push状态的操作
ThreadUtil.INST.excute(new Runnable() {
@Override
public void run() {
if (client == null || !ApiClientMgr.INST.isConnect(client)) {
... | [
"@",
"Override",
"public",
"void",
"onConnect",
"(",
"final",
"int",
"rst",
",",
"final",
"HuaweiApiClient",
"client",
")",
"{",
"//需要在子线程中执行获取push状态的操作\r",
"ThreadUtil",
".",
"INST",
".",
"excute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"pu... | HuaweiApiClient 连接结果回调
@param rst 结果码
@param client HuaweiApiClient 实例 | [
"HuaweiApiClient",
"连接结果回调"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/push/GetPushStateApi.java#L33-L48 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java | DefaultReconfigurationProblem.defaultHeuristic | private void defaultHeuristic() {
IntStrategy intStrat = Search.intVarSearch(new FirstFail(csp), new IntDomainMin(), csp.retrieveIntVars(true));
SetStrategy setStrat = new SetStrategy(csp.retrieveSetVars(), new InputOrder<>(csp), new SetDomainMin(), true);
RealStrategy realStrat = new RealStrate... | java | private void defaultHeuristic() {
IntStrategy intStrat = Search.intVarSearch(new FirstFail(csp), new IntDomainMin(), csp.retrieveIntVars(true));
SetStrategy setStrat = new SetStrategy(csp.retrieveSetVars(), new InputOrder<>(csp), new SetDomainMin(), true);
RealStrategy realStrat = new RealStrate... | [
"private",
"void",
"defaultHeuristic",
"(",
")",
"{",
"IntStrategy",
"intStrat",
"=",
"Search",
".",
"intVarSearch",
"(",
"new",
"FirstFail",
"(",
"csp",
")",
",",
"new",
"IntDomainMin",
"(",
")",
",",
"csp",
".",
"retrieveIntVars",
"(",
"true",
")",
")",
... | A naive heuristic to be sure every variables will be instantiated. | [
"A",
"naive",
"heuristic",
"to",
"be",
"sure",
"every",
"variables",
"will",
"be",
"instantiated",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java#L324-L329 |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java | YarnContainerManager.onContainerStarted | @Override
public void onContainerStarted(final ContainerId containerId, final Map<String, ByteBuffer> stringByteBufferMap) {
final Optional<Container> container = this.containers.getOptional(containerId.toString());
if (container.isPresent()) {
this.nodeManager.getContainerStatusAsync(containerId, conta... | java | @Override
public void onContainerStarted(final ContainerId containerId, final Map<String, ByteBuffer> stringByteBufferMap) {
final Optional<Container> container = this.containers.getOptional(containerId.toString());
if (container.isPresent()) {
this.nodeManager.getContainerStatusAsync(containerId, conta... | [
"@",
"Override",
"public",
"void",
"onContainerStarted",
"(",
"final",
"ContainerId",
"containerId",
",",
"final",
"Map",
"<",
"String",
",",
"ByteBuffer",
">",
"stringByteBufferMap",
")",
"{",
"final",
"Optional",
"<",
"Container",
">",
"container",
"=",
"this"... | NM Callback: NM accepts the starting container request.
@param containerId ID of a new container being started.
@param stringByteBufferMap a Map between the auxiliary service names and their outputs. Not used. | [
"NM",
"Callback",
":",
"NM",
"accepts",
"the",
"starting",
"container",
"request",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/YarnContainerManager.java#L223-L229 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/ajax/editable/tabs/AjaxAddableTabbedPanel.java | AjaxAddableTabbedPanel.newCloseLink | protected WebMarkupContainer newCloseLink(final String linkId, final int index)
{
return new AjaxFallbackLink<Void>(linkId)
{
private static final long serialVersionUID = 1L;
@Override
public void onClick(final AjaxRequestTarget target)
{
if (target != null)
{
onRemoveTab(target, index);... | java | protected WebMarkupContainer newCloseLink(final String linkId, final int index)
{
return new AjaxFallbackLink<Void>(linkId)
{
private static final long serialVersionUID = 1L;
@Override
public void onClick(final AjaxRequestTarget target)
{
if (target != null)
{
onRemoveTab(target, index);... | [
"protected",
"WebMarkupContainer",
"newCloseLink",
"(",
"final",
"String",
"linkId",
",",
"final",
"int",
"index",
")",
"{",
"return",
"new",
"AjaxFallbackLink",
"<",
"Void",
">",
"(",
"linkId",
")",
"{",
"private",
"static",
"final",
"long",
"serialVersionUID",... | Factory method for links used to close the selected tab.
The created component is attached to the following markup. Label component with id: title
will be added for you by the tabbed panel.
<pre>
<a href="#" wicket:id="link"><span wicket:id="title">[[tab title]]</span>&... | [
"Factory",
"method",
"for",
"links",
"used",
"to",
"close",
"the",
"selected",
"tab",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/ajax/editable/tabs/AjaxAddableTabbedPanel.java#L392-L409 |
yanzhenjie/SwipeRecyclerView | x/src/main/java/com/yanzhenjie/recyclerview/SwipeMenuLayout.java | SwipeMenuLayout.getSwipeDuration | private int getSwipeDuration(MotionEvent ev, int velocity) {
int sx = getScrollX();
int dx = (int)(ev.getX() - sx);
final int width = mSwipeCurrentHorizontal.getMenuWidth();
final int halfWidth = width / 2;
final float distanceRatio = Math.min(1f, 1.0f * Math.abs(dx) / width);
... | java | private int getSwipeDuration(MotionEvent ev, int velocity) {
int sx = getScrollX();
int dx = (int)(ev.getX() - sx);
final int width = mSwipeCurrentHorizontal.getMenuWidth();
final int halfWidth = width / 2;
final float distanceRatio = Math.min(1f, 1.0f * Math.abs(dx) / width);
... | [
"private",
"int",
"getSwipeDuration",
"(",
"MotionEvent",
"ev",
",",
"int",
"velocity",
")",
"{",
"int",
"sx",
"=",
"getScrollX",
"(",
")",
";",
"int",
"dx",
"=",
"(",
"int",
")",
"(",
"ev",
".",
"getX",
"(",
")",
"-",
"sx",
")",
";",
"final",
"i... | compute finish duration.
@param ev up event.
@param velocity velocity x.
@return finish duration. | [
"compute",
"finish",
"duration",
"."
] | train | https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/x/src/main/java/com/yanzhenjie/recyclerview/SwipeMenuLayout.java#L305-L321 |
ironjacamar/ironjacamar | rarinfo/src/main/java/org/ironjacamar/rarinfo/Main.java | Main.removeIntrospectedValue | private static void removeIntrospectedValue(Map<String, String> m, String name)
{
if (m != null)
{
m.remove(name);
if (name.length() == 1)
{
name = name.toUpperCase(Locale.US);
}
else
{
name = name.substring(0, 1).toUpperCase(... | java | private static void removeIntrospectedValue(Map<String, String> m, String name)
{
if (m != null)
{
m.remove(name);
if (name.length() == 1)
{
name = name.toUpperCase(Locale.US);
}
else
{
name = name.substring(0, 1).toUpperCase(... | [
"private",
"static",
"void",
"removeIntrospectedValue",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"m",
",",
"String",
"name",
")",
"{",
"if",
"(",
"m",
"!=",
"null",
")",
"{",
"m",
".",
"remove",
"(",
"name",
")",
";",
"if",
"(",
"name",
".",
... | Remove introspected value
@param m The map
@param name The name | [
"Remove",
"introspected",
"value"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/rarinfo/src/main/java/org/ironjacamar/rarinfo/Main.java#L1389-L1417 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/TextDuplicator.java | TextDuplicator.setupUI | private void setupUI(final String labelText) {
WButton dupBtn = new WButton("Duplicate");
dupBtn.setAction(new DuplicateAction());
WButton clrBtn = new WButton("Clear");
clrBtn.setAction(new ClearAction());
add(new WLabel(labelText, textFld));
add(textFld);
add(dupBtn);
add(clrBtn);
add(new WAjaxCon... | java | private void setupUI(final String labelText) {
WButton dupBtn = new WButton("Duplicate");
dupBtn.setAction(new DuplicateAction());
WButton clrBtn = new WButton("Clear");
clrBtn.setAction(new ClearAction());
add(new WLabel(labelText, textFld));
add(textFld);
add(dupBtn);
add(clrBtn);
add(new WAjaxCon... | [
"private",
"void",
"setupUI",
"(",
"final",
"String",
"labelText",
")",
"{",
"WButton",
"dupBtn",
"=",
"new",
"WButton",
"(",
"\"Duplicate\"",
")",
";",
"dupBtn",
".",
"setAction",
"(",
"new",
"DuplicateAction",
"(",
")",
")",
";",
"WButton",
"clrBtn",
"="... | Add the controls to the UI.
@param labelText the text to show in the duplicator field's label. | [
"Add",
"the",
"controls",
"to",
"the",
"UI",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/TextDuplicator.java#L48-L61 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java | NodeImpl.checkedOut | public boolean checkedOut() throws UnsupportedRepositoryOperationException, RepositoryException
{
// this will also check if item is valid
NodeData vancestor = getVersionableAncestor();
if (vancestor != null)
{
PropertyData isCheckedOut =
(PropertyData)dataManager.getItem... | java | public boolean checkedOut() throws UnsupportedRepositoryOperationException, RepositoryException
{
// this will also check if item is valid
NodeData vancestor = getVersionableAncestor();
if (vancestor != null)
{
PropertyData isCheckedOut =
(PropertyData)dataManager.getItem... | [
"public",
"boolean",
"checkedOut",
"(",
")",
"throws",
"UnsupportedRepositoryOperationException",
",",
"RepositoryException",
"{",
"// this will also check if item is valid",
"NodeData",
"vancestor",
"=",
"getVersionableAncestor",
"(",
")",
";",
"if",
"(",
"vancestor",
"!="... | Tell if this node or its nearest versionable ancestor is checked-out.
@return boolean
@throws UnsupportedRepositoryOperationException
if Versionable operations is not supported
@throws RepositoryException
if error occurs | [
"Tell",
"if",
"this",
"node",
"or",
"its",
"nearest",
"versionable",
"ancestor",
"is",
"checked",
"-",
"out",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java#L433-L447 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsWriter.java | JdepsWriter.toTag | String toTag(Archive source, String name, Archive target) {
if (source == target || !target.getModule().isNamed()) {
return target.getName();
}
Module module = target.getModule();
String pn = name;
if ((type == CLASS || type == VERBOSE)) {
int i = name.la... | java | String toTag(Archive source, String name, Archive target) {
if (source == target || !target.getModule().isNamed()) {
return target.getName();
}
Module module = target.getModule();
String pn = name;
if ((type == CLASS || type == VERBOSE)) {
int i = name.la... | [
"String",
"toTag",
"(",
"Archive",
"source",
",",
"String",
"name",
",",
"Archive",
"target",
")",
"{",
"if",
"(",
"source",
"==",
"target",
"||",
"!",
"target",
".",
"getModule",
"(",
")",
".",
"isNamed",
"(",
")",
")",
"{",
"return",
"target",
".",... | If the given archive is JDK archive, this method returns the profile name
only if -profile option is specified; it accesses a private JDK API and
the returned value will have "JDK internal API" prefix
For non-JDK archives, this method returns the file name of the archive. | [
"If",
"the",
"given",
"archive",
"is",
"JDK",
"archive",
"this",
"method",
"returns",
"the",
"profile",
"name",
"only",
"if",
"-",
"profile",
"option",
"is",
"specified",
";",
"it",
"accesses",
"a",
"private",
"JDK",
"API",
"and",
"the",
"returned",
"value... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsWriter.java#L308-L333 |
zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.readResponse | protected void readResponse(HttpState state, HttpConnection conn)
throws IOException, HttpException {
LOG.trace(
"enter HttpMethodBase.readResponse(HttpState, HttpConnection)");
// Status line & line may have already been received
// if 'expect - continue' handshake has been used
... | java | protected void readResponse(HttpState state, HttpConnection conn)
throws IOException, HttpException {
LOG.trace(
"enter HttpMethodBase.readResponse(HttpState, HttpConnection)");
// Status line & line may have already been received
// if 'expect - continue' handshake has been used
... | [
"protected",
"void",
"readResponse",
"(",
"HttpState",
"state",
",",
"HttpConnection",
"conn",
")",
"throws",
"IOException",
",",
"HttpException",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.readResponse(HttpState, HttpConnection)\"",
")",
";",
"// Status line ... | Reads the response from the given {@link HttpConnection connection}.
<p>
The response is processed as the following sequence of actions:
<ol>
<li>
{@link #readStatusLine(HttpState,HttpConnection)} is
invoked to read the request line.
</li>
<li>
{@link #processStatusLine(HttpState,HttpConnection)}
is invoked, allowing... | [
"Reads",
"the",
"response",
"from",
"the",
"given",
"{",
"@link",
"HttpConnection",
"connection",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1862-L1884 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterInvoker.java | FilterInvoker.getBooleanMethodParam | protected boolean getBooleanMethodParam(String methodName, String paramKey, boolean defaultValue) {
if (CommonUtils.isEmpty(configContext)) {
return defaultValue;
}
Boolean o = (Boolean) configContext.get(buildMethodKey(methodName, paramKey));
if (o == null) {
o =... | java | protected boolean getBooleanMethodParam(String methodName, String paramKey, boolean defaultValue) {
if (CommonUtils.isEmpty(configContext)) {
return defaultValue;
}
Boolean o = (Boolean) configContext.get(buildMethodKey(methodName, paramKey));
if (o == null) {
o =... | [
"protected",
"boolean",
"getBooleanMethodParam",
"(",
"String",
"methodName",
",",
"String",
"paramKey",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"CommonUtils",
".",
"isEmpty",
"(",
"configContext",
")",
")",
"{",
"return",
"defaultValue",
";",
"}",
... | 取得方法的特殊参数配置
@param methodName 方法名
@param paramKey 参数关键字
@param defaultValue 默认值
@return 都找不到为false boolean method param | [
"取得方法的特殊参数配置"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterInvoker.java#L140-L151 |
apache/incubator-gobblin | gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java | GPGFileDecryptor.decryptFile | public InputStream decryptFile(InputStream inputStream, InputStream keyIn, String passPhrase)
throws IOException {
try {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
Iterator it = enc.getEncryptedDataObjects();
PGPPrivateKey sKey = null;
PGPPublicKeyEncryptedData pb... | java | public InputStream decryptFile(InputStream inputStream, InputStream keyIn, String passPhrase)
throws IOException {
try {
PGPEncryptedDataList enc = getPGPEncryptedDataList(inputStream);
Iterator it = enc.getEncryptedDataObjects();
PGPPrivateKey sKey = null;
PGPPublicKeyEncryptedData pb... | [
"public",
"InputStream",
"decryptFile",
"(",
"InputStream",
"inputStream",
",",
"InputStream",
"keyIn",
",",
"String",
"passPhrase",
")",
"throws",
"IOException",
"{",
"try",
"{",
"PGPEncryptedDataList",
"enc",
"=",
"getPGPEncryptedDataList",
"(",
"inputStream",
")",
... | Taking in a file inputstream, keyring inputstream and a passPhrase, generate a decrypted file inputstream.
@param inputStream file inputstream
@param keyIn keyring inputstream. This InputStream is owned by the caller.
@param passPhrase passPhrase
@return an {@link InputStream} for the decrypted content
@throws IOExcept... | [
"Taking",
"in",
"a",
"file",
"inputstream",
"keyring",
"inputstream",
"and",
"a",
"passPhrase",
"generate",
"a",
"decrypted",
"file",
"inputstream",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java#L89-L115 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/translator/VariableTranslator.java | VariableTranslator.realToString | public static String realToString(Package pkg, String type, Object value) {
if (value == null)
return "";
com.centurylink.mdw.variable.VariableTranslator trans = getTranslator(pkg, type);
if (trans instanceof DocumentReferenceTranslator)
return ((DocumentReferenceTranslat... | java | public static String realToString(Package pkg, String type, Object value) {
if (value == null)
return "";
com.centurylink.mdw.variable.VariableTranslator trans = getTranslator(pkg, type);
if (trans instanceof DocumentReferenceTranslator)
return ((DocumentReferenceTranslat... | [
"public",
"static",
"String",
"realToString",
"(",
"Package",
"pkg",
",",
"String",
"type",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"\"\"",
";",
"com",
".",
"centurylink",
".",
"mdw",
".",
"variable",
".",
"Va... | Serializes a runtime variable object to its string value. Documents are expanded.
@param pkg workflow package
@param type variable type
@param value object value
@return serialized string value | [
"Serializes",
"a",
"runtime",
"variable",
"object",
"to",
"its",
"string",
"value",
".",
"Documents",
"are",
"expanded",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/translator/VariableTranslator.java#L139-L147 |
spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/SorterDialog.java | SorterDialog.createSorterPane | private JPanel createSorterPane() {
JPanel insidePanel = new JPanel();
insidePanel.setLayout(new GridBagLayout());
preview = new JTableHeader();
Sortables[] sortables = MainFrame.getInstance().getAvailableSortables();
preview.setColumnModel(new SorterTableColumnModel(sortables));... | java | private JPanel createSorterPane() {
JPanel insidePanel = new JPanel();
insidePanel.setLayout(new GridBagLayout());
preview = new JTableHeader();
Sortables[] sortables = MainFrame.getInstance().getAvailableSortables();
preview.setColumnModel(new SorterTableColumnModel(sortables));... | [
"private",
"JPanel",
"createSorterPane",
"(",
")",
"{",
"JPanel",
"insidePanel",
"=",
"new",
"JPanel",
"(",
")",
";",
"insidePanel",
".",
"setLayout",
"(",
"new",
"GridBagLayout",
"(",
")",
")",
";",
"preview",
"=",
"new",
"JTableHeader",
"(",
")",
";",
... | Creates JPanel with checkboxes of different things to sort by. List is:
priority, class, package, category, bugcode, status, and type. | [
"Creates",
"JPanel",
"with",
"checkboxes",
"of",
"different",
"things",
"to",
"sort",
"by",
".",
"List",
"is",
":",
"priority",
"class",
"package",
"category",
"bugcode",
"status",
"and",
"type",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/SorterDialog.java#L96-L138 |
sarxos/webcam-capture | webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java | Webcam.setParameters | public void setParameters(Map<String, ?> parameters) {
WebcamDevice device = getDevice();
if (device instanceof Configurable) {
((Configurable) device).setParameters(parameters);
} else {
LOG.debug("Webcam device {} is not configurable", device);
}
} | java | public void setParameters(Map<String, ?> parameters) {
WebcamDevice device = getDevice();
if (device instanceof Configurable) {
((Configurable) device).setParameters(parameters);
} else {
LOG.debug("Webcam device {} is not configurable", device);
}
} | [
"public",
"void",
"setParameters",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"parameters",
")",
"{",
"WebcamDevice",
"device",
"=",
"getDevice",
"(",
")",
";",
"if",
"(",
"device",
"instanceof",
"Configurable",
")",
"{",
"(",
"(",
"Configurable",
")",
"d... | If the underlying device implements Configurable interface, specified parameters are passed
to it. May be called before the open method or later in dependence of the device
implementation.
@param parameters - Map of parameters changing device defaults
@see Configurable | [
"If",
"the",
"underlying",
"device",
"implements",
"Configurable",
"interface",
"specified",
"parameters",
"are",
"passed",
"to",
"it",
".",
"May",
"be",
"called",
"before",
"the",
"open",
"method",
"or",
"later",
"in",
"dependence",
"of",
"the",
"device",
"im... | train | https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java#L796-L803 |
guardtime/ksi-java-sdk | ksi-service-ha/src/main/java/com/guardtime/ksi/service/ha/HAConfUtil.java | HAConfUtil.isSmaller | static boolean isSmaller(Long a, Long b) {
return a == null || (b != null && b < a);
} | java | static boolean isSmaller(Long a, Long b) {
return a == null || (b != null && b < a);
} | [
"static",
"boolean",
"isSmaller",
"(",
"Long",
"a",
",",
"Long",
"b",
")",
"{",
"return",
"a",
"==",
"null",
"||",
"(",
"b",
"!=",
"null",
"&&",
"b",
"<",
"a",
")",
";",
"}"
] | Is value of b smaller than value of a.
@return True, if b is smaller than a. Always true, if value of a is null. | [
"Is",
"value",
"of",
"b",
"smaller",
"than",
"value",
"of",
"a",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-service-ha/src/main/java/com/guardtime/ksi/service/ha/HAConfUtil.java#L43-L45 |
Terracotta-OSS/offheap-store | src/main/java/org/terracotta/offheapstore/paging/UpfrontAllocatingPageSource.java | UpfrontAllocatingPageSource.addAllocationThreshold | public synchronized Runnable addAllocationThreshold(ThresholdDirection direction, long threshold, Runnable action) {
switch (direction) {
case RISING:
return risingThresholds.put(threshold, action);
case FALLING:
return fallingThresholds.put(threshold, action);
}
th... | java | public synchronized Runnable addAllocationThreshold(ThresholdDirection direction, long threshold, Runnable action) {
switch (direction) {
case RISING:
return risingThresholds.put(threshold, action);
case FALLING:
return fallingThresholds.put(threshold, action);
}
th... | [
"public",
"synchronized",
"Runnable",
"addAllocationThreshold",
"(",
"ThresholdDirection",
"direction",
",",
"long",
"threshold",
",",
"Runnable",
"action",
")",
"{",
"switch",
"(",
"direction",
")",
"{",
"case",
"RISING",
":",
"return",
"risingThresholds",
".",
"... | Adds an allocation threshold action.
<p>
There can be only a single action associated with each unique direction
and threshold combination. If an action is already associated with the
supplied combination then the action is replaced by the new action and the
old action is returned.
<p>
Actions are fired on passing thr... | [
"Adds",
"an",
"allocation",
"threshold",
"action",
".",
"<p",
">",
"There",
"can",
"be",
"only",
"a",
"single",
"action",
"associated",
"with",
"each",
"unique",
"direction",
"and",
"threshold",
"combination",
".",
"If",
"an",
"action",
"is",
"already",
"ass... | train | https://github.com/Terracotta-OSS/offheap-store/blob/600486cddb33c0247025c0cb69eff289eb6d7d93/src/main/java/org/terracotta/offheapstore/paging/UpfrontAllocatingPageSource.java#L443-L451 |
cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java | ParameterMetaData.Double | public static ParameterDef Double(final double d) {
final BigDecimal bd = new BigDecimal(String.format(Locale.US, "%f", d)).
stripTrailingZeros();
return Scaled(Types.DOUBLE, bd.scale());
} | java | public static ParameterDef Double(final double d) {
final BigDecimal bd = new BigDecimal(String.format(Locale.US, "%f", d)).
stripTrailingZeros();
return Scaled(Types.DOUBLE, bd.scale());
} | [
"public",
"static",
"ParameterDef",
"Double",
"(",
"final",
"double",
"d",
")",
"{",
"final",
"BigDecimal",
"bd",
"=",
"new",
"BigDecimal",
"(",
"String",
".",
"format",
"(",
"Locale",
".",
"US",
",",
"\"%f\"",
",",
"d",
")",
")",
".",
"stripTrailingZero... | Double constructor.
@param d the double precision value for the parameter
@return Parameter definition for given double precision value | [
"Double",
"constructor",
"."
] | train | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java#L290-L295 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/ResourceMonitor.java | ResourceMonitor.removeResourceChangeListener | public void removeResourceChangeListener(ResourceChangeListener pListener, Object pResourceId) {
synchronized (timerEntries) {
removeListenerInternal(getResourceId(pResourceId, pListener));
}
} | java | public void removeResourceChangeListener(ResourceChangeListener pListener, Object pResourceId) {
synchronized (timerEntries) {
removeListenerInternal(getResourceId(pResourceId, pListener));
}
} | [
"public",
"void",
"removeResourceChangeListener",
"(",
"ResourceChangeListener",
"pListener",
",",
"Object",
"pResourceId",
")",
"{",
"synchronized",
"(",
"timerEntries",
")",
"{",
"removeListenerInternal",
"(",
"getResourceId",
"(",
"pResourceId",
",",
"pListener",
")"... | Remove the {@code ResourceChangeListener} from the notification list.
@param pListener the pListener to be removed.
@param pResourceId name of the resource to monitor. | [
"Remove",
"the",
"{",
"@code",
"ResourceChangeListener",
"}",
"from",
"the",
"notification",
"list",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/ResourceMonitor.java#L112-L116 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/util/Util.java | Util.toOutputStream | public static OutputStream toOutputStream(final String s, final OutputStream os) throws IOException {
// This needs to be fast.
final int length = s.length();
for(int i = 0; i < length; i++) {
assert s.charAt(i) < (char)0x100 : s.charAt(i);
os.write(s.charAt(i));
}
return os;
} | java | public static OutputStream toOutputStream(final String s, final OutputStream os) throws IOException {
// This needs to be fast.
final int length = s.length();
for(int i = 0; i < length; i++) {
assert s.charAt(i) < (char)0x100 : s.charAt(i);
os.write(s.charAt(i));
}
return os;
} | [
"public",
"static",
"OutputStream",
"toOutputStream",
"(",
"final",
"String",
"s",
",",
"final",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"// This needs to be fast.",
"final",
"int",
"length",
"=",
"s",
".",
"length",
"(",
")",
";",
"for",
"(",... | Writes a string to an output stream, discarding higher order bits.
<p>This method is significantly faster than those relying on character encoders, and it does not allocate any object.
@param s a string.
@param os an output stream.
@return {@code os}.
@throws AssertionError if assertions are enabled and some characte... | [
"Writes",
"a",
"string",
"to",
"an",
"output",
"stream",
"discarding",
"higher",
"order",
"bits",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L211-L220 |
tvesalainen/lpg | src/main/java/org/vesalainen/grammar/Grammar.java | Grammar.addAnonymousTerminal | public void addAnonymousTerminal(String expression, Option... options)
{
addTerminal(null, "'"+expression+"'", expression, "", 0, 10, options);
} | java | public void addAnonymousTerminal(String expression, Option... options)
{
addTerminal(null, "'"+expression+"'", expression, "", 0, 10, options);
} | [
"public",
"void",
"addAnonymousTerminal",
"(",
"String",
"expression",
",",
"Option",
"...",
"options",
")",
"{",
"addTerminal",
"(",
"null",
",",
"\"'\"",
"+",
"expression",
"+",
"\"'\"",
",",
"expression",
",",
"\"\"",
",",
"0",
",",
"10",
",",
"options"... | Adds anonymous terminal. Anonymous terminals name is 'expression'
@param expression
@param options | [
"Adds",
"anonymous",
"terminal",
".",
"Anonymous",
"terminals",
"name",
"is",
"expression"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/grammar/Grammar.java#L348-L351 |
zaproxy/zaproxy | src/org/parosproxy/paros/model/SiteMap.java | SiteMap.addPath | public synchronized SiteNode addPath(HistoryReference ref) {
if (Constant.isLowMemoryOptionSet()) {
throw new InvalidParameterException("SiteMap should not be accessed when the low memory option is set");
}
HttpMessage msg = null;
try {
msg = ref.getHttpMessage();
... | java | public synchronized SiteNode addPath(HistoryReference ref) {
if (Constant.isLowMemoryOptionSet()) {
throw new InvalidParameterException("SiteMap should not be accessed when the low memory option is set");
}
HttpMessage msg = null;
try {
msg = ref.getHttpMessage();
... | [
"public",
"synchronized",
"SiteNode",
"addPath",
"(",
"HistoryReference",
"ref",
")",
"{",
"if",
"(",
"Constant",
".",
"isLowMemoryOptionSet",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidParameterException",
"(",
"\"SiteMap should not be accessed when the low memory optio... | Add the HistoryReference into the SiteMap.
This method will rely on reading message from the History table.
Note that this method must only be called on the EventDispatchThread
@param ref | [
"Add",
"the",
"HistoryReference",
"into",
"the",
"SiteMap",
".",
"This",
"method",
"will",
"rely",
"on",
"reading",
"message",
"from",
"the",
"History",
"table",
".",
"Note",
"that",
"this",
"method",
"must",
"only",
"be",
"called",
"on",
"the",
"EventDispat... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/model/SiteMap.java#L347-L362 |
BlueBrain/bluima | modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/Launcher.java | Launcher.runPipeline | public static void runPipeline(File scriptFile, List<String> cliArgs)
throws IOException, UIMAException, ParseException {
if (!scriptFile.exists()) {
throw new IOException("Script file does not exist ("
+ scriptFile.getAbsolutePath() + ")");
}
LOG.inf... | java | public static void runPipeline(File scriptFile, List<String> cliArgs)
throws IOException, UIMAException, ParseException {
if (!scriptFile.exists()) {
throw new IOException("Script file does not exist ("
+ scriptFile.getAbsolutePath() + ")");
}
LOG.inf... | [
"public",
"static",
"void",
"runPipeline",
"(",
"File",
"scriptFile",
",",
"List",
"<",
"String",
">",
"cliArgs",
")",
"throws",
"IOException",
",",
"UIMAException",
",",
"ParseException",
"{",
"if",
"(",
"!",
"scriptFile",
".",
"exists",
"(",
")",
")",
"{... | Parse this pipeline and run it
@return true if no error during processing
@throws ParseException | [
"Parse",
"this",
"pipeline",
"and",
"run",
"it"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/Launcher.java#L174-L200 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/notifications/NotificationsActor.java | NotificationsActor.onMessagesRead | public void onMessagesRead(Peer peer, long fromDate) {
// Filtering obsolete read events
if (fromDate < getLastReadDate(peer)) {
return;
}
// Removing read messages from pending storage
getNotifications().clear();
pendingStorage.setMessagesCount(0);
... | java | public void onMessagesRead(Peer peer, long fromDate) {
// Filtering obsolete read events
if (fromDate < getLastReadDate(peer)) {
return;
}
// Removing read messages from pending storage
getNotifications().clear();
pendingStorage.setMessagesCount(0);
... | [
"public",
"void",
"onMessagesRead",
"(",
"Peer",
"peer",
",",
"long",
"fromDate",
")",
"{",
"// Filtering obsolete read events",
"if",
"(",
"fromDate",
"<",
"getLastReadDate",
"(",
"peer",
")",
")",
"{",
"return",
";",
"}",
"// Removing read messages from pending st... | Processing event about messages read
@param peer peer
@param fromDate read from date | [
"Processing",
"event",
"about",
"messages",
"read"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/notifications/NotificationsActor.java#L240-L257 |
jhunters/jprotobuf | android/src/main/java/com/baidu/bjf/remoting/protobuf/utils/StringUtils.java | StringUtils.splitByWholeSeparator | public static String[] splitByWholeSeparator(String str, String separator) {
return splitByWholeSeparatorWorker(str, separator, -1, false);
} | java | public static String[] splitByWholeSeparator(String str, String separator) {
return splitByWholeSeparatorWorker(str, separator, -1, false);
} | [
"public",
"static",
"String",
"[",
"]",
"splitByWholeSeparator",
"(",
"String",
"str",
",",
"String",
"separator",
")",
"{",
"return",
"splitByWholeSeparatorWorker",
"(",
"str",
",",
"separator",
",",
"-",
"1",
",",
"false",
")",
";",
"}"
] | <p>
Splits the provided text into an array, separator string specified.
</p>
<p>
The separator(s) will not be included in the returned String array. Adjacent separators are treated as one
separator.
</p>
<p>
A <code>null</code> input String returns <code>null</code>. A <code>null</code> separator splits on whitespace... | [
"<p",
">",
"Splits",
"the",
"provided",
"text",
"into",
"an",
"array",
"separator",
"string",
"specified",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/android/src/main/java/com/baidu/bjf/remoting/protobuf/utils/StringUtils.java#L1016-L1018 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentItemPersistenceImpl.java | CommerceShipmentItemPersistenceImpl.findByGroupId | @Override
public List<CommerceShipmentItem> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | java | @Override
public List<CommerceShipmentItem> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShipmentItem",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}... | Returns a range of all the commerce shipment items where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"shipment",
"items",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentItemPersistenceImpl.java#L139-L143 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.withHours | public Period withHours(int hours) {
int[] values = getValues(); // cloned
getPeriodType().setIndexedField(this, PeriodType.HOUR_INDEX, values, hours);
return new Period(values, getPeriodType());
} | java | public Period withHours(int hours) {
int[] values = getValues(); // cloned
getPeriodType().setIndexedField(this, PeriodType.HOUR_INDEX, values, hours);
return new Period(values, getPeriodType());
} | [
"public",
"Period",
"withHours",
"(",
"int",
"hours",
")",
"{",
"int",
"[",
"]",
"values",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"getPeriodType",
"(",
")",
".",
"setIndexedField",
"(",
"this",
",",
"PeriodType",
".",
"HOUR_INDEX",
",",
"values",
... | Returns a new period with the specified number of hours.
<p>
This period instance is immutable and unaffected by this method call.
@param hours the amount of hours to add, may be negative
@return the new period with the increased hours
@throws UnsupportedOperationException if the field is not supported | [
"Returns",
"a",
"new",
"period",
"with",
"the",
"specified",
"number",
"of",
"hours",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L974-L978 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/SpiderController.java | SpiderController.createURI | private URI createURI(String uri) {
URI uriV = null;
try {
// Try to see if we can create the URI, considering it's encoded.
uriV = new URI(uri, true);
} catch (URIException e) {
// An error occurred, so try to create the URI considering it's not encoded.
try {
log.debug("Second try...");
uriV... | java | private URI createURI(String uri) {
URI uriV = null;
try {
// Try to see if we can create the URI, considering it's encoded.
uriV = new URI(uri, true);
} catch (URIException e) {
// An error occurred, so try to create the URI considering it's not encoded.
try {
log.debug("Second try...");
uriV... | [
"private",
"URI",
"createURI",
"(",
"String",
"uri",
")",
"{",
"URI",
"uriV",
"=",
"null",
";",
"try",
"{",
"// Try to see if we can create the URI, considering it's encoded.",
"uriV",
"=",
"new",
"URI",
"(",
"uri",
",",
"true",
")",
";",
"}",
"catch",
"(",
... | Creates the {@link URI} starting from the uri string. First it tries to convert it into a
String considering it's already encoded and, if it fails, tries to create it considering it's
not encoded.
@param uri the string of the uri
@return the URI, or null if an error occurred and the URI could not be constructed. | [
"Creates",
"the",
"{",
"@link",
"URI",
"}",
"starting",
"from",
"the",
"uri",
"string",
".",
"First",
"it",
"tries",
"to",
"convert",
"it",
"into",
"a",
"String",
"considering",
"it",
"s",
"already",
"encoded",
"and",
"if",
"it",
"fails",
"tries",
"to",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderController.java#L379-L399 |
aws/aws-sdk-java | aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/util/StepFactory.java | StepFactory.newInstallHiveStep | public HadoopJarStepConfig newInstallHiveStep(HiveVersion... hiveVersions) {
if (hiveVersions.length > 0) {
String[] versionStrings = new String[hiveVersions.length];
for (int i = 0; i < hiveVersions.length; i++) {
versionStrings[i] = hiveVersions[i].toString();
... | java | public HadoopJarStepConfig newInstallHiveStep(HiveVersion... hiveVersions) {
if (hiveVersions.length > 0) {
String[] versionStrings = new String[hiveVersions.length];
for (int i = 0; i < hiveVersions.length; i++) {
versionStrings[i] = hiveVersions[i].toString();
... | [
"public",
"HadoopJarStepConfig",
"newInstallHiveStep",
"(",
"HiveVersion",
"...",
"hiveVersions",
")",
"{",
"if",
"(",
"hiveVersions",
".",
"length",
">",
"0",
")",
"{",
"String",
"[",
"]",
"versionStrings",
"=",
"new",
"String",
"[",
"hiveVersions",
".",
"len... | Step that installs the specified versions of Hive on your job flow.
@param hiveVersions the versions of Hive to install
@return HadoopJarStepConfig that can be passed to your job flow. | [
"Step",
"that",
"installs",
"the",
"specified",
"versions",
"of",
"Hive",
"on",
"your",
"job",
"flow",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-emr/src/main/java/com/amazonaws/services/elasticmapreduce/util/StepFactory.java#L159-L168 |
citiususc/hipster | hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Maze2D.java | Maze2D.getStringMazeFilled | public String getStringMazeFilled(Collection<Point> points, char symbol) {
Map<Point, Character> replacements = new HashMap<Point, Character>();
for (Point p : points) {
replacements.put(p, symbol);
}
return getReplacedMazeString(Collections.singletonList(replacements));
... | java | public String getStringMazeFilled(Collection<Point> points, char symbol) {
Map<Point, Character> replacements = new HashMap<Point, Character>();
for (Point p : points) {
replacements.put(p, symbol);
}
return getReplacedMazeString(Collections.singletonList(replacements));
... | [
"public",
"String",
"getStringMazeFilled",
"(",
"Collection",
"<",
"Point",
">",
"points",
",",
"char",
"symbol",
")",
"{",
"Map",
"<",
"Point",
",",
"Character",
">",
"replacements",
"=",
"new",
"HashMap",
"<",
"Point",
",",
"Character",
">",
"(",
")",
... | Generates a string representation of this maze, with the indicated points replaced
with the symbol provided.
@param points points of the maze.
@param symbol symbol to be inserted in each point.
@return the string representation of the maze with the points changed. | [
"Generates",
"a",
"string",
"representation",
"of",
"this",
"maze",
"with",
"the",
"indicated",
"points",
"replaced",
"with",
"the",
"symbol",
"provided",
"."
] | train | https://github.com/citiususc/hipster/blob/9ab1236abb833a27641ae73ba9ca890d5c17598e/hipster-core/src/main/java/es/usc/citius/hipster/util/examples/maze/Maze2D.java#L341-L347 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java | Activator.preInvokeActivateBean | public BeanO preInvokeActivateBean(EJBThreadData threadData, ContainerTx tx, BeanId beanId) // d641259
throws RemoteException
{
return beanId.getActivationStrategy().atActivate(threadData, tx, beanId);
} | java | public BeanO preInvokeActivateBean(EJBThreadData threadData, ContainerTx tx, BeanId beanId) // d641259
throws RemoteException
{
return beanId.getActivationStrategy().atActivate(threadData, tx, beanId);
} | [
"public",
"BeanO",
"preInvokeActivateBean",
"(",
"EJBThreadData",
"threadData",
",",
"ContainerTx",
"tx",
",",
"BeanId",
"beanId",
")",
"// d641259",
"throws",
"RemoteException",
"{",
"return",
"beanId",
".",
"getActivationStrategy",
"(",
")",
".",
"atActivate",
"("... | Activate a bean in the context of a transaction. If an instance of the
bean is already active in the transaction, that instance is returned.
Otherwise, one of several strategies is used to activate an instance
depending on what the bean supports. <p>
If this method completes normally, it must be balanced with a call t... | [
"Activate",
"a",
"bean",
"in",
"the",
"context",
"of",
"a",
"transaction",
".",
"If",
"an",
"instance",
"of",
"the",
"bean",
"is",
"already",
"active",
"in",
"the",
"transaction",
"that",
"instance",
"is",
"returned",
".",
"Otherwise",
"one",
"of",
"severa... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java#L260-L264 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/trustregion/UnconMinTrustRegionBFGS_F64.java | UnconMinTrustRegionBFGS_F64.wolfeCondition | protected boolean wolfeCondition( DMatrixRMaj s , DMatrixRMaj y , DMatrixRMaj g_k) {
double left = CommonOps_DDRM.dot(y,s);
double g_s = CommonOps_DDRM.dot(g_k,s);
double right = (c2-1)*g_s;
if( left >= right ) {
return (fx-f_prev) <= c1*g_s;
}
return false;
} | java | protected boolean wolfeCondition( DMatrixRMaj s , DMatrixRMaj y , DMatrixRMaj g_k) {
double left = CommonOps_DDRM.dot(y,s);
double g_s = CommonOps_DDRM.dot(g_k,s);
double right = (c2-1)*g_s;
if( left >= right ) {
return (fx-f_prev) <= c1*g_s;
}
return false;
} | [
"protected",
"boolean",
"wolfeCondition",
"(",
"DMatrixRMaj",
"s",
",",
"DMatrixRMaj",
"y",
",",
"DMatrixRMaj",
"g_k",
")",
"{",
"double",
"left",
"=",
"CommonOps_DDRM",
".",
"dot",
"(",
"y",
",",
"s",
")",
";",
"double",
"g_s",
"=",
"CommonOps_DDRM",
".",... | Indicates if there's sufficient decrease and curvature. If the Wolfe condition is meet then the Hessian
will be positive definite.
@param s change in state (new - old)
@param y change in gradient (new - old)
@param g_k Gradient at step k.
@return | [
"Indicates",
"if",
"there",
"s",
"sufficient",
"decrease",
"and",
"curvature",
".",
"If",
"the",
"Wolfe",
"condition",
"is",
"meet",
"then",
"the",
"Hessian",
"will",
"be",
"positive",
"definite",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/trustregion/UnconMinTrustRegionBFGS_F64.java#L139-L147 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java | SphereUtil.haversineFormulaRad | @Reference(authors = "R. W. Sinnott", //
title = "Virtues of the Haversine", //
booktitle = "Sky and Telescope 68(2)", //
bibkey = "journals/skytelesc/Sinnott84")
public static double haversineFormulaRad(double lat1, double lon1, double lat2, double lon2) {
if(lat1 == lat2 && lon1 == lon2) {
... | java | @Reference(authors = "R. W. Sinnott", //
title = "Virtues of the Haversine", //
booktitle = "Sky and Telescope 68(2)", //
bibkey = "journals/skytelesc/Sinnott84")
public static double haversineFormulaRad(double lat1, double lon1, double lat2, double lon2) {
if(lat1 == lat2 && lon1 == lon2) {
... | [
"@",
"Reference",
"(",
"authors",
"=",
"\"R. W. Sinnott\"",
",",
"//",
"title",
"=",
"\"Virtues of the Haversine\"",
",",
"//",
"booktitle",
"=",
"\"Sky and Telescope 68(2)\"",
",",
"//",
"bibkey",
"=",
"\"journals/skytelesc/Sinnott84\"",
")",
"public",
"static",
"dou... | Compute the approximate great-circle distance of two points using the
Haversine formula
<p>
Complexity: 5 trigonometric functions, 1-2 sqrt.
<p>
Reference:
<p>
R. W. Sinnott,<br>
Virtues of the Haversine<br>
Sky and Telescope 68(2)
@param lat1 Latitude of first point in degree
@param lon1 Longitude of first point in d... | [
"Compute",
"the",
"approximate",
"great",
"-",
"circle",
"distance",
"of",
"two",
"points",
"using",
"the",
"Haversine",
"formula",
"<p",
">",
"Complexity",
":",
"5",
"trigonometric",
"functions",
"1",
"-",
"2",
"sqrt",
".",
"<p",
">",
"Reference",
":",
"<... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L174-L187 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.insertBusHaltAfter | public BusItineraryHalt insertBusHaltAfter(BusItineraryHalt afterHalt, UUID id, BusItineraryHaltType type) {
return insertBusHaltAfter(afterHalt, id, null, type);
} | java | public BusItineraryHalt insertBusHaltAfter(BusItineraryHalt afterHalt, UUID id, BusItineraryHaltType type) {
return insertBusHaltAfter(afterHalt, id, null, type);
} | [
"public",
"BusItineraryHalt",
"insertBusHaltAfter",
"(",
"BusItineraryHalt",
"afterHalt",
",",
"UUID",
"id",
",",
"BusItineraryHaltType",
"type",
")",
"{",
"return",
"insertBusHaltAfter",
"(",
"afterHalt",
",",
"id",
",",
"null",
",",
"type",
")",
";",
"}"
] | Insert newHalt after afterHalt in the ordered list of {@link BusItineraryHalt}.
@param afterHalt the halt where insert the new halt
@param id id of the new halt
@param type the type of bus halt
@return the added bus halt, otherwise <code>null</code> | [
"Insert",
"newHalt",
"after",
"afterHalt",
"in",
"the",
"ordered",
"list",
"of",
"{",
"@link",
"BusItineraryHalt",
"}",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1162-L1164 |
pac4j/pac4j | pac4j-saml/src/main/java/org/pac4j/saml/sso/impl/SAML2AuthnResponseValidator.java | SAML2AuthnResponseValidator.decryptEncryptedAssertions | protected final void decryptEncryptedAssertions(final Response response, final Decrypter decrypter) {
for (final EncryptedAssertion encryptedAssertion : response.getEncryptedAssertions()) {
try {
final Assertion decryptedAssertion = decrypter.decrypt(encryptedAssertion);
... | java | protected final void decryptEncryptedAssertions(final Response response, final Decrypter decrypter) {
for (final EncryptedAssertion encryptedAssertion : response.getEncryptedAssertions()) {
try {
final Assertion decryptedAssertion = decrypter.decrypt(encryptedAssertion);
... | [
"protected",
"final",
"void",
"decryptEncryptedAssertions",
"(",
"final",
"Response",
"response",
",",
"final",
"Decrypter",
"decrypter",
")",
"{",
"for",
"(",
"final",
"EncryptedAssertion",
"encryptedAssertion",
":",
"response",
".",
"getEncryptedAssertions",
"(",
")... | Decrypt encrypted assertions and add them to the assertions list of the response.
@param response the response
@param decrypter the decrypter | [
"Decrypt",
"encrypted",
"assertions",
"and",
"add",
"them",
"to",
"the",
"assertions",
"list",
"of",
"the",
"response",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-saml/src/main/java/org/pac4j/saml/sso/impl/SAML2AuthnResponseValidator.java#L294-L305 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/BandwidthClient.java | BandwidthClient.buildUri | protected URI buildUri(final String path, final List<NameValuePair> queryStringParams) {
final StringBuilder sb = new StringBuilder();
sb.append(path);
if (queryStringParams != null && queryStringParams.size() > 0) {
sb.append("?").append(URLEncodedUtils.format(queryStringPa... | java | protected URI buildUri(final String path, final List<NameValuePair> queryStringParams) {
final StringBuilder sb = new StringBuilder();
sb.append(path);
if (queryStringParams != null && queryStringParams.size() > 0) {
sb.append("?").append(URLEncodedUtils.format(queryStringPa... | [
"protected",
"URI",
"buildUri",
"(",
"final",
"String",
"path",
",",
"final",
"List",
"<",
"NameValuePair",
">",
"queryStringParams",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"path",
")... | Helper method to return URI query parameters
@param path the path.
@param queryStringParams the query string parameters.
@return the URI object. | [
"Helper",
"method",
"to",
"return",
"URI",
"query",
"parameters"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/BandwidthClient.java#L687-L700 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java | SessionDataManager.getItemData | public ItemData getItemData(QPath path) throws RepositoryException
{
NodeData parent = (NodeData)getItemData(Constants.ROOT_UUID);
if (path.equals(Constants.ROOT_PATH))
{
return parent;
}
QPathEntry[] relPathEntries = path.getRelPath(path.getDepth());
return getItemDa... | java | public ItemData getItemData(QPath path) throws RepositoryException
{
NodeData parent = (NodeData)getItemData(Constants.ROOT_UUID);
if (path.equals(Constants.ROOT_PATH))
{
return parent;
}
QPathEntry[] relPathEntries = path.getRelPath(path.getDepth());
return getItemDa... | [
"public",
"ItemData",
"getItemData",
"(",
"QPath",
"path",
")",
"throws",
"RepositoryException",
"{",
"NodeData",
"parent",
"=",
"(",
"NodeData",
")",
"getItemData",
"(",
"Constants",
".",
"ROOT_UUID",
")",
";",
"if",
"(",
"path",
".",
"equals",
"(",
"Consta... | Return item data by internal <b>qpath</b> in this transient storage then in workspace
container.
@param path
- absolute path
@return existed item data or null if not found
@throws RepositoryException
@see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getItemData(String) | [
"Return",
"item",
"data",
"by",
"internal",
"<b",
">",
"qpath<",
"/",
"b",
">",
"in",
"this",
"transient",
"storage",
"then",
"in",
"workspace",
"container",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java#L152-L165 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/util/ByteUtils.java | ByteUtils.toExtendedASCIIs | public static String toExtendedASCIIs(byte[] bytes, int n, ByteOrder bo) {
RubyArray<String> ra = Ruby.Array.create();
if (bo == LITTLE_ENDIAN) {
for (int i = 0; i < n; i++) {
if (i >= bytes.length) {
ra.push("\0");
continue;
}
byte b = bytes[i];
ra.push... | java | public static String toExtendedASCIIs(byte[] bytes, int n, ByteOrder bo) {
RubyArray<String> ra = Ruby.Array.create();
if (bo == LITTLE_ENDIAN) {
for (int i = 0; i < n; i++) {
if (i >= bytes.length) {
ra.push("\0");
continue;
}
byte b = bytes[i];
ra.push... | [
"public",
"static",
"String",
"toExtendedASCIIs",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"n",
",",
"ByteOrder",
"bo",
")",
"{",
"RubyArray",
"<",
"String",
">",
"ra",
"=",
"Ruby",
".",
"Array",
".",
"create",
"(",
")",
";",
"if",
"(",
"bo",
"=... | Converts a byte array into an ASCII String.
@param bytes
used to be converted
@param n
length of ASCII String
@param bo
a ByteOrder
@return ASCII String | [
"Converts",
"a",
"byte",
"array",
"into",
"an",
"ASCII",
"String",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/util/ByteUtils.java#L398-L423 |
jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/screen/BaseFolderGridScreen.java | BaseFolderGridScreen.doCommand | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if (strCommand.equalsIgnoreCase(MenuConstants.FORMDETAIL))
{ // Make sure if the use wants to select a record to re-connect the selection
Record targetRecord = null;
int iMode = Scree... | java | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if (strCommand.equalsIgnoreCase(MenuConstants.FORMDETAIL))
{ // Make sure if the use wants to select a record to re-connect the selection
Record targetRecord = null;
int iMode = Scree... | [
"public",
"boolean",
"doCommand",
"(",
"String",
"strCommand",
",",
"ScreenField",
"sourceSField",
",",
"int",
"iCommandOptions",
")",
"{",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"MenuConstants",
".",
"FORMDETAIL",
")",
")",
"{",
"// Make sure if t... | Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't process, pass to parent (with me as the source).
<br />Note: Never pass to a parent or child that matches t... | [
"Process",
"the",
"command",
".",
"<br",
"/",
">",
"Step",
"1",
"-",
"Process",
"the",
"command",
"if",
"possible",
"and",
"return",
"true",
"if",
"processed",
".",
"<br",
"/",
">",
"Step",
"2",
"-",
"If",
"I",
"can",
"t",
"process",
"pass",
"to",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/screen/BaseFolderGridScreen.java#L123-L143 |
geomajas/geomajas-project-client-gwt | plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/action/toolbar/MultiLayerFeatureInfoModalAction.java | MultiLayerFeatureInfoModalAction.setFeaturesListLabels | public void setFeaturesListLabels(Map<String, String> featuresListLabels) {
this.featuresListLabels = featuresListLabels;
controller.setFeaturesListLabels(featuresListLabels);
} | java | public void setFeaturesListLabels(Map<String, String> featuresListLabels) {
this.featuresListLabels = featuresListLabels;
controller.setFeaturesListLabels(featuresListLabels);
} | [
"public",
"void",
"setFeaturesListLabels",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"featuresListLabels",
")",
"{",
"this",
".",
"featuresListLabels",
"=",
"featuresListLabels",
";",
"controller",
".",
"setFeaturesListLabels",
"(",
"featuresListLabels",
")",
"... | Set labels for feature lists.
@param featuresListLabels the featuresListLabels to set | [
"Set",
"labels",
"for",
"feature",
"lists",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/action/toolbar/MultiLayerFeatureInfoModalAction.java#L131-L134 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/PluginGroup.java | PluginGroup.loadPlugins | @Nullable
static PluginGroup loadPlugins(PluginTarget target, CentralDogmaConfig config) {
return loadPlugins(PluginGroup.class.getClassLoader(), target, config);
} | java | @Nullable
static PluginGroup loadPlugins(PluginTarget target, CentralDogmaConfig config) {
return loadPlugins(PluginGroup.class.getClassLoader(), target, config);
} | [
"@",
"Nullable",
"static",
"PluginGroup",
"loadPlugins",
"(",
"PluginTarget",
"target",
",",
"CentralDogmaConfig",
"config",
")",
"{",
"return",
"loadPlugins",
"(",
"PluginGroup",
".",
"class",
".",
"getClassLoader",
"(",
")",
",",
"target",
",",
"config",
")",
... | Returns a new {@link PluginGroup} which holds the {@link Plugin}s loaded from the classpath.
{@code null} is returned if there is no {@link Plugin} whose target equals to the specified
{@code target}.
@param target the {@link PluginTarget} which would be loaded | [
"Returns",
"a",
"new",
"{",
"@link",
"PluginGroup",
"}",
"which",
"holds",
"the",
"{",
"@link",
"Plugin",
"}",
"s",
"loaded",
"from",
"the",
"classpath",
".",
"{",
"@code",
"null",
"}",
"is",
"returned",
"if",
"there",
"is",
"no",
"{",
"@link",
"Plugin... | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/PluginGroup.java#L62-L65 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Connection.java | JDBC4Connection.prepareStatement | @Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
if ((resultSetType == ResultSet.TYPE_SCROLL_INSENSITIVE || resultSetType == ResultSet.TYPE_FORWARD_ONLY) &&
resultSetConcurrency == ResultSet.CONCUR_READ_ONL... | java | @Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
if ((resultSetType == ResultSet.TYPE_SCROLL_INSENSITIVE || resultSetType == ResultSet.TYPE_FORWARD_ONLY) &&
resultSetConcurrency == ResultSet.CONCUR_READ_ONL... | [
"@",
"Override",
"public",
"PreparedStatement",
"prepareStatement",
"(",
"String",
"sql",
",",
"int",
"resultSetType",
",",
"int",
"resultSetConcurrency",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"(",
"resultSetType",
"==",
"ResultSet",
".",
"TYPE_SCROLL_INSEN... | Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency. | [
"Creates",
"a",
"PreparedStatement",
"object",
"that",
"will",
"generate",
"ResultSet",
"objects",
"with",
"the",
"given",
"type",
"and",
"concurrency",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Connection.java#L386-L395 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/adapter/BasicResponseAdapter.java | BasicResponseAdapter.addHeader | @Override
public void addHeader(String name, String value) {
touchHeaders().add(name, value);
} | java | @Override
public void addHeader(String name, String value) {
touchHeaders().add(name, value);
} | [
"@",
"Override",
"public",
"void",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"touchHeaders",
"(",
")",
".",
"add",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Add the given single header value to the current list of values
for the given header.
@param name the header name
@param value the header value to be added | [
"Add",
"the",
"given",
"single",
"header",
"value",
"to",
"the",
"current",
"list",
"of",
"values",
"for",
"the",
"given",
"header",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/adapter/BasicResponseAdapter.java#L136-L139 |
VoltDB/voltdb | src/frontend/org/voltdb/exportclient/ExportRow.java | ExportRow.decodeRow | public static ExportRow decodeRow(ExportRow previous, int partition, long startTS, ByteBuffer bb) throws IOException {
final int partitionColIndex = bb.getInt();
final int columnCount = bb.getInt();
assert(columnCount <= DDLCompiler.MAX_COLUMNS);
boolean[] is_null = extractNullFlags(bb, ... | java | public static ExportRow decodeRow(ExportRow previous, int partition, long startTS, ByteBuffer bb) throws IOException {
final int partitionColIndex = bb.getInt();
final int columnCount = bb.getInt();
assert(columnCount <= DDLCompiler.MAX_COLUMNS);
boolean[] is_null = extractNullFlags(bb, ... | [
"public",
"static",
"ExportRow",
"decodeRow",
"(",
"ExportRow",
"previous",
",",
"int",
"partition",
",",
"long",
"startTS",
",",
"ByteBuffer",
"bb",
")",
"throws",
"IOException",
"{",
"final",
"int",
"partitionColIndex",
"=",
"bb",
".",
"getInt",
"(",
")",
... | Decode a byte array of row data into ExportRow
@param previous previous row for schema purposes.
@param partition partition of this data
@param startTS start time for this export data source
@param rowData row data to decode.
@return ExportRow row data with metadata
@throws IOException | [
"Decode",
"a",
"byte",
"array",
"of",
"row",
"data",
"into",
"ExportRow"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/exportclient/ExportRow.java#L106-L136 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLInverseFunctionalObjectPropertyAxiomImpl_CustomFieldSerializer.java | OWLInverseFunctionalObjectPropertyAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLInverseFunctionalObjectPropertyAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLInverseFunctionalObjectPropertyAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLInverseFunctionalObjectPropertyAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";... | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLInverseFunctionalObjectPropertyAxiomImpl_CustomFieldSerializer.java#L74-L77 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLightManager.java | MultiUserChatLightManager.unblockRoom | public void unblockRoom(DomainBareJid mucLightService, Jid roomJid)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
HashMap<Jid, Boolean> rooms = new HashMap<>();
rooms.put(roomJid, true);
sendUnblockRooms(mucLightService, rooms);
} | java | public void unblockRoom(DomainBareJid mucLightService, Jid roomJid)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
HashMap<Jid, Boolean> rooms = new HashMap<>();
rooms.put(roomJid, true);
sendUnblockRooms(mucLightService, rooms);
} | [
"public",
"void",
"unblockRoom",
"(",
"DomainBareJid",
"mucLightService",
",",
"Jid",
"roomJid",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"HashMap",
"<",
"Jid",
",",
"Boolean",
">"... | Unblock a room.
@param mucLightService
@param roomJid
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedException | [
"Unblock",
"a",
"room",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLightManager.java#L340-L345 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java | PDPageContentStreamExt.drawImage | public void drawImage (final PDImageXObject image,
final float x,
final float y,
final float width,
final float height) throws IOException
{
if (inTextMode)
{
throw new IllegalStateException ("Error: draw... | java | public void drawImage (final PDImageXObject image,
final float x,
final float y,
final float width,
final float height) throws IOException
{
if (inTextMode)
{
throw new IllegalStateException ("Error: draw... | [
"public",
"void",
"drawImage",
"(",
"final",
"PDImageXObject",
"image",
",",
"final",
"float",
"x",
",",
"final",
"float",
"y",
",",
"final",
"float",
"width",
",",
"final",
"float",
"height",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inTextMode",
")"... | Draw an image at the x,y coordinates, with the given size.
@param image
The image to draw.
@param x
The x-coordinate to draw the image.
@param y
The y-coordinate to draw the image.
@param width
The width to draw the image.
@param height
The height to draw the image.
@throws IOException
If there is an error writing to ... | [
"Draw",
"an",
"image",
"at",
"the",
"x",
"y",
"coordinates",
"with",
"the",
"given",
"size",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L510-L530 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.multTransA | public static void multTransA(ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c )
{
if( a.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH ||
b.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH ) {
MatrixMatrixMult_ZDRM.multTransA_reorder(a, b, c);
} else {
MatrixMatrix... | java | public static void multTransA(ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c )
{
if( a.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH ||
b.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH ) {
MatrixMatrixMult_ZDRM.multTransA_reorder(a, b, c);
} else {
MatrixMatrix... | [
"public",
"static",
"void",
"multTransA",
"(",
"ZMatrixRMaj",
"a",
",",
"ZMatrixRMaj",
"b",
",",
"ZMatrixRMaj",
"c",
")",
"{",
"if",
"(",
"a",
".",
"numCols",
">=",
"EjmlParameters",
".",
"CMULT_COLUMN_SWITCH",
"||",
"b",
".",
"numCols",
">=",
"EjmlParameter... | <p>Performs the following operation:<br>
<br>
c = a<sup>H</sup> * b <br>
<br>
c<sub>ij</sub> = ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>kj</sub>}
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multiplication operation. Not modified.
@param c Where th... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"a<sup",
">",
"H<",
"/",
"sup",
">",
"*",
"b",
"<br",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"&sum",
";",
"<sub",
">",
"k",
"=... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L454-L462 |
strator-dev/greenpepper-open | extensions-external/fit/src/main/java/com/greenpepper/extensions/fit/Fit.java | Fit.isATimedActionFitInterpreter | public static boolean isATimedActionFitInterpreter(SystemUnderDevelopment sud, String name)
{
try
{
Object target = sud.getFixture(name).getTarget();
if (target instanceof TimedActionFixture)
return true;
}
catch (Throwable t)
{
... | java | public static boolean isATimedActionFitInterpreter(SystemUnderDevelopment sud, String name)
{
try
{
Object target = sud.getFixture(name).getTarget();
if (target instanceof TimedActionFixture)
return true;
}
catch (Throwable t)
{
... | [
"public",
"static",
"boolean",
"isATimedActionFitInterpreter",
"(",
"SystemUnderDevelopment",
"sud",
",",
"String",
"name",
")",
"{",
"try",
"{",
"Object",
"target",
"=",
"sud",
".",
"getFixture",
"(",
"name",
")",
".",
"getTarget",
"(",
")",
";",
"if",
"(",... | <p>isATimedActionFitInterpreter.</p>
@param sud a {@link com.greenpepper.systemunderdevelopment.SystemUnderDevelopment} object.
@param name a {@link java.lang.String} object.
@return a boolean. | [
"<p",
">",
"isATimedActionFitInterpreter",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper-open/blob/71fd244b4989e9cd2d07ae62dd954a1f2a269a92/extensions-external/fit/src/main/java/com/greenpepper/extensions/fit/Fit.java#L29-L42 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java | DynamicReportBuilder.setColspan | public DynamicReportBuilder setColspan(int colNumber, int colQuantity, String colspanTitle) {
this.setColspan(colNumber, colQuantity, colspanTitle, null);
return this;
} | java | public DynamicReportBuilder setColspan(int colNumber, int colQuantity, String colspanTitle) {
this.setColspan(colNumber, colQuantity, colspanTitle, null);
return this;
} | [
"public",
"DynamicReportBuilder",
"setColspan",
"(",
"int",
"colNumber",
",",
"int",
"colQuantity",
",",
"String",
"colspanTitle",
")",
"{",
"this",
".",
"setColspan",
"(",
"colNumber",
",",
"colQuantity",
",",
"colspanTitle",
",",
"null",
")",
";",
"return",
... | Set a colspan in a group of columns. First add the cols to the report
@param colNumber the index of the col
@param colQuantity the number of cols how i will take
@param colspanTitle colspan title
@return a Dynamic Report Builder
@throws ColumnBuilderException When the index of the cols is out of
bounds. | [
"Set",
"a",
"colspan",
"in",
"a",
"group",
"of",
"columns",
".",
"First",
"add",
"the",
"cols",
"to",
"the",
"report"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java#L1645-L1650 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/JsonUtils.java | JsonUtils.renderException | private static void renderException(final Map model, final HttpServletResponse response) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
model.put("status", HttpServletResponse.SC_BAD_REQUEST);
render(model, response);
} | java | private static void renderException(final Map model, final HttpServletResponse response) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
model.put("status", HttpServletResponse.SC_BAD_REQUEST);
render(model, response);
} | [
"private",
"static",
"void",
"renderException",
"(",
"final",
"Map",
"model",
",",
"final",
"HttpServletResponse",
"response",
")",
"{",
"response",
".",
"setStatus",
"(",
"HttpServletResponse",
".",
"SC_BAD_REQUEST",
")",
";",
"model",
".",
"put",
"(",
"\"statu... | Render exceptions. Sets the response status accordingly to note bad requests.
@param model the model
@param response the response | [
"Render",
"exceptions",
".",
"Sets",
"the",
"response",
"status",
"accordingly",
"to",
"note",
"bad",
"requests",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/JsonUtils.java#L67-L71 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.