repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileArtifactNotifier.java | ZipFileArtifactNotifier.registerListener | private boolean registerListener(String newPath, ArtifactListenerSelector newListener) {
"""
Register a listener to a specified path.
Registration has two effects: The listener is put into a table
which maps the listener to specified path. The path of the
listener are added to the covering paths collection, ... | java | private boolean registerListener(String newPath, ArtifactListenerSelector newListener) {
boolean updatedCoveringPaths = addCoveringPath(newPath);
Collection<ArtifactListenerSelector> listenersForPath = listeners.get(newPath);
if ( listenersForPath == null ) {
// Each listeners colle... | [
"private",
"boolean",
"registerListener",
"(",
"String",
"newPath",
",",
"ArtifactListenerSelector",
"newListener",
")",
"{",
"boolean",
"updatedCoveringPaths",
"=",
"addCoveringPath",
"(",
"newPath",
")",
";",
"Collection",
"<",
"ArtifactListenerSelector",
">",
"listen... | Register a listener to a specified path.
Registration has two effects: The listener is put into a table
which maps the listener to specified path. The path of the
listener are added to the covering paths collection, possibly
causing newly covered paths to be removed from the collection.
If the new path is already cov... | [
"Register",
"a",
"listener",
"to",
"a",
"specified",
"path",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileArtifactNotifier.java#L465-L477 |
52inc/android-52Kit | library-winds/src/main/java/com/ftinc/kit/winds/Winds.java | Winds.checkChangelogActivity | public static void checkChangelogActivity(Context ctx, @XmlRes int configId) {
"""
Check to see if we should show the changelog activity if there are any new changes
to the configuration file.
@param ctx the context to launch the activity with
@param configId the changelog configuration xml res... | java | public static void checkChangelogActivity(Context ctx, @XmlRes int configId){
// Parse configuration
ChangeLog changeLog = Parser.parse(ctx, configId);
if(changeLog != null){
// Validate that there is a new version code
if(validateVersion(ctx, changeLog)) {
... | [
"public",
"static",
"void",
"checkChangelogActivity",
"(",
"Context",
"ctx",
",",
"@",
"XmlRes",
"int",
"configId",
")",
"{",
"// Parse configuration",
"ChangeLog",
"changeLog",
"=",
"Parser",
".",
"parse",
"(",
"ctx",
",",
"configId",
")",
";",
"if",
"(",
"... | Check to see if we should show the changelog activity if there are any new changes
to the configuration file.
@param ctx the context to launch the activity with
@param configId the changelog configuration xml resource id | [
"Check",
"to",
"see",
"if",
"we",
"should",
"show",
"the",
"changelog",
"activity",
"if",
"there",
"are",
"any",
"new",
"changes",
"to",
"the",
"configuration",
"file",
"."
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library-winds/src/main/java/com/ftinc/kit/winds/Winds.java#L120-L135 |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.addToTab | public Report addToTab(String tabName, String key, Object value) {
"""
Add a key value pair to a metadata tab.
@param tabName the name of the tab to add the key value pair to
@param key the key of the metadata to add
@param value the metadata value to add
@return the modified report
"""
dia... | java | public Report addToTab(String tabName, String key, Object value) {
diagnostics.metaData.addToTab(tabName, key, value);
return this;
} | [
"public",
"Report",
"addToTab",
"(",
"String",
"tabName",
",",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"diagnostics",
".",
"metaData",
".",
"addToTab",
"(",
"tabName",
",",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add a key value pair to a metadata tab.
@param tabName the name of the tab to add the key value pair to
@param key the key of the metadata to add
@param value the metadata value to add
@return the modified report | [
"Add",
"a",
"key",
"value",
"pair",
"to",
"a",
"metadata",
"tab",
"."
] | train | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L190-L193 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/tlv/TLVElement.java | TLVElement.getDecodedString | public final String getDecodedString() throws TLVParserException {
"""
Converts the TLV element content data to UTF-8 string.
@return Decoded instance of string.
@throws TLVParserException
when content string isn't null terminated or is malformed UTF-8 data.
"""
byte[] data = getContent();
... | java | public final String getDecodedString() throws TLVParserException {
byte[] data = getContent();
if (!(data.length > 0 && data[data.length - 1] == '\0')) {
throw new TLVParserException("String must be null terminated");
}
try {
return Util.decodeString(data, 0, data... | [
"public",
"final",
"String",
"getDecodedString",
"(",
")",
"throws",
"TLVParserException",
"{",
"byte",
"[",
"]",
"data",
"=",
"getContent",
"(",
")",
";",
"if",
"(",
"!",
"(",
"data",
".",
"length",
">",
"0",
"&&",
"data",
"[",
"data",
".",
"length",
... | Converts the TLV element content data to UTF-8 string.
@return Decoded instance of string.
@throws TLVParserException
when content string isn't null terminated or is malformed UTF-8 data. | [
"Converts",
"the",
"TLV",
"element",
"content",
"data",
"to",
"UTF",
"-",
"8",
"string",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/tlv/TLVElement.java#L257-L267 |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java | PythonStreamExecutionEnvironment.socket_text_stream | public PythonDataStream socket_text_stream(String host, int port) {
"""
A thin wrapper layer over {@link StreamExecutionEnvironment#socketTextStream(java.lang.String, int)}.
@param host The host name which a server socket binds
@param port The port number which a server socket binds. A port number of 0 means t... | java | public PythonDataStream socket_text_stream(String host, int port) {
return new PythonDataStream<>(env.socketTextStream(host, port).map(new AdapterMap<String>()));
} | [
"public",
"PythonDataStream",
"socket_text_stream",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"return",
"new",
"PythonDataStream",
"<>",
"(",
"env",
".",
"socketTextStream",
"(",
"host",
",",
"port",
")",
".",
"map",
"(",
"new",
"AdapterMap",
"<",... | A thin wrapper layer over {@link StreamExecutionEnvironment#socketTextStream(java.lang.String, int)}.
@param host The host name which a server socket binds
@param port The port number which a server socket binds. A port number of 0 means that the port number is automatically
allocated.
@return A python data stream con... | [
"A",
"thin",
"wrapper",
"layer",
"over",
"{",
"@link",
"StreamExecutionEnvironment#socketTextStream",
"(",
"java",
".",
"lang",
".",
"String",
"int",
")",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java#L200-L202 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/img/ImageExtensions.java | ImageExtensions.newPdfPTable | public static PdfPTable newPdfPTable(int numColumns, List<String> headerNames) {
"""
Factory method for create a new {@link PdfPTable} with the given count of columns and the
column header names
@param numColumns
the count of columns of the table
@param headerNames
the column header names
@return the new {... | java | public static PdfPTable newPdfPTable(int numColumns, List<String> headerNames)
{
PdfPTable table = new PdfPTable(numColumns);
headerNames.stream().forEach(columnHeaderName -> {
PdfPCell header = new PdfPCell();
header.setBackgroundColor(BaseColor.LIGHT_GRAY);
header.setBorderWidth(2);
header.setPhrase(... | [
"public",
"static",
"PdfPTable",
"newPdfPTable",
"(",
"int",
"numColumns",
",",
"List",
"<",
"String",
">",
"headerNames",
")",
"{",
"PdfPTable",
"table",
"=",
"new",
"PdfPTable",
"(",
"numColumns",
")",
";",
"headerNames",
".",
"stream",
"(",
")",
".",
"f... | Factory method for create a new {@link PdfPTable} with the given count of columns and the
column header names
@param numColumns
the count of columns of the table
@param headerNames
the column header names
@return the new {@link PdfPTable} | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"PdfPTable",
"}",
"with",
"the",
"given",
"count",
"of",
"columns",
"and",
"the",
"column",
"header",
"names"
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/img/ImageExtensions.java#L217-L228 |
structurizr/java | structurizr-core/src/com/structurizr/model/DeploymentNode.java | DeploymentNode.addDeploymentNode | public DeploymentNode addDeploymentNode(String name, String description, String technology, int instances) {
"""
Adds a child deployment node.
@param name the name of the deployment node
@param description a short description
@param technology the technology
@param instances the number of i... | java | public DeploymentNode addDeploymentNode(String name, String description, String technology, int instances) {
return addDeploymentNode(name, description, technology, instances, null);
} | [
"public",
"DeploymentNode",
"addDeploymentNode",
"(",
"String",
"name",
",",
"String",
"description",
",",
"String",
"technology",
",",
"int",
"instances",
")",
"{",
"return",
"addDeploymentNode",
"(",
"name",
",",
"description",
",",
"technology",
",",
"instances... | Adds a child deployment node.
@param name the name of the deployment node
@param description a short description
@param technology the technology
@param instances the number of instances
@return a DeploymentNode object | [
"Adds",
"a",
"child",
"deployment",
"node",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/DeploymentNode.java#L78-L80 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/FilterUtils.java | FilterUtils.checkRuleMapping | private void checkRuleMapping(final QName attName, final List<String> attValue) {
"""
Check if attribute value has mapping in filter configuration and throw messages.
@param attName attribute name
@param attValue attribute value
"""
if (attValue == null || attValue.isEmpty()) {
return;
... | java | private void checkRuleMapping(final QName attName, final List<String> attValue) {
if (attValue == null || attValue.isEmpty()) {
return;
}
for (final String attSubValue: attValue) {
final FilterKey filterKey = new FilterKey(attName, attSubValue);
final Action f... | [
"private",
"void",
"checkRuleMapping",
"(",
"final",
"QName",
"attName",
",",
"final",
"List",
"<",
"String",
">",
"attValue",
")",
"{",
"if",
"(",
"attValue",
"==",
"null",
"||",
"attValue",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"for... | Check if attribute value has mapping in filter configuration and throw messages.
@param attName attribute name
@param attValue attribute value | [
"Check",
"if",
"attribute",
"value",
"has",
"mapping",
"in",
"filter",
"configuration",
"and",
"throw",
"messages",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FilterUtils.java#L467-L480 |
KyoriPowered/lunar | src/main/java/net/kyori/lunar/PrimitiveOptionals.java | PrimitiveOptionals.mapToInt | public static @NonNull OptionalInt mapToInt(final @NonNull OptionalDouble optional, final @NonNull DoubleToIntFunction function) {
"""
Apply the provided mapping function to the {@code optional} if a value is present,
and return an {@code OptionalInt} describing the result.
@param optional the optional
@param... | java | public static @NonNull OptionalInt mapToInt(final @NonNull OptionalDouble optional, final @NonNull DoubleToIntFunction function) {
requireNonNull(function, "function");
return optional.isPresent() ? OptionalInt.of(function.applyAsInt(optional.getAsDouble())) : OptionalInt.empty();
} | [
"public",
"static",
"@",
"NonNull",
"OptionalInt",
"mapToInt",
"(",
"final",
"@",
"NonNull",
"OptionalDouble",
"optional",
",",
"final",
"@",
"NonNull",
"DoubleToIntFunction",
"function",
")",
"{",
"requireNonNull",
"(",
"function",
",",
"\"function\"",
")",
";",
... | Apply the provided mapping function to the {@code optional} if a value is present,
and return an {@code OptionalInt} describing the result.
@param optional the optional
@param function the function
@return an optional | [
"Apply",
"the",
"provided",
"mapping",
"function",
"to",
"the",
"{",
"@code",
"optional",
"}",
"if",
"a",
"value",
"is",
"present",
"and",
"return",
"an",
"{",
"@code",
"OptionalInt",
"}",
"describing",
"the",
"result",
"."
] | train | https://github.com/KyoriPowered/lunar/blob/6856747d9034a2fe0c8d0a8a0150986797732b5c/src/main/java/net/kyori/lunar/PrimitiveOptionals.java#L63-L66 |
scribejava/scribejava | scribejava-core/src/main/java/com/github/scribejava/core/oauth/OAuth10aService.java | OAuth10aService.getAccessTokenAsync | public Future<OAuth1AccessToken> getAccessTokenAsync(OAuth1RequestToken requestToken, String oauthVerifier,
OAuthAsyncRequestCallback<OAuth1AccessToken> callback) {
"""
Start the request to retrieve the access token. The optionally provided callback will be called with the Token
when it is available.
... | java | public Future<OAuth1AccessToken> getAccessTokenAsync(OAuth1RequestToken requestToken, String oauthVerifier,
OAuthAsyncRequestCallback<OAuth1AccessToken> callback) {
log("async obtaining access token from %s", api.getAccessTokenEndpoint());
final OAuthRequest request = prepareAccessTokenReque... | [
"public",
"Future",
"<",
"OAuth1AccessToken",
">",
"getAccessTokenAsync",
"(",
"OAuth1RequestToken",
"requestToken",
",",
"String",
"oauthVerifier",
",",
"OAuthAsyncRequestCallback",
"<",
"OAuth1AccessToken",
">",
"callback",
")",
"{",
"log",
"(",
"\"async obtaining acces... | Start the request to retrieve the access token. The optionally provided callback will be called with the Token
when it is available.
@param requestToken request token (obtained previously or null)
@param oauthVerifier oauth_verifier
@param callback optional callback
@return Future | [
"Start",
"the",
"request",
"to",
"retrieve",
"the",
"access",
"token",
".",
"The",
"optionally",
"provided",
"callback",
"will",
"be",
"called",
"with",
"the",
"Token",
"when",
"it",
"is",
"available",
"."
] | train | https://github.com/scribejava/scribejava/blob/030d76872fe371a84b5d05c6c3c33c34e8f611f1/scribejava-core/src/main/java/com/github/scribejava/core/oauth/OAuth10aService.java#L113-L123 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.createAllPeers | private void createAllPeers() throws NetworkConfigurationException {
"""
Creates Node instances representing all the peers defined in the config file
"""
// Sanity checks
if (peers != null) {
throw new NetworkConfigurationException("INTERNAL ERROR: peers has already been initializ... | java | private void createAllPeers() throws NetworkConfigurationException {
// Sanity checks
if (peers != null) {
throw new NetworkConfigurationException("INTERNAL ERROR: peers has already been initialized!");
}
peers = new HashMap<>();
// peers is a JSON object containin... | [
"private",
"void",
"createAllPeers",
"(",
")",
"throws",
"NetworkConfigurationException",
"{",
"// Sanity checks",
"if",
"(",
"peers",
"!=",
"null",
")",
"{",
"throw",
"new",
"NetworkConfigurationException",
"(",
"\"INTERNAL ERROR: peers has already been initialized!\"",
")... | Creates Node instances representing all the peers defined in the config file | [
"Creates",
"Node",
"instances",
"representing",
"all",
"the",
"peers",
"defined",
"in",
"the",
"config",
"file"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L534-L566 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java | ManagedPropertyPersistenceHelper.generateParamSerializer | public static void generateParamSerializer(BindTypeContext context, String propertyName, TypeName parameterTypeName, PersistType persistType) {
"""
Generate param serializer.
@param context the context
@param propertyName the property name
@param parameterTypeName the parameter type name
@param persistType t... | java | public static void generateParamSerializer(BindTypeContext context, String propertyName, TypeName parameterTypeName, PersistType persistType) {
propertyName = SQLiteDaoDefinition.PARAM_SERIALIZER_PREFIX + propertyName;
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(propertyName).addJavadoc("for param ... | [
"public",
"static",
"void",
"generateParamSerializer",
"(",
"BindTypeContext",
"context",
",",
"String",
"propertyName",
",",
"TypeName",
"parameterTypeName",
",",
"PersistType",
"persistType",
")",
"{",
"propertyName",
"=",
"SQLiteDaoDefinition",
".",
"PARAM_SERIALIZER_P... | Generate param serializer.
@param context the context
@param propertyName the property name
@param parameterTypeName the parameter type name
@param persistType the persist type | [
"Generate",
"param",
"serializer",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/ManagedPropertyPersistenceHelper.java#L244-L303 |
tvesalainen/lpg | src/main/java/org/vesalainen/grammar/state/NFAState.java | NFAState.epsilonClosure | public Set<NFAState<T>> epsilonClosure(Scope<DFAState<T>> scope) {
"""
Creates a dfa state from all nfa states that can be reached from this state
with epsilon move.
@param scope
@return
"""
Set<NFAState<T>> set = new HashSet<>();
set.add(this);
return epsilonClosure(scope, set);
... | java | public Set<NFAState<T>> epsilonClosure(Scope<DFAState<T>> scope)
{
Set<NFAState<T>> set = new HashSet<>();
set.add(this);
return epsilonClosure(scope, set);
} | [
"public",
"Set",
"<",
"NFAState",
"<",
"T",
">",
">",
"epsilonClosure",
"(",
"Scope",
"<",
"DFAState",
"<",
"T",
">",
">",
"scope",
")",
"{",
"Set",
"<",
"NFAState",
"<",
"T",
">>",
"set",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"set",
".",
... | Creates a dfa state from all nfa states that can be reached from this state
with epsilon move.
@param scope
@return | [
"Creates",
"a",
"dfa",
"state",
"from",
"all",
"nfa",
"states",
"that",
"can",
"be",
"reached",
"from",
"this",
"state",
"with",
"epsilon",
"move",
"."
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/grammar/state/NFAState.java#L431-L436 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Line.java | Line.set | public void set(Vector2f start, Vector2f end) {
"""
Configure the line
@param start
The start point of the line
@param end
The end point of the line
"""
super.pointsDirty = true;
if (this.start == null) {
this.start = new Vector2f();
}
this.start.set(start);
if (this.end == null) {
... | java | public void set(Vector2f start, Vector2f end) {
super.pointsDirty = true;
if (this.start == null) {
this.start = new Vector2f();
}
this.start.set(start);
if (this.end == null) {
this.end = new Vector2f();
}
this.end.set(end);
vec = new Vector2f(end);
vec.sub(start);
lenSquare... | [
"public",
"void",
"set",
"(",
"Vector2f",
"start",
",",
"Vector2f",
"end",
")",
"{",
"super",
".",
"pointsDirty",
"=",
"true",
";",
"if",
"(",
"this",
".",
"start",
"==",
"null",
")",
"{",
"this",
".",
"start",
"=",
"new",
"Vector2f",
"(",
")",
";"... | Configure the line
@param start
The start point of the line
@param end
The end point of the line | [
"Configure",
"the",
"line"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Line.java#L185-L201 |
cvut/JCOP | src/main/java/cz/cvut/felk/cig/jcop/problem/sat/SAT.java | SAT.initCommons | protected void initCommons() {
"""
Initializes common attributes such as operations and default fitness.
<p/>
Requires {@link #formula}/{@link #variables} to be already fully loaded.
"""
this.setTrueOperations = new ArrayList<SetTrueOperation>(this.dimension);
this.setFalseOperations = new Ar... | java | protected void initCommons() {
this.setTrueOperations = new ArrayList<SetTrueOperation>(this.dimension);
this.setFalseOperations = new ArrayList<SetFalseOperation>(this.dimension);
SetTrueOperation setTrueOperation;
SetFalseOperation setFalseOperation;
for (int i = 0; i < this.di... | [
"protected",
"void",
"initCommons",
"(",
")",
"{",
"this",
".",
"setTrueOperations",
"=",
"new",
"ArrayList",
"<",
"SetTrueOperation",
">",
"(",
"this",
".",
"dimension",
")",
";",
"this",
".",
"setFalseOperations",
"=",
"new",
"ArrayList",
"<",
"SetFalseOpera... | Initializes common attributes such as operations and default fitness.
<p/>
Requires {@link #formula}/{@link #variables} to be already fully loaded. | [
"Initializes",
"common",
"attributes",
"such",
"as",
"operations",
"and",
"default",
"fitness",
".",
"<p",
"/",
">",
"Requires",
"{"
] | train | https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/problem/sat/SAT.java#L180-L197 |
GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/AbstractDelegationTokenBinding.java | AbstractDelegationTokenBinding.bindToFileSystem | public void bindToFileSystem(GoogleHadoopFileSystemBase fs, Text service) {
"""
Bind to the filesystem. Subclasses can use this to perform their own binding operations - but
they must always call their superclass implementation. This <i>Must</i> be called before
calling {@code init()}.
<p><b>Important:</b> Th... | java | public void bindToFileSystem(GoogleHadoopFileSystemBase fs, Text service) {
this.fileSystem = requireNonNull(fs);
this.service = requireNonNull(service);
} | [
"public",
"void",
"bindToFileSystem",
"(",
"GoogleHadoopFileSystemBase",
"fs",
",",
"Text",
"service",
")",
"{",
"this",
".",
"fileSystem",
"=",
"requireNonNull",
"(",
"fs",
")",
";",
"this",
".",
"service",
"=",
"requireNonNull",
"(",
"service",
")",
";",
"... | Bind to the filesystem. Subclasses can use this to perform their own binding operations - but
they must always call their superclass implementation. This <i>Must</i> be called before
calling {@code init()}.
<p><b>Important:</b> This binding will happen during FileSystem.initialize(); the FS is not
live for actual use ... | [
"Bind",
"to",
"the",
"filesystem",
".",
"Subclasses",
"can",
"use",
"this",
"to",
"perform",
"their",
"own",
"binding",
"operations",
"-",
"but",
"they",
"must",
"always",
"call",
"their",
"superclass",
"implementation",
".",
"This",
"<i",
">",
"Must<",
"/",... | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/auth/AbstractDelegationTokenBinding.java#L94-L97 |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/TimeSensor.java | TimeSensor.setEnabled | public void setEnabled(boolean enable, GVRContext gvrContext) {
"""
setEnabled will set the TimeSensor enable variable.
if true, then it will started the animation
if fase, then it changes repeat mode to ONCE so the animation will conclude.
There is no simple stop() animation
@param enable
@param gvrContext
... | java | public void setEnabled(boolean enable, GVRContext gvrContext) {
if (this.enabled != enabled ) {
// a change in the animation stopping / starting
for (GVRNodeAnimation gvrKeyFrameAnimation : gvrKeyFrameAnimations) {
if (enable) gvrKeyFrameAnimation.start(gvrContext.getAnim... | [
"public",
"void",
"setEnabled",
"(",
"boolean",
"enable",
",",
"GVRContext",
"gvrContext",
")",
"{",
"if",
"(",
"this",
".",
"enabled",
"!=",
"enabled",
")",
"{",
"// a change in the animation stopping / starting",
"for",
"(",
"GVRNodeAnimation",
"gvrKeyFrameAnimation... | setEnabled will set the TimeSensor enable variable.
if true, then it will started the animation
if fase, then it changes repeat mode to ONCE so the animation will conclude.
There is no simple stop() animation
@param enable
@param gvrContext | [
"setEnabled",
"will",
"set",
"the",
"TimeSensor",
"enable",
"variable",
".",
"if",
"true",
"then",
"it",
"will",
"started",
"the",
"animation",
"if",
"fase",
"then",
"it",
"changes",
"repeat",
"mode",
"to",
"ONCE",
"so",
"the",
"animation",
"will",
"conclude... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/TimeSensor.java#L76-L87 |
MenoData/Time4J | base/src/main/java/net/time4j/engine/Chronology.java | Chronology.getRule | <V> ElementRule<T, V> getRule(ChronoElement<V> element) {
"""
<p>Bestimmt eine chronologische Regel zum angegebenen Element. </p>
@param <V> Elementwerttyp
@param element chronologisches Element
@return Regelobjekt
@throws RuleNotFoundException if given element is not registered in
this chronology... | java | <V> ElementRule<T, V> getRule(ChronoElement<V> element) {
if (element == null) {
throw new NullPointerException("Missing chronological element.");
}
ElementRule<?, ?> rule = this.ruleMap.get(element);
if (rule == null) {
rule = this.getDerivedRule(element, true... | [
"<",
"V",
">",
"ElementRule",
"<",
"T",
",",
"V",
">",
"getRule",
"(",
"ChronoElement",
"<",
"V",
">",
"element",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Missing chronological element.\"",
")"... | <p>Bestimmt eine chronologische Regel zum angegebenen Element. </p>
@param <V> Elementwerttyp
@param element chronologisches Element
@return Regelobjekt
@throws RuleNotFoundException if given element is not registered in
this chronology and there is also no element rule which can
be derived from element | [
"<p",
">",
"Bestimmt",
"eine",
"chronologische",
"Regel",
"zum",
"angegebenen",
"Element",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/engine/Chronology.java#L471-L489 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/util/ComparableUtils.java | ComparableUtils.safeCompare | public static <T> int safeCompare(Comparable<T> d1, T d2) {
"""
Does a safe comparison of two {@link Comparable} objects accounting for nulls
@param d1
First object
@param d2
Second object
@return A positive number if the object double is larger, a negative number if the second
object is larger, or 0 if th... | java | public static <T> int safeCompare(Comparable<T> d1, T d2) {
if (d1 != null && d2 != null) {
return d1.compareTo(d2);
} else if (d1 == null && d2 != null) {
return -1;
} else if (d1 != null && d2 == null) {
return 1;
} else {
return 0;
... | [
"public",
"static",
"<",
"T",
">",
"int",
"safeCompare",
"(",
"Comparable",
"<",
"T",
">",
"d1",
",",
"T",
"d2",
")",
"{",
"if",
"(",
"d1",
"!=",
"null",
"&&",
"d2",
"!=",
"null",
")",
"{",
"return",
"d1",
".",
"compareTo",
"(",
"d2",
")",
";",... | Does a safe comparison of two {@link Comparable} objects accounting for nulls
@param d1
First object
@param d2
Second object
@return A positive number if the object double is larger, a negative number if the second
object is larger, or 0 if they are equal. Null is considered less than any non-null
value | [
"Does",
"a",
"safe",
"comparison",
"of",
"two",
"{",
"@link",
"Comparable",
"}",
"objects",
"accounting",
"for",
"nulls"
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/util/ComparableUtils.java#L30-L40 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/proposition/interval/Relation.java | Relation.hasRelation | public boolean hasRelation(Interval interval1, Interval interval2) {
"""
Determines whether the given intervals have this relation.
@param interval1
the left-hand-side {@link Interval}.
@param interval2
the right-hand-side {@link Interval}.
@return <code>true</code> if the intervals have this relation,
<co... | java | public boolean hasRelation(Interval interval1, Interval interval2) {
if (interval1 == null || interval2 == null) {
return false;
}
Long minStart1 = interval1.getMinimumStart();
Long maxStart1 = interval1.getMaximumStart();
Long minFinish1 = interval1.getMinimumFinish(... | [
"public",
"boolean",
"hasRelation",
"(",
"Interval",
"interval1",
",",
"Interval",
"interval2",
")",
"{",
"if",
"(",
"interval1",
"==",
"null",
"||",
"interval2",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"Long",
"minStart1",
"=",
"interval1",
"... | Determines whether the given intervals have this relation.
@param interval1
the left-hand-side {@link Interval}.
@param interval2
the right-hand-side {@link Interval}.
@return <code>true</code> if the intervals have this relation,
<code>false</code> otherwise. Returns <code>false</code> if any
<code>null</code> argume... | [
"Determines",
"whether",
"the",
"given",
"intervals",
"have",
"this",
"relation",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/proposition/interval/Relation.java#L288-L308 |
openengsb/openengsb | connector/userprojectsldap/src/main/java/org/openengsb/connector/userprojects/ldap/internal/ldap/Utils.java | Utils.extractAttributeValueNoEmptyCheck | public static String extractAttributeValueNoEmptyCheck(Entry entry, String attributeType) {
"""
Returns the value of the attribute of attributeType from entry.
"""
Attribute attribute = entry.get(attributeType);
if (attribute == null) {
return null;
}
try {
... | java | public static String extractAttributeValueNoEmptyCheck(Entry entry, String attributeType) {
Attribute attribute = entry.get(attributeType);
if (attribute == null) {
return null;
}
try {
return attribute.getString();
} catch (LdapInvalidAttributeValueExcept... | [
"public",
"static",
"String",
"extractAttributeValueNoEmptyCheck",
"(",
"Entry",
"entry",
",",
"String",
"attributeType",
")",
"{",
"Attribute",
"attribute",
"=",
"entry",
".",
"get",
"(",
"attributeType",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"... | Returns the value of the attribute of attributeType from entry. | [
"Returns",
"the",
"value",
"of",
"the",
"attribute",
"of",
"attributeType",
"from",
"entry",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/connector/userprojectsldap/src/main/java/org/openengsb/connector/userprojects/ldap/internal/ldap/Utils.java#L55-L65 |
LearnLib/learnlib | oracles/membership-oracles/src/main/java/de/learnlib/oracle/membership/SimulatorOmegaOracle.java | SimulatorOmegaOracle.isSameState | @Override
public boolean isSameState(Word<I> input1, S s1, Word<I> input2, S s2) {
"""
Test for state equivalence by simply invoking {@link Object#equals(Object)}.
@see OmegaMembershipOracle#isSameState(Word, Object, Word, Object)
"""
return s1.equals(s2);
} | java | @Override
public boolean isSameState(Word<I> input1, S s1, Word<I> input2, S s2) {
return s1.equals(s2);
} | [
"@",
"Override",
"public",
"boolean",
"isSameState",
"(",
"Word",
"<",
"I",
">",
"input1",
",",
"S",
"s1",
",",
"Word",
"<",
"I",
">",
"input2",
",",
"S",
"s2",
")",
"{",
"return",
"s1",
".",
"equals",
"(",
"s2",
")",
";",
"}"
] | Test for state equivalence by simply invoking {@link Object#equals(Object)}.
@see OmegaMembershipOracle#isSameState(Word, Object, Word, Object) | [
"Test",
"for",
"state",
"equivalence",
"by",
"simply",
"invoking",
"{",
"@link",
"Object#equals",
"(",
"Object",
")",
"}",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/membership-oracles/src/main/java/de/learnlib/oracle/membership/SimulatorOmegaOracle.java#L92-L95 |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java | OutlookMessageParser.analyzeDocumentEntry | private OutlookFieldInformation analyzeDocumentEntry(final DocumentEntry de) {
"""
Analyzes the {@link DocumentEntry} and returns
a {@link OutlookFieldInformation} object containing the
class (the field name, so to say) and type of
the entry.
@param de The {@link DocumentEntry} that should be examined.
@ret... | java | private OutlookFieldInformation analyzeDocumentEntry(final DocumentEntry de) {
final String name = de.getName();
// we are only interested in document entries
// with names starting with __substg1.
LOGGER.trace("Document entry: {}", name);
if (name.startsWith(PROPERTY_STREAM_PREFIX)) {
final String clazz;
... | [
"private",
"OutlookFieldInformation",
"analyzeDocumentEntry",
"(",
"final",
"DocumentEntry",
"de",
")",
"{",
"final",
"String",
"name",
"=",
"de",
".",
"getName",
"(",
")",
";",
"// we are only interested in document entries",
"// with names starting with __substg1.",
"LOGG... | Analyzes the {@link DocumentEntry} and returns
a {@link OutlookFieldInformation} object containing the
class (the field name, so to say) and type of
the entry.
@param de The {@link DocumentEntry} that should be examined.
@return A {@link OutlookFieldInformation} object containing class and type of the document entry o... | [
"Analyzes",
"the",
"{",
"@link",
"DocumentEntry",
"}",
"and",
"returns",
"a",
"{",
"@link",
"OutlookFieldInformation",
"}",
"object",
"containing",
"the",
"class",
"(",
"the",
"field",
"name",
"so",
"to",
"say",
")",
"and",
"type",
"of",
"the",
"entry",
".... | train | https://github.com/bbottema/outlook-message-parser/blob/ea7d59da33c8a62dfc2e0aa64d2f8f7c903ccb0e/src/main/java/org/simplejavamail/outlookmessageparser/OutlookMessageParser.java#L520-L550 |
j256/ormlite-core | src/main/java/com/j256/ormlite/dao/DaoManager.java | DaoManager.unregisterDao | public static synchronized void unregisterDao(ConnectionSource connectionSource, Dao<?, ?> dao) {
"""
Remove a DAO from the cache. This is necessary if we've registered it already but it throws an exception during
configuration.
"""
if (connectionSource == null) {
throw new IllegalArgumentException("conn... | java | public static synchronized void unregisterDao(ConnectionSource connectionSource, Dao<?, ?> dao) {
if (connectionSource == null) {
throw new IllegalArgumentException("connectionSource argument cannot be null");
}
removeDaoToClassMap(new ClassConnectionSource(connectionSource, dao.getDataClass()));
} | [
"public",
"static",
"synchronized",
"void",
"unregisterDao",
"(",
"ConnectionSource",
"connectionSource",
",",
"Dao",
"<",
"?",
",",
"?",
">",
"dao",
")",
"{",
"if",
"(",
"connectionSource",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"... | Remove a DAO from the cache. This is necessary if we've registered it already but it throws an exception during
configuration. | [
"Remove",
"a",
"DAO",
"from",
"the",
"cache",
".",
"This",
"is",
"necessary",
"if",
"we",
"ve",
"registered",
"it",
"already",
"but",
"it",
"throws",
"an",
"exception",
"during",
"configuration",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/dao/DaoManager.java#L179-L184 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/PersistentPageFile.java | PersistentPageFile.readPage | @Override
public P readPage(int pageID) {
"""
Reads the page with the given id from this file.
@param pageID the id of the page to be returned
@return the page with the given pageId
"""
try {
countRead();
long offset = ((long) (header.getReservedPages() + pageID)) * (long) pageSize;
... | java | @Override
public P readPage(int pageID) {
try {
countRead();
long offset = ((long) (header.getReservedPages() + pageID)) * (long) pageSize;
byte[] buffer = new byte[pageSize];
file.seek(offset);
file.read(buffer);
return byteArrayToPage(buffer);
}
catch(IOException e) {... | [
"@",
"Override",
"public",
"P",
"readPage",
"(",
"int",
"pageID",
")",
"{",
"try",
"{",
"countRead",
"(",
")",
";",
"long",
"offset",
"=",
"(",
"(",
"long",
")",
"(",
"header",
".",
"getReservedPages",
"(",
")",
"+",
"pageID",
")",
")",
"*",
"(",
... | Reads the page with the given id from this file.
@param pageID the id of the page to be returned
@return the page with the given pageId | [
"Reads",
"the",
"page",
"with",
"the",
"given",
"id",
"from",
"this",
"file",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/PersistentPageFile.java#L112-L125 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/EventListenerListHelper.java | EventListenerListHelper.fire | public void fire(String methodName, Object arg) {
"""
Invokes the method with the given name and a single parameter on each of the listeners
registered with this list.
@param methodName the name of the method to invoke.
@param arg the single argument to pass to each invocation.
@throws IllegalArgumentExcep... | java | public void fire(String methodName, Object arg) {
if (listeners != EMPTY_OBJECT_ARRAY) {
fireEventByReflection(methodName, new Object[] { arg });
}
} | [
"public",
"void",
"fire",
"(",
"String",
"methodName",
",",
"Object",
"arg",
")",
"{",
"if",
"(",
"listeners",
"!=",
"EMPTY_OBJECT_ARRAY",
")",
"{",
"fireEventByReflection",
"(",
"methodName",
",",
"new",
"Object",
"[",
"]",
"{",
"arg",
"}",
")",
";",
"}... | Invokes the method with the given name and a single parameter on each of the listeners
registered with this list.
@param methodName the name of the method to invoke.
@param arg the single argument to pass to each invocation.
@throws IllegalArgumentException if no method with the given name and a single formal
paramet... | [
"Invokes",
"the",
"method",
"with",
"the",
"given",
"name",
"and",
"a",
"single",
"parameter",
"on",
"each",
"of",
"the",
"listeners",
"registered",
"with",
"this",
"list",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/EventListenerListHelper.java#L233-L237 |
mguymon/naether | src/main/java/com/tobedevoured/naether/maven/Project.java | Project.toXml | public String toXml() throws ProjectException {
"""
Convert Project to POM XML
@return String
@throws ProjectException exception
"""
log.debug("Writing xml");
Project copy = this;
copy.removeProperty( "project.basedir" );
StringWriter writer = new StringWriter();
... | java | public String toXml() throws ProjectException {
log.debug("Writing xml");
Project copy = this;
copy.removeProperty( "project.basedir" );
StringWriter writer = new StringWriter();
MavenXpp3Writer pomWriter = new MavenXpp3Writer();
try {
pomWriter.write(write... | [
"public",
"String",
"toXml",
"(",
")",
"throws",
"ProjectException",
"{",
"log",
".",
"debug",
"(",
"\"Writing xml\"",
")",
";",
"Project",
"copy",
"=",
"this",
";",
"copy",
".",
"removeProperty",
"(",
"\"project.basedir\"",
")",
";",
"StringWriter",
"writer",... | Convert Project to POM XML
@return String
@throws ProjectException exception | [
"Convert",
"Project",
"to",
"POM",
"XML"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/maven/Project.java#L543-L560 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java | MarshallUtil.marshallMap | public static <K, V, T extends Map<K, V>> void marshallMap(T map, ElementWriter<K> keyWriter, ElementWriter<V> valueWrite, ObjectOutput out) throws IOException {
"""
Marshall the {@code map} to the {@code ObjectOutput}.
<p>
{@code null} maps are supported.
@param map {@link Map} to marshall.
@param out {@lin... | java | public static <K, V, T extends Map<K, V>> void marshallMap(T map, ElementWriter<K> keyWriter, ElementWriter<V> valueWrite, ObjectOutput out) throws IOException {
final int mapSize = map == null ? NULL_VALUE : map.size();
marshallSize(out, mapSize);
if (mapSize <= 0) return;
for (Map.Entry<K, V>... | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"T",
"extends",
"Map",
"<",
"K",
",",
"V",
">",
">",
"void",
"marshallMap",
"(",
"T",
"map",
",",
"ElementWriter",
"<",
"K",
">",
"keyWriter",
",",
"ElementWriter",
"<",
"V",
">",
"valueWrite",
",",
"Obj... | Marshall the {@code map} to the {@code ObjectOutput}.
<p>
{@code null} maps are supported.
@param map {@link Map} to marshall.
@param out {@link ObjectOutput} to write. It must be non-null.
@param <K> Key type of the map.
@param <V> Value type of the map.
@param <T> Type of the {@link Map}.
@throws IOException If any ... | [
"Marshall",
"the",
"{",
"@code",
"map",
"}",
"to",
"the",
"{",
"@code",
"ObjectOutput",
"}",
".",
"<p",
">",
"{",
"@code",
"null",
"}",
"maps",
"are",
"supported",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L102-L111 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/impl/InvariantChecker.java | InvariantChecker.checkInvariant | public void checkInvariant(INode node) throws InconsistentNodeModelException {
"""
Assert the invariant of completely build node model.
Checks that every pointer is correct, e.g.
<ul>
<li>a parent points to its first child,</li>
<li>siblings point to the very same parent,</li>
<li>the offset and length data i... | java | public void checkInvariant(INode node) throws InconsistentNodeModelException {
try {
doCheckInvariant(node.getRootNode());
} catch(ClassCastException e) {
throw new InconsistentNodeModelException("node has no root node", e);
} catch(NullPointerException e) {
throw new InconsistentNodeModelException("node... | [
"public",
"void",
"checkInvariant",
"(",
"INode",
"node",
")",
"throws",
"InconsistentNodeModelException",
"{",
"try",
"{",
"doCheckInvariant",
"(",
"node",
".",
"getRootNode",
"(",
")",
")",
";",
"}",
"catch",
"(",
"ClassCastException",
"e",
")",
"{",
"throw"... | Assert the invariant of completely build node model.
Checks that every pointer is correct, e.g.
<ul>
<li>a parent points to its first child,</li>
<li>siblings point to the very same parent,</li>
<li>the offset and length data is in sync, and</li>
<li>no null fields are present (besides some empty first child pointers).... | [
"Assert",
"the",
"invariant",
"of",
"completely",
"build",
"node",
"model",
".",
"Checks",
"that",
"every",
"pointer",
"is",
"correct",
"e",
".",
"g",
".",
"<ul",
">",
"<li",
">",
"a",
"parent",
"points",
"to",
"its",
"first",
"child",
"<",
"/",
"li",
... | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/impl/InvariantChecker.java#L53-L61 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/FeaturableModel.java | FeaturableModel.setField | private void setField(Field field, Object object, Class<?> type) {
"""
Set the field service only if currently <code>null</code>.
@param field The field to set.
@param object The object to update.
@param type The service type.
@throws LionEngineException If error on setting service.
"""
try
... | java | private void setField(Field field, Object object, Class<?> type)
{
try
{
if (field.get(object) == null)
{
final Class<? extends Feature> clazz;
// CHECKSTYLE IGNORE LINE: InnerAssignment
if (Feature.class.isAssignableFro... | [
"private",
"void",
"setField",
"(",
"Field",
"field",
",",
"Object",
"object",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"try",
"{",
"if",
"(",
"field",
".",
"get",
"(",
"object",
")",
"==",
"null",
")",
"{",
"final",
"Class",
"<",
"?",
"ext... | Set the field service only if currently <code>null</code>.
@param field The field to set.
@param object The object to update.
@param type The service type.
@throws LionEngineException If error on setting service. | [
"Set",
"the",
"field",
"service",
"only",
"if",
"currently",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/FeaturableModel.java#L127-L154 |
hortonworks/dstream | dstream-api/src/main/java/io/dstream/DStreamExecutionGraphBuilder.java | DStreamExecutionGraphBuilder.doBuild | @SuppressWarnings("rawtypes")
private DStreamExecutionGraph doBuild(boolean isDependent) {
"""
The 'dependentStream' attribute implies that the DStreamOperations the methid is about to build
is a dependency of another DStreamOperations (e.g., for cases such as Join, union etc.)
Basically, each process should ha... | java | @SuppressWarnings("rawtypes")
private DStreamExecutionGraph doBuild(boolean isDependent){
this.invocationPipeline.getInvocations().forEach(this::addInvocation);
if (this.requiresInitialSetOfOperations()){
this.createDefaultExtractOperation();
}
if (this.requiresPostShuffleOperation(isDependent)){
Ser... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"private",
"DStreamExecutionGraph",
"doBuild",
"(",
"boolean",
"isDependent",
")",
"{",
"this",
".",
"invocationPipeline",
".",
"getInvocations",
"(",
")",
".",
"forEach",
"(",
"this",
"::",
"addInvocation",
")",
... | The 'dependentStream' attribute implies that the DStreamOperations the methid is about to build
is a dependency of another DStreamOperations (e.g., for cases such as Join, union etc.)
Basically, each process should have at least two operations - 'read -> write' with shuffle in between.
For cases where we are building a... | [
"The",
"dependentStream",
"attribute",
"implies",
"that",
"the",
"DStreamOperations",
"the",
"methid",
"is",
"about",
"to",
"build",
"is",
"a",
"dependency",
"of",
"another",
"DStreamOperations",
"(",
"e",
".",
"g",
".",
"for",
"cases",
"such",
"as",
"Join",
... | train | https://github.com/hortonworks/dstream/blob/3a106c0f14725b028fe7fe2dbc660406d9a5f142/dstream-api/src/main/java/io/dstream/DStreamExecutionGraphBuilder.java#L89-L117 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiClient.java | JsiiClient.setStaticPropertyValue | public void setStaticPropertyValue(final String fqn, final String property, final JsonNode value) {
"""
Sets the value of a mutable static property.
@param fqn The FQN of the class
@param property The property name
@param value The new value
"""
ObjectNode req = makeRequest("sset");
req.put(... | java | public void setStaticPropertyValue(final String fqn, final String property, final JsonNode value) {
ObjectNode req = makeRequest("sset");
req.put("fqn", fqn);
req.put("property", property);
req.set("value", value);
this.runtime.requestResponse(req);
} | [
"public",
"void",
"setStaticPropertyValue",
"(",
"final",
"String",
"fqn",
",",
"final",
"String",
"property",
",",
"final",
"JsonNode",
"value",
")",
"{",
"ObjectNode",
"req",
"=",
"makeRequest",
"(",
"\"sset\"",
")",
";",
"req",
".",
"put",
"(",
"\"fqn\"",... | Sets the value of a mutable static property.
@param fqn The FQN of the class
@param property The property name
@param value The new value | [
"Sets",
"the",
"value",
"of",
"a",
"mutable",
"static",
"property",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiClient.java#L149-L155 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/ObjectUtils.java | ObjectUtils.isCompatibleWithThrowsClause | public static boolean isCompatibleWithThrowsClause(Throwable ex, Class<?>... declaredExceptions) {
"""
Check whether the given exception is compatible with the specified
exception types, as declared in a throws clause.
@param ex the exception to check
@param declaredExceptions the exception ty... | java | public static boolean isCompatibleWithThrowsClause(Throwable ex, Class<?>... declaredExceptions) {
if (!isCheckedException(ex)) {
return true;
}
if (declaredExceptions != null) {
for (Class<?> declaredException : declaredExceptions) {
if (declaredException... | [
"public",
"static",
"boolean",
"isCompatibleWithThrowsClause",
"(",
"Throwable",
"ex",
",",
"Class",
"<",
"?",
">",
"...",
"declaredExceptions",
")",
"{",
"if",
"(",
"!",
"isCheckedException",
"(",
"ex",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"("... | Check whether the given exception is compatible with the specified
exception types, as declared in a throws clause.
@param ex the exception to check
@param declaredExceptions the exception types declared in the throws clause
@return whether the given exception is compatible | [
"Check",
"whether",
"the",
"given",
"exception",
"is",
"compatible",
"with",
"the",
"specified",
"exception",
"types",
"as",
"declared",
"in",
"a",
"throws",
"clause",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/ObjectUtils.java#L48-L60 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/BoardsApi.java | BoardsApi.getBoard | public Board getBoard(Object projectIdOrPath, Integer boardId) throws GitLabApiException {
"""
Get a single issue board.
<pre><code>GitLab Endpoint: GET /projects/:id/boards/:board_id</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param boar... | java | public Board getBoard(Object projectIdOrPath, Integer boardId) throws GitLabApiException {
Response response = get(Response.Status.OK, null,
"projects", getProjectIdOrPath(projectIdOrPath), "boards", boardId);
return (response.readEntity(Board.class));
} | [
"public",
"Board",
"getBoard",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"boardId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
"getProj... | Get a single issue board.
<pre><code>GitLab Endpoint: GET /projects/:id/boards/:board_id</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param boardId the ID of the board
@return a Board instance for the specified board ID
@throws GitLabApiException if... | [
"Get",
"a",
"single",
"issue",
"board",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/BoardsApi.java#L95-L99 |
weld/core | impl/src/main/java/org/jboss/weld/resolution/AbstractAssignabilityRules.java | AbstractAssignabilityRules.boundsMatch | protected boolean boundsMatch(Type[] upperBounds, Type[] stricterUpperBounds) {
"""
Returns <tt>true</tt> iff for each upper bound T, there is at least one bound from <tt>stricterUpperBounds</tt>
assignable to T. This reflects that <tt>stricterUpperBounds</tt> are at least as strict as <tt>upperBounds</tt> are.
... | java | protected boolean boundsMatch(Type[] upperBounds, Type[] stricterUpperBounds) {
// getUppermostBounds to make sure that both arrays of bounds contain ONLY ACTUAL TYPES! otherwise, the CovariantTypes
// assignability rules do not reflect our needs
upperBounds = getUppermostBounds(upperBounds);
... | [
"protected",
"boolean",
"boundsMatch",
"(",
"Type",
"[",
"]",
"upperBounds",
",",
"Type",
"[",
"]",
"stricterUpperBounds",
")",
"{",
"// getUppermostBounds to make sure that both arrays of bounds contain ONLY ACTUAL TYPES! otherwise, the CovariantTypes",
"// assignability rules do no... | Returns <tt>true</tt> iff for each upper bound T, there is at least one bound from <tt>stricterUpperBounds</tt>
assignable to T. This reflects that <tt>stricterUpperBounds</tt> are at least as strict as <tt>upperBounds</tt> are.
<p>
Arguments passed to this method must be legal java bounds, i.e. bounds returned by {@li... | [
"Returns",
"<tt",
">",
"true<",
"/",
"tt",
">",
"iff",
"for",
"each",
"upper",
"bound",
"T",
"there",
"is",
"at",
"least",
"one",
"bound",
"from",
"<tt",
">",
"stricterUpperBounds<",
"/",
"tt",
">",
"assignable",
"to",
"T",
".",
"This",
"reflects",
"th... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/AbstractAssignabilityRules.java#L79-L90 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.mapKeys | public static Map mapKeys(Mapper mapper, Map map, boolean allowNull) {
"""
Create a new Map by mapping all keys from the original map and maintaining the original value.
@param mapper a Mapper to map the keys
@param map a Map
@param allowNull allow null values
@return a new Map with keys mapped
""... | java | public static Map mapKeys(Mapper mapper, Map map, boolean allowNull) {
HashMap h = new HashMap();
for (Object e : map.entrySet()) {
Map.Entry entry = (Map.Entry) e;
Object o = mapper.map(entry.getKey());
if (allowNull || o != null) {
h.put(o, entry.get... | [
"public",
"static",
"Map",
"mapKeys",
"(",
"Mapper",
"mapper",
",",
"Map",
"map",
",",
"boolean",
"allowNull",
")",
"{",
"HashMap",
"h",
"=",
"new",
"HashMap",
"(",
")",
";",
"for",
"(",
"Object",
"e",
":",
"map",
".",
"entrySet",
"(",
")",
")",
"{... | Create a new Map by mapping all keys from the original map and maintaining the original value.
@param mapper a Mapper to map the keys
@param map a Map
@param allowNull allow null values
@return a new Map with keys mapped | [
"Create",
"a",
"new",
"Map",
"by",
"mapping",
"all",
"keys",
"from",
"the",
"original",
"map",
"and",
"maintaining",
"the",
"original",
"value",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L390-L400 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/BitemporalMapper.java | BitemporalMapper.readBitemporalDate | BitemporalDateTime readBitemporalDate(Columns columns, String field) {
"""
Returns a {@link BitemporalDateTime} read from the specified {@link Columns}.
@param columns the column where the data is
@param field the name of the field to be read from {@code columns}
@return a bitemporal date time
"""
... | java | BitemporalDateTime readBitemporalDate(Columns columns, String field) {
return parseBitemporalDate(columns.valueForField(field));
} | [
"BitemporalDateTime",
"readBitemporalDate",
"(",
"Columns",
"columns",
",",
"String",
"field",
")",
"{",
"return",
"parseBitemporalDate",
"(",
"columns",
".",
"valueForField",
"(",
"field",
")",
")",
";",
"}"
] | Returns a {@link BitemporalDateTime} read from the specified {@link Columns}.
@param columns the column where the data is
@param field the name of the field to be read from {@code columns}
@return a bitemporal date time | [
"Returns",
"a",
"{",
"@link",
"BitemporalDateTime",
"}",
"read",
"from",
"the",
"specified",
"{",
"@link",
"Columns",
"}",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/BitemporalMapper.java#L173-L175 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/JaspiServiceImpl.java | JaspiServiceImpl.setRequestAuthType | protected void setRequestAuthType(MessageInfo msgInfo, JaspiRequest jaspiRequest) {
"""
/*
The runtime must also ensure that the value returned by calling
getAuthType on the HttpServletRequest is consistent in terms of being null
or non-null with the value returned by getUserPrincipal. When getAuthType
is to r... | java | protected void setRequestAuthType(MessageInfo msgInfo, JaspiRequest jaspiRequest) {
String authType = null;
if (msgInfo.getMap().containsKey(AUTH_TYPE)) {
authType = (String) msgInfo.getMap().get(AUTH_TYPE);
} else {
authType = getDDAuthMethod(jaspiRequest);
i... | [
"protected",
"void",
"setRequestAuthType",
"(",
"MessageInfo",
"msgInfo",
",",
"JaspiRequest",
"jaspiRequest",
")",
"{",
"String",
"authType",
"=",
"null",
";",
"if",
"(",
"msgInfo",
".",
"getMap",
"(",
")",
".",
"containsKey",
"(",
"AUTH_TYPE",
")",
")",
"{... | /*
The runtime must also ensure that the value returned by calling
getAuthType on the HttpServletRequest is consistent in terms of being null
or non-null with the value returned by getUserPrincipal. When getAuthType
is to return a non-null value, the runtime must consult the Map of
the MessageInfo object used in the ca... | [
"/",
"*",
"The",
"runtime",
"must",
"also",
"ensure",
"that",
"the",
"value",
"returned",
"by",
"calling",
"getAuthType",
"on",
"the",
"HttpServletRequest",
"is",
"consistent",
"in",
"terms",
"of",
"being",
"null",
"or",
"non",
"-",
"null",
"with",
"the",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/JaspiServiceImpl.java#L635-L647 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.trackCustomCascadingSaves | protected void trackCustomCascadingSaves(Mapping mapping, Iterable<PersistentProperty> persistentProperties) {
"""
Checks for any custom cascading saves set up via the mapping DSL and records them within the persistent property.
@param mapping The Mapping.
@param persistentProperties The persistent properties of... | java | protected void trackCustomCascadingSaves(Mapping mapping, Iterable<PersistentProperty> persistentProperties) {
for (PersistentProperty property : persistentProperties) {
PropertyConfig propConf = mapping.getPropertyConfig(property.getName());
if (propConf != null && propConf.getCascade(... | [
"protected",
"void",
"trackCustomCascadingSaves",
"(",
"Mapping",
"mapping",
",",
"Iterable",
"<",
"PersistentProperty",
">",
"persistentProperties",
")",
"{",
"for",
"(",
"PersistentProperty",
"property",
":",
"persistentProperties",
")",
"{",
"PropertyConfig",
"propCo... | Checks for any custom cascading saves set up via the mapping DSL and records them within the persistent property.
@param mapping The Mapping.
@param persistentProperties The persistent properties of the domain class. | [
"Checks",
"for",
"any",
"custom",
"cascading",
"saves",
"set",
"up",
"via",
"the",
"mapping",
"DSL",
"and",
"records",
"them",
"within",
"the",
"persistent",
"property",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L1276-L1284 |
Swrve/rate-limited-logger | src/main/java/com/swrve/ratelimitedlogger/RateLimitedLog.java | RateLimitedLog.get | public RateLimitedLogWithPattern get(final String message) {
"""
@return a RateLimitedLogWithPattern object for the supplied @param message. This can be cached and
reused by callers in performance-sensitive cases to avoid performing a ConcurrentHashMap lookup.
Note that the string is the sole key used, so the... | java | public RateLimitedLogWithPattern get(final String message) {
// fast path: hopefully we can do this without creating a Supplier object
RateLimitedLogWithPattern got = knownPatterns.get(message);
if (got != null) {
return got;
}
// before we create another one, check ... | [
"public",
"RateLimitedLogWithPattern",
"get",
"(",
"final",
"String",
"message",
")",
"{",
"// fast path: hopefully we can do this without creating a Supplier object",
"RateLimitedLogWithPattern",
"got",
"=",
"knownPatterns",
".",
"get",
"(",
"message",
")",
";",
"if",
"(",... | @return a RateLimitedLogWithPattern object for the supplied @param message. This can be cached and
reused by callers in performance-sensitive cases to avoid performing a ConcurrentHashMap lookup.
Note that the string is the sole key used, so the same string cannot be reused with differing period
settings; any periods... | [
"@return",
"a",
"RateLimitedLogWithPattern",
"object",
"for",
"the",
"supplied",
"@param",
"message",
".",
"This",
"can",
"be",
"cached",
"and",
"reused",
"by",
"callers",
"in",
"performance",
"-",
"sensitive",
"cases",
"to",
"avoid",
"performing",
"a",
"Concurr... | train | https://github.com/Swrve/rate-limited-logger/blob/9094d3961f35dad0d6114aafade4a34b0b264b0b/src/main/java/com/swrve/ratelimitedlogger/RateLimitedLog.java#L399-L419 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java | Configurations.getBoolean | public static boolean getBoolean(String name, boolean defaultVal) {
"""
Get the property object as Boolean, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as boolean, return defaultVal if property is undefined.
... | java | public static boolean getBoolean(String name, boolean defaultVal){
if(getConfiguration().containsKey(name)){
return getConfiguration().getBoolean(name);
} else {
return defaultVal;
}
} | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"String",
"name",
",",
"boolean",
"defaultVal",
")",
"{",
"if",
"(",
"getConfiguration",
"(",
")",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"getConfiguration",
"(",
")",
".",
"getBoolean",
... | Get the property object as Boolean, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as boolean, return defaultVal if property is undefined. | [
"Get",
"the",
"property",
"object",
"as",
"Boolean",
"or",
"return",
"defaultVal",
"if",
"property",
"is",
"not",
"defined",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java#L140-L146 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java | BootstrapConfig.getWorkareaFile | public File getWorkareaFile(String relativeServerWorkareaPath) {
"""
Allocate a file in the server directory, e.g.
usr/servers/serverName/workarea/relativeServerWorkareaPath
@param relativeServerWorkareaPath
relative path of file to create in the server's workarea
@return File object for relative path, or fo... | java | public File getWorkareaFile(String relativeServerWorkareaPath) {
if (relativeServerWorkareaPath == null)
return workarea;
else
return new File(workarea, relativeServerWorkareaPath);
} | [
"public",
"File",
"getWorkareaFile",
"(",
"String",
"relativeServerWorkareaPath",
")",
"{",
"if",
"(",
"relativeServerWorkareaPath",
"==",
"null",
")",
"return",
"workarea",
";",
"else",
"return",
"new",
"File",
"(",
"workarea",
",",
"relativeServerWorkareaPath",
")... | Allocate a file in the server directory, e.g.
usr/servers/serverName/workarea/relativeServerWorkareaPath
@param relativeServerWorkareaPath
relative path of file to create in the server's workarea
@return File object for relative path, or for the server workarea itself if
the relative path argument is null | [
"Allocate",
"a",
"file",
"in",
"the",
"server",
"directory",
"e",
".",
"g",
".",
"usr",
"/",
"servers",
"/",
"serverName",
"/",
"workarea",
"/",
"relativeServerWorkareaPath"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java#L644-L649 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/AABBUtils.java | AABBUtils.writeToNBT | public static void writeToNBT(NBTTagCompound tag, AxisAlignedBB aabb, String prefix) {
"""
Writes a {@link AxisAlignedBB} to a {@link NBTTagCompound} with the specified prefix.
@param tag the tag
@param aabb the aabb
@param prefix the prefix
"""
if (tag == null || aabb == null)
return;
prefix = pr... | java | public static void writeToNBT(NBTTagCompound tag, AxisAlignedBB aabb, String prefix)
{
if (tag == null || aabb == null)
return;
prefix = prefix == null ? "" : prefix + ".";
tag.setDouble(prefix + "minX", aabb.minX);
tag.setDouble(prefix + "minY", aabb.minY);
tag.setDouble(prefix + "minZ", aabb.minZ);
t... | [
"public",
"static",
"void",
"writeToNBT",
"(",
"NBTTagCompound",
"tag",
",",
"AxisAlignedBB",
"aabb",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"tag",
"==",
"null",
"||",
"aabb",
"==",
"null",
")",
"return",
";",
"prefix",
"=",
"prefix",
"==",
"null"... | Writes a {@link AxisAlignedBB} to a {@link NBTTagCompound} with the specified prefix.
@param tag the tag
@param aabb the aabb
@param prefix the prefix | [
"Writes",
"a",
"{",
"@link",
"AxisAlignedBB",
"}",
"to",
"a",
"{",
"@link",
"NBTTagCompound",
"}",
"with",
"the",
"specified",
"prefix",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/AABBUtils.java#L266-L278 |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/definition/DefaultJobDefinition.java | DefaultJobDefinition.cronJobDefinition | public static JobDefinition cronJobDefinition(final String jobType,
final String jobName,
final String description,
final String cron,
... | java | public static JobDefinition cronJobDefinition(final String jobType,
final String jobName,
final String description,
final String cron,
... | [
"public",
"static",
"JobDefinition",
"cronJobDefinition",
"(",
"final",
"String",
"jobType",
",",
"final",
"String",
"jobName",
",",
"final",
"String",
"description",
",",
"final",
"String",
"cron",
",",
"final",
"int",
"restarts",
",",
"final",
"Optional",
"<",... | Create a JobDefinition that is using a cron expression to specify, when and how often the job should be triggered.
@param jobType The type of the Job
@param jobName A human readable name of the Job
@param description A human readable description of the Job.
@param cron The cron expression. Must conform ... | [
"Create",
"a",
"JobDefinition",
"that",
"is",
"using",
"a",
"cron",
"expression",
"to",
"specify",
"when",
"and",
"how",
"often",
"the",
"job",
"should",
"be",
"triggered",
"."
] | train | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/definition/DefaultJobDefinition.java#L59-L66 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/CommonFunction.java | CommonFunction.getNLSMessage | public static final String getNLSMessage(String key, Object... args) {
"""
Retrieve a translated message from the J2C messages file.
If the message cannot be found, the key is returned.
@param key a valid message key from the J2C messages file.
@param args a list of parameters to include in the translatable m... | java | public static final String getNLSMessage(String key, Object... args) {
return NLS.getFormattedMessage(key, args, key);
} | [
"public",
"static",
"final",
"String",
"getNLSMessage",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"NLS",
".",
"getFormattedMessage",
"(",
"key",
",",
"args",
",",
"key",
")",
";",
"}"
] | Retrieve a translated message from the J2C messages file.
If the message cannot be found, the key is returned.
@param key a valid message key from the J2C messages file.
@param args a list of parameters to include in the translatable message.
@return a translated message. | [
"Retrieve",
"a",
"translated",
"message",
"from",
"the",
"J2C",
"messages",
"file",
".",
"If",
"the",
"message",
"cannot",
"be",
"found",
"the",
"key",
"is",
"returned",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/CommonFunction.java#L131-L133 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java | ConnectLinesGrid.connectTry | private boolean connectTry( LineSegment2D_F32 target , int x , int y ) {
"""
See if there is a line that matches in this adjacent region.
@param target Line being connected.
@param x x-coordinate of adjacent region.
@param y y-coordinate of adjacent region.
@return true if a connection was made.
"""
if... | java | private boolean connectTry( LineSegment2D_F32 target , int x , int y ) {
if( !grid.isInBounds(x,y) )
return false;
List<LineSegment2D_F32> lines = grid.get(x,y);
int index = findBestCompatible(target,lines,0);
if( index == -1 )
return false;
LineSegment2D_F32 b = lines.remove(index);
// join the ... | [
"private",
"boolean",
"connectTry",
"(",
"LineSegment2D_F32",
"target",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"!",
"grid",
".",
"isInBounds",
"(",
"x",
",",
"y",
")",
")",
"return",
"false",
";",
"List",
"<",
"LineSegment2D_F32",
">",
... | See if there is a line that matches in this adjacent region.
@param target Line being connected.
@param x x-coordinate of adjacent region.
@param y y-coordinate of adjacent region.
@return true if a connection was made. | [
"See",
"if",
"there",
"is",
"a",
"line",
"that",
"matches",
"in",
"this",
"adjacent",
"region",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java#L146-L171 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java | DocumentationUtils.createLinkToServiceDocumentation | public static String createLinkToServiceDocumentation(Metadata metadata, String name) {
"""
Create the HTML for a link to the operation/shape core AWS docs site
@param metadata the UID for the service from that services metadata
@param name the name of the shape/request/operation
@return a '@see also' HTML... | java | public static String createLinkToServiceDocumentation(Metadata metadata, String name) {
if (isCrossLinkingEnabledForService(metadata)) {
return String.format("@see <a href=\"http://%s/goto/WebAPI/%s/%s\" target=\"_top\">AWS API Documentation</a>",
AWS_DOCS_HOST,
... | [
"public",
"static",
"String",
"createLinkToServiceDocumentation",
"(",
"Metadata",
"metadata",
",",
"String",
"name",
")",
"{",
"if",
"(",
"isCrossLinkingEnabledForService",
"(",
"metadata",
")",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"@see <a href=\\\"... | Create the HTML for a link to the operation/shape core AWS docs site
@param metadata the UID for the service from that services metadata
@param name the name of the shape/request/operation
@return a '@see also' HTML link to the doc | [
"Create",
"the",
"HTML",
"for",
"a",
"link",
"to",
"the",
"operation",
"/",
"shape",
"core",
"AWS",
"docs",
"site"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java#L130-L138 |
atomix/atomix | cluster/src/main/java/io/atomix/cluster/messaging/impl/NettyMessagingService.java | NettyMessagingService.bootstrapClient | private CompletableFuture<Channel> bootstrapClient(Address address) {
"""
Bootstraps a new channel to the given address.
@param address the address to which to connect
@return a future to be completed with the connected channel
"""
CompletableFuture<Channel> future = new OrderedFuture<>();
Bootstra... | java | private CompletableFuture<Channel> bootstrapClient(Address address) {
CompletableFuture<Channel> future = new OrderedFuture<>();
Bootstrap bootstrap = new Bootstrap();
bootstrap.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
bootstrap.option(ChannelOption.WRITE_BUFFER_WATER_MARK,
... | [
"private",
"CompletableFuture",
"<",
"Channel",
">",
"bootstrapClient",
"(",
"Address",
"address",
")",
"{",
"CompletableFuture",
"<",
"Channel",
">",
"future",
"=",
"new",
"OrderedFuture",
"<>",
"(",
")",
";",
"Bootstrap",
"bootstrap",
"=",
"new",
"Bootstrap",
... | Bootstraps a new channel to the given address.
@param address the address to which to connect
@return a future to be completed with the connected channel | [
"Bootstraps",
"a",
"new",
"channel",
"to",
"the",
"given",
"address",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/cluster/src/main/java/io/atomix/cluster/messaging/impl/NettyMessagingService.java#L471-L502 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java | AnalyticsItemsInner.putAsync | public Observable<ApplicationInsightsComponentAnalyticsItemInner> putAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, Boolean overrideItem) {
"""
Adds or Updates a specific Analytics Item within an Application Insights comp... | java | public Observable<ApplicationInsightsComponentAnalyticsItemInner> putAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ApplicationInsightsComponentAnalyticsItemInner itemProperties, Boolean overrideItem) {
return putWithServiceResponseAsync(resourceGroupName, resourceName, scopePath,... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentAnalyticsItemInner",
">",
"putAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ItemScopePath",
"scopePath",
",",
"ApplicationInsightsComponentAnalyticsItemInner",
"itemProperties",
",",
"B... | Adds or Updates a specific Analytics Item within an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param scopePath Enum indicating if this item definition is owned by a specific user or is shared bet... | [
"Adds",
"or",
"Updates",
"a",
"specific",
"Analytics",
"Item",
"within",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java#L602-L609 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/JsonUtil.java | JsonUtil.parseJsonProperty | public static JsonProperty parseJsonProperty(JsonReader reader, String name)
throws RepositoryException, IOException {
"""
Parses a single property of the first element of an array and returns the result as a JSON POJO object.
@param reader the reader with the JSON stream
@param name the already ... | java | public static JsonProperty parseJsonProperty(JsonReader reader, String name)
throws RepositoryException, IOException {
JsonToken token = reader.peek();
JsonProperty property = new JsonProperty();
property.name = name;
switch (token) {
case BOOLEAN:
... | [
"public",
"static",
"JsonProperty",
"parseJsonProperty",
"(",
"JsonReader",
"reader",
",",
"String",
"name",
")",
"throws",
"RepositoryException",
",",
"IOException",
"{",
"JsonToken",
"token",
"=",
"reader",
".",
"peek",
"(",
")",
";",
"JsonProperty",
"property",... | Parses a single property of the first element of an array and returns the result as a JSON POJO object.
@param reader the reader with the JSON stream
@param name the already parsed name of the property
@return a new JsonProperty object with the name, type, and value set
@throws RepositoryException
@throws IOExceptio... | [
"Parses",
"a",
"single",
"property",
"of",
"the",
"first",
"element",
"of",
"an",
"array",
"and",
"returns",
"the",
"result",
"as",
"a",
"JSON",
"POJO",
"object",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/JsonUtil.java#L565-L590 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java | MountTable.delete | public boolean delete(Supplier<JournalContext> journalContext, AlluxioURI uri) {
"""
Unmounts the given Alluxio path. The path should match an existing mount point.
@param journalContext journal context
@param uri an Alluxio path URI
@return whether the operation succeeded or not
"""
String path = uri... | java | public boolean delete(Supplier<JournalContext> journalContext, AlluxioURI uri) {
String path = uri.getPath();
LOG.info("Unmounting {}", path);
if (path.equals(ROOT)) {
LOG.warn("Cannot unmount the root mount point.");
return false;
}
try (LockResource r = new LockResource(mWriteLock)) {... | [
"public",
"boolean",
"delete",
"(",
"Supplier",
"<",
"JournalContext",
">",
"journalContext",
",",
"AlluxioURI",
"uri",
")",
"{",
"String",
"path",
"=",
"uri",
".",
"getPath",
"(",
")",
";",
"LOG",
".",
"info",
"(",
"\"Unmounting {}\"",
",",
"path",
")",
... | Unmounts the given Alluxio path. The path should match an existing mount point.
@param journalContext journal context
@param uri an Alluxio path URI
@return whether the operation succeeded or not | [
"Unmounts",
"the",
"given",
"Alluxio",
"path",
".",
"The",
"path",
"should",
"match",
"an",
"existing",
"mount",
"point",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MountTable.java#L157-L187 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/storable/GeneralStructure.java | GeneralStructure.addKeyPart | public boolean addKeyPart(String name, int size) throws IOException {
"""
Adds a new KeyPart
@param name
the name of the key part. With this name you can access this part
@param size
the size of the key part in bytes
@return true if adding the key part was successful
@throws IOException
"""
if ... | java | public boolean addKeyPart(String name, int size) throws IOException {
if (INSTANCE_EXISITS) {
throw new IOException("A GeneralStroable was already instantiated. You cant further add Key Parts");
}
int hash = Arrays.hashCode(name.getBytes());
int index = keyPartNames.size();
... | [
"public",
"boolean",
"addKeyPart",
"(",
"String",
"name",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"if",
"(",
"INSTANCE_EXISITS",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"A GeneralStroable was already instantiated. You cant further add Key Parts\"",
... | Adds a new KeyPart
@param name
the name of the key part. With this name you can access this part
@param size
the size of the key part in bytes
@return true if adding the key part was successful
@throws IOException | [
"Adds",
"a",
"new",
"KeyPart"
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/storable/GeneralStructure.java#L125-L142 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.lastIndexOf | public static int lastIndexOf(String str, char searchChar, int startPos) {
"""
<p>Finds the last index within a String from a start position,
handling <code>null</code>.
This method uses {@link String#lastIndexOf(int, int)}.</p>
<p>A <code>null</code> or empty ("") String will return <code>-1</code>.
A negat... | java | public static int lastIndexOf(String str, char searchChar, int startPos) {
if (isEmpty(str)) {
return -1;
}
return str.lastIndexOf(searchChar, startPos);
} | [
"public",
"static",
"int",
"lastIndexOf",
"(",
"String",
"str",
",",
"char",
"searchChar",
",",
"int",
"startPos",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"return",
"str",
".",
"lastIndexOf",
"(",
"sea... | <p>Finds the last index within a String from a start position,
handling <code>null</code>.
This method uses {@link String#lastIndexOf(int, int)}.</p>
<p>A <code>null</code> or empty ("") String will return <code>-1</code>.
A negative start position returns <code>-1</code>.
A start position greater than the string leng... | [
"<p",
">",
"Finds",
"the",
"last",
"index",
"within",
"a",
"String",
"from",
"a",
"start",
"position",
"handling",
"<code",
">",
"null<",
"/",
"code",
">",
".",
"This",
"method",
"uses",
"{",
"@link",
"String#lastIndexOf",
"(",
"int",
"int",
")",
"}",
... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L886-L891 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/HFClient.java | HFClient.newOrderer | public Orderer newOrderer(String name, String grpcURL) throws InvalidArgumentException {
"""
Create a new urlOrderer.
@param name name of the orderer.
@param grpcURL url location of orderer grpc or grpcs protocol.
@return a new Orderer.
@throws InvalidArgumentException
"""
clientCheck();
... | java | public Orderer newOrderer(String name, String grpcURL) throws InvalidArgumentException {
clientCheck();
return newOrderer(name, grpcURL, null);
} | [
"public",
"Orderer",
"newOrderer",
"(",
"String",
"name",
",",
"String",
"grpcURL",
")",
"throws",
"InvalidArgumentException",
"{",
"clientCheck",
"(",
")",
";",
"return",
"newOrderer",
"(",
"name",
",",
"grpcURL",
",",
"null",
")",
";",
"}"
] | Create a new urlOrderer.
@param name name of the orderer.
@param grpcURL url location of orderer grpc or grpcs protocol.
@return a new Orderer.
@throws InvalidArgumentException | [
"Create",
"a",
"new",
"urlOrderer",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/HFClient.java#L694-L697 |
sporniket/core | sporniket-core-ui/src/main/java/com/sporniket/libre/ui/swing/WindowLocation.java | WindowLocation.snapWindowTo | public static void snapWindowTo(Window win, int location) {
"""
Snap the Window Position to a special location.
@param win
The Window to move
@param location
A value among the allowed predefined positions
"""
Dimension _screen = Toolkit.getDefaultToolkit().getScreenSize();
Dimension _window = win.get... | java | public static void snapWindowTo(Window win, int location)
{
Dimension _screen = Toolkit.getDefaultToolkit().getScreenSize();
Dimension _window = win.getSize();
int _wx = 0;
int _wy = 0;
switch (location)
{
case TOP_LEFT:
break;
case TOP_CENTER:
_wx = (_screen.width - _window.width) / 2;
b... | [
"public",
"static",
"void",
"snapWindowTo",
"(",
"Window",
"win",
",",
"int",
"location",
")",
"{",
"Dimension",
"_screen",
"=",
"Toolkit",
".",
"getDefaultToolkit",
"(",
")",
".",
"getScreenSize",
"(",
")",
";",
"Dimension",
"_window",
"=",
"win",
".",
"g... | Snap the Window Position to a special location.
@param win
The Window to move
@param location
A value among the allowed predefined positions | [
"Snap",
"the",
"Window",
"Position",
"to",
"a",
"special",
"location",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ui/src/main/java/com/sporniket/libre/ui/swing/WindowLocation.java#L76-L116 |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/common/Utils.java | Utils.getOption | public static String getOption(Properties props, String key) throws IOException {
"""
Get a mandatory configuration option
@param props property set
@param key key
@return value of the configuration
@throws IOException if there was no match for the key
"""
String val = props.getProperty(key);
if ... | java | public static String getOption(Properties props, String key) throws IOException {
String val = props.getProperty(key);
if (val == null) {
throw new IOException("Undefined property: " + key);
}
return val;
} | [
"public",
"static",
"String",
"getOption",
"(",
"Properties",
"props",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"String",
"val",
"=",
"props",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"throw",
... | Get a mandatory configuration option
@param props property set
@param key key
@return value of the configuration
@throws IOException if there was no match for the key | [
"Get",
"a",
"mandatory",
"configuration",
"option"
] | train | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/common/Utils.java#L198-L204 |
primefaces/primefaces | src/main/java/org/primefaces/expression/SearchExpressionFacade.java | SearchExpressionFacade.resolveComponent | public static UIComponent resolveComponent(FacesContext context, UIComponent source, String expression) {
"""
Resolves a {@link UIComponent} for the given expression.
@param context The {@link FacesContext}.
@param source The source component. E.g. a button.
@param expression The search expression.
@return A... | java | public static UIComponent resolveComponent(FacesContext context, UIComponent source, String expression) {
return resolveComponent(context, source, expression, SearchExpressionHint.NONE);
} | [
"public",
"static",
"UIComponent",
"resolveComponent",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"source",
",",
"String",
"expression",
")",
"{",
"return",
"resolveComponent",
"(",
"context",
",",
"source",
",",
"expression",
",",
"SearchExpressionHint",
"... | Resolves a {@link UIComponent} for the given expression.
@param context The {@link FacesContext}.
@param source The source component. E.g. a button.
@param expression The search expression.
@return A resolved {@link UIComponent} or <code>null</code>. | [
"Resolves",
"a",
"{",
"@link",
"UIComponent",
"}",
"for",
"the",
"given",
"expression",
"."
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/expression/SearchExpressionFacade.java#L419-L422 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesInner.java | BackupShortTermRetentionPoliciesInner.getAsync | public Observable<BackupShortTermRetentionPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Gets a database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Reso... | java | public Observable<BackupShortTermRetentionPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<BackupShortTermRetentionPolicyInner>, BackupShortTermRetentionPolicyIn... | [
"public",
"Observable",
"<",
"BackupShortTermRetentionPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverNa... | Gets a database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@throws IllegalArgument... | [
"Gets",
"a",
"database",
"s",
"short",
"term",
"retention",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesInner.java#L131-L138 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.isAssignableTo | public static void isAssignableTo(Class<?> from, Class<?> to, RuntimeException cause) {
"""
Asserts that the {@link Class 'from' class type} is assignable to the {@link Class 'to' class type}.
The assertion holds if and only if the {@link Class 'from' class type} is the same as or a subclass
of the {@link Clas... | java | public static void isAssignableTo(Class<?> from, Class<?> to, RuntimeException cause) {
if (isNotAssignableTo(from, to)) {
throw cause;
}
} | [
"public",
"static",
"void",
"isAssignableTo",
"(",
"Class",
"<",
"?",
">",
"from",
",",
"Class",
"<",
"?",
">",
"to",
",",
"RuntimeException",
"cause",
")",
"{",
"if",
"(",
"isNotAssignableTo",
"(",
"from",
",",
"to",
")",
")",
"{",
"throw",
"cause",
... | Asserts that the {@link Class 'from' class type} is assignable to the {@link Class 'to' class type}.
The assertion holds if and only if the {@link Class 'from' class type} is the same as or a subclass
of the {@link Class 'to' class type}.
@param from {@link Class class type} being evaluated for assignment compatibili... | [
"Asserts",
"that",
"the",
"{",
"@link",
"Class",
"from",
"class",
"type",
"}",
"is",
"assignable",
"to",
"the",
"{",
"@link",
"Class",
"to",
"class",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L584-L588 |
performancecopilot/parfait | parfait-core/src/main/java/io/pcp/parfait/MonitorableRegistry.java | MonitorableRegistry.registerOrReuse | @SuppressWarnings("unchecked")
public synchronized <T> T registerOrReuse(Monitorable<T> monitorable) {
"""
Registers the monitorable if it does not already exist, but otherwise returns an already registered
Monitorable with the same name, Semantics and UNnit definition. This method is useful when objects
a... | java | @SuppressWarnings("unchecked")
public synchronized <T> T registerOrReuse(Monitorable<T> monitorable) {
String name = monitorable.getName();
if (monitorables.containsKey(name)) {
Monitorable<?> existingMonitorableWithSameName = monitorables.get(name);
if (monitorable.getS... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"synchronized",
"<",
"T",
">",
"T",
"registerOrReuse",
"(",
"Monitorable",
"<",
"T",
">",
"monitorable",
")",
"{",
"String",
"name",
"=",
"monitorable",
".",
"getName",
"(",
")",
";",
"if",
"(",... | Registers the monitorable if it does not already exist, but otherwise returns an already registered
Monitorable with the same name, Semantics and UNnit definition. This method is useful when objects
appear and disappear, and then return, and the lifecycle of the application requires an attempt to recreate
the Monitora... | [
"Registers",
"the",
"monitorable",
"if",
"it",
"does",
"not",
"already",
"exist",
"but",
"otherwise",
"returns",
"an",
"already",
"registered",
"Monitorable",
"with",
"the",
"same",
"name",
"Semantics",
"and",
"UNnit",
"definition",
".",
"This",
"method",
"is",
... | train | https://github.com/performancecopilot/parfait/blob/33ed3aaa96ee3e0ab4c45791a7bd3e5cd443e94b/parfait-core/src/main/java/io/pcp/parfait/MonitorableRegistry.java#L86-L101 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.createEmptyTable | public static void createEmptyTable(Connection connection, String tableReference) throws SQLException {
"""
A method to create an empty table (no columns)
@param connection Connection
@param tableReference Table name
@throws java.sql.SQLException
"""
try (Statement statement = connection.createState... | java | public static void createEmptyTable(Connection connection, String tableReference) throws SQLException {
try (Statement statement = connection.createStatement()) {
statement.execute("CREATE TABLE "+ tableReference+ " ()");
}
} | [
"public",
"static",
"void",
"createEmptyTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"statement",
"=",
"connection",
".",
"createStatement",
"(",
")",
")",
"{",
"statement",
... | A method to create an empty table (no columns)
@param connection Connection
@param tableReference Table name
@throws java.sql.SQLException | [
"A",
"method",
"to",
"create",
"an",
"empty",
"table",
"(",
"no",
"columns",
")"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L387-L391 |
opentelecoms-org/zrtp-java | src/zorg/ZRTP.java | ZRTP.setSdpHelloHash | public void setSdpHelloHash(String version, String helloHash) {
"""
Hash of the Hello message to be received. This hash is sent by the other
end as part of the SDP for further verification.
@param version
ZRTP version of the hash
@param helloHash
Hello hash received as part of SDP in SIP
"""
if (!vers... | java | public void setSdpHelloHash(String version, String helloHash) {
if (!version.startsWith(VERSION_PREFIX)) {
logWarning("Different version number: '" + version + "' Ours: '"
+ VERSION_PREFIX + "' (" + VERSION + ")");
}
sdpHelloHashReceived = helloHash;
} | [
"public",
"void",
"setSdpHelloHash",
"(",
"String",
"version",
",",
"String",
"helloHash",
")",
"{",
"if",
"(",
"!",
"version",
".",
"startsWith",
"(",
"VERSION_PREFIX",
")",
")",
"{",
"logWarning",
"(",
"\"Different version number: '\"",
"+",
"version",
"+",
... | Hash of the Hello message to be received. This hash is sent by the other
end as part of the SDP for further verification.
@param version
ZRTP version of the hash
@param helloHash
Hello hash received as part of SDP in SIP | [
"Hash",
"of",
"the",
"Hello",
"message",
"to",
"be",
"received",
".",
"This",
"hash",
"is",
"sent",
"by",
"the",
"other",
"end",
"as",
"part",
"of",
"the",
"SDP",
"for",
"further",
"verification",
"."
] | train | https://github.com/opentelecoms-org/zrtp-java/blob/10a0c77866c5d1b1504df161db9a447f5069ed54/src/zorg/ZRTP.java#L2554-L2560 |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/CmsContentTypeVisitor.java | CmsContentTypeVisitor.readDefaultValue | private String readDefaultValue(I_CmsXmlSchemaType schemaType, String path) {
"""
Reads the default value for the given type.<p>
@param schemaType the schema type
@param path the element path
@return the default value
"""
return m_contentHandler.getDefault(getCmsObject(), m_file, schemaType, ... | java | private String readDefaultValue(I_CmsXmlSchemaType schemaType, String path) {
return m_contentHandler.getDefault(getCmsObject(), m_file, schemaType, path, m_locale);
} | [
"private",
"String",
"readDefaultValue",
"(",
"I_CmsXmlSchemaType",
"schemaType",
",",
"String",
"path",
")",
"{",
"return",
"m_contentHandler",
".",
"getDefault",
"(",
"getCmsObject",
"(",
")",
",",
"m_file",
",",
"schemaType",
",",
"path",
",",
"m_locale",
")"... | Reads the default value for the given type.<p>
@param schemaType the schema type
@param path the element path
@return the default value | [
"Reads",
"the",
"default",
"value",
"for",
"the",
"given",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/CmsContentTypeVisitor.java#L746-L749 |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java | COSAPIClient.pathToKey | private String pathToKey(Path path) {
"""
Turns a path (relative or otherwise) into an COS key
@param path object full path
"""
if (!path.isAbsolute()) {
path = new Path(workingDir, path);
}
if (path.toUri().getScheme() != null && path.toUri().getPath().isEmpty()) {
return "";
}... | java | private String pathToKey(Path path) {
if (!path.isAbsolute()) {
path = new Path(workingDir, path);
}
if (path.toUri().getScheme() != null && path.toUri().getPath().isEmpty()) {
return "";
}
return path.toUri().getPath().substring(1);
} | [
"private",
"String",
"pathToKey",
"(",
"Path",
"path",
")",
"{",
"if",
"(",
"!",
"path",
".",
"isAbsolute",
"(",
")",
")",
"{",
"path",
"=",
"new",
"Path",
"(",
"workingDir",
",",
"path",
")",
";",
"}",
"if",
"(",
"path",
".",
"toUri",
"(",
")",
... | Turns a path (relative or otherwise) into an COS key
@param path object full path | [
"Turns",
"a",
"path",
"(",
"relative",
"or",
"otherwise",
")",
"into",
"an",
"COS",
"key"
] | train | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java#L1035-L1045 |
whitesource/agents | wss-agent-api/src/main/java/org/whitesource/agent/api/dispatch/RequestFactory.java | RequestFactory.newDependencyDataRequest | @Deprecated
public GetDependencyDataRequest newDependencyDataRequest(String orgToken, Collection<AgentProjectInfo> projects, String userKey) {
"""
Create new Dependency Data request.
@param orgToken WhiteSource organization token.
@param projects Projects status statement to check.
@param userKey user ke... | java | @Deprecated
public GetDependencyDataRequest newDependencyDataRequest(String orgToken, Collection<AgentProjectInfo> projects, String userKey) {
return newDependencyDataRequest(orgToken, null, null, projects, userKey);
} | [
"@",
"Deprecated",
"public",
"GetDependencyDataRequest",
"newDependencyDataRequest",
"(",
"String",
"orgToken",
",",
"Collection",
"<",
"AgentProjectInfo",
">",
"projects",
",",
"String",
"userKey",
")",
"{",
"return",
"newDependencyDataRequest",
"(",
"orgToken",
",",
... | Create new Dependency Data request.
@param orgToken WhiteSource organization token.
@param projects Projects status statement to check.
@param userKey user key uniquely identifying the account at white source.
@return Newly created request to get Dependency Additional Data (Licenses, Description, homepageUrl and Vuln... | [
"Create",
"new",
"Dependency",
"Data",
"request",
"."
] | train | https://github.com/whitesource/agents/blob/8a947a3dbad257aff70f23f79fb3a55ca90b765f/wss-agent-api/src/main/java/org/whitesource/agent/api/dispatch/RequestFactory.java#L483-L486 |
inmite/android-validation-komensky | library/src/main/java/eu/inmite/android/lib/validations/form/FormValidator.java | FormValidator.startLiveValidation | public static void startLiveValidation(final Object target, final View formContainer, final IValidationCallback callback) {
"""
Start live validation - whenever focus changes from view with validations upon itself, validators will run.<br/>
Don't forget to call {@link #stopLiveValidation(Object)} once you are don... | java | public static void startLiveValidation(final Object target, final View formContainer, final IValidationCallback callback) {
if (formContainer == null) {
throw new IllegalArgumentException("form container view cannot be null");
}
if (target == null) {
throw new IllegalArgumentException("target cannot be null... | [
"public",
"static",
"void",
"startLiveValidation",
"(",
"final",
"Object",
"target",
",",
"final",
"View",
"formContainer",
",",
"final",
"IValidationCallback",
"callback",
")",
"{",
"if",
"(",
"formContainer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArg... | Start live validation - whenever focus changes from view with validations upon itself, validators will run.<br/>
Don't forget to call {@link #stopLiveValidation(Object)} once you are done.
@param target target with views to validate, there can be only one continuous validation per target
@param formContainer view that... | [
"Start",
"live",
"validation",
"-",
"whenever",
"focus",
"changes",
"from",
"view",
"with",
"validations",
"upon",
"itself",
"validators",
"will",
"run",
".",
"<br",
"/",
">",
"Don",
"t",
"forget",
"to",
"call",
"{",
"@link",
"#stopLiveValidation",
"(",
"Obj... | train | https://github.com/inmite/android-validation-komensky/blob/7c544f2d9f104a9800fcf4757eecb3caa8e76451/library/src/main/java/eu/inmite/android/lib/validations/form/FormValidator.java#L139-L160 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/SigninPanel.java | SigninPanel.newPasswordTextField | protected LabeledPasswordTextFieldPanel<String, T> newPasswordTextField(final String id,
final IModel<T> model) {
"""
Factory method for creating the EmailTextField for the password. This method is invoked in
the constructor from the derived classes and can be overridden so users can provide their own
version ... | java | protected LabeledPasswordTextFieldPanel<String, T> newPasswordTextField(final String id,
final IModel<T> model)
{
final IModel<String> labelModel = ResourceModelFactory
.newResourceModel("global.password.label", this);
final IModel<String> placeholderModel = ResourceModelFactory
.newResourceModel("global.e... | [
"protected",
"LabeledPasswordTextFieldPanel",
"<",
"String",
",",
"T",
">",
"newPasswordTextField",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"IModel",
"<",
"String",
">",
"labelModel",
"=",
"ResourceModel... | Factory method for creating the EmailTextField for the password. This method is invoked in
the constructor from the derived classes and can be overridden so users can provide their own
version of a EmailTextField for the password.
@param id
the id
@param model
the model
@return the text field LabeledPasswordTextFieldP... | [
"Factory",
"method",
"for",
"creating",
"the",
"EmailTextField",
"for",
"the",
"password",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/SigninPanel.java#L121-L152 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.fillFromToWith | public void fillFromToWith(int from, int to, Object val) {
"""
Sets the specified range of elements in the specified array to the specified value.
@param from the index of the first element (inclusive) to be filled with the specified value.
@param to the index of the last element (inclusive) to be filled with ... | java | public void fillFromToWith(int from, int to, Object val) {
checkRangeFromTo(from,to,this.size);
for (int i=from; i<=to;) setQuick(i++,val);
} | [
"public",
"void",
"fillFromToWith",
"(",
"int",
"from",
",",
"int",
"to",
",",
"Object",
"val",
")",
"{",
"checkRangeFromTo",
"(",
"from",
",",
"to",
",",
"this",
".",
"size",
")",
";",
"for",
"(",
"int",
"i",
"=",
"from",
";",
"i",
"<=",
"to",
"... | Sets the specified range of elements in the specified array to the specified value.
@param from the index of the first element (inclusive) to be filled with the specified value.
@param to the index of the last element (inclusive) to be filled with the specified value.
@param val the value to be stored in the specified... | [
"Sets",
"the",
"specified",
"range",
"of",
"elements",
"in",
"the",
"specified",
"array",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L376-L379 |
radkovo/SwingBox | src/main/java/org/fit/cssbox/swingbox/view/TextBoxView.java | TextBoxView.getTextEx | protected String getTextEx(int position, int len) {
"""
Gets the text.
@param position
the position, where to begin
@param len
the length of text portion
@return the text
"""
try {
return getDocument().getText(position, len);
} catch (BadLocationException e) {
e.p... | java | protected String getTextEx(int position, int len)
{
try {
return getDocument().getText(position, len);
} catch (BadLocationException e) {
e.printStackTrace();
return "";
}
} | [
"protected",
"String",
"getTextEx",
"(",
"int",
"position",
",",
"int",
"len",
")",
"{",
"try",
"{",
"return",
"getDocument",
"(",
")",
".",
"getText",
"(",
"position",
",",
"len",
")",
";",
"}",
"catch",
"(",
"BadLocationException",
"e",
")",
"{",
"e"... | Gets the text.
@param position
the position, where to begin
@param len
the length of text portion
@return the text | [
"Gets",
"the",
"text",
"."
] | train | https://github.com/radkovo/SwingBox/blob/ff370f3dc54d248e4c8852c17513618c83c25984/src/main/java/org/fit/cssbox/swingbox/view/TextBoxView.java#L555-L563 |
leancloud/java-sdk-all | android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/common/ActivityMgr.java | ActivityMgr.onActivityCreated | @Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
"""
activity onCreate 监听回调 | Activity OnCreate Listener Callback
@param activity 发生onCreate事件的activity | Activity that occurs OnCreate events
@param savedInstanceState 缓存状态数据 | Cached state data
"""
HMSAgent... | java | @Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
HMSAgentLog.d("onCreated:" + StrUtils.objDesc(activity));
setCurActivity(activity);
} | [
"@",
"Override",
"public",
"void",
"onActivityCreated",
"(",
"Activity",
"activity",
",",
"Bundle",
"savedInstanceState",
")",
"{",
"HMSAgentLog",
".",
"d",
"(",
"\"onCreated:\"",
"+",
"StrUtils",
".",
"objDesc",
"(",
"activity",
")",
")",
";",
"setCurActivity",... | activity onCreate 监听回调 | Activity OnCreate Listener Callback
@param activity 发生onCreate事件的activity | Activity that occurs OnCreate events
@param savedInstanceState 缓存状态数据 | Cached state data | [
"activity",
"onCreate",
"监听回调",
"|",
"Activity",
"OnCreate",
"Listener",
"Callback"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/common/ActivityMgr.java#L168-L172 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/MyHTTPUtils.java | MyHTTPUtils.getContent | public static String getContent(String stringUrl, Map<String, String> parameters, Proxy proxy)
throws IOException {
"""
Get content for url/parameters/proxy
@param stringUrl the URL to get
@param parameters HTTP parameters to pass
@param proxy Proxy to use
@return content the response content
@throws ... | java | public static String getContent(String stringUrl, Map<String, String> parameters, Proxy proxy)
throws IOException {
URL url = new URL(stringUrl);
URLConnection conn;
if (proxy != null) {
conn = url.openConnection(proxy);
} else {
conn = url.openConnection();
}
conn.setConnect... | [
"public",
"static",
"String",
"getContent",
"(",
"String",
"stringUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"Proxy",
"proxy",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"stringUrl",
")",
";",
"U... | Get content for url/parameters/proxy
@param stringUrl the URL to get
@param parameters HTTP parameters to pass
@param proxy Proxy to use
@return content the response content
@throws IOException I/O error happened | [
"Get",
"content",
"for",
"url",
"/",
"parameters",
"/",
"proxy"
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/MyHTTPUtils.java#L96-L122 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.evaluateAutoScaleAsync | public ServiceFuture<AutoScaleRun> evaluateAutoScaleAsync(String poolId, String autoScaleFormula, final ServiceCallback<AutoScaleRun> serviceCallback) {
"""
Gets the result of evaluating an automatic scaling formula on the pool.
This API is primarily for validating an autoscale formula, as it simply returns the r... | java | public ServiceFuture<AutoScaleRun> evaluateAutoScaleAsync(String poolId, String autoScaleFormula, final ServiceCallback<AutoScaleRun> serviceCallback) {
return ServiceFuture.fromHeaderResponse(evaluateAutoScaleWithServiceResponseAsync(poolId, autoScaleFormula), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"AutoScaleRun",
">",
"evaluateAutoScaleAsync",
"(",
"String",
"poolId",
",",
"String",
"autoScaleFormula",
",",
"final",
"ServiceCallback",
"<",
"AutoScaleRun",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromHead... | Gets the result of evaluating an automatic scaling formula on the pool.
This API is primarily for validating an autoscale formula, as it simply returns the result without applying the formula to the pool. The pool must have auto scaling enabled in order to evaluate a formula.
@param poolId The ID of the pool on which ... | [
"Gets",
"the",
"result",
"of",
"evaluating",
"an",
"automatic",
"scaling",
"formula",
"on",
"the",
"pool",
".",
"This",
"API",
"is",
"primarily",
"for",
"validating",
"an",
"autoscale",
"formula",
"as",
"it",
"simply",
"returns",
"the",
"result",
"without",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L2523-L2525 |
netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Snappy.java | Snappy.findMatchingLength | private static int findMatchingLength(ByteBuf in, int minIndex, int inIndex, int maxIndex) {
"""
Iterates over the supplied input buffer between the supplied minIndex and
maxIndex to find how long our matched copy overlaps with an already-written
literal value.
@param in The input buffer to scan over
@param ... | java | private static int findMatchingLength(ByteBuf in, int minIndex, int inIndex, int maxIndex) {
int matched = 0;
while (inIndex <= maxIndex - 4 &&
in.getInt(inIndex) == in.getInt(minIndex + matched)) {
inIndex += 4;
matched += 4;
}
while (inIndex < ... | [
"private",
"static",
"int",
"findMatchingLength",
"(",
"ByteBuf",
"in",
",",
"int",
"minIndex",
",",
"int",
"inIndex",
",",
"int",
"maxIndex",
")",
"{",
"int",
"matched",
"=",
"0",
";",
"while",
"(",
"inIndex",
"<=",
"maxIndex",
"-",
"4",
"&&",
"in",
"... | Iterates over the supplied input buffer between the supplied minIndex and
maxIndex to find how long our matched copy overlaps with an already-written
literal value.
@param in The input buffer to scan over
@param minIndex The index in the input buffer to start scanning from
@param inIndex The index of the start of our ... | [
"Iterates",
"over",
"the",
"supplied",
"input",
"buffer",
"between",
"the",
"supplied",
"minIndex",
"and",
"maxIndex",
"to",
"find",
"how",
"long",
"our",
"matched",
"copy",
"overlaps",
"with",
"an",
"already",
"-",
"written",
"literal",
"value",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L179-L194 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipStack.java | SipStack.createSipPhone | public SipPhone createSipPhone(String me) throws InvalidArgumentException, ParseException {
"""
This method is the equivalent to the other createSipPhone() methods but without a proxy server.
@param me "Address of Record" URI of the phone user. Each SipPhone is associated with one user.
This parameter is used ... | java | public SipPhone createSipPhone(String me) throws InvalidArgumentException, ParseException {
return createSipPhone(null, null, -1, me);
} | [
"public",
"SipPhone",
"createSipPhone",
"(",
"String",
"me",
")",
"throws",
"InvalidArgumentException",
",",
"ParseException",
"{",
"return",
"createSipPhone",
"(",
"null",
",",
"null",
",",
"-",
"1",
",",
"me",
")",
";",
"}"
] | This method is the equivalent to the other createSipPhone() methods but without a proxy server.
@param me "Address of Record" URI of the phone user. Each SipPhone is associated with one user.
This parameter is used in the "from" header field.
@return A new SipPhone object.
@throws InvalidArgumentException
@throws Par... | [
"This",
"method",
"is",
"the",
"equivalent",
"to",
"the",
"other",
"createSipPhone",
"()",
"methods",
"but",
"without",
"a",
"proxy",
"server",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipStack.java#L283-L285 |
OpenBEL/openbel-framework | org.openbel.framework.api/src/main/java/org/openbel/framework/api/BasicPathFinder.java | BasicPathFinder.runDepthFirstScan | private void runDepthFirstScan(final Kam kam,
final KamNode cnode,
final KamNode source,
int depth,
final SetStack<KamNode> nodeStack,
final SetStack<KamEdge> edgeStack,
final List<SimplePath> pathResults) {
"""
Runs a recursive depth-first sc... | java | private void runDepthFirstScan(final Kam kam,
final KamNode cnode,
final KamNode source,
int depth,
final SetStack<KamNode> nodeStack,
final SetStack<KamEdge> edgeStack,
final List<SimplePath> pathResults) {
depth += 1;
final Set<... | [
"private",
"void",
"runDepthFirstScan",
"(",
"final",
"Kam",
"kam",
",",
"final",
"KamNode",
"cnode",
",",
"final",
"KamNode",
"source",
",",
"int",
"depth",
",",
"final",
"SetStack",
"<",
"KamNode",
">",
"nodeStack",
",",
"final",
"SetStack",
"<",
"KamEdge"... | Runs a recursive depth-first scan from a {@link KamNode} source until a
max search depth ({@link BasicPathFinder#maxSearchDepth}) is reached.
When the max search depth is reached a {@link SimplePath} is added,
containing the {@link Stack} of {@link KamEdge}, and the algorithm continues.
@param kam {@link Kam}, the kam... | [
"Runs",
"a",
"recursive",
"depth",
"-",
"first",
"scan",
"from",
"a",
"{",
"@link",
"KamNode",
"}",
"source",
"until",
"a",
"max",
"search",
"depth",
"(",
"{",
"@link",
"BasicPathFinder#maxSearchDepth",
"}",
")",
"is",
"reached",
".",
"When",
"the",
"max",... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/BasicPathFinder.java#L374-L409 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java | MurmurHashUtil.hashBytesByWords | public static int hashBytesByWords(MemorySegment segment, int offset, int lengthInBytes) {
"""
Hash bytes in MemorySegment, length must be aligned to 4 bytes.
@param segment segment.
@param offset offset for MemorySegment
@param lengthInBytes length in MemorySegment
@return hash code
"""
return hashBytes... | java | public static int hashBytesByWords(MemorySegment segment, int offset, int lengthInBytes) {
return hashBytesByWords(segment, offset, lengthInBytes, DEFAULT_SEED);
} | [
"public",
"static",
"int",
"hashBytesByWords",
"(",
"MemorySegment",
"segment",
",",
"int",
"offset",
",",
"int",
"lengthInBytes",
")",
"{",
"return",
"hashBytesByWords",
"(",
"segment",
",",
"offset",
",",
"lengthInBytes",
",",
"DEFAULT_SEED",
")",
";",
"}"
] | Hash bytes in MemorySegment, length must be aligned to 4 bytes.
@param segment segment.
@param offset offset for MemorySegment
@param lengthInBytes length in MemorySegment
@return hash code | [
"Hash",
"bytes",
"in",
"MemorySegment",
"length",
"must",
"be",
"aligned",
"to",
"4",
"bytes",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java#L62-L64 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/document/DocClassifierCrossValidator.java | DocClassifierCrossValidator.evaluate | public void evaluate(ObjectStream<DocSample> samples, int nFolds)
throws IOException {
"""
Starts the evaluation.
@param samples
the data to train and test
@param nFolds
number of folds
@throws IOException if io error
"""
CrossValidationPartitioner<DocSample> partitioner = new CrossValidati... | java | public void evaluate(ObjectStream<DocSample> samples, int nFolds)
throws IOException {
CrossValidationPartitioner<DocSample> partitioner = new CrossValidationPartitioner<>(
samples, nFolds);
while (partitioner.hasNext()) {
CrossValidationPartitioner.TrainingSampleStream<DocSample> trainin... | [
"public",
"void",
"evaluate",
"(",
"ObjectStream",
"<",
"DocSample",
">",
"samples",
",",
"int",
"nFolds",
")",
"throws",
"IOException",
"{",
"CrossValidationPartitioner",
"<",
"DocSample",
">",
"partitioner",
"=",
"new",
"CrossValidationPartitioner",
"<>",
"(",
"... | Starts the evaluation.
@param samples
the data to train and test
@param nFolds
number of folds
@throws IOException if io error | [
"Starts",
"the",
"evaluation",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/document/DocClassifierCrossValidator.java#L60-L83 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.debugFeatureValue | private void debugFeatureValue(String feature, int index, ConcatVector vector, BufferedWriter bw) throws IOException {
"""
This writes a feature's individual value, using the human readable name if possible, to a StringBuilder
"""
bw.write("\t");
if (sparseFeatureIndex.containsKey(feature) && s... | java | private void debugFeatureValue(String feature, int index, ConcatVector vector, BufferedWriter bw) throws IOException {
bw.write("\t");
if (sparseFeatureIndex.containsKey(feature) && sparseFeatureIndex.get(feature).values().contains(index)) {
// we can map this index to an interpretable strin... | [
"private",
"void",
"debugFeatureValue",
"(",
"String",
"feature",
",",
"int",
"index",
",",
"ConcatVector",
"vector",
",",
"BufferedWriter",
"bw",
")",
"throws",
"IOException",
"{",
"bw",
".",
"write",
"(",
"\"\\t\"",
")",
";",
"if",
"(",
"sparseFeatureIndex",... | This writes a feature's individual value, using the human readable name if possible, to a StringBuilder | [
"This",
"writes",
"a",
"feature",
"s",
"individual",
"value",
"using",
"the",
"human",
"readable",
"name",
"if",
"possible",
"to",
"a",
"StringBuilder"
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L371-L386 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/ByteArrayUtil.java | ByteArrayUtil.putFloatLE | public static void putFloatLE(final byte[] array, final int offset, final float value) {
"""
Put the source <i>float</i> into the destination byte array starting at the given offset
in little endian order.
There is no bounds checking.
@param array destination byte array
@param offset destination offset
@param... | java | public static void putFloatLE(final byte[] array, final int offset, final float value) {
putIntLE(array, offset, Float.floatToRawIntBits(value));
} | [
"public",
"static",
"void",
"putFloatLE",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"float",
"value",
")",
"{",
"putIntLE",
"(",
"array",
",",
"offset",
",",
"Float",
".",
"floatToRawIntBits",
"(",
"value",
")"... | Put the source <i>float</i> into the destination byte array starting at the given offset
in little endian order.
There is no bounds checking.
@param array destination byte array
@param offset destination offset
@param value source <i>float</i> | [
"Put",
"the",
"source",
"<i",
">",
"float<",
"/",
"i",
">",
"into",
"the",
"destination",
"byte",
"array",
"starting",
"at",
"the",
"given",
"offset",
"in",
"little",
"endian",
"order",
".",
"There",
"is",
"no",
"bounds",
"checking",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/ByteArrayUtil.java#L213-L215 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java | ConfigUtils.resolveEncrypted | public static Config resolveEncrypted(Config config, Optional<String> encConfigPath) {
"""
Resolves encrypted config value(s) by considering on the path with "encConfigPath" as encrypted.
(If encConfigPath is absent or encConfigPath does not exist in config, config will be just returned untouched.)
It will use P... | java | public static Config resolveEncrypted(Config config, Optional<String> encConfigPath) {
if (!encConfigPath.isPresent() || !config.hasPath(encConfigPath.get())) {
return config;
}
Config encryptedConfig = config.getConfig(encConfigPath.get());
PasswordManager passwordManager = PasswordManager.getI... | [
"public",
"static",
"Config",
"resolveEncrypted",
"(",
"Config",
"config",
",",
"Optional",
"<",
"String",
">",
"encConfigPath",
")",
"{",
"if",
"(",
"!",
"encConfigPath",
".",
"isPresent",
"(",
")",
"||",
"!",
"config",
".",
"hasPath",
"(",
"encConfigPath",... | Resolves encrypted config value(s) by considering on the path with "encConfigPath" as encrypted.
(If encConfigPath is absent or encConfigPath does not exist in config, config will be just returned untouched.)
It will use Password manager via given config. Thus, convention of PasswordManager need to be followed in order... | [
"Resolves",
"encrypted",
"config",
"value",
"(",
"s",
")",
"by",
"considering",
"on",
"the",
"path",
"with",
"encConfigPath",
"as",
"encrypted",
".",
"(",
"If",
"encConfigPath",
"is",
"absent",
"or",
"encConfigPath",
"does",
"not",
"exist",
"in",
"config",
"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java#L505-L520 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationRequest.java | CreateIntegrationRequest.withRequestTemplates | public CreateIntegrationRequest withRequestTemplates(java.util.Map<String, String> requestTemplates) {
"""
<p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the te... | java | public CreateIntegrationRequest withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} | [
"public",
"CreateIntegrationRequest",
"withRequestTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestTemplates",
")",
"{",
"setRequestTemplates",
"(",
"requestTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
String) is the value.
</p>
@param requestTemplates
Represents a map of Velocity templates that are a... | [
"<p",
">",
"Represents",
"a",
"map",
"of",
"Velocity",
"templates",
"that",
"are",
"applied",
"on",
"the",
"request",
"payload",
"based",
"on",
"the",
"value",
"of",
"the",
"Content",
"-",
"Type",
"header",
"sent",
"by",
"the",
"client",
".",
"The",
"con... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationRequest.java#L1161-L1164 |
overview/mime-types | src/main/java/org/overviewproject/mime_types/MimeTypeDetector.java | MimeTypeDetector.oneMatchletMagicEquals | private boolean oneMatchletMagicEquals(int offset, byte[] data) {
"""
Tests whether one matchlet (but not its children) matches data.
"""
int rangeStart = content.getInt(offset); // first byte of data for check to start at
int rangeLength = content.getInt(offset + 4); // last byte of data ... | java | private boolean oneMatchletMagicEquals(int offset, byte[] data) {
int rangeStart = content.getInt(offset); // first byte of data for check to start at
int rangeLength = content.getInt(offset + 4); // last byte of data for check to start at
int dataLength = content.getInt(offset + 12); // nu... | [
"private",
"boolean",
"oneMatchletMagicEquals",
"(",
"int",
"offset",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"int",
"rangeStart",
"=",
"content",
".",
"getInt",
"(",
"offset",
")",
";",
"// first byte of data for check to start at",
"int",
"rangeLength",
"=",
... | Tests whether one matchlet (but not its children) matches data. | [
"Tests",
"whether",
"one",
"matchlet",
"(",
"but",
"not",
"its",
"children",
")",
"matches",
"data",
"."
] | train | https://github.com/overview/mime-types/blob/d5c45302049c0cd5e634a50954304d8ddeb9abb4/src/main/java/org/overviewproject/mime_types/MimeTypeDetector.java#L434-L461 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/server/VanillaDb.java | VanillaDb.newPlanner | public static Planner newPlanner() {
"""
Creates a planner for SQL commands. To change how the planner works,
modify this method.
@return the system's planner for SQL commands
"""
QueryPlanner qplanner;
UpdatePlanner uplanner;
try {
qplanner = (QueryPlanner) queryPlannerCls.newInstance();
... | java | public static Planner newPlanner() {
QueryPlanner qplanner;
UpdatePlanner uplanner;
try {
qplanner = (QueryPlanner) queryPlannerCls.newInstance();
uplanner = (UpdatePlanner) updatePlannerCls.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
r... | [
"public",
"static",
"Planner",
"newPlanner",
"(",
")",
"{",
"QueryPlanner",
"qplanner",
";",
"UpdatePlanner",
"uplanner",
";",
"try",
"{",
"qplanner",
"=",
"(",
"QueryPlanner",
")",
"queryPlannerCls",
".",
"newInstance",
"(",
")",
";",
"uplanner",
"=",
"(",
... | Creates a planner for SQL commands. To change how the planner works,
modify this method.
@return the system's planner for SQL commands | [
"Creates",
"a",
"planner",
"for",
"SQL",
"commands",
".",
"To",
"change",
"how",
"the",
"planner",
"works",
"modify",
"this",
"method",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/server/VanillaDb.java#L283-L296 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByAppArg0 | public Iterable<DConnection> queryByAppArg0(java.lang.String appArg0) {
"""
query-by method for field appArg0
@param appArg0 the specified attribute
@return an Iterable of DConnections for the specified appArg0
"""
return queryByField(null, DConnectionMapper.Field.APPARG0.getFieldName(), appArg0);
} | java | public Iterable<DConnection> queryByAppArg0(java.lang.String appArg0) {
return queryByField(null, DConnectionMapper.Field.APPARG0.getFieldName(), appArg0);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByAppArg0",
"(",
"java",
".",
"lang",
".",
"String",
"appArg0",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"APPARG0",
".",
"getFieldName",
"(",
")",
",",
... | query-by method for field appArg0
@param appArg0 the specified attribute
@return an Iterable of DConnections for the specified appArg0 | [
"query",
"-",
"by",
"method",
"for",
"field",
"appArg0"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L52-L54 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/CharTrieIndex.java | CharTrieIndex.addDocument | public int addDocument(String document) {
"""
Adds a document to be indexed. This can only be performed before splitting.
@param document the document
@return this int
"""
if (root().getNumberOfChildren() >= 0) {
throw new IllegalStateException("Tree sorting has begun");
}
final int index... | java | public int addDocument(String document) {
if (root().getNumberOfChildren() >= 0) {
throw new IllegalStateException("Tree sorting has begun");
}
final int index;
synchronized (this) {
index = documents.size();
documents.add(document);
}
cursors.addAll(
IntStream.range(0, d... | [
"public",
"int",
"addDocument",
"(",
"String",
"document",
")",
"{",
"if",
"(",
"root",
"(",
")",
".",
"getNumberOfChildren",
"(",
")",
">=",
"0",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Tree sorting has begun\"",
")",
";",
"}",
"final",
... | Adds a document to be indexed. This can only be performed before splitting.
@param document the document
@return this int | [
"Adds",
"a",
"document",
"to",
"be",
"indexed",
".",
"This",
"can",
"only",
"be",
"performed",
"before",
"splitting",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/CharTrieIndex.java#L220-L233 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRuleUserSegmentRelPersistenceImpl.java | CPRuleUserSegmentRelPersistenceImpl.findByCPRuleId | @Override
public List<CPRuleUserSegmentRel> findByCPRuleId(long CPRuleId, int start,
int end, OrderByComparator<CPRuleUserSegmentRel> orderByComparator) {
"""
Returns an ordered range of all the cp rule user segment rels where CPRuleId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>... | java | @Override
public List<CPRuleUserSegmentRel> findByCPRuleId(long CPRuleId, int start,
int end, OrderByComparator<CPRuleUserSegmentRel> orderByComparator) {
return findByCPRuleId(CPRuleId, start, end, orderByComparator, true);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRuleUserSegmentRel",
">",
"findByCPRuleId",
"(",
"long",
"CPRuleId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CPRuleUserSegmentRel",
">",
"orderByComparator",
")",
"{",
"return",
"findByCPRu... | Returns an ordered range of all the cp rule user segment rels where CPRuleId = ?.
<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 r... | [
"Returns",
"an",
"ordered",
"range",
"of",
"all",
"the",
"cp",
"rule",
"user",
"segment",
"rels",
"where",
"CPRuleId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRuleUserSegmentRelPersistenceImpl.java#L159-L163 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getRewrittenHrefURI | public static String getRewrittenHrefURI( ServletContext servletContext, HttpServletRequest request,
HttpServletResponse response, String path, Map params,
String fragment, boolean forXML )
throws URISyntaxException ... | java | public static String getRewrittenHrefURI( ServletContext servletContext, HttpServletRequest request,
HttpServletResponse response, String path, Map params,
String fragment, boolean forXML )
throws URISyntaxException
... | [
"public",
"static",
"String",
"getRewrittenHrefURI",
"(",
"ServletContext",
"servletContext",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"path",
",",
"Map",
"params",
",",
"String",
"fragment",
",",
"boolean",
"forXML"... | Create a fully-rewritten URI given a path and parameters.
<p> Calls the rewriter service using a type of {@link URLType#ACTION}. </p>
@param servletContext the current ServletContext.
@param request the current HttpServletRequest.
@param response the current HttpServletResponse.
@param path the path to process into a... | [
"Create",
"a",
"fully",
"-",
"rewritten",
"URI",
"given",
"a",
"path",
"and",
"parameters",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L1571-L1577 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/TransportFormatAdapter.java | TransportFormatAdapter.writeXml | public static void writeXml(Serializable serializable, OutputStream output) throws IOException {
"""
Export XML.
@param serializable Serializable
@param output OutputStream
@throws IOException e
"""
TransportFormat.XML.writeSerializableTo(serializable, output);
} | java | public static void writeXml(Serializable serializable, OutputStream output) throws IOException {
TransportFormat.XML.writeSerializableTo(serializable, output);
} | [
"public",
"static",
"void",
"writeXml",
"(",
"Serializable",
"serializable",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"TransportFormat",
".",
"XML",
".",
"writeSerializableTo",
"(",
"serializable",
",",
"output",
")",
";",
"}"
] | Export XML.
@param serializable Serializable
@param output OutputStream
@throws IOException e | [
"Export",
"XML",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/TransportFormatAdapter.java#L41-L43 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.commitContexts | private void commitContexts(boolean accept, boolean all) {
"""
Commit or cancel all pending context changes.
@param accept If true, pending changes are committed. If false, they are canceled.
@param all If false, only polled subscribers are notified.
"""
Stack<IManagedContext<?>> stack = commitStac... | java | private void commitContexts(boolean accept, boolean all) {
Stack<IManagedContext<?>> stack = commitStack;
commitStack = new Stack<>();
// First, commit or cancel all pending context changes.
for (IManagedContext<?> managedContext : stack) {
if (managedContext.isPending()) {
... | [
"private",
"void",
"commitContexts",
"(",
"boolean",
"accept",
",",
"boolean",
"all",
")",
"{",
"Stack",
"<",
"IManagedContext",
"<",
"?",
">",
">",
"stack",
"=",
"commitStack",
";",
"commitStack",
"=",
"new",
"Stack",
"<>",
"(",
")",
";",
"// First, commi... | Commit or cancel all pending context changes.
@param accept If true, pending changes are committed. If false, they are canceled.
@param all If false, only polled subscribers are notified. | [
"Commit",
"or",
"cancel",
"all",
"pending",
"context",
"changes",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L268-L281 |
mike706574/java-map-support | src/main/java/fun/mike/map/alpha/Get.java | Get.populatedUrl | public static <T> String populatedUrl(Map<String, T> map, String key) {
"""
Validates that the value from {@code map} for the given {@code key} is a
valid, populated string URL. Returns the value when valid; otherwise,
throws an {@code IllegalArgumentException}.
@param map a map
@param key a key
@param <T> th... | java | public static <T> String populatedUrl(Map<String, T> map, String key) {
String url = populatedStringOfType(map, key, "URL");
UrlValidator.http(url)
.orThrow(String.format("Invalid URL value \"%s\" for key \"%s\"", url, key));
return url;
} | [
"public",
"static",
"<",
"T",
">",
"String",
"populatedUrl",
"(",
"Map",
"<",
"String",
",",
"T",
">",
"map",
",",
"String",
"key",
")",
"{",
"String",
"url",
"=",
"populatedStringOfType",
"(",
"map",
",",
"key",
",",
"\"URL\"",
")",
";",
"UrlValidator... | Validates that the value from {@code map} for the given {@code key} is a
valid, populated string URL. Returns the value when valid; otherwise,
throws an {@code IllegalArgumentException}.
@param map a map
@param key a key
@param <T> the type of value
@return the string value
@throws java.util.NoSuchElementException if t... | [
"Validates",
"that",
"the",
"value",
"from",
"{"
] | train | https://github.com/mike706574/java-map-support/blob/7cb09f34c24adfaca73ad25a3c3e05abec72eafe/src/main/java/fun/mike/map/alpha/Get.java#L52-L57 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/CmsImageResourcePreview.java | CmsImageResourcePreview.getImageInfo | private void getImageInfo(final String resourcePath, final I_CmsSimpleCallback<CmsImageInfoBean> callback) {
"""
Returns the image info bean for the given resource.<p>
@param resourcePath the resource path
@param callback the calback to execute
"""
CmsRpcAction<CmsImageInfoBean> action = new CmsRp... | java | private void getImageInfo(final String resourcePath, final I_CmsSimpleCallback<CmsImageInfoBean> callback) {
CmsRpcAction<CmsImageInfoBean> action = new CmsRpcAction<CmsImageInfoBean>() {
/**
* @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
*/
@Overrid... | [
"private",
"void",
"getImageInfo",
"(",
"final",
"String",
"resourcePath",
",",
"final",
"I_CmsSimpleCallback",
"<",
"CmsImageInfoBean",
">",
"callback",
")",
"{",
"CmsRpcAction",
"<",
"CmsImageInfoBean",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"CmsImageInfo... | Returns the image info bean for the given resource.<p>
@param resourcePath the resource path
@param callback the calback to execute | [
"Returns",
"the",
"image",
"info",
"bean",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsImageResourcePreview.java#L324-L350 |
jenkinsci/jenkins | core/src/main/java/hudson/scheduler/BaseParser.java | BaseParser.doHash | protected long doHash(int step, int field) throws ANTLRException {
"""
Uses {@link Hash} to choose a random (but stable) value from within this field.
@param step
Increments. For example, 15 if "H/15". Or {@link #NO_STEP} to indicate
the special constant for "H" without the step value.
"""
int u =... | java | protected long doHash(int step, int field) throws ANTLRException {
int u = UPPER_BOUNDS[field];
if (field==2) u = 28; // day of month can vary depending on month, so to make life simpler, just use [1,28] that's always safe
if (field==4) u = 6; // Both 0 and 7 of day of week are Sunday. For b... | [
"protected",
"long",
"doHash",
"(",
"int",
"step",
",",
"int",
"field",
")",
"throws",
"ANTLRException",
"{",
"int",
"u",
"=",
"UPPER_BOUNDS",
"[",
"field",
"]",
";",
"if",
"(",
"field",
"==",
"2",
")",
"u",
"=",
"28",
";",
"// day of month can vary depe... | Uses {@link Hash} to choose a random (but stable) value from within this field.
@param step
Increments. For example, 15 if "H/15". Or {@link #NO_STEP} to indicate
the special constant for "H" without the step value. | [
"Uses",
"{",
"@link",
"Hash",
"}",
"to",
"choose",
"a",
"random",
"(",
"but",
"stable",
")",
"value",
"from",
"within",
"this",
"field",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scheduler/BaseParser.java#L96-L101 |
vladmihalcea/db-util | src/main/java/com/vladmihalcea/sql/SQLStatementCountValidator.java | SQLStatementCountValidator.assertDeleteCount | public static void assertDeleteCount(long expectedDeleteCount) {
"""
Assert delete statement count
@param expectedDeleteCount expected delete statement count
"""
QueryCount queryCount = QueryCountHolder.getGrandTotal();
long recordedDeleteCount = queryCount.getDelete();
if (expectedD... | java | public static void assertDeleteCount(long expectedDeleteCount) {
QueryCount queryCount = QueryCountHolder.getGrandTotal();
long recordedDeleteCount = queryCount.getDelete();
if (expectedDeleteCount != recordedDeleteCount) {
throw new SQLDeleteCountMismatchException(expectedDeleteCoun... | [
"public",
"static",
"void",
"assertDeleteCount",
"(",
"long",
"expectedDeleteCount",
")",
"{",
"QueryCount",
"queryCount",
"=",
"QueryCountHolder",
".",
"getGrandTotal",
"(",
")",
";",
"long",
"recordedDeleteCount",
"=",
"queryCount",
".",
"getDelete",
"(",
")",
"... | Assert delete statement count
@param expectedDeleteCount expected delete statement count | [
"Assert",
"delete",
"statement",
"count"
] | train | https://github.com/vladmihalcea/db-util/blob/81c8c8421253c9869db1d4e221668d7afbd69fd0/src/main/java/com/vladmihalcea/sql/SQLStatementCountValidator.java#L132-L138 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ResourceImpl.java | ResourceImpl.withTag | @SuppressWarnings("unchecked")
public final FluentModelImplT withTag(String key, String value) {
"""
Adds a tag to the resource.
@param key the key for the tag
@param value the value for the tag
@return the next stage of the definition/update
"""
if (this.inner().getTags() == null) {
... | java | @SuppressWarnings("unchecked")
public final FluentModelImplT withTag(String key, String value) {
if (this.inner().getTags() == null) {
this.inner().withTags(new HashMap<String, String>());
}
this.inner().getTags().put(key, value);
return (FluentModelImplT) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"FluentModelImplT",
"withTag",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"inner",
"(",
")",
".",
"getTags",
"(",
")",
"==",
"null",
")",
"{",
"... | Adds a tag to the resource.
@param key the key for the tag
@param value the value for the tag
@return the next stage of the definition/update | [
"Adds",
"a",
"tag",
"to",
"the",
"resource",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ResourceImpl.java#L109-L116 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java | IntersectionImpl.wrapInstance | static IntersectionImpl wrapInstance(final WritableMemory srcMem, final long seed) {
"""
Wrap an Intersection target around the given source Memory containing intersection data.
@param srcMem The source Memory image.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoo... | java | static IntersectionImpl wrapInstance(final WritableMemory srcMem, final long seed) {
final IntersectionImpl impl = new IntersectionImpl(srcMem, seed, false);
return (IntersectionImpl) internalWrapInstance(srcMem, impl);
} | [
"static",
"IntersectionImpl",
"wrapInstance",
"(",
"final",
"WritableMemory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"IntersectionImpl",
"impl",
"=",
"new",
"IntersectionImpl",
"(",
"srcMem",
",",
"seed",
",",
"false",
")",
";",
"return",
"... | Wrap an Intersection target around the given source Memory containing intersection data.
@param srcMem The source Memory image.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@return a IntersectionImpl that wraps a source Me... | [
"Wrap",
"an",
"Intersection",
"target",
"around",
"the",
"given",
"source",
"Memory",
"containing",
"intersection",
"data",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java#L164-L167 |
datacleaner/AnalyzerBeans | env/xml-config/src/main/java/org/eobjects/analyzer/configuration/JaxbConfigurationReader.java | JaxbConfigurationReader.checkName | private static void checkName(String name, Class<?> type, List<? extends ReferenceData> previousEntries)
throws IllegalStateException {
"""
Checks if a string is a valid name of a component.
@param name
the name to be validated
@param type
the type of component (used for error messages)
@param p... | java | private static void checkName(String name, Class<?> type, List<? extends ReferenceData> previousEntries)
throws IllegalStateException {
if (StringUtils.isNullOrEmpty(name)) {
throw new IllegalStateException(type.getSimpleName() + " name cannot be null");
}
for (ReferenceD... | [
"private",
"static",
"void",
"checkName",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"type",
",",
"List",
"<",
"?",
"extends",
"ReferenceData",
">",
"previousEntries",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"StringUtils",
".",
"isNu... | Checks if a string is a valid name of a component.
@param name
the name to be validated
@param type
the type of component (used for error messages)
@param previousEntries
the previous entries of that component type (for uniqueness
check)
@throws IllegalStateException
if the name is invalid | [
"Checks",
"if",
"a",
"string",
"is",
"a",
"valid",
"name",
"of",
"a",
"component",
"."
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/env/xml-config/src/main/java/org/eobjects/analyzer/configuration/JaxbConfigurationReader.java#L1250-L1260 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/form/SigninFormPanel.java | SigninFormPanel.newPasswordForgottenLink | protected MarkupContainer newPasswordForgottenLink(final String id, final IModel<T> model) {
"""
Factory method for create the new {@link MarkupContainer} of the {@link Link} for the
password forgotten. This method is invoked in the constructor from the derived classes and
can be overridden so users can provide ... | java | protected MarkupContainer newPasswordForgottenLink(final String id, final IModel<T> model)
{
final LinkPanel linkPanel = new LinkPanel(id,
ResourceModelFactory.newResourceModel(ResourceBundleKey.builder()
.key("password.forgotten.label").defaultValue("Password forgotten").build()))
{
/**
* The serial... | [
"protected",
"MarkupContainer",
"newPasswordForgottenLink",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"LinkPanel",
"linkPanel",
"=",
"new",
"LinkPanel",
"(",
"id",
",",
"ResourceModelFactory",
".",
"newResou... | Factory method for create the new {@link MarkupContainer} of the {@link Link} for the
password forgotten. This method is invoked in the constructor from the derived classes and
can be overridden so users can provide their own version of a new {@link MarkupContainer} of
the {@link Link} for the password forgotten.
@par... | [
"Factory",
"method",
"for",
"create",
"the",
"new",
"{",
"@link",
"MarkupContainer",
"}",
"of",
"the",
"{",
"@link",
"Link",
"}",
"for",
"the",
"password",
"forgotten",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"der... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/form/SigninFormPanel.java#L173-L195 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java | CPDefinitionSpecificationOptionValuePersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the cp definition specification option values where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CPDefinitionSpecificationOptionValue cpDefinitionSpe... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue : findByUuid_C(
uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionSpecificationOptionValue);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CPDefinitionSpecificationOptionValue",
"cpDefinitionSpecificationOptionValue",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryU... | Removes all the cp definition specification option values where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"cp",
"definition",
"specification",
"option",
"values",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java#L1440-L1446 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/ScriptUtil.java | ScriptUtil.getScript | public static ExecutableScript getScript(String language, String source, String resource, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
"""
Creates a new {@link ExecutableScript} from a source or resource. It excepts static and
dynamic sources and resources. Dynamic means that the source or ... | java | public static ExecutableScript getScript(String language, String source, String resource, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
ensureNotEmpty(NotValidException.class, "Script language", language);
ensureAtLeastOneNotNull(NotValidException.class, "No script source or resource was g... | [
"public",
"static",
"ExecutableScript",
"getScript",
"(",
"String",
"language",
",",
"String",
"source",
",",
"String",
"resource",
",",
"ExpressionManager",
"expressionManager",
",",
"ScriptFactory",
"scriptFactory",
")",
"{",
"ensureNotEmpty",
"(",
"NotValidException"... | Creates a new {@link ExecutableScript} from a source or resource. It excepts static and
dynamic sources and resources. Dynamic means that the source or resource is an expression
which will be evaluated during execution.
@param language the language of the script
@param source the source code of the script or an expres... | [
"Creates",
"a",
"new",
"{",
"@link",
"ExecutableScript",
"}",
"from",
"a",
"source",
"or",
"resource",
".",
"It",
"excepts",
"static",
"and",
"dynamic",
"sources",
"and",
"resources",
".",
"Dynamic",
"means",
"that",
"the",
"source",
"or",
"resource",
"is",
... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/ScriptUtil.java#L66-L75 |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/Address.java | Address.getByName | public static InetAddress
getByName(String name) throws UnknownHostException {
"""
Determines the IP address of a host
@param name The hostname to look up
@return The first matching IP address
@throws UnknownHostException The hostname does not have any addresses
"""
try {
return ge... | java | public static InetAddress
getByName(String name) throws UnknownHostException {
try {
return getByAddress(name);
} catch (UnknownHostException e) {
Record[] records = lookupHostName(name);
return addrFromRecord(name, records[0]);
}
} | [
"public",
"static",
"InetAddress",
"getByName",
"(",
"String",
"name",
")",
"throws",
"UnknownHostException",
"{",
"try",
"{",
"return",
"getByAddress",
"(",
"name",
")",
";",
"}",
"catch",
"(",
"UnknownHostException",
"e",
")",
"{",
"Record",
"[",
"]",
"rec... | Determines the IP address of a host
@param name The hostname to look up
@return The first matching IP address
@throws UnknownHostException The hostname does not have any addresses | [
"Determines",
"the",
"IP",
"address",
"of",
"a",
"host"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L268-L276 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.