repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/www/MessageHeader.java | MessageHeader.set | public synchronized void set(int i, String k, String v) {
grow();
if (i < 0) {
return;
} else if (i >= nkeys) {
add(k, v);
} else {
keys[i] = k;
values[i] = v;
}
} | java | public synchronized void set(int i, String k, String v) {
grow();
if (i < 0) {
return;
} else if (i >= nkeys) {
add(k, v);
} else {
keys[i] = k;
values[i] = v;
}
} | [
"public",
"synchronized",
"void",
"set",
"(",
"int",
"i",
",",
"String",
"k",
",",
"String",
"v",
")",
"{",
"grow",
"(",
")",
";",
"if",
"(",
"i",
"<",
"0",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"i",
">=",
"nkeys",
")",
"{",
"add",... | Overwrite the previous key/val pair at location 'i'
with the new k/v. If the index didn't exist before
the key/val is simply tacked onto the end. | [
"Overwrite",
"the",
"previous",
"key",
"/",
"val",
"pair",
"at",
"location",
"i",
"with",
"the",
"new",
"k",
"/",
"v",
".",
"If",
"the",
"index",
"didn",
"t",
"exist",
"before",
"the",
"key",
"/",
"val",
"is",
"simply",
"tacked",
"onto",
"the",
"end"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/www/MessageHeader.java#L327-L337 |
amzn/ion-java | src/com/amazon/ion/system/SimpleCatalog.java | SimpleCatalog.removeTable | public SymbolTable removeTable(String name, int version)
{
SymbolTable removed = null;
synchronized (myTablesByName)
{
TreeMap<Integer,SymbolTable> versions =
myTablesByName.get(name);
if (versions != null)
{
synchronized (versions)
{
removed = versions.remove(version);
// Remove empty intermediate table
if (versions.isEmpty())
{
myTablesByName.remove(name);
}
}
}
}
return removed;
} | java | public SymbolTable removeTable(String name, int version)
{
SymbolTable removed = null;
synchronized (myTablesByName)
{
TreeMap<Integer,SymbolTable> versions =
myTablesByName.get(name);
if (versions != null)
{
synchronized (versions)
{
removed = versions.remove(version);
// Remove empty intermediate table
if (versions.isEmpty())
{
myTablesByName.remove(name);
}
}
}
}
return removed;
} | [
"public",
"SymbolTable",
"removeTable",
"(",
"String",
"name",
",",
"int",
"version",
")",
"{",
"SymbolTable",
"removed",
"=",
"null",
";",
"synchronized",
"(",
"myTablesByName",
")",
"{",
"TreeMap",
"<",
"Integer",
",",
"SymbolTable",
">",
"versions",
"=",
... | Removes a symbol table from this catalog.
@return the removed table, or <code>null</code> if this catalog has
no matching table. | [
"Removes",
"a",
"symbol",
"table",
"from",
"this",
"catalog",
"."
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/system/SimpleCatalog.java#L181-L205 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/RequiresCondition.java | RequiresCondition.processPostStartRequirements | private void processPostStartRequirements(ConditionContext context, AnnotationValue<Requires> requirements) {
processPreStartRequirements(context, requirements);
if (context.isFailing()) {
return;
}
if (!matchesPresenceOfBeans(context, requirements)) {
return;
}
if (!matchesAbsenceOfBeans(context, requirements)) {
return;
}
matchesCustomConditions(context, requirements);
} | java | private void processPostStartRequirements(ConditionContext context, AnnotationValue<Requires> requirements) {
processPreStartRequirements(context, requirements);
if (context.isFailing()) {
return;
}
if (!matchesPresenceOfBeans(context, requirements)) {
return;
}
if (!matchesAbsenceOfBeans(context, requirements)) {
return;
}
matchesCustomConditions(context, requirements);
} | [
"private",
"void",
"processPostStartRequirements",
"(",
"ConditionContext",
"context",
",",
"AnnotationValue",
"<",
"Requires",
">",
"requirements",
")",
"{",
"processPreStartRequirements",
"(",
"context",
",",
"requirements",
")",
";",
"if",
"(",
"context",
".",
"i... | This method will run conditions that require all beans to be loaded. These conditions included "beans", "missingBeans" and custom conditions. | [
"This",
"method",
"will",
"run",
"conditions",
"that",
"require",
"all",
"beans",
"to",
"be",
"loaded",
".",
"These",
"conditions",
"included",
"beans",
"missingBeans",
"and",
"custom",
"conditions",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/RequiresCondition.java#L173-L189 |
haifengl/smile | plot/src/main/java/smile/swing/table/DefaultTableHeaderCellRenderer.java | DefaultTableHeaderCellRenderer.getSortKey | @SuppressWarnings("rawtypes")
protected SortKey getSortKey(JTable table, int column) {
RowSorter rowSorter = table.getRowSorter();
if (rowSorter == null) {
return null;
}
List sortedColumns = rowSorter.getSortKeys();
if (!sortedColumns.isEmpty()) {
return (SortKey) sortedColumns.get(0);
}
return null;
} | java | @SuppressWarnings("rawtypes")
protected SortKey getSortKey(JTable table, int column) {
RowSorter rowSorter = table.getRowSorter();
if (rowSorter == null) {
return null;
}
List sortedColumns = rowSorter.getSortKeys();
if (!sortedColumns.isEmpty()) {
return (SortKey) sortedColumns.get(0);
}
return null;
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"protected",
"SortKey",
"getSortKey",
"(",
"JTable",
"table",
",",
"int",
"column",
")",
"{",
"RowSorter",
"rowSorter",
"=",
"table",
".",
"getRowSorter",
"(",
")",
";",
"if",
"(",
"rowSorter",
"==",
"null",... | Returns the current sort key, or null if the column is unsorted.
@param table the table
@param column the column index
@return the SortKey, or null if the column is unsorted | [
"Returns",
"the",
"current",
"sort",
"key",
"or",
"null",
"if",
"the",
"column",
"is",
"unsorted",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/swing/table/DefaultTableHeaderCellRenderer.java#L122-L134 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java | RunbookDraftsInner.undoEditAsync | public Observable<RunbookDraftUndoEditResultInner> undoEditAsync(String resourceGroupName, String automationAccountName, String runbookName) {
return undoEditWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName).map(new Func1<ServiceResponse<RunbookDraftUndoEditResultInner>, RunbookDraftUndoEditResultInner>() {
@Override
public RunbookDraftUndoEditResultInner call(ServiceResponse<RunbookDraftUndoEditResultInner> response) {
return response.body();
}
});
} | java | public Observable<RunbookDraftUndoEditResultInner> undoEditAsync(String resourceGroupName, String automationAccountName, String runbookName) {
return undoEditWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName).map(new Func1<ServiceResponse<RunbookDraftUndoEditResultInner>, RunbookDraftUndoEditResultInner>() {
@Override
public RunbookDraftUndoEditResultInner call(ServiceResponse<RunbookDraftUndoEditResultInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"RunbookDraftUndoEditResultInner",
">",
"undoEditAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"runbookName",
")",
"{",
"return",
"undoEditWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Undo draft edit to last known published state identified by runbook name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param runbookName The runbook name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RunbookDraftUndoEditResultInner object | [
"Undo",
"draft",
"edit",
"to",
"last",
"known",
"published",
"state",
"identified",
"by",
"runbook",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java#L654-L661 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java | HttpUtils.executePost | public static HttpResponse executePost(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final String entity) {
return executePost(url, basicAuthUsername, basicAuthPassword, entity, new HashMap<>());
} | java | public static HttpResponse executePost(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final String entity) {
return executePost(url, basicAuthUsername, basicAuthPassword, entity, new HashMap<>());
} | [
"public",
"static",
"HttpResponse",
"executePost",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"basicAuthUsername",
",",
"final",
"String",
"basicAuthPassword",
",",
"final",
"String",
"entity",
")",
"{",
"return",
"executePost",
"(",
"url",
",",
"bas... | Execute post http response.
@param url the url
@param basicAuthUsername the basic auth username
@param basicAuthPassword the basic auth password
@param entity the json entity
@return the http response | [
"Execute",
"post",
"http",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java#L309-L314 |
weld/core | impl/src/main/java/org/jboss/weld/contexts/unbound/DependentContextImpl.java | DependentContextImpl.get | public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
if (creationalContext != null) {
T instance = contextual.create(creationalContext);
if (creationalContext instanceof WeldCreationalContext<?>) {
addDependentInstance(instance, contextual, (WeldCreationalContext<T>) creationalContext);
}
return instance;
} else {
return null;
}
} | java | public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
if (!isActive()) {
throw new ContextNotActiveException();
}
if (creationalContext != null) {
T instance = contextual.create(creationalContext);
if (creationalContext instanceof WeldCreationalContext<?>) {
addDependentInstance(instance, contextual, (WeldCreationalContext<T>) creationalContext);
}
return instance;
} else {
return null;
}
} | [
"public",
"<",
"T",
">",
"T",
"get",
"(",
"Contextual",
"<",
"T",
">",
"contextual",
",",
"CreationalContext",
"<",
"T",
">",
"creationalContext",
")",
"{",
"if",
"(",
"!",
"isActive",
"(",
")",
")",
"{",
"throw",
"new",
"ContextNotActiveException",
"(",... | Overridden method always creating a new instance
@param contextual The bean to create
@param creationalContext The creation context | [
"Overridden",
"method",
"always",
"creating",
"a",
"new",
"instance"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/contexts/unbound/DependentContextImpl.java#L65-L78 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java | TrackerMeanShiftComaniciu2003.initialize | public void initialize( T image , RectangleRotate_F32 initial ) {
this.region.set(initial);
calcHistogram.computeHistogram(image,initial);
System.arraycopy(calcHistogram.getHistogram(),0,keyHistogram,0,keyHistogram.length);
this.minimumWidth = initial.width*minimumSizeRatio;
} | java | public void initialize( T image , RectangleRotate_F32 initial ) {
this.region.set(initial);
calcHistogram.computeHistogram(image,initial);
System.arraycopy(calcHistogram.getHistogram(),0,keyHistogram,0,keyHistogram.length);
this.minimumWidth = initial.width*minimumSizeRatio;
} | [
"public",
"void",
"initialize",
"(",
"T",
"image",
",",
"RectangleRotate_F32",
"initial",
")",
"{",
"this",
".",
"region",
".",
"set",
"(",
"initial",
")",
";",
"calcHistogram",
".",
"computeHistogram",
"(",
"image",
",",
"initial",
")",
";",
"System",
"."... | Specifies the initial image to learn the target description
@param image Image
@param initial Initial image which contains the target | [
"Specifies",
"the",
"initial",
"image",
"to",
"learn",
"the",
"target",
"description"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/meanshift/TrackerMeanShiftComaniciu2003.java#L141-L147 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java | TransformerHandlerImpl.elementDecl | public void elementDecl(String name, String model) throws SAXException
{
if (DEBUG)
System.out.println("TransformerHandlerImpl#elementDecl: " + name + ", "
+ model);
if (null != m_declHandler)
{
m_declHandler.elementDecl(name, model);
}
} | java | public void elementDecl(String name, String model) throws SAXException
{
if (DEBUG)
System.out.println("TransformerHandlerImpl#elementDecl: " + name + ", "
+ model);
if (null != m_declHandler)
{
m_declHandler.elementDecl(name, model);
}
} | [
"public",
"void",
"elementDecl",
"(",
"String",
"name",
",",
"String",
"model",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"DEBUG",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"TransformerHandlerImpl#elementDecl: \"",
"+",
"name",
"+",
"\", \"",
"+",... | Report an element type declaration.
<p>The content model will consist of the string "EMPTY", the
string "ANY", or a parenthesised group, optionally followed
by an occurrence indicator. The model will be normalized so
that all whitespace is removed,and will include the enclosing
parentheses.</p>
@param name The element type name.
@param model The content model as a normalized string.
@throws SAXException The application may raise an exception. | [
"Report",
"an",
"element",
"type",
"declaration",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java#L935-L946 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java | RangeUtils.mergeTokenRanges | static List<DeepTokenRange> mergeTokenRanges(Map<String, Iterable<Comparable>> tokens,
final Session session,
final IPartitioner p) {
final Iterable<Comparable> allRanges = Ordering.natural().sortedCopy(concat(tokens.values()));
final Comparable maxValue = Ordering.natural().max(allRanges);
final Comparable minValue = (Comparable) p.minValue(maxValue.getClass()).getToken().token;
Function<Comparable, Set<DeepTokenRange>> map =
new MergeTokenRangesFunction(maxValue, minValue, session, p, allRanges);
Iterable<DeepTokenRange> concatenated = concat(transform(allRanges, map));
Set<DeepTokenRange> dedup = Sets.newHashSet(concatenated);
return Ordering.natural().sortedCopy(dedup);
} | java | static List<DeepTokenRange> mergeTokenRanges(Map<String, Iterable<Comparable>> tokens,
final Session session,
final IPartitioner p) {
final Iterable<Comparable> allRanges = Ordering.natural().sortedCopy(concat(tokens.values()));
final Comparable maxValue = Ordering.natural().max(allRanges);
final Comparable minValue = (Comparable) p.minValue(maxValue.getClass()).getToken().token;
Function<Comparable, Set<DeepTokenRange>> map =
new MergeTokenRangesFunction(maxValue, minValue, session, p, allRanges);
Iterable<DeepTokenRange> concatenated = concat(transform(allRanges, map));
Set<DeepTokenRange> dedup = Sets.newHashSet(concatenated);
return Ordering.natural().sortedCopy(dedup);
} | [
"static",
"List",
"<",
"DeepTokenRange",
">",
"mergeTokenRanges",
"(",
"Map",
"<",
"String",
",",
"Iterable",
"<",
"Comparable",
">",
">",
"tokens",
",",
"final",
"Session",
"session",
",",
"final",
"IPartitioner",
"p",
")",
"{",
"final",
"Iterable",
"<",
... | Merges the list of tokens for each cluster machine to a single list of token ranges.
@param tokens the map of tokens for each cluster machine.
@param session the connection to the cluster.
@param p the partitioner used in the cluster.
@return the merged lists of tokens transformed to DeepTokenRange(s). The returned collection is shuffled. | [
"Merges",
"the",
"list",
"of",
"tokens",
"for",
"each",
"cluster",
"machine",
"to",
"a",
"single",
"list",
"of",
"token",
"ranges",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java#L106-L122 |
apache/flink | flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/util/WebLogDataGenerator.java | WebLogDataGenerator.genDocs | private static void genDocs(int noDocs, String[] filterKeyWords, String[] words, String path) {
Random rand = new Random(Calendar.getInstance().getTimeInMillis());
try (BufferedWriter fw = new BufferedWriter(new FileWriter(path))) {
for (int i = 0; i < noDocs; i++) {
int wordsInDoc = rand.nextInt(40) + 10;
// URL
StringBuilder doc = new StringBuilder("url_" + i + "|");
for (int j = 0; j < wordsInDoc; j++) {
if (rand.nextDouble() > 0.9) {
// Approx. every 10th word is a keyword
doc.append(filterKeyWords[rand.nextInt(filterKeyWords.length)] + " ");
} else {
// Fills up the docs file(s) with random words
doc.append(words[rand.nextInt(words.length)] + " ");
}
}
doc.append("|\n");
fw.write(doc.toString());
}
} catch (IOException e) {
e.printStackTrace();
}
} | java | private static void genDocs(int noDocs, String[] filterKeyWords, String[] words, String path) {
Random rand = new Random(Calendar.getInstance().getTimeInMillis());
try (BufferedWriter fw = new BufferedWriter(new FileWriter(path))) {
for (int i = 0; i < noDocs; i++) {
int wordsInDoc = rand.nextInt(40) + 10;
// URL
StringBuilder doc = new StringBuilder("url_" + i + "|");
for (int j = 0; j < wordsInDoc; j++) {
if (rand.nextDouble() > 0.9) {
// Approx. every 10th word is a keyword
doc.append(filterKeyWords[rand.nextInt(filterKeyWords.length)] + " ");
} else {
// Fills up the docs file(s) with random words
doc.append(words[rand.nextInt(words.length)] + " ");
}
}
doc.append("|\n");
fw.write(doc.toString());
}
} catch (IOException e) {
e.printStackTrace();
}
} | [
"private",
"static",
"void",
"genDocs",
"(",
"int",
"noDocs",
",",
"String",
"[",
"]",
"filterKeyWords",
",",
"String",
"[",
"]",
"words",
",",
"String",
"path",
")",
"{",
"Random",
"rand",
"=",
"new",
"Random",
"(",
"Calendar",
".",
"getInstance",
"(",
... | Generates the files for the documents relation. The entries apply the
following format: <br />
<code>URL | Content</code>
@param noDocs
Number of entries for the documents relation
@param filterKeyWords
A list of keywords that should be contained
@param words
A list of words to fill the entries
@param path
Output path for the documents relation | [
"Generates",
"the",
"files",
"for",
"the",
"documents",
"relation",
".",
"The",
"entries",
"apply",
"the",
"following",
"format",
":",
"<br",
"/",
">",
"<code",
">",
"URL",
"|",
"Content<",
"/",
"code",
">"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/util/WebLogDataGenerator.java#L98-L124 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/Counter.java | Counter.getCounterRequestByName | public CounterRequest getCounterRequestByName(String requestName, boolean saveRequestIfAbsent) {
// l'instance de CounterRequest retournée est clonée
// (nécessaire pour protéger la synchronisation interne du counter),
// son état peut donc être lu sans synchronisation
// mais toute modification de cet état ne sera pas conservée
final String aggregateRequestName = getAggregateRequestName(requestName);
final CounterRequest request = getCounterRequestInternal(aggregateRequestName,
saveRequestIfAbsent);
synchronized (request) {
return request.clone();
}
} | java | public CounterRequest getCounterRequestByName(String requestName, boolean saveRequestIfAbsent) {
// l'instance de CounterRequest retournée est clonée
// (nécessaire pour protéger la synchronisation interne du counter),
// son état peut donc être lu sans synchronisation
// mais toute modification de cet état ne sera pas conservée
final String aggregateRequestName = getAggregateRequestName(requestName);
final CounterRequest request = getCounterRequestInternal(aggregateRequestName,
saveRequestIfAbsent);
synchronized (request) {
return request.clone();
}
} | [
"public",
"CounterRequest",
"getCounterRequestByName",
"(",
"String",
"requestName",
",",
"boolean",
"saveRequestIfAbsent",
")",
"{",
"// l'instance de CounterRequest retournée est clonée\r",
"// (nécessaire pour protéger la synchronisation interne du counter),\r",
"// son état peut donc ê... | Retourne l'objet {@link CounterRequest} correspondant au nom sans agrégation en paramètre.
@param requestName Nom de la requête sans agrégation par requestTransformPattern
@param saveRequestIfAbsent true except for current requests because the requestName may not be yet bestMatchingPattern
@return CounterRequest | [
"Retourne",
"l",
"objet",
"{"
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/Counter.java#L745-L756 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java | AbstractAttributeDefinitionBuilder.setCapabilityReference | @Deprecated
public BUILDER setCapabilityReference(String referencedCapability, String dependentCapability, boolean dynamicDependent) {
//noinspection deprecation
referenceRecorder = new CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder(referencedCapability, dependentCapability, dynamicDependent);
return (BUILDER) this;
} | java | @Deprecated
public BUILDER setCapabilityReference(String referencedCapability, String dependentCapability, boolean dynamicDependent) {
//noinspection deprecation
referenceRecorder = new CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder(referencedCapability, dependentCapability, dynamicDependent);
return (BUILDER) this;
} | [
"@",
"Deprecated",
"public",
"BUILDER",
"setCapabilityReference",
"(",
"String",
"referencedCapability",
",",
"String",
"dependentCapability",
",",
"boolean",
"dynamicDependent",
")",
"{",
"//noinspection deprecation",
"referenceRecorder",
"=",
"new",
"CapabilityReferenceReco... | Records that this attribute's value represents a reference to an instance of a
{@link org.jboss.as.controller.capability.RuntimeCapability#isDynamicallyNamed() dynamic capability}.
<p>
This method is a convenience method equivalent to calling
{@link #setCapabilityReference(CapabilityReferenceRecorder)}
passing in a {@link org.jboss.as.controller.CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder}
constructed using the parameters passed to this method.
@param referencedCapability the name of the dynamic capability the dynamic portion of whose name is
represented by the attribute's value
@param dependentCapability the name of the capability that depends on {@code referencedCapability}
@param dynamicDependent {@code true} if {@code dependentCapability} is a dynamic capability, the dynamic
portion of which comes from the name of the resource with which
the attribute is associated
@return the builder
@deprecated Use {@link #setCapabilityReference(String, RuntimeCapability)} instead. | [
"Records",
"that",
"this",
"attribute",
"s",
"value",
"represents",
"a",
"reference",
"to",
"an",
"instance",
"of",
"a",
"{",
"@link",
"org",
".",
"jboss",
".",
"as",
".",
"controller",
".",
"capability",
".",
"RuntimeCapability#isDynamicallyNamed",
"()",
"dyn... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java#L958-L963 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlMNStatement.java | SqlMNStatement.appendListOfColumns | protected List appendListOfColumns(String[] columns, StringBuffer stmt)
{
ArrayList columnList = new ArrayList();
for (int i = 0; i < columns.length; i++)
{
if (i > 0)
{
stmt.append(",");
}
stmt.append(columns[i]);
columnList.add(columns[i]);
}
return columnList;
} | java | protected List appendListOfColumns(String[] columns, StringBuffer stmt)
{
ArrayList columnList = new ArrayList();
for (int i = 0; i < columns.length; i++)
{
if (i > 0)
{
stmt.append(",");
}
stmt.append(columns[i]);
columnList.add(columns[i]);
}
return columnList;
} | [
"protected",
"List",
"appendListOfColumns",
"(",
"String",
"[",
"]",
"columns",
",",
"StringBuffer",
"stmt",
")",
"{",
"ArrayList",
"columnList",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"columns",
".",
"... | Appends to the statement a comma separated list of column names.
@param columns defines the columns to be selected (for reports)
@return list of column names | [
"Appends",
"to",
"the",
"statement",
"a",
"comma",
"separated",
"list",
"of",
"column",
"names",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlMNStatement.java#L108-L123 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/UploadCallable.java | UploadCallable.uploadInParts | private UploadResult uploadInParts() throws Exception {
boolean isUsingEncryption = s3 instanceof AmazonS3Encryption;
long optimalPartSize = getOptimalPartSize(isUsingEncryption);
try {
if (multipartUploadId == null) {
multipartUploadId = initiateMultipartUpload(origReq,
isUsingEncryption);
}
UploadPartRequestFactory requestFactory = new UploadPartRequestFactory(origReq, multipartUploadId, optimalPartSize);
if (TransferManagerUtils.isUploadParallelizable(origReq, isUsingEncryption)) {
captureUploadStateIfPossible();
uploadPartsInParallel(requestFactory, multipartUploadId);
return null;
} else {
return uploadPartsInSeries(requestFactory);
}
} catch (Exception e) {
publishProgress(listener, ProgressEventType.TRANSFER_FAILED_EVENT);
performAbortMultipartUpload();
throw e;
} finally {
if (origReq.getInputStream() != null) {
try {origReq.getInputStream().close(); } catch (Exception e) {
log.warn("Unable to cleanly close input stream: " + e.getMessage(), e);
}
}
}
} | java | private UploadResult uploadInParts() throws Exception {
boolean isUsingEncryption = s3 instanceof AmazonS3Encryption;
long optimalPartSize = getOptimalPartSize(isUsingEncryption);
try {
if (multipartUploadId == null) {
multipartUploadId = initiateMultipartUpload(origReq,
isUsingEncryption);
}
UploadPartRequestFactory requestFactory = new UploadPartRequestFactory(origReq, multipartUploadId, optimalPartSize);
if (TransferManagerUtils.isUploadParallelizable(origReq, isUsingEncryption)) {
captureUploadStateIfPossible();
uploadPartsInParallel(requestFactory, multipartUploadId);
return null;
} else {
return uploadPartsInSeries(requestFactory);
}
} catch (Exception e) {
publishProgress(listener, ProgressEventType.TRANSFER_FAILED_EVENT);
performAbortMultipartUpload();
throw e;
} finally {
if (origReq.getInputStream() != null) {
try {origReq.getInputStream().close(); } catch (Exception e) {
log.warn("Unable to cleanly close input stream: " + e.getMessage(), e);
}
}
}
} | [
"private",
"UploadResult",
"uploadInParts",
"(",
")",
"throws",
"Exception",
"{",
"boolean",
"isUsingEncryption",
"=",
"s3",
"instanceof",
"AmazonS3Encryption",
";",
"long",
"optimalPartSize",
"=",
"getOptimalPartSize",
"(",
"isUsingEncryption",
")",
";",
"try",
"{",
... | Uploads the request in multiple chunks, submitting each upload chunk task
to the thread pool and recording its corresponding Future object, as well
as the multipart upload id. | [
"Uploads",
"the",
"request",
"in",
"multiple",
"chunks",
"submitting",
"each",
"upload",
"chunk",
"task",
"to",
"the",
"thread",
"pool",
"and",
"recording",
"its",
"corresponding",
"Future",
"object",
"as",
"well",
"as",
"the",
"multipart",
"upload",
"id",
"."... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/UploadCallable.java#L172-L202 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.generateStreamCut | public CompletableFuture<StreamCutRecord> generateStreamCut(final String scope, final String stream, final StreamCutRecord previous,
final OperationContext contextOpt, String delegationToken) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, stream) : contextOpt;
return streamMetadataStore.getActiveSegments(scope, stream, context, executor)
.thenCompose(activeSegments -> Futures.allOfWithResults(activeSegments
.stream()
.parallel()
.collect(Collectors.toMap(x -> x, x -> getSegmentOffset(scope, stream, x.segmentId(), delegationToken)))))
.thenCompose(map -> {
final long generationTime = System.currentTimeMillis();
ImmutableMap.Builder<Long, Long> builder = ImmutableMap.builder();
map.forEach((key, value) -> builder.put(key.segmentId(), value));
ImmutableMap<Long, Long> streamCutMap = builder.build();
return streamMetadataStore.getSizeTillStreamCut(scope, stream, streamCutMap, Optional.ofNullable(previous), context, executor)
.thenApply(sizeTill -> new StreamCutRecord(generationTime, sizeTill, streamCutMap));
});
} | java | public CompletableFuture<StreamCutRecord> generateStreamCut(final String scope, final String stream, final StreamCutRecord previous,
final OperationContext contextOpt, String delegationToken) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, stream) : contextOpt;
return streamMetadataStore.getActiveSegments(scope, stream, context, executor)
.thenCompose(activeSegments -> Futures.allOfWithResults(activeSegments
.stream()
.parallel()
.collect(Collectors.toMap(x -> x, x -> getSegmentOffset(scope, stream, x.segmentId(), delegationToken)))))
.thenCompose(map -> {
final long generationTime = System.currentTimeMillis();
ImmutableMap.Builder<Long, Long> builder = ImmutableMap.builder();
map.forEach((key, value) -> builder.put(key.segmentId(), value));
ImmutableMap<Long, Long> streamCutMap = builder.build();
return streamMetadataStore.getSizeTillStreamCut(scope, stream, streamCutMap, Optional.ofNullable(previous), context, executor)
.thenApply(sizeTill -> new StreamCutRecord(generationTime, sizeTill, streamCutMap));
});
} | [
"public",
"CompletableFuture",
"<",
"StreamCutRecord",
">",
"generateStreamCut",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"StreamCutRecord",
"previous",
",",
"final",
"OperationContext",
"contextOpt",
",",
"String",
"delegationT... | Generate a new stream cut.
@param scope scope.
@param stream stream name.
@param contextOpt optional context
@param delegationToken token to be sent to segmentstore.
@param previous previous stream cut record
@return streamCut. | [
"Generate",
"a",
"new",
"stream",
"cut",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L336-L353 |
groovy/groovy-core | src/main/groovy/lang/IntRange.java | IntRange.subListBorders | public RangeInfo subListBorders(int size) {
if (inclusive == null) throw new IllegalStateException("Should not call subListBorders on a non-inclusive aware IntRange");
int tempFrom = from;
if (tempFrom < 0) {
tempFrom += size;
}
int tempTo = to;
if (tempTo < 0) {
tempTo += size;
}
if (tempFrom > tempTo) {
return new RangeInfo(inclusive ? tempTo : tempTo + 1, tempFrom + 1, true);
}
return new RangeInfo(tempFrom, inclusive ? tempTo + 1 : tempTo, false);
} | java | public RangeInfo subListBorders(int size) {
if (inclusive == null) throw new IllegalStateException("Should not call subListBorders on a non-inclusive aware IntRange");
int tempFrom = from;
if (tempFrom < 0) {
tempFrom += size;
}
int tempTo = to;
if (tempTo < 0) {
tempTo += size;
}
if (tempFrom > tempTo) {
return new RangeInfo(inclusive ? tempTo : tempTo + 1, tempFrom + 1, true);
}
return new RangeInfo(tempFrom, inclusive ? tempTo + 1 : tempTo, false);
} | [
"public",
"RangeInfo",
"subListBorders",
"(",
"int",
"size",
")",
"{",
"if",
"(",
"inclusive",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Should not call subListBorders on a non-inclusive aware IntRange\"",
")",
";",
"int",
"tempFrom",
"=",
"f... | A method for determining from and to information when using this IntRange to index an aggregate object of the specified size.
Normally only used internally within Groovy but useful if adding range indexing support for your own aggregates.
@param size the size of the aggregate being indexed
@return the calculated range information (with 1 added to the to value, ready for providing to subList | [
"A",
"method",
"for",
"determining",
"from",
"and",
"to",
"information",
"when",
"using",
"this",
"IntRange",
"to",
"index",
"an",
"aggregate",
"object",
"of",
"the",
"specified",
"size",
".",
"Normally",
"only",
"used",
"internally",
"within",
"Groovy",
"but"... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/IntRange.java#L197-L211 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.subscription_subscriptionType_PUT | public void subscription_subscriptionType_PUT(String subscriptionType, OvhSubscription body) throws IOException {
String qPath = "/me/subscription/{subscriptionType}";
StringBuilder sb = path(qPath, subscriptionType);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void subscription_subscriptionType_PUT(String subscriptionType, OvhSubscription body) throws IOException {
String qPath = "/me/subscription/{subscriptionType}";
StringBuilder sb = path(qPath, subscriptionType);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"subscription_subscriptionType_PUT",
"(",
"String",
"subscriptionType",
",",
"OvhSubscription",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/subscription/{subscriptionType}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Alter this object properties
REST: PUT /me/subscription/{subscriptionType}
@param body [required] New object properties
@param subscriptionType [required] The type of subscription | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2626-L2630 |
KyoriPowered/text | api/src/main/java/net/kyori/text/ScoreComponent.java | ScoreComponent.of | public static ScoreComponent of(final @NonNull String name, final @NonNull String objective) {
return of(name, objective, null);
} | java | public static ScoreComponent of(final @NonNull String name, final @NonNull String objective) {
return of(name, objective, null);
} | [
"public",
"static",
"ScoreComponent",
"of",
"(",
"final",
"@",
"NonNull",
"String",
"name",
",",
"final",
"@",
"NonNull",
"String",
"objective",
")",
"{",
"return",
"of",
"(",
"name",
",",
"objective",
",",
"null",
")",
";",
"}"
] | Creates a score component with a name and objective.
@param name the score name
@param objective the score objective
@return the score component | [
"Creates",
"a",
"score",
"component",
"with",
"a",
"name",
"and",
"objective",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/ScoreComponent.java#L84-L86 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/WatchQuery.java | WatchQuery.fillKey | @Override
public void fillKey(RowCursor cursor, Object []args)
{
_whereKraken.fillMinCursor(cursor, args);
} | java | @Override
public void fillKey(RowCursor cursor, Object []args)
{
_whereKraken.fillMinCursor(cursor, args);
} | [
"@",
"Override",
"public",
"void",
"fillKey",
"(",
"RowCursor",
"cursor",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"_whereKraken",
".",
"fillMinCursor",
"(",
"cursor",
",",
"args",
")",
";",
"}"
] | /*
@Override
public void unwatch(DatabaseWatch watch, Object... args)
{
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cursor();
RowCursor maxCursor = tableKelp.cursor();
minCursor.clear();
maxCursor.setKeyMax();
_whereKraken.fillMinCursor(minCursor, args);
_whereKraken.fillMaxCursor(minCursor, args);
QueryKelp whereKelp = _whereExpr.bind(args);
XXX: binding should be with unique
EnvKelp whereKelp = new EnvKelp(_whereKelp, args);
tableKelp.findOne(minCursor, maxCursor, whereKelp,
new FindDeleteResult(result));
_table.removeWatch(watch, minCursor.getKey());
result.completed(null);
} | [
"/",
"*",
"@Override",
"public",
"void",
"unwatch",
"(",
"DatabaseWatch",
"watch",
"Object",
"...",
"args",
")",
"{",
"TableKelp",
"tableKelp",
"=",
"_table",
".",
"getTableKelp",
"()",
";"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/WatchQuery.java#L145-L149 |
icode/ameba | src/main/java/ameba/websocket/internal/EndpointMeta.java | EndpointMeta.onOpen | @SuppressWarnings("unchecked")
public void onOpen(Session session, EndpointConfig configuration) {
for (MessageHandlerFactory f : messageHandlerFactories) {
MessageHandler handler = f.create(session);
final Class<?> handlerClass = getHandlerType(handler);
if (handler instanceof MessageHandler.Whole) { //WHOLE MESSAGE HANDLER
session.addMessageHandler(handlerClass, (MessageHandler.Whole) handler);
} else if (handler instanceof MessageHandler.Partial) { // PARTIAL MESSAGE HANDLER
session.addMessageHandler(handlerClass, (MessageHandler.Partial) handler);
}
}
if (getOnOpenHandle() != null) {
callMethod(getOnOpenHandle(), getOnOpenParameters(), session, true);
}
} | java | @SuppressWarnings("unchecked")
public void onOpen(Session session, EndpointConfig configuration) {
for (MessageHandlerFactory f : messageHandlerFactories) {
MessageHandler handler = f.create(session);
final Class<?> handlerClass = getHandlerType(handler);
if (handler instanceof MessageHandler.Whole) { //WHOLE MESSAGE HANDLER
session.addMessageHandler(handlerClass, (MessageHandler.Whole) handler);
} else if (handler instanceof MessageHandler.Partial) { // PARTIAL MESSAGE HANDLER
session.addMessageHandler(handlerClass, (MessageHandler.Partial) handler);
}
}
if (getOnOpenHandle() != null) {
callMethod(getOnOpenHandle(), getOnOpenParameters(), session, true);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"onOpen",
"(",
"Session",
"session",
",",
"EndpointConfig",
"configuration",
")",
"{",
"for",
"(",
"MessageHandlerFactory",
"f",
":",
"messageHandlerFactories",
")",
"{",
"MessageHandler",
"handle... | <p>onOpen.</p>
@param session a {@link javax.websocket.Session} object.
@param configuration a {@link javax.websocket.EndpointConfig} object. | [
"<p",
">",
"onOpen",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/websocket/internal/EndpointMeta.java#L171-L187 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.stripMargin | public static String stripMargin(CharSequence self, char marginChar) {
String s = self.toString();
if (s.length() == 0) return s;
try {
StringBuilder builder = new StringBuilder();
for (String line : readLines((CharSequence) s)) {
builder.append(stripMarginFromLine(line, marginChar));
builder.append("\n");
}
// remove the normalized ending line ending if it was not present
if (!s.endsWith("\n")) {
builder.deleteCharAt(builder.length() - 1);
}
return builder.toString();
} catch (IOException e) {
/* ignore */
}
return s;
} | java | public static String stripMargin(CharSequence self, char marginChar) {
String s = self.toString();
if (s.length() == 0) return s;
try {
StringBuilder builder = new StringBuilder();
for (String line : readLines((CharSequence) s)) {
builder.append(stripMarginFromLine(line, marginChar));
builder.append("\n");
}
// remove the normalized ending line ending if it was not present
if (!s.endsWith("\n")) {
builder.deleteCharAt(builder.length() - 1);
}
return builder.toString();
} catch (IOException e) {
/* ignore */
}
return s;
} | [
"public",
"static",
"String",
"stripMargin",
"(",
"CharSequence",
"self",
",",
"char",
"marginChar",
")",
"{",
"String",
"s",
"=",
"self",
".",
"toString",
"(",
")",
";",
"if",
"(",
"s",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"s",
";",
... | Strip leading whitespace/control characters followed by <tt>marginChar</tt> from
every line in a CharSequence.
<pre class="groovyTestCase">
assert 'ABC\n123\n456' == '''ABC
*123
*456'''.stripMargin('*')
</pre>
@param self The CharSequence to strip the margin from
@param marginChar Any character that serves as margin delimiter
@return the stripped String
@see #stripMargin(String, char)
@since 1.8.2 | [
"Strip",
"leading",
"whitespace",
"/",
"control",
"characters",
"followed",
"by",
"<tt",
">",
"marginChar<",
"/",
"tt",
">",
"from",
"every",
"line",
"in",
"a",
"CharSequence",
".",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"assert",
"ABC",
"\\",
"n123",
... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L3054-L3072 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/DefaultValueFunction.java | DefaultValueFunction.defaultValue | public static DefaultValueFunction defaultValue(Function function, Object defaultValue) {
Assert.notNull(function, "Function must not be 'null' for default value operation.");
Assert.notNull(defaultValue, "DefaultValue must not be 'null'.");
return new DefaultValueFunction(function, defaultValue);
} | java | public static DefaultValueFunction defaultValue(Function function, Object defaultValue) {
Assert.notNull(function, "Function must not be 'null' for default value operation.");
Assert.notNull(defaultValue, "DefaultValue must not be 'null'.");
return new DefaultValueFunction(function, defaultValue);
} | [
"public",
"static",
"DefaultValueFunction",
"defaultValue",
"(",
"Function",
"function",
",",
"Object",
"defaultValue",
")",
"{",
"Assert",
".",
"notNull",
"(",
"function",
",",
"\"Function must not be 'null' for default value operation.\"",
")",
";",
"Assert",
".",
"no... | Creates new {@link DefaultValueFunction} representing {@code def(function, defaultValue))}
@param function must not be null
@param defaultValue must not be null
@return | [
"Creates",
"new",
"{",
"@link",
"DefaultValueFunction",
"}",
"representing",
"{",
"@code",
"def",
"(",
"function",
"defaultValue",
"))",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/DefaultValueFunction.java#L72-L78 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MenuLoader.java | MenuLoader.requestPlaylistMenuFrom | public List<Message> requestPlaylistMenuFrom(final SlotReference slotReference, final int sortOrder)
throws Exception {
return MetadataFinder.getInstance().requestPlaylistItemsFrom(slotReference.player, slotReference.slot, sortOrder,
0, true);
} | java | public List<Message> requestPlaylistMenuFrom(final SlotReference slotReference, final int sortOrder)
throws Exception {
return MetadataFinder.getInstance().requestPlaylistItemsFrom(slotReference.player, slotReference.slot, sortOrder,
0, true);
} | [
"public",
"List",
"<",
"Message",
">",
"requestPlaylistMenuFrom",
"(",
"final",
"SlotReference",
"slotReference",
",",
"final",
"int",
"sortOrder",
")",
"throws",
"Exception",
"{",
"return",
"MetadataFinder",
".",
"getInstance",
"(",
")",
".",
"requestPlaylistItemsF... | Ask the specified player for a Playlist menu. This boils down to a call to
{@link MetadataFinder#requestPlaylistItemsFrom(int, CdjStatus.TrackSourceSlot, int, int, boolean)} asking for
the playlist folder with ID 0, but it is also made available here since this is likely where people will be
looking for the capability. To get the contents of individual playlists or sub-folders, pass the playlist or
folder ID obtained by calling this to that function.
@param slotReference the player and slot for which the menu is desired
@param sortOrder the order in which responses should be sorted, 0 for default, see Section 6.11.1 of the
<a href="https://github.com/Deep-Symmetry/dysentery/blob/master/doc/Analysis.pdf">Packet Analysis
document</a> for details
@return the playlists and folders in the playlist menu
@see MetadataFinder#requestPlaylistItemsFrom(int, CdjStatus.TrackSourceSlot, int, int, boolean)
@throws Exception if there is a problem obtaining the menu | [
"Ask",
"the",
"specified",
"player",
"for",
"a",
"Playlist",
"menu",
".",
"This",
"boils",
"down",
"to",
"a",
"call",
"to",
"{",
"@link",
"MetadataFinder#requestPlaylistItemsFrom",
"(",
"int",
"CdjStatus",
".",
"TrackSourceSlot",
"int",
"int",
"boolean",
")",
... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MenuLoader.java#L87-L92 |
centic9/commons-dost | src/main/java/org/dstadler/commons/svn/SVNCommands.java | SVNCommands.commitMergeInfo | public static void commitMergeInfo(String comment, File directory) throws IOException {
// all these additional merge-info updates on the sub-directories and items just
// clobbers the svn history, revert all those and just keep the merge-info on the root-directory
revertAllButRootDir(directory);
IOException exception = null;
for (int i = 0; i < COMMIT_RETRY_COUNT; i++) {
try {
// update once more
SVNCommands.update(directory);
// now we can commit the resulting file, alternatively we could also just commit "." here and revert everything else afterwards
CommandLine cmdLine = new CommandLine(SVN_CMD);
cmdLine.addArgument("commit");
addDefaultArguments(cmdLine, null, null);
cmdLine.addArgument("-m");
cmdLine.addArgument(comment);
//cmdLine.addArgument("."); // current dir
try (InputStream result = ExecutionHelper.getCommandResult(cmdLine, directory, 0, 120000)) {
log.info("Svn-Commit reported:\n" + IOUtils.toString(result, "UTF-8"));
}
return;
} catch (IOException e) {
// try again if we find the general error message which usually indicates that another
// check-in was made in between and we need to re-update once more
if (e.getMessage().contains("Process exited with an error: 1 (Exit value: 1)")) {
exception = e;
log.log(Level.WARNING, "Retrying merge info commit as we had an error which usually indicates that another developer checked in something: " + e.getMessage());
continue;
}
throw e;
}
}
throw exception;
} | java | public static void commitMergeInfo(String comment, File directory) throws IOException {
// all these additional merge-info updates on the sub-directories and items just
// clobbers the svn history, revert all those and just keep the merge-info on the root-directory
revertAllButRootDir(directory);
IOException exception = null;
for (int i = 0; i < COMMIT_RETRY_COUNT; i++) {
try {
// update once more
SVNCommands.update(directory);
// now we can commit the resulting file, alternatively we could also just commit "." here and revert everything else afterwards
CommandLine cmdLine = new CommandLine(SVN_CMD);
cmdLine.addArgument("commit");
addDefaultArguments(cmdLine, null, null);
cmdLine.addArgument("-m");
cmdLine.addArgument(comment);
//cmdLine.addArgument("."); // current dir
try (InputStream result = ExecutionHelper.getCommandResult(cmdLine, directory, 0, 120000)) {
log.info("Svn-Commit reported:\n" + IOUtils.toString(result, "UTF-8"));
}
return;
} catch (IOException e) {
// try again if we find the general error message which usually indicates that another
// check-in was made in between and we need to re-update once more
if (e.getMessage().contains("Process exited with an error: 1 (Exit value: 1)")) {
exception = e;
log.log(Level.WARNING, "Retrying merge info commit as we had an error which usually indicates that another developer checked in something: " + e.getMessage());
continue;
}
throw e;
}
}
throw exception;
} | [
"public",
"static",
"void",
"commitMergeInfo",
"(",
"String",
"comment",
",",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"// all these additional merge-info updates on the sub-directories and items just",
"// clobbers the svn history, revert all those and just keep the mer... | Will commit the merge info on the root branch.
<p>
Attention: This will revert all changes on the working copy except the property on the
root-dir. Be careful to not run this on a working copy with other relevant changes!
@param comment The comment to use for the commit
@param directory The local working directory
@throws IOException Execution of the SVN sub-process failed or the
sub-process returned a exit value indicating a failure | [
"Will",
"commit",
"the",
"merge",
"info",
"on",
"the",
"root",
"branch",
".",
"<p",
">",
"Attention",
":",
"This",
"will",
"revert",
"all",
"changes",
"on",
"the",
"working",
"copy",
"except",
"the",
"property",
"on",
"the",
"root",
"-",
"dir",
".",
"B... | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/svn/SVNCommands.java#L406-L444 |
talsma-ict/umldoclet | src/main/java/nl/talsmasoftware/umldoclet/rendering/writers/DelegatingWriter.java | DelegatingWriter.mergeExceptions | private IOException mergeExceptions(String actionVerb, Collection<Exception> exceptions) {
if (exceptions.size() == 1) {
Exception singleException = exceptions.iterator().next();
if (singleException instanceof RuntimeException) {
throw (RuntimeException) singleException;
} else if (singleException instanceof IOException) {
return (IOException) singleException;
}
}
IOException ioe = new IOException("Error " + actionVerb + " " + exceptions.size() + " delegate writers!");
for (Exception suppressed : exceptions) {
ioe.addSuppressed(suppressed);
}
return ioe;
} | java | private IOException mergeExceptions(String actionVerb, Collection<Exception> exceptions) {
if (exceptions.size() == 1) {
Exception singleException = exceptions.iterator().next();
if (singleException instanceof RuntimeException) {
throw (RuntimeException) singleException;
} else if (singleException instanceof IOException) {
return (IOException) singleException;
}
}
IOException ioe = new IOException("Error " + actionVerb + " " + exceptions.size() + " delegate writers!");
for (Exception suppressed : exceptions) {
ioe.addSuppressed(suppressed);
}
return ioe;
} | [
"private",
"IOException",
"mergeExceptions",
"(",
"String",
"actionVerb",
",",
"Collection",
"<",
"Exception",
">",
"exceptions",
")",
"{",
"if",
"(",
"exceptions",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"Exception",
"singleException",
"=",
"exceptions",
... | Creates a single {@link IOException} merging potentially multiple cause exceptions into it.
Having this as a separate method helps avoiding unnecessary wrapping for the 'single exception' case.
<p>
Only in case a non-<code>IO</code> checked exception or multiple exceptions occurred,
this method will create a new IOException with message <code>"Error [ACTIONVERB] delegate writer!"</code> or
<code>"Error [ACTIONVERB] N delegate writers!</code> whatever may be the case.
@param actionVerb A verb describing the action, e.g. <code>"writing"</code>, <code>"flushing"</code>
or <code>"closing"</code>.
@param exceptions The exceptions to merge into one IOException.
@return The merged IOException. | [
"Creates",
"a",
"single",
"{",
"@link",
"IOException",
"}",
"merging",
"potentially",
"multiple",
"cause",
"exceptions",
"into",
"it",
".",
"Having",
"this",
"as",
"a",
"separate",
"method",
"helps",
"avoiding",
"unnecessary",
"wrapping",
"for",
"the",
"single",... | train | https://github.com/talsma-ict/umldoclet/blob/373b23f2646603fddca4a495e9eccbb4a4491fdf/src/main/java/nl/talsmasoftware/umldoclet/rendering/writers/DelegatingWriter.java#L129-L143 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/Record.java | Record.getClosingParenthesisPosition | private int getClosingParenthesisPosition(String text, int opening)
{
if (text.charAt(opening) != '(')
{
return -1;
}
int count = 0;
for (int i = opening; i < text.length(); i++)
{
char c = text.charAt(i);
switch (c)
{
case '(':
{
++count;
break;
}
case ')':
{
--count;
if (count == 0)
{
return i;
}
break;
}
}
}
return -1;
} | java | private int getClosingParenthesisPosition(String text, int opening)
{
if (text.charAt(opening) != '(')
{
return -1;
}
int count = 0;
for (int i = opening; i < text.length(); i++)
{
char c = text.charAt(i);
switch (c)
{
case '(':
{
++count;
break;
}
case ')':
{
--count;
if (count == 0)
{
return i;
}
break;
}
}
}
return -1;
} | [
"private",
"int",
"getClosingParenthesisPosition",
"(",
"String",
"text",
",",
"int",
"opening",
")",
"{",
"if",
"(",
"text",
".",
"charAt",
"(",
"opening",
")",
"!=",
"'",
"'",
")",
"{",
"return",
"-",
"1",
";",
"}",
"int",
"count",
"=",
"0",
";",
... | Look for the closing parenthesis corresponding to the one at position
represented by the opening index.
@param text input expression
@param opening opening parenthesis index
@return closing parenthesis index | [
"Look",
"for",
"the",
"closing",
"parenthesis",
"corresponding",
"to",
"the",
"one",
"at",
"position",
"represented",
"by",
"the",
"opening",
"index",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/Record.java#L204-L236 |
m-m-m/util | cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java | AbstractCliParser.parseArgument | protected void parseArgument(CliParserState parserState, String argument, CliArgumentContainer argumentContainer, CliParameterConsumer parameterConsumer) {
CliValueContainer valueContainer = this.valueMap.getOrCreate(argumentContainer);
valueContainer.setValue(argument);
if (!valueContainer.isArrayMapOrCollection()) {
// TODO: determines on config for separator/single-value
parserState.argumentIndex++;
}
} | java | protected void parseArgument(CliParserState parserState, String argument, CliArgumentContainer argumentContainer, CliParameterConsumer parameterConsumer) {
CliValueContainer valueContainer = this.valueMap.getOrCreate(argumentContainer);
valueContainer.setValue(argument);
if (!valueContainer.isArrayMapOrCollection()) {
// TODO: determines on config for separator/single-value
parserState.argumentIndex++;
}
} | [
"protected",
"void",
"parseArgument",
"(",
"CliParserState",
"parserState",
",",
"String",
"argument",
",",
"CliArgumentContainer",
"argumentContainer",
",",
"CliParameterConsumer",
"parameterConsumer",
")",
"{",
"CliValueContainer",
"valueContainer",
"=",
"this",
".",
"v... | This method parses the value of a {@link CliOption}.
@param parserState is the {@link CliParserState}.
@param argument is the commandline parameter.
@param argumentContainer is the {@link CliArgumentContainer} for the current argument.
@param parameterConsumer is the {@link CliParameterConsumer}. | [
"This",
"method",
"parses",
"the",
"value",
"of",
"a",
"{",
"@link",
"CliOption",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/AbstractCliParser.java#L211-L219 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/style/ColorUtils.java | ColorUtils.getHexSingle | private static String getHexSingle(String hex, int colorIndex) {
validateHex(hex);
if (hex.startsWith("#")) {
hex = hex.substring(1);
}
int colorCharacters = 1;
int numColors = hex.length();
if (numColors > 4) {
colorCharacters++;
numColors /= 2;
}
String color = null;
if (colorIndex >= 0 || numColors > 3) {
if (numColors > 3) {
colorIndex++;
}
int startIndex = colorIndex;
if (colorCharacters > 1) {
startIndex *= 2;
}
color = hex.substring(startIndex, startIndex + colorCharacters);
color = expandShorthandHexSingle(color);
}
return color;
} | java | private static String getHexSingle(String hex, int colorIndex) {
validateHex(hex);
if (hex.startsWith("#")) {
hex = hex.substring(1);
}
int colorCharacters = 1;
int numColors = hex.length();
if (numColors > 4) {
colorCharacters++;
numColors /= 2;
}
String color = null;
if (colorIndex >= 0 || numColors > 3) {
if (numColors > 3) {
colorIndex++;
}
int startIndex = colorIndex;
if (colorCharacters > 1) {
startIndex *= 2;
}
color = hex.substring(startIndex, startIndex + colorCharacters);
color = expandShorthandHexSingle(color);
}
return color;
} | [
"private",
"static",
"String",
"getHexSingle",
"(",
"String",
"hex",
",",
"int",
"colorIndex",
")",
"{",
"validateHex",
"(",
"hex",
")",
";",
"if",
"(",
"hex",
".",
"startsWith",
"(",
"\"#\"",
")",
")",
"{",
"hex",
"=",
"hex",
".",
"substring",
"(",
... | Get the hex single color
@param hex
hex color
@param colorIndex
red=0, green=1, blue=2, alpha=-1
@return hex single color in format FF or null | [
"Get",
"the",
"hex",
"single",
"color"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/style/ColorUtils.java#L498-L526 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java | BoxTermsOfServiceUserStatus.getInfo | public static List<BoxTermsOfServiceUserStatus.Info> getInfo(final BoxAPIConnection api, String termsOfServiceID) {
return getInfo(api, termsOfServiceID);
} | java | public static List<BoxTermsOfServiceUserStatus.Info> getInfo(final BoxAPIConnection api, String termsOfServiceID) {
return getInfo(api, termsOfServiceID);
} | [
"public",
"static",
"List",
"<",
"BoxTermsOfServiceUserStatus",
".",
"Info",
">",
"getInfo",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"termsOfServiceID",
")",
"{",
"return",
"getInfo",
"(",
"api",
",",
"termsOfServiceID",
")",
";",
"}"
] | Retrieves a list of User Status for Terms of Service as an Iterable.
@param api the API connection to be used by the resource.
@param termsOfServiceID the ID of the terms of service.
@return the Iterable of User Status for Terms of Service. | [
"Retrieves",
"a",
"list",
"of",
"User",
"Status",
"for",
"Terms",
"of",
"Service",
"as",
"an",
"Iterable",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java#L89-L91 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/common/rdf/JRDF.java | JRDF.sameLiteral | public static boolean sameLiteral(Literal l1, Literal l2) {
URI type = l2.getDatatypeURI();
return sameLiteral(l1, l2.getLexicalForm(), type, l2.getLanguage());
} | java | public static boolean sameLiteral(Literal l1, Literal l2) {
URI type = l2.getDatatypeURI();
return sameLiteral(l1, l2.getLexicalForm(), type, l2.getLanguage());
} | [
"public",
"static",
"boolean",
"sameLiteral",
"(",
"Literal",
"l1",
",",
"Literal",
"l2",
")",
"{",
"URI",
"type",
"=",
"l2",
".",
"getDatatypeURI",
"(",
")",
";",
"return",
"sameLiteral",
"(",
"l1",
",",
"l2",
".",
"getLexicalForm",
"(",
")",
",",
"ty... | Tells whether the given literals are equivalent.
<p>
Two literals are equivalent if they have the same lexical value, language
(which may be unspecified), and datatype (which may be unspecified).
@param l1
first literal.
@param l2
second literal.
@return true if equivalent, false otherwise. | [
"Tells",
"whether",
"the",
"given",
"literals",
"are",
"equivalent",
".",
"<p",
">",
"Two",
"literals",
"are",
"equivalent",
"if",
"they",
"have",
"the",
"same",
"lexical",
"value",
"language",
"(",
"which",
"may",
"be",
"unspecified",
")",
"and",
"datatype"... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/common/rdf/JRDF.java#L86-L89 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java | JobsInner.getAsync | public Observable<JobInner> getAsync(String resourceGroupName, String workspaceName, String experimentName, String jobName) {
return getWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName, jobName).map(new Func1<ServiceResponse<JobInner>, JobInner>() {
@Override
public JobInner call(ServiceResponse<JobInner> response) {
return response.body();
}
});
} | java | public Observable<JobInner> getAsync(String resourceGroupName, String workspaceName, String experimentName, String jobName) {
return getWithServiceResponseAsync(resourceGroupName, workspaceName, experimentName, jobName).map(new Func1<ServiceResponse<JobInner>, JobInner>() {
@Override
public JobInner call(ServiceResponse<JobInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"JobInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workspaceName",
",",
"String",
"experimentName",
",",
"String",
"jobName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gets information about a Job.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
@param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
@param jobName The name of the job within the specified resource group. Job names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the JobInner object | [
"Gets",
"information",
"about",
"a",
"Job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/JobsInner.java#L813-L820 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaGraphicsResourceGetMappedPointer | public static int cudaGraphicsResourceGetMappedPointer(Pointer devPtr, long size[], cudaGraphicsResource resource)
{
return checkResult(cudaGraphicsResourceGetMappedPointerNative(devPtr, size, resource));
} | java | public static int cudaGraphicsResourceGetMappedPointer(Pointer devPtr, long size[], cudaGraphicsResource resource)
{
return checkResult(cudaGraphicsResourceGetMappedPointerNative(devPtr, size, resource));
} | [
"public",
"static",
"int",
"cudaGraphicsResourceGetMappedPointer",
"(",
"Pointer",
"devPtr",
",",
"long",
"size",
"[",
"]",
",",
"cudaGraphicsResource",
"resource",
")",
"{",
"return",
"checkResult",
"(",
"cudaGraphicsResourceGetMappedPointerNative",
"(",
"devPtr",
",",... | Get an device pointer through which to access a mapped graphics resource.
<pre>
cudaError_t cudaGraphicsResourceGetMappedPointer (
void** devPtr,
size_t* size,
cudaGraphicsResource_t resource )
</pre>
<div>
<p>Get an device pointer through which to
access a mapped graphics resource. Returns in <tt>*devPtr</tt> a
pointer through which the mapped graphics resource <tt>resource</tt>
may be accessed. Returns in <tt>*size</tt> the size of the memory in
bytes which may be accessed from that pointer. The value set in <tt>devPtr</tt> may change every time that <tt>resource</tt> is mapped.
</p>
<p>If <tt>resource</tt> is not a buffer
then it cannot be accessed via a pointer and cudaErrorUnknown is
returned. If <tt>resource</tt> is not mapped then cudaErrorUnknown is
returned. *
</p>
<div>
<span>Note:</span>
<p>Note that this
function may also return error codes from previous, asynchronous
launches.
</p>
</div>
</p>
</div>
@param devPtr Returned pointer through which resource may be accessed
@param size Returned size of the buffer accessible starting at *devPtr
@param resource Mapped resource to access
@return cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidResourceHandle,
cudaErrorUnknown
@see JCuda#cudaGraphicsMapResources
@see JCuda#cudaGraphicsSubResourceGetMappedArray | [
"Get",
"an",
"device",
"pointer",
"through",
"which",
"to",
"access",
"a",
"mapped",
"graphics",
"resource",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L11607-L11610 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.trimEnd | @Nullable
@CheckReturnValue
public static String trimEnd (@Nullable final String sSrc, @Nonnegative final int nCount)
{
if (nCount <= 0)
return sSrc;
return getLength (sSrc) <= nCount ? "" : sSrc.substring (0, sSrc.length () - nCount);
} | java | @Nullable
@CheckReturnValue
public static String trimEnd (@Nullable final String sSrc, @Nonnegative final int nCount)
{
if (nCount <= 0)
return sSrc;
return getLength (sSrc) <= nCount ? "" : sSrc.substring (0, sSrc.length () - nCount);
} | [
"@",
"Nullable",
"@",
"CheckReturnValue",
"public",
"static",
"String",
"trimEnd",
"(",
"@",
"Nullable",
"final",
"String",
"sSrc",
",",
"@",
"Nonnegative",
"final",
"int",
"nCount",
")",
"{",
"if",
"(",
"nCount",
"<=",
"0",
")",
"return",
"sSrc",
";",
"... | Trim the passed tail from the source value. If the source value does not end
with the passed tail, nothing happens.
@param sSrc
The input source string
@param nCount
The number of characters to trim at the end.
@return The trimmed string, or an empty string if nCount is ≥ the length
of the source string | [
"Trim",
"the",
"passed",
"tail",
"from",
"the",
"source",
"value",
".",
"If",
"the",
"source",
"value",
"does",
"not",
"end",
"with",
"the",
"passed",
"tail",
"nothing",
"happens",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3445-L3452 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/provider/TemporaryTokenCache.java | TemporaryTokenCache.generateTemporaryToken | public String generateTemporaryToken(String key, int secondsToLive, Object context) {
checkNotNull(key);
String token = tokenGenerator.generate();
tokenCache.put(key, Triplet.of(token, DateTime.now().plusSeconds(secondsToLive).getMillis(), context));
return token;
} | java | public String generateTemporaryToken(String key, int secondsToLive, Object context) {
checkNotNull(key);
String token = tokenGenerator.generate();
tokenCache.put(key, Triplet.of(token, DateTime.now().plusSeconds(secondsToLive).getMillis(), context));
return token;
} | [
"public",
"String",
"generateTemporaryToken",
"(",
"String",
"key",
",",
"int",
"secondsToLive",
",",
"Object",
"context",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"String",
"token",
"=",
"tokenGenerator",
".",
"generate",
"(",
")",
";",
"tokenCache",
... | Same as above but will also store a context that can be retried later. | [
"Same",
"as",
"above",
"but",
"will",
"also",
"store",
"a",
"context",
"that",
"can",
"be",
"retried",
"later",
"."
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/provider/TemporaryTokenCache.java#L54-L59 |
buschmais/jqa-javaee6-plugin | src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/JsfFaceletScannerPlugin.java | JsfFaceletScannerPlugin.absolutifyFilePath | private String absolutifyFilePath(final String path, final String referencePath) {
// can't handle EL-expressions
if (isElExpression(path)) {
return path;
}
String normalizedPath;
if (!path.startsWith("/")) {
Path reference = Paths.get(referencePath);
normalizedPath = reference.getParent().resolve(path).normalize().toString();
} else {
normalizedPath = Paths.get(path).normalize().toString();
}
return normalizeFilePath(normalizedPath);
} | java | private String absolutifyFilePath(final String path, final String referencePath) {
// can't handle EL-expressions
if (isElExpression(path)) {
return path;
}
String normalizedPath;
if (!path.startsWith("/")) {
Path reference = Paths.get(referencePath);
normalizedPath = reference.getParent().resolve(path).normalize().toString();
} else {
normalizedPath = Paths.get(path).normalize().toString();
}
return normalizeFilePath(normalizedPath);
} | [
"private",
"String",
"absolutifyFilePath",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"referencePath",
")",
"{",
"// can't handle EL-expressions",
"if",
"(",
"isElExpression",
"(",
"path",
")",
")",
"{",
"return",
"path",
";",
"}",
"String",
"normal... | <p>
Try to make an absolute path from a relative path and a reference path.
</p>
<p>
<b>Example:</b><br>
<i>path</i> - ../../a/b.jspx<br>
<i>referencePath</i> - c/d/e/f.jspx<br>
<b>Result: c/a/b.jspx</b>
</p>
@param path
the relative path
@param referencePath
the reference file path (should be absolute)
@return a path absolute path in reference to the second path. | [
"<p",
">",
"Try",
"to",
"make",
"an",
"absolute",
"path",
"from",
"a",
"relative",
"path",
"and",
"a",
"reference",
"path",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/buschmais/jqa-javaee6-plugin/blob/f5776604d9255206807e5aca90b8767bde494e14/src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/JsfFaceletScannerPlugin.java#L218-L233 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/lang/gosuc/Gosuc.java | Gosuc.main | public static void main( String[] args ) throws FileNotFoundException {
String error = GosucArg.parseArgs( args );
if( error != null ) {
System.err.println( error );
return;
}
String strFile = GosucArg.PROJECT.getValue();
Gosuc gosuc = new Gosuc( strFile, maybeGetCustomParser() );
gosuc.initializeGosu();
gosuc.compile( (String)null, Collections.singletonList( "-all" ) );
} | java | public static void main( String[] args ) throws FileNotFoundException {
String error = GosucArg.parseArgs( args );
if( error != null ) {
System.err.println( error );
return;
}
String strFile = GosucArg.PROJECT.getValue();
Gosuc gosuc = new Gosuc( strFile, maybeGetCustomParser() );
gosuc.initializeGosu();
gosuc.compile( (String)null, Collections.singletonList( "-all" ) );
} | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"FileNotFoundException",
"{",
"String",
"error",
"=",
"GosucArg",
".",
"parseArgs",
"(",
"args",
")",
";",
"if",
"(",
"error",
"!=",
"null",
")",
"{",
"System",
".",
"e... | - Then run this from IJ using 'classpath of module' setting to match the proper module for pl/pc/cc etc. (this is so the global loaders will be in the classpath) | [
"-",
"Then",
"run",
"this",
"from",
"IJ",
"using",
"classpath",
"of",
"module",
"setting",
"to",
"match",
"the",
"proper",
"module",
"for",
"pl",
"/",
"pc",
"/",
"cc",
"etc",
".",
"(",
"this",
"is",
"so",
"the",
"global",
"loaders",
"will",
"be",
"in... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/lang/gosuc/Gosuc.java#L309-L319 |
blackducksoftware/blackduck-common | src/main/java/com/synopsys/integration/blackduck/codelocation/signaturescanner/command/ScanPathsUtility.java | ScanPathsUtility.determineSignatureScannerPaths | public ScanPaths determineSignatureScannerPaths(final File directory) throws BlackDuckIntegrationException {
if (directory == null) {
throw new IllegalArgumentException("null is not a valid directory");
}
if (!directory.isDirectory()) {
throw new IllegalArgumentException(String.format("%s is not a valid directory", directory.getAbsolutePath()));
}
if (!directory.exists()) {
throw new IllegalArgumentException(String.format("%s does not exist.", directory.getAbsolutePath()));
}
boolean managedByLibrary = false;
File installDirectory = directory;
final File[] blackDuckScanInstallationDirectories = directory.listFiles(file -> ScannerZipInstaller.BLACK_DUCK_SIGNATURE_SCANNER_INSTALL_DIRECTORY.equals(file.getName()));
if (blackDuckScanInstallationDirectories.length == 1) {
logger.debug("The directory structure was likely created by the installer");
installDirectory = findFirstFilteredFile(blackDuckScanInstallationDirectories[0], EXCLUDE_NON_SCAN_CLI_DIRECTORIES_FILTER, "No scan.cli directories could be found in %s.");
managedByLibrary = true;
} else {
logger.debug(String.format("The directory structure was likely created manually - be sure the jre folder exists in: %s", installDirectory.getAbsolutePath()));
}
final String pathToJavaExecutable;
final String bdsJavaHome = intEnvironmentVariables.getValue(BDS_JAVA_HOME);
if (StringUtils.isNotBlank(bdsJavaHome)) {
pathToJavaExecutable = findPathToJavaExe(new File(bdsJavaHome));
} else {
final File jreContentsDirectory = findFirstFilteredFile(installDirectory, JRE_DIRECTORY_FILTER, "Could not find the 'jre' directory in %s.");
pathToJavaExecutable = findPathToJavaExe(jreContentsDirectory);
}
final File libDirectory = findFirstFilteredFile(installDirectory, LIB_DIRECTORY_FILTER, "Could not find the 'lib' directory in %s.");
final String pathToOneJar = findPathToStandaloneJar(libDirectory);
final String pathToScanExecutable = findPathToScanCliJar(libDirectory);
return new ScanPaths(pathToJavaExecutable, pathToOneJar, pathToScanExecutable, managedByLibrary);
} | java | public ScanPaths determineSignatureScannerPaths(final File directory) throws BlackDuckIntegrationException {
if (directory == null) {
throw new IllegalArgumentException("null is not a valid directory");
}
if (!directory.isDirectory()) {
throw new IllegalArgumentException(String.format("%s is not a valid directory", directory.getAbsolutePath()));
}
if (!directory.exists()) {
throw new IllegalArgumentException(String.format("%s does not exist.", directory.getAbsolutePath()));
}
boolean managedByLibrary = false;
File installDirectory = directory;
final File[] blackDuckScanInstallationDirectories = directory.listFiles(file -> ScannerZipInstaller.BLACK_DUCK_SIGNATURE_SCANNER_INSTALL_DIRECTORY.equals(file.getName()));
if (blackDuckScanInstallationDirectories.length == 1) {
logger.debug("The directory structure was likely created by the installer");
installDirectory = findFirstFilteredFile(blackDuckScanInstallationDirectories[0], EXCLUDE_NON_SCAN_CLI_DIRECTORIES_FILTER, "No scan.cli directories could be found in %s.");
managedByLibrary = true;
} else {
logger.debug(String.format("The directory structure was likely created manually - be sure the jre folder exists in: %s", installDirectory.getAbsolutePath()));
}
final String pathToJavaExecutable;
final String bdsJavaHome = intEnvironmentVariables.getValue(BDS_JAVA_HOME);
if (StringUtils.isNotBlank(bdsJavaHome)) {
pathToJavaExecutable = findPathToJavaExe(new File(bdsJavaHome));
} else {
final File jreContentsDirectory = findFirstFilteredFile(installDirectory, JRE_DIRECTORY_FILTER, "Could not find the 'jre' directory in %s.");
pathToJavaExecutable = findPathToJavaExe(jreContentsDirectory);
}
final File libDirectory = findFirstFilteredFile(installDirectory, LIB_DIRECTORY_FILTER, "Could not find the 'lib' directory in %s.");
final String pathToOneJar = findPathToStandaloneJar(libDirectory);
final String pathToScanExecutable = findPathToScanCliJar(libDirectory);
return new ScanPaths(pathToJavaExecutable, pathToOneJar, pathToScanExecutable, managedByLibrary);
} | [
"public",
"ScanPaths",
"determineSignatureScannerPaths",
"(",
"final",
"File",
"directory",
")",
"throws",
"BlackDuckIntegrationException",
"{",
"if",
"(",
"directory",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null is not a valid directo... | The directory can either be the directory that contains Black_Duck_Scan_Installation, or the directory that contains the bin, jre, lib (etc) directories.
@param directory
@throws BlackDuckIntegrationException | [
"The",
"directory",
"can",
"either",
"be",
"the",
"directory",
"that",
"contains",
"Black_Duck_Scan_Installation",
"or",
"the",
"directory",
"that",
"contains",
"the",
"bin",
"jre",
"lib",
"(",
"etc",
")",
"directories",
"."
] | train | https://github.com/blackducksoftware/blackduck-common/blob/4ea4e90b52b75470b71c597b65cf4e2d73887bcc/src/main/java/com/synopsys/integration/blackduck/codelocation/signaturescanner/command/ScanPathsUtility.java#L76-L115 |
mapbox/mapbox-plugins-android | plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/offline/OfflineDownloadService.java | OfflineDownloadService.onStartCommand | @Override
public int onStartCommand(final Intent intent, int flags, final int startId) {
Timber.v("onStartCommand called.");
if (intent != null) {
final OfflineDownloadOptions offlineDownload = intent.getParcelableExtra(KEY_BUNDLE);
if (offlineDownload != null) {
onResolveCommand(intent.getAction(), offlineDownload);
} else {
stopSelf(startId);
throw new NullPointerException("A DownloadOptions instance must be passed into the service to"
+ " begin downloading.");
}
}
return START_STICKY;
} | java | @Override
public int onStartCommand(final Intent intent, int flags, final int startId) {
Timber.v("onStartCommand called.");
if (intent != null) {
final OfflineDownloadOptions offlineDownload = intent.getParcelableExtra(KEY_BUNDLE);
if (offlineDownload != null) {
onResolveCommand(intent.getAction(), offlineDownload);
} else {
stopSelf(startId);
throw new NullPointerException("A DownloadOptions instance must be passed into the service to"
+ " begin downloading.");
}
}
return START_STICKY;
} | [
"@",
"Override",
"public",
"int",
"onStartCommand",
"(",
"final",
"Intent",
"intent",
",",
"int",
"flags",
",",
"final",
"int",
"startId",
")",
"{",
"Timber",
".",
"v",
"(",
"\"onStartCommand called.\"",
")",
";",
"if",
"(",
"intent",
"!=",
"null",
")",
... | Called each time a new download is initiated. First it acquires the
{@link OfflineDownloadOptions} from the intent and if found, the process of downloading the
offline region carries on to the {@link #onResolveCommand(String, OfflineDownloadOptions)}.
If the {@link OfflineDownloadOptions} fails to be found inside the intent, the service is
stopped (only if no other downloads are currently running) and throws a
{@link NullPointerException}.
<p>
{@inheritDoc}
@since 0.1.0 | [
"Called",
"each",
"time",
"a",
"new",
"download",
"is",
"initiated",
".",
"First",
"it",
"acquires",
"the",
"{",
"@link",
"OfflineDownloadOptions",
"}",
"from",
"the",
"intent",
"and",
"if",
"found",
"the",
"process",
"of",
"downloading",
"the",
"offline",
"... | train | https://github.com/mapbox/mapbox-plugins-android/blob/c683cad4d8306945d71838d96fae73b8cbe2e6c9/plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/offline/OfflineDownloadService.java#L83-L97 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.expectedCause | public static boolean expectedCause(final Exception actualException, final Collection<Class<? extends Exception>> expectedExceptions) {
checkNotNull("actualException", actualException);
if (expectedExceptions == null || expectedExceptions.size() == 0) {
// All exceptions are expected
return true;
}
final Throwable cause = actualException.getCause();
if (!(cause instanceof Exception)) {
// We're only interested in exceptions
return false;
}
return expectedException((Exception) cause, expectedExceptions);
} | java | public static boolean expectedCause(final Exception actualException, final Collection<Class<? extends Exception>> expectedExceptions) {
checkNotNull("actualException", actualException);
if (expectedExceptions == null || expectedExceptions.size() == 0) {
// All exceptions are expected
return true;
}
final Throwable cause = actualException.getCause();
if (!(cause instanceof Exception)) {
// We're only interested in exceptions
return false;
}
return expectedException((Exception) cause, expectedExceptions);
} | [
"public",
"static",
"boolean",
"expectedCause",
"(",
"final",
"Exception",
"actualException",
",",
"final",
"Collection",
"<",
"Class",
"<",
"?",
"extends",
"Exception",
">",
">",
"expectedExceptions",
")",
"{",
"checkNotNull",
"(",
"\"actualException\"",
",",
"ac... | Verifies if the cause of an exception is of a given type.
@param actualException
Actual exception that was caused by something else - Cannot be <code>null</code>.
@param expectedExceptions
Expected exceptions - May be <code>null</code> if any cause is expected.
@return TRUE if the actual exception is one of the expected exceptions. | [
"Verifies",
"if",
"the",
"cause",
"of",
"an",
"exception",
"is",
"of",
"a",
"given",
"type",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L1568-L1585 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java | MapComposedElement.insertPointAt | public final int insertPointAt(Point2D<?, ?> point, int indexGroup, int indexInGroup) {
return insertPointAt(point.getX(), point.getY(), indexGroup, indexInGroup);
} | java | public final int insertPointAt(Point2D<?, ?> point, int indexGroup, int indexInGroup) {
return insertPointAt(point.getX(), point.getY(), indexGroup, indexInGroup);
} | [
"public",
"final",
"int",
"insertPointAt",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
",",
"int",
"indexGroup",
",",
"int",
"indexInGroup",
")",
"{",
"return",
"insertPointAt",
"(",
"point",
".",
"getX",
"(",
")",
",",
"point",
".",
"getY",
"(",... | Insert the specified point at the given index in the specified group.
@param point is the point to insert
@param indexGroup is the index of the group
@param indexInGroup is the index of the ponit in the group (0 for the
first point of the group...).
@return the index of the new point in the element.
@throws IndexOutOfBoundsException in case of error. | [
"Insert",
"the",
"specified",
"point",
"at",
"the",
"given",
"index",
"in",
"the",
"specified",
"group",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java#L783-L785 |
mozilla/rhino | src/org/mozilla/classfile/ClassFileWriter.java | ClassFileWriter.addVariableDescriptor | public void addVariableDescriptor(String name, String type, int startPC, int register) {
int nameIndex = itsConstantPool.addUtf8(name);
int descriptorIndex = itsConstantPool.addUtf8(type);
int[] chunk = {nameIndex, descriptorIndex, startPC, register};
if (itsVarDescriptors == null) {
itsVarDescriptors = new ObjArray();
}
itsVarDescriptors.add(chunk);
} | java | public void addVariableDescriptor(String name, String type, int startPC, int register) {
int nameIndex = itsConstantPool.addUtf8(name);
int descriptorIndex = itsConstantPool.addUtf8(type);
int[] chunk = {nameIndex, descriptorIndex, startPC, register};
if (itsVarDescriptors == null) {
itsVarDescriptors = new ObjArray();
}
itsVarDescriptors.add(chunk);
} | [
"public",
"void",
"addVariableDescriptor",
"(",
"String",
"name",
",",
"String",
"type",
",",
"int",
"startPC",
",",
"int",
"register",
")",
"{",
"int",
"nameIndex",
"=",
"itsConstantPool",
".",
"addUtf8",
"(",
"name",
")",
";",
"int",
"descriptorIndex",
"="... | Add Information about java variable to use when generating the local variable table.
@param name variable name.
@param type variable type as bytecode descriptor string.
@param startPC the starting bytecode PC where this variable is live, or -1 if it does not have
a Java register.
@param register the Java register number of variable or -1 if it does not have a Java
register. | [
"Add",
"Information",
"about",
"java",
"variable",
"to",
"use",
"when",
"generating",
"the",
"local",
"variable",
"table",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/classfile/ClassFileWriter.java#L214-L222 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/util/LruCache.java | LruCache.putAll | public synchronized void putAll(Map<Key, Value> m) {
for (Map.Entry<Key, Value> entry : m.entrySet()) {
this.put(entry.getKey(), entry.getValue());
}
} | java | public synchronized void putAll(Map<Key, Value> m) {
for (Map.Entry<Key, Value> entry : m.entrySet()) {
this.put(entry.getKey(), entry.getValue());
}
} | [
"public",
"synchronized",
"void",
"putAll",
"(",
"Map",
"<",
"Key",
",",
"Value",
">",
"m",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Key",
",",
"Value",
">",
"entry",
":",
"m",
".",
"entrySet",
"(",
")",
")",
"{",
"this",
".",
"put",
"(... | Puts all the values from the given map into the cache.
@param m The map containing entries to put into the cache | [
"Puts",
"all",
"the",
"values",
"from",
"the",
"given",
"map",
"into",
"the",
"cache",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/util/LruCache.java#L152-L156 |
alkacon/opencms-core | src/org/opencms/xml/types/CmsXmlVfsImageValue.java | CmsXmlVfsImageValue.setDescription | public void setDescription(CmsObject cms, String description) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(description)) {
m_description = "";
if (m_element.element(PARAM_DESCRIPTION) != null) {
m_element.remove(m_element.element(PARAM_DESCRIPTION));
}
} else {
m_description = description;
description = CmsEncoder.escapeWBlanks(description, CmsEncoder.ENCODING_UTF_8);
}
setParameterValue(cms, PARAM_DESCRIPTION, description);
} | java | public void setDescription(CmsObject cms, String description) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(description)) {
m_description = "";
if (m_element.element(PARAM_DESCRIPTION) != null) {
m_element.remove(m_element.element(PARAM_DESCRIPTION));
}
} else {
m_description = description;
description = CmsEncoder.escapeWBlanks(description, CmsEncoder.ENCODING_UTF_8);
}
setParameterValue(cms, PARAM_DESCRIPTION, description);
} | [
"public",
"void",
"setDescription",
"(",
"CmsObject",
"cms",
",",
"String",
"description",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"description",
")",
")",
"{",
"m_description",
"=",
"\"\"",
";",
"if",
"(",
"m_element",
".",
... | Sets the description of the image.<p>
@param cms the current users context
@param description the description of the image | [
"Sets",
"the",
"description",
"of",
"the",
"image",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/types/CmsXmlVfsImageValue.java#L228-L240 |
elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java | GeneratorXMLDatabaseConnection.processElementUniform | private void processElementUniform(GeneratorSingleCluster cluster, Node cur) {
double min = 0.0;
double max = 1.0;
String minstr = ((Element) cur).getAttribute(ATTR_MIN);
if(minstr != null && minstr.length() > 0) {
min = ParseUtil.parseDouble(minstr);
}
String maxstr = ((Element) cur).getAttribute(ATTR_MAX);
if(maxstr != null && maxstr.length() > 0) {
max = ParseUtil.parseDouble(maxstr);
}
// *** new uniform generator
Random random = cluster.getNewRandomGenerator();
Distribution generator = new UniformDistribution(min, max, random);
cluster.addGenerator(generator);
// TODO: check for unknown attributes.
XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
while(iter.hasNext()) {
Node child = iter.next();
if(child.getNodeType() == Node.ELEMENT_NODE) {
LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
}
}
} | java | private void processElementUniform(GeneratorSingleCluster cluster, Node cur) {
double min = 0.0;
double max = 1.0;
String minstr = ((Element) cur).getAttribute(ATTR_MIN);
if(minstr != null && minstr.length() > 0) {
min = ParseUtil.parseDouble(minstr);
}
String maxstr = ((Element) cur).getAttribute(ATTR_MAX);
if(maxstr != null && maxstr.length() > 0) {
max = ParseUtil.parseDouble(maxstr);
}
// *** new uniform generator
Random random = cluster.getNewRandomGenerator();
Distribution generator = new UniformDistribution(min, max, random);
cluster.addGenerator(generator);
// TODO: check for unknown attributes.
XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
while(iter.hasNext()) {
Node child = iter.next();
if(child.getNodeType() == Node.ELEMENT_NODE) {
LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
}
}
} | [
"private",
"void",
"processElementUniform",
"(",
"GeneratorSingleCluster",
"cluster",
",",
"Node",
"cur",
")",
"{",
"double",
"min",
"=",
"0.0",
";",
"double",
"max",
"=",
"1.0",
";",
"String",
"minstr",
"=",
"(",
"(",
"Element",
")",
"cur",
")",
".",
"g... | Process a 'uniform' Element in the XML stream.
@param cluster
@param cur Current document nod | [
"Process",
"a",
"uniform",
"Element",
"in",
"the",
"XML",
"stream",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L392-L418 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/S3ObjectId.java | S3ObjectId.instructionFileId | public InstructionFileId instructionFileId(String suffix) {
String ifileKey = key + DOT;
ifileKey += (suffix == null || suffix.trim().length() == 0)
? DEFAULT_INSTRUCTION_FILE_SUFFIX
: suffix
;
return new InstructionFileId(bucket, ifileKey, versionId);
} | java | public InstructionFileId instructionFileId(String suffix) {
String ifileKey = key + DOT;
ifileKey += (suffix == null || suffix.trim().length() == 0)
? DEFAULT_INSTRUCTION_FILE_SUFFIX
: suffix
;
return new InstructionFileId(bucket, ifileKey, versionId);
} | [
"public",
"InstructionFileId",
"instructionFileId",
"(",
"String",
"suffix",
")",
"{",
"String",
"ifileKey",
"=",
"key",
"+",
"DOT",
";",
"ifileKey",
"+=",
"(",
"suffix",
"==",
"null",
"||",
"suffix",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",... | Returns the instruction file id of an instruction file with the given
suffix. | [
"Returns",
"the",
"instruction",
"file",
"id",
"of",
"an",
"instruction",
"file",
"with",
"the",
"given",
"suffix",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/S3ObjectId.java#L95-L102 |
elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/deliclu/DeLiCluTree.java | DeLiCluTree.setExpanded | public void setExpanded(SpatialEntry entry1, SpatialEntry entry2) {
IntSet exp1 = expanded.get(getPageID(entry1));
if(exp1 == null) {
exp1 = new IntOpenHashSet();
expanded.put(getPageID(entry1), exp1);
}
exp1.add(getPageID(entry2));
} | java | public void setExpanded(SpatialEntry entry1, SpatialEntry entry2) {
IntSet exp1 = expanded.get(getPageID(entry1));
if(exp1 == null) {
exp1 = new IntOpenHashSet();
expanded.put(getPageID(entry1), exp1);
}
exp1.add(getPageID(entry2));
} | [
"public",
"void",
"setExpanded",
"(",
"SpatialEntry",
"entry1",
",",
"SpatialEntry",
"entry2",
")",
"{",
"IntSet",
"exp1",
"=",
"expanded",
".",
"get",
"(",
"getPageID",
"(",
"entry1",
")",
")",
";",
"if",
"(",
"exp1",
"==",
"null",
")",
"{",
"exp1",
"... | Marks the nodes with the specified ids as expanded.
@param entry1 the first node
@param entry2 the second node | [
"Marks",
"the",
"nodes",
"with",
"the",
"specified",
"ids",
"as",
"expanded",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/deliclu/DeLiCluTree.java#L72-L79 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getSAMLAssertion | public SAMLEndpointResponse getSAMLAssertion(String usernameOrEmail, String password, String appId, String subdomain) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getSAMLAssertion(usernameOrEmail, password, appId, subdomain, null);
} | java | public SAMLEndpointResponse getSAMLAssertion(String usernameOrEmail, String password, String appId, String subdomain) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getSAMLAssertion(usernameOrEmail, password, appId, subdomain, null);
} | [
"public",
"SAMLEndpointResponse",
"getSAMLAssertion",
"(",
"String",
"usernameOrEmail",
",",
"String",
"password",
",",
"String",
"appId",
",",
"String",
"subdomain",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"r... | Generates a SAML Assertion.
@param usernameOrEmail
username or email of the OneLogin user accessing the app
@param password
Password of the OneLogin user accessing the app
@param appId
App ID of the app for which you want to generate a SAML token
@param subdomain
subdomain of the OneLogin user accessing the app
@return SAMLEndpointResponse
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOAuthProblemException is enabled
@throws URISyntaxException - if there is an error when generating the target URL at the URIBuilder constructor
@see com.onelogin.sdk.model.SAMLEndpointResponse
@see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/saml-assertions/generate-saml-assertion">Generate SAML Assertion documentation</a> | [
"Generates",
"a",
"SAML",
"Assertion",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2453-L2455 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java | Partition.createRangePartition | static Partition createRangePartition(SqlgGraph sqlgGraph, AbstractLabel abstractLabel, String name, String from, String to) {
Preconditions.checkArgument(!abstractLabel.getSchema().isSqlgSchema(), "createRangePartition may not be called for \"%s\"", Topology.SQLG_SCHEMA);
Partition partition = new Partition(sqlgGraph, abstractLabel, name, from, to, PartitionType.NONE, null);
partition.createRangePartitionOnDb();
if (abstractLabel instanceof VertexLabel) {
TopologyManager.addVertexLabelPartition(
sqlgGraph,
abstractLabel.getSchema().getName(),
abstractLabel.getName(),
name,
from,
to,
PartitionType.NONE,
null);
} else {
TopologyManager.addEdgeLabelPartition(sqlgGraph, abstractLabel, name, from, to, PartitionType.NONE, null);
}
partition.committed = false;
return partition;
} | java | static Partition createRangePartition(SqlgGraph sqlgGraph, AbstractLabel abstractLabel, String name, String from, String to) {
Preconditions.checkArgument(!abstractLabel.getSchema().isSqlgSchema(), "createRangePartition may not be called for \"%s\"", Topology.SQLG_SCHEMA);
Partition partition = new Partition(sqlgGraph, abstractLabel, name, from, to, PartitionType.NONE, null);
partition.createRangePartitionOnDb();
if (abstractLabel instanceof VertexLabel) {
TopologyManager.addVertexLabelPartition(
sqlgGraph,
abstractLabel.getSchema().getName(),
abstractLabel.getName(),
name,
from,
to,
PartitionType.NONE,
null);
} else {
TopologyManager.addEdgeLabelPartition(sqlgGraph, abstractLabel, name, from, to, PartitionType.NONE, null);
}
partition.committed = false;
return partition;
} | [
"static",
"Partition",
"createRangePartition",
"(",
"SqlgGraph",
"sqlgGraph",
",",
"AbstractLabel",
"abstractLabel",
",",
"String",
"name",
",",
"String",
"from",
",",
"String",
"to",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"abstractLabel",
".",... | Create a range partition on an {@link AbstractLabel}
@param sqlgGraph
@param abstractLabel
@param name
@param from
@param to
@return | [
"Create",
"a",
"range",
"partition",
"on",
"an",
"{",
"@link",
"AbstractLabel",
"}"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/Partition.java#L194-L213 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/model/handler/XmlModelHandler.java | XmlModelHandler.initModelIF | public Object initModelIF(EventModel em, ModelForm form, ServletContext scontext) throws Exception {
Object result = null;
try {
HandlerMetaDef hm = this.modelMapping.getHandlerMetaDef();
String serviceName = hm.getServiceRef();
Debug.logVerbose("[JdonFramework] construct the CRUD method for the service:" + serviceName, module);
MethodMetaArgs methodMetaArgs = maFactory.createinitMethod(hm, em);
AppContextWrapper acw = new ServletContextWrapper(scontext);
Service service = serviceFacade.getService(acw);
if (methodMetaArgs != null)
result = service.execute(serviceName, methodMetaArgs, acw);
} catch (Exception e) {
Debug.logError("[JdonFramework] initModel error: " + e, module);
throw new Exception(e);
}
return result;
} | java | public Object initModelIF(EventModel em, ModelForm form, ServletContext scontext) throws Exception {
Object result = null;
try {
HandlerMetaDef hm = this.modelMapping.getHandlerMetaDef();
String serviceName = hm.getServiceRef();
Debug.logVerbose("[JdonFramework] construct the CRUD method for the service:" + serviceName, module);
MethodMetaArgs methodMetaArgs = maFactory.createinitMethod(hm, em);
AppContextWrapper acw = new ServletContextWrapper(scontext);
Service service = serviceFacade.getService(acw);
if (methodMetaArgs != null)
result = service.execute(serviceName, methodMetaArgs, acw);
} catch (Exception e) {
Debug.logError("[JdonFramework] initModel error: " + e, module);
throw new Exception(e);
}
return result;
} | [
"public",
"Object",
"initModelIF",
"(",
"EventModel",
"em",
",",
"ModelForm",
"form",
",",
"ServletContext",
"scontext",
")",
"throws",
"Exception",
"{",
"Object",
"result",
"=",
"null",
";",
"try",
"{",
"HandlerMetaDef",
"hm",
"=",
"this",
".",
"modelMapping"... | if your application need initialize the ModelForm, this method is a
option. extends thie method. | [
"if",
"your",
"application",
"need",
"initialize",
"the",
"ModelForm",
"this",
"method",
"is",
"a",
"option",
".",
"extends",
"thie",
"method",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/model/handler/XmlModelHandler.java#L142-L158 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/CmsGalleryTreeItem.java | CmsGalleryTreeItem.showGallery | protected void showGallery(CmsClientSitemapEntry entry) {
CmsGalleryConfiguration configuration = new CmsGalleryConfiguration();
List<String> typeNames = CmsSitemapView.getInstance().getController().getGalleryType(
new Integer(entry.getResourceTypeId())).getContentTypeNames();
configuration.setSearchTypes(typeNames);
configuration.setResourceTypes(typeNames);
configuration.setGalleryMode(GalleryMode.adeView);
configuration.setGalleryStoragePrefix("" + GalleryMode.adeView);
configuration.setTabConfiguration(CmsGalleryTabConfiguration.resolve("selectDoc"));
configuration.setReferencePath(getSitePath());
configuration.setGalleryPath(getSitePath());
CmsGalleryPopup dialog = new CmsGalleryPopup(null, configuration);
dialog.center();
} | java | protected void showGallery(CmsClientSitemapEntry entry) {
CmsGalleryConfiguration configuration = new CmsGalleryConfiguration();
List<String> typeNames = CmsSitemapView.getInstance().getController().getGalleryType(
new Integer(entry.getResourceTypeId())).getContentTypeNames();
configuration.setSearchTypes(typeNames);
configuration.setResourceTypes(typeNames);
configuration.setGalleryMode(GalleryMode.adeView);
configuration.setGalleryStoragePrefix("" + GalleryMode.adeView);
configuration.setTabConfiguration(CmsGalleryTabConfiguration.resolve("selectDoc"));
configuration.setReferencePath(getSitePath());
configuration.setGalleryPath(getSitePath());
CmsGalleryPopup dialog = new CmsGalleryPopup(null, configuration);
dialog.center();
} | [
"protected",
"void",
"showGallery",
"(",
"CmsClientSitemapEntry",
"entry",
")",
"{",
"CmsGalleryConfiguration",
"configuration",
"=",
"new",
"CmsGalleryConfiguration",
"(",
")",
";",
"List",
"<",
"String",
">",
"typeNames",
"=",
"CmsSitemapView",
".",
"getInstance",
... | Shows the gallery dialog for the given entry.<p>
@param entry the gallery folder entry | [
"Shows",
"the",
"gallery",
"dialog",
"for",
"the",
"given",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/CmsGalleryTreeItem.java#L188-L202 |
haifengl/smile | core/src/main/java/smile/association/FPGrowth.java | FPGrowth.getLocalFPTree | private FPTree getLocalFPTree(FPTree.Node node, int[] localItemSupport, int[] prefixItemset) {
FPTree tree = new FPTree(localItemSupport, minSupport);
while (node != null) {
Node parent = node.parent;
int i = prefixItemset.length;
while (parent != null) {
if (localItemSupport[parent.id] >= minSupport) {
prefixItemset[--i] = parent.id;
}
parent = parent.parent;
}
if (i < prefixItemset.length) {
tree.add(i, prefixItemset.length, prefixItemset, node.count);
}
node = node.next;
}
return tree;
} | java | private FPTree getLocalFPTree(FPTree.Node node, int[] localItemSupport, int[] prefixItemset) {
FPTree tree = new FPTree(localItemSupport, minSupport);
while (node != null) {
Node parent = node.parent;
int i = prefixItemset.length;
while (parent != null) {
if (localItemSupport[parent.id] >= minSupport) {
prefixItemset[--i] = parent.id;
}
parent = parent.parent;
}
if (i < prefixItemset.length) {
tree.add(i, prefixItemset.length, prefixItemset, node.count);
}
node = node.next;
}
return tree;
} | [
"private",
"FPTree",
"getLocalFPTree",
"(",
"FPTree",
".",
"Node",
"node",
",",
"int",
"[",
"]",
"localItemSupport",
",",
"int",
"[",
"]",
"prefixItemset",
")",
"{",
"FPTree",
"tree",
"=",
"new",
"FPTree",
"(",
"localItemSupport",
",",
"minSupport",
")",
"... | Generates a local FP tree
@param node the conditional patterns given this node to construct the local FP-tree.
@rerurn the local FP-tree. | [
"Generates",
"a",
"local",
"FP",
"tree"
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/FPGrowth.java#L444-L464 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/Assert.java | Assert.isTimeZone | public static void isTimeZone(String beginTime, String endTime, String format) {
DateUtil.parse(beginTime, format);
DateUtil.parse(endTime, format);
if (beginTime.compareTo(endTime) > 0) {
throw new IllegalArgumentException("开始时间必须小于结束时间");
}
} | java | public static void isTimeZone(String beginTime, String endTime, String format) {
DateUtil.parse(beginTime, format);
DateUtil.parse(endTime, format);
if (beginTime.compareTo(endTime) > 0) {
throw new IllegalArgumentException("开始时间必须小于结束时间");
}
} | [
"public",
"static",
"void",
"isTimeZone",
"(",
"String",
"beginTime",
",",
"String",
"endTime",
",",
"String",
"format",
")",
"{",
"DateUtil",
".",
"parse",
"(",
"beginTime",
",",
"format",
")",
";",
"DateUtil",
".",
"parse",
"(",
"endTime",
",",
"format",... | 断言给定时间是一个正确的时间段(即开始时间小于结束时间)
@param beginTime 开始时间
@param endTime 结束时间
@param format 时间格式 | [
"断言给定时间是一个正确的时间段(即开始时间小于结束时间)"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/Assert.java#L36-L42 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/HttpHeader.java | HttpHeader.addHeader | public void addHeader(String name, String val) {
mMsgHeader = mMsgHeader + name + ": " + val + mLineDelimiter;
addInternalHeaderFields(name, val);
} | java | public void addHeader(String name, String val) {
mMsgHeader = mMsgHeader + name + ": " + val + mLineDelimiter;
addInternalHeaderFields(name, val);
} | [
"public",
"void",
"addHeader",
"(",
"String",
"name",
",",
"String",
"val",
")",
"{",
"mMsgHeader",
"=",
"mMsgHeader",
"+",
"name",
"+",
"\": \"",
"+",
"val",
"+",
"mLineDelimiter",
";",
"addInternalHeaderFields",
"(",
"name",
",",
"val",
")",
";",
"}"
] | Add a header with the name and value given. It will be appended to the
header string.
@param name
@param val | [
"Add",
"a",
"header",
"with",
"the",
"name",
"and",
"value",
"given",
".",
"It",
"will",
"be",
"appended",
"to",
"the",
"header",
"string",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/HttpHeader.java#L238-L241 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_hotfix.java | xen_hotfix.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_hotfix_responses result = (xen_hotfix_responses) service.get_payload_formatter().string_to_resource(xen_hotfix_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
service.clear_session();
throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_hotfix_response_array);
}
xen_hotfix[] result_xen_hotfix = new xen_hotfix[result.xen_hotfix_response_array.length];
for(int i = 0; i < result.xen_hotfix_response_array.length; i++)
{
result_xen_hotfix[i] = result.xen_hotfix_response_array[i].xen_hotfix[0];
}
return result_xen_hotfix;
} | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_hotfix_responses result = (xen_hotfix_responses) service.get_payload_formatter().string_to_resource(xen_hotfix_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NOT_EXISTS)
service.clear_session();
throw new nitro_exception(result.message, result.errorcode, (base_response [])result.xen_hotfix_response_array);
}
xen_hotfix[] result_xen_hotfix = new xen_hotfix[result.xen_hotfix_response_array.length];
for(int i = 0; i < result.xen_hotfix_response_array.length; i++)
{
result_xen_hotfix[i] = result.xen_hotfix_response_array[i].xen_hotfix[0];
}
return result_xen_hotfix;
} | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_hotfix_responses",
"result",
"=",
"(",
"xen_hotfix_responses",
")",
"service",
".",
"get_payload_formatte... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_hotfix.java#L319-L336 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/NotificationsApi.java | NotificationsApi.notificationsSubscribeWithHttpInfo | public ApiResponse<Void> notificationsSubscribeWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsSubscribeValidateBeforeCall(null, null);
return apiClient.execute(call);
} | java | public ApiResponse<Void> notificationsSubscribeWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = notificationsSubscribeValidateBeforeCall(null, null);
return apiClient.execute(call);
} | [
"public",
"ApiResponse",
"<",
"Void",
">",
"notificationsSubscribeWithHttpInfo",
"(",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"call",
"=",
"notificationsSubscribeValidateBeforeCall",
"(",
"null",
",",
"null",
")",
";... | Subscribe to CometD channel notification
See the [CometD documentation](https://docs.cometd.org/current/reference/#_bayeux_meta_subscribe) for details. For a list of all available channels, see the [CometD section](/reference/workspace/index.html) in the Workspace API overview.
@return ApiResponse<Void>
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Subscribe",
"to",
"CometD",
"channel",
"notification",
"See",
"the",
"[",
"CometD",
"documentation",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"cometd",
".",
"org",
"/",
"current",
"/",
"reference",
"/",
"#_bayeux_meta_subscribe",
")",
"for",
"details",
".... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/NotificationsApi.java#L564-L567 |
omise/omise-java | src/main/java/co/omise/Serializer.java | Serializer.deserializeFromMap | public <T extends OmiseObject> T deserializeFromMap(Map<String, Object> map, Class<T> klass) {
return objectMapper.convertValue(map, klass);
} | java | public <T extends OmiseObject> T deserializeFromMap(Map<String, Object> map, Class<T> klass) {
return objectMapper.convertValue(map, klass);
} | [
"public",
"<",
"T",
"extends",
"OmiseObject",
">",
"T",
"deserializeFromMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"Class",
"<",
"T",
">",
"klass",
")",
"{",
"return",
"objectMapper",
".",
"convertValue",
"(",
"map",
",",
"klass",
... | Deserialize an instance of the given class from the map.
@param map The {@link Map} containing the JSON structure to deserialize from.
@param klass The {@link Class} to deserialize the result into.
@param <T> The type to deserialize the result into.
@return An instance of type T deserialized from the map. | [
"Deserialize",
"an",
"instance",
"of",
"the",
"given",
"class",
"from",
"the",
"map",
"."
] | train | https://github.com/omise/omise-java/blob/95aafc5e8c21b44e6d00a5a9080b9e353fe98042/src/main/java/co/omise/Serializer.java#L140-L142 |
apache/groovy | subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java | DateTimeExtensions.toZoneOffset | public static ZoneOffset toZoneOffset(final TimeZone self, Instant instant) {
return self.toZoneId().getRules().getOffset(instant);
} | java | public static ZoneOffset toZoneOffset(final TimeZone self, Instant instant) {
return self.toZoneId().getRules().getOffset(instant);
} | [
"public",
"static",
"ZoneOffset",
"toZoneOffset",
"(",
"final",
"TimeZone",
"self",
",",
"Instant",
"instant",
")",
"{",
"return",
"self",
".",
"toZoneId",
"(",
")",
".",
"getRules",
"(",
")",
".",
"getOffset",
"(",
"instant",
")",
";",
"}"
] | Converts this TimeZone to a corresponding {@link java.time.ZoneOffset}. The offset is determined
using the date/time of specified Instant.
@param self a TimeZone
@return a ZoneOffset
@since 2.5.0 | [
"Converts",
"this",
"TimeZone",
"to",
"a",
"corresponding",
"{",
"@link",
"java",
".",
"time",
".",
"ZoneOffset",
"}",
".",
"The",
"offset",
"is",
"determined",
"using",
"the",
"date",
"/",
"time",
"of",
"specified",
"Instant",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-datetime/src/main/java/org/apache/groovy/datetime/extensions/DateTimeExtensions.java#L2416-L2418 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.removeNumericRefinement | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher removeNumericRefinement(@NonNull NumericRefinement refinement) {
if (refinement.operator == NumericRefinement.OPERATOR_UNKNOWN) {
numericRefinements.remove(refinement.attribute);
} else {
NumericRefinement.checkOperatorIsValid(refinement.operator);
final SparseArray<NumericRefinement> attributeRefinements = numericRefinements.get(refinement.attribute);
if (attributeRefinements != null) {
attributeRefinements.remove(refinement.operator);
}
}
rebuildQueryNumericFilters();
EventBus.getDefault().post(new NumericRefinementEvent(this, Operation.REMOVE, refinement));
return this;
} | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher removeNumericRefinement(@NonNull NumericRefinement refinement) {
if (refinement.operator == NumericRefinement.OPERATOR_UNKNOWN) {
numericRefinements.remove(refinement.attribute);
} else {
NumericRefinement.checkOperatorIsValid(refinement.operator);
final SparseArray<NumericRefinement> attributeRefinements = numericRefinements.get(refinement.attribute);
if (attributeRefinements != null) {
attributeRefinements.remove(refinement.operator);
}
}
rebuildQueryNumericFilters();
EventBus.getDefault().post(new NumericRefinementEvent(this, Operation.REMOVE, refinement));
return this;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"removeNumericRefinement",
"(",
"@",
"NonNull",
"NumericRefinement",
"refinement",
")",
"{",
"if",
"(",
"refinement",
".",
"operator",
"... | Removes the given numeric refinement for the next queries.
@param refinement a description of the refinement to remove.
@return this {@link Searcher} for chaining. | [
"Removes",
"the",
"given",
"numeric",
"refinement",
"for",
"the",
"next",
"queries",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L742-L756 |
krotscheck/data-file-reader | data-file-reader-csv/src/main/java/net/krotscheck/dfr/csv/CSVDataEncoder.java | CSVDataEncoder.writeToOutput | @Override
protected void writeToOutput(final Map<String, Object> row)
throws IOException {
if (writer == null) {
CsvMapper mapper = new CsvMapper();
mapper.disable(SerializationFeature.CLOSE_CLOSEABLE);
mapper.getFactory()
.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET,
false);
CsvSchema schema = buildCsvSchema(row);
writer = mapper.writer(schema);
writer.writeValue(getWriter(), row.keySet());
}
writer.writeValue(getWriter(), row.values());
} | java | @Override
protected void writeToOutput(final Map<String, Object> row)
throws IOException {
if (writer == null) {
CsvMapper mapper = new CsvMapper();
mapper.disable(SerializationFeature.CLOSE_CLOSEABLE);
mapper.getFactory()
.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET,
false);
CsvSchema schema = buildCsvSchema(row);
writer = mapper.writer(schema);
writer.writeValue(getWriter(), row.keySet());
}
writer.writeValue(getWriter(), row.values());
} | [
"@",
"Override",
"protected",
"void",
"writeToOutput",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"row",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"CsvMapper",
"mapper",
"=",
"new",
"CsvMapper",
"(",
")"... | Write a row to the destination.
@param row The row to write.
@throws java.io.IOException Exception thrown when there's problems
writing to the output. | [
"Write",
"a",
"row",
"to",
"the",
"destination",
"."
] | train | https://github.com/krotscheck/data-file-reader/blob/b9a85bd07dc9f9b8291ffbfb6945443d96371811/data-file-reader-csv/src/main/java/net/krotscheck/dfr/csv/CSVDataEncoder.java#L47-L61 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java | FileWriterServices.copyResourceToClassesOutput | public void copyResourceToClassesOutput(String path, String filename) {
String fullpath = path + ProcessorConstants.SEPARATORCHAR + filename;
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript copy js : " + fullpath + " to : class dir");
try (Writer writer = getFileObjectWriterInClassOutput("", filename)) {
bodyWriter.write(writer, OcelotProcessor.class.getResourceAsStream(fullpath));
} catch (IOException ex) {
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " FAILED TO CREATE : " + fullpath + " : " + ex.getMessage());
}
} | java | public void copyResourceToClassesOutput(String path, String filename) {
String fullpath = path + ProcessorConstants.SEPARATORCHAR + filename;
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript copy js : " + fullpath + " to : class dir");
try (Writer writer = getFileObjectWriterInClassOutput("", filename)) {
bodyWriter.write(writer, OcelotProcessor.class.getResourceAsStream(fullpath));
} catch (IOException ex) {
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " FAILED TO CREATE : " + fullpath + " : " + ex.getMessage());
}
} | [
"public",
"void",
"copyResourceToClassesOutput",
"(",
"String",
"path",
",",
"String",
"filename",
")",
"{",
"String",
"fullpath",
"=",
"path",
"+",
"ProcessorConstants",
".",
"SEPARATORCHAR",
"+",
"filename",
";",
"messager",
".",
"printMessage",
"(",
"Diagnostic... | Copy path/filename, from jar ocelot-processor in classes directory of current project/module
@param path
@param filename | [
"Copy",
"path",
"/",
"filename",
"from",
"jar",
"ocelot",
"-",
"processor",
"in",
"classes",
"directory",
"of",
"current",
"project",
"/",
"module"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java#L40-L48 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_envVar_GET | public ArrayList<String> serviceName_envVar_GET(String serviceName, net.minidev.ovh.api.hosting.web.envvar.OvhTypeEnum type) throws IOException {
String qPath = "/hosting/web/{serviceName}/envVar";
StringBuilder sb = path(qPath, serviceName);
query(sb, "type", type);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t1);
} | java | public ArrayList<String> serviceName_envVar_GET(String serviceName, net.minidev.ovh.api.hosting.web.envvar.OvhTypeEnum type) throws IOException {
String qPath = "/hosting/web/{serviceName}/envVar";
StringBuilder sb = path(qPath, serviceName);
query(sb, "type", type);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t1);
} | [
"public",
"ArrayList",
"<",
"String",
">",
"serviceName_envVar_GET",
"(",
"String",
"serviceName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"hosting",
".",
"web",
".",
"envvar",
".",
"OvhTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
... | Environment variables set on your webhosting
REST: GET /hosting/web/{serviceName}/envVar
@param type [required] Filter the value of type property (=)
@param serviceName [required] The internal name of your hosting | [
"Environment",
"variables",
"set",
"on",
"your",
"webhosting"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1814-L1820 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/externallink/CmsEditExternalLinkDialog.java | CmsEditExternalLinkDialog.initContent | protected void initContent(CmsExternalLinkInfoBean linkInfo) {
CmsPushButton closeButton = new CmsPushButton();
closeButton.setText(Messages.get().key(Messages.GUI_CANCEL_0));
closeButton.setUseMinWidth(true);
closeButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.BLUE);
closeButton.addClickHandler(new ClickHandler() {
/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/
public void onClick(ClickEvent event) {
hide();
}
});
addButton(closeButton);
m_okButton = new CmsPushButton();
m_okButton.setText(Messages.get().key(Messages.GUI_OK_0));
m_okButton.setUseMinWidth(true);
m_okButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.RED);
m_okButton.addClickHandler(new ClickHandler() {
/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/
public void onClick(ClickEvent event) {
onOk();
}
});
addButton(m_okButton);
m_linkInfo = linkInfo;
m_previousLink = m_linkInfo.getLink() != null ? m_linkInfo.getLink() : "";
m_previousTitle = m_linkInfo.getTitle() != null ? m_linkInfo.getTitle() : "";
m_dialogContent = new CmsFieldsetFormFieldPanel(m_linkInfo, null);
m_dialogContent.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().highTextBoxes());
m_dialogContent.getFieldSet().setOpenerVisible(false);
m_dialogContent.getFieldSet().getElement().getStyle().setMarginTop(4, Style.Unit.PX);
setMainContent(m_dialogContent);
if (m_isCreateNew) {
m_fileName = new CmsTextBox();
m_fileName.setTriggerChangeOnKeyPress(true);
m_fileName.addValueChangeHandler(this);
addInputRow(Messages.get().key(Messages.GUI_EDIT_LINK_LABEL_FILE_NAME_0), m_fileName);
}
m_linkTitle = new CmsTextBox();
m_linkTitle.setFormValueAsString(m_previousTitle);
m_linkTitle.setTriggerChangeOnKeyPress(true);
m_linkTitle.addValueChangeHandler(this);
addInputRow(Messages.get().key(Messages.GUI_EDIT_LINK_LABEL_TITLE_0), m_linkTitle);
m_linkContent = new CmsTextBox();
m_linkContent.setFormValueAsString(m_previousLink);
m_linkContent.setTriggerChangeOnKeyPress(true);
m_linkContent.addValueChangeHandler(this);
addInputRow(Messages.get().key(Messages.GUI_EDIT_LINK_LABEL_LINK_0), m_linkContent);
addDialogClose(null);
setOkEnabled(
false,
m_isCreateNew
? Messages.get().key(Messages.GUI_EDIT_LINK_NO_FILE_NAME_0)
: Messages.get().key(Messages.GUI_EDIT_LINK_NO_CHANGES_0));
m_dialogContent.truncate(METRICS_KEY, CmsPopup.DEFAULT_WIDTH - 20);
} | java | protected void initContent(CmsExternalLinkInfoBean linkInfo) {
CmsPushButton closeButton = new CmsPushButton();
closeButton.setText(Messages.get().key(Messages.GUI_CANCEL_0));
closeButton.setUseMinWidth(true);
closeButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.BLUE);
closeButton.addClickHandler(new ClickHandler() {
/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/
public void onClick(ClickEvent event) {
hide();
}
});
addButton(closeButton);
m_okButton = new CmsPushButton();
m_okButton.setText(Messages.get().key(Messages.GUI_OK_0));
m_okButton.setUseMinWidth(true);
m_okButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.RED);
m_okButton.addClickHandler(new ClickHandler() {
/**
* @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
*/
public void onClick(ClickEvent event) {
onOk();
}
});
addButton(m_okButton);
m_linkInfo = linkInfo;
m_previousLink = m_linkInfo.getLink() != null ? m_linkInfo.getLink() : "";
m_previousTitle = m_linkInfo.getTitle() != null ? m_linkInfo.getTitle() : "";
m_dialogContent = new CmsFieldsetFormFieldPanel(m_linkInfo, null);
m_dialogContent.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().highTextBoxes());
m_dialogContent.getFieldSet().setOpenerVisible(false);
m_dialogContent.getFieldSet().getElement().getStyle().setMarginTop(4, Style.Unit.PX);
setMainContent(m_dialogContent);
if (m_isCreateNew) {
m_fileName = new CmsTextBox();
m_fileName.setTriggerChangeOnKeyPress(true);
m_fileName.addValueChangeHandler(this);
addInputRow(Messages.get().key(Messages.GUI_EDIT_LINK_LABEL_FILE_NAME_0), m_fileName);
}
m_linkTitle = new CmsTextBox();
m_linkTitle.setFormValueAsString(m_previousTitle);
m_linkTitle.setTriggerChangeOnKeyPress(true);
m_linkTitle.addValueChangeHandler(this);
addInputRow(Messages.get().key(Messages.GUI_EDIT_LINK_LABEL_TITLE_0), m_linkTitle);
m_linkContent = new CmsTextBox();
m_linkContent.setFormValueAsString(m_previousLink);
m_linkContent.setTriggerChangeOnKeyPress(true);
m_linkContent.addValueChangeHandler(this);
addInputRow(Messages.get().key(Messages.GUI_EDIT_LINK_LABEL_LINK_0), m_linkContent);
addDialogClose(null);
setOkEnabled(
false,
m_isCreateNew
? Messages.get().key(Messages.GUI_EDIT_LINK_NO_FILE_NAME_0)
: Messages.get().key(Messages.GUI_EDIT_LINK_NO_CHANGES_0));
m_dialogContent.truncate(METRICS_KEY, CmsPopup.DEFAULT_WIDTH - 20);
} | [
"protected",
"void",
"initContent",
"(",
"CmsExternalLinkInfoBean",
"linkInfo",
")",
"{",
"CmsPushButton",
"closeButton",
"=",
"new",
"CmsPushButton",
"(",
")",
";",
"closeButton",
".",
"setText",
"(",
"Messages",
".",
"get",
"(",
")",
".",
"key",
"(",
"Messag... | Initializes the dialog content.<p>
@param linkInfo the link info bean | [
"Initializes",
"the",
"dialog",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/externallink/CmsEditExternalLinkDialog.java#L237-L304 |
jcuda/jcurand | JCurandJava/src/main/java/jcuda/jcurand/JCurand.java | JCurand.curandGenerateUniformDouble | public static int curandGenerateUniformDouble(curandGenerator generator, Pointer outputPtr, long num)
{
return checkResult(curandGenerateUniformDoubleNative(generator, outputPtr, num));
} | java | public static int curandGenerateUniformDouble(curandGenerator generator, Pointer outputPtr, long num)
{
return checkResult(curandGenerateUniformDoubleNative(generator, outputPtr, num));
} | [
"public",
"static",
"int",
"curandGenerateUniformDouble",
"(",
"curandGenerator",
"generator",
",",
"Pointer",
"outputPtr",
",",
"long",
"num",
")",
"{",
"return",
"checkResult",
"(",
"curandGenerateUniformDoubleNative",
"(",
"generator",
",",
"outputPtr",
",",
"num",... | <pre>
Generate uniformly distributed doubles.
Use generator to generate num double results into the device memory at
outputPtr. The device memory must have been previously allocated and be
large enough to hold all the results. Launches are done with the stream
set using ::curandSetStream(), or the null stream if no stream has been set.
Results are 64-bit double precision floating point values between
0.0 and 1.0, excluding 0.0 and including 1.0.
@param generator - Generator to use
@param outputPtr - Pointer to device memory to store CUDA-generated results, or
Pointer to host memory to store CPU-generated results
@param num - Number of doubles to generate
@return
CURAND_STATUS_NOT_INITIALIZED if the generator was never created
CURAND_STATUS_PREEXISTING_FAILURE if there was an existing error from
a previous kernel launch
CURAND_STATUS_LAUNCH_FAILURE if the kernel launch failed for any reason
CURAND_STATUS_LENGTH_NOT_MULTIPLE if the number of output samples is
not a multiple of the quasirandom dimension
CURAND_STATUS_DOUBLE_PRECISION_REQUIRED if the GPU does not support double precision
CURAND_STATUS_SUCCESS if the results were generated successfully
</pre> | [
"<pre",
">",
"Generate",
"uniformly",
"distributed",
"doubles",
"."
] | train | https://github.com/jcuda/jcurand/blob/0f463d2bb72cd93b3988f7ce148cdb6069ba4fd9/JCurandJava/src/main/java/jcuda/jcurand/JCurand.java#L629-L632 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixMemberName | @Fix(IssueCodes.INVALID_MEMBER_NAME)
public void fixMemberName(final Issue issue, IssueResolutionAcceptor acceptor) {
MemberRenameModification.accept(this, issue, acceptor);
MemberRemoveModification.accept(this, issue, acceptor);
} | java | @Fix(IssueCodes.INVALID_MEMBER_NAME)
public void fixMemberName(final Issue issue, IssueResolutionAcceptor acceptor) {
MemberRenameModification.accept(this, issue, acceptor);
MemberRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"IssueCodes",
".",
"INVALID_MEMBER_NAME",
")",
"public",
"void",
"fixMemberName",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"MemberRenameModification",
".",
"accept",
"(",
"this",
",",
"issue",
",",
"a... | Quick fix for "Invalid member name".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Invalid",
"member",
"name",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L718-L722 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/GenericTypeResolver.java | GenericTypeResolver.resolveTypeArguments | public static Class<?>[] resolveTypeArguments(Class<?> clazz, Class<?> genericIfc) {
return doResolveTypeArguments(clazz, clazz, genericIfc);
} | java | public static Class<?>[] resolveTypeArguments(Class<?> clazz, Class<?> genericIfc) {
return doResolveTypeArguments(clazz, clazz, genericIfc);
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"resolveTypeArguments",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"genericIfc",
")",
"{",
"return",
"doResolveTypeArguments",
"(",
"clazz",
",",
"clazz",
",",
"genericIfc",
")... | Resolve the type arguments of the given generic interface against the given
target class which is assumed to implement the generic interface and possibly
declare concrete types for its type variables.
@param clazz the target class to check against
@param genericIfc the generic interface or superclass to resolve the type argument from
@return the resolved type of each argument, with the array size matching the
number of actual type arguments, or {@code null} if not resolvable | [
"Resolve",
"the",
"type",
"arguments",
"of",
"the",
"given",
"generic",
"interface",
"against",
"the",
"given",
"target",
"class",
"which",
"is",
"assumed",
"to",
"implement",
"the",
"generic",
"interface",
"and",
"possibly",
"declare",
"concrete",
"types",
"for... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/GenericTypeResolver.java#L258-L260 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/animation/PropertyValuesHolder.java | PropertyValuesHolder.ofKeyframe | public static PropertyValuesHolder ofKeyframe(String propertyName, Keyframe... values) {
KeyframeSet keyframeSet = KeyframeSet.ofKeyframe(values);
if (keyframeSet instanceof IntKeyframeSet) {
return new IntPropertyValuesHolder(propertyName, (IntKeyframeSet) keyframeSet);
} else if (keyframeSet instanceof FloatKeyframeSet) {
return new FloatPropertyValuesHolder(propertyName, (FloatKeyframeSet) keyframeSet);
}
else {
PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName);
pvh.mKeyframeSet = keyframeSet;
pvh.mValueType = ((Keyframe)values[0]).getType();
return pvh;
}
} | java | public static PropertyValuesHolder ofKeyframe(String propertyName, Keyframe... values) {
KeyframeSet keyframeSet = KeyframeSet.ofKeyframe(values);
if (keyframeSet instanceof IntKeyframeSet) {
return new IntPropertyValuesHolder(propertyName, (IntKeyframeSet) keyframeSet);
} else if (keyframeSet instanceof FloatKeyframeSet) {
return new FloatPropertyValuesHolder(propertyName, (FloatKeyframeSet) keyframeSet);
}
else {
PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName);
pvh.mKeyframeSet = keyframeSet;
pvh.mValueType = ((Keyframe)values[0]).getType();
return pvh;
}
} | [
"public",
"static",
"PropertyValuesHolder",
"ofKeyframe",
"(",
"String",
"propertyName",
",",
"Keyframe",
"...",
"values",
")",
"{",
"KeyframeSet",
"keyframeSet",
"=",
"KeyframeSet",
".",
"ofKeyframe",
"(",
"values",
")",
";",
"if",
"(",
"keyframeSet",
"instanceof... | Constructs and returns a PropertyValuesHolder object with the specified property name and set
of values. These values can be of any type, but the type should be consistent so that
an appropriate {@link android.animation.TypeEvaluator} can be found that matches
the common type.
<p>If there is only one value, it is assumed to be the end value of an animation,
and an initial value will be derived, if possible, by calling a getter function
on the object. Also, if any value is null, the value will be filled in when the animation
starts in the same way. This mechanism of automatically getting null values only works
if the PropertyValuesHolder object is used in conjunction
{@link ObjectAnimator}, and with a getter function
derived automatically from <code>propertyName</code>, since otherwise PropertyValuesHolder has
no way of determining what the value should be.
@param propertyName The name of the property associated with this set of values. This
can be the actual property name to be used when using a ObjectAnimator object, or
just a name used to get animated values, such as if this object is used with an
ValueAnimator object.
@param values The set of values to animate between. | [
"Constructs",
"and",
"returns",
"a",
"PropertyValuesHolder",
"object",
"with",
"the",
"specified",
"property",
"name",
"and",
"set",
"of",
"values",
".",
"These",
"values",
"can",
"be",
"of",
"any",
"type",
"but",
"the",
"type",
"should",
"be",
"consistent",
... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/PropertyValuesHolder.java#L249-L262 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java | Tile.tileAreasOverlap | public static boolean tileAreasOverlap(Tile upperLeft, Tile lowerRight, Tile upperLeftOther, Tile lowerRightOther) {
if (upperLeft.zoomLevel != upperLeftOther.zoomLevel) {
return false;
}
if (upperLeft.equals(upperLeftOther) && lowerRight.equals(lowerRightOther)) {
return true;
}
return getBoundaryAbsolute(upperLeft, lowerRight).intersects(getBoundaryAbsolute(upperLeftOther, lowerRightOther));
} | java | public static boolean tileAreasOverlap(Tile upperLeft, Tile lowerRight, Tile upperLeftOther, Tile lowerRightOther) {
if (upperLeft.zoomLevel != upperLeftOther.zoomLevel) {
return false;
}
if (upperLeft.equals(upperLeftOther) && lowerRight.equals(lowerRightOther)) {
return true;
}
return getBoundaryAbsolute(upperLeft, lowerRight).intersects(getBoundaryAbsolute(upperLeftOther, lowerRightOther));
} | [
"public",
"static",
"boolean",
"tileAreasOverlap",
"(",
"Tile",
"upperLeft",
",",
"Tile",
"lowerRight",
",",
"Tile",
"upperLeftOther",
",",
"Tile",
"lowerRightOther",
")",
"{",
"if",
"(",
"upperLeft",
".",
"zoomLevel",
"!=",
"upperLeftOther",
".",
"zoomLevel",
"... | Returns true if two tile areas, defined by upper left and lower right tiles, overlap.
Precondition: zoom levels of upperLeft/lowerRight and upperLeftOther/lowerRightOther are the
same.
@param upperLeft tile in upper left corner of area 1.
@param lowerRight tile in lower right corner of area 1.
@param upperLeftOther tile in upper left corner of area 2.
@param lowerRightOther tile in lower right corner of area 2.
@return true if the areas overlap, false if zoom levels differ or areas do not overlap. | [
"Returns",
"true",
"if",
"two",
"tile",
"areas",
"defined",
"by",
"upper",
"left",
"and",
"lower",
"right",
"tiles",
"overlap",
".",
"Precondition",
":",
"zoom",
"levels",
"of",
"upperLeft",
"/",
"lowerRight",
"and",
"upperLeftOther",
"/",
"lowerRightOther",
"... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L66-L74 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_dnsMXFilter_GET | public OvhDomainMXFilterEnum domain_dnsMXFilter_GET(String domain, String subDomain) throws IOException {
String qPath = "/email/domain/{domain}/dnsMXFilter";
StringBuilder sb = path(qPath, domain);
query(sb, "subDomain", subDomain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDomainMXFilterEnum.class);
} | java | public OvhDomainMXFilterEnum domain_dnsMXFilter_GET(String domain, String subDomain) throws IOException {
String qPath = "/email/domain/{domain}/dnsMXFilter";
StringBuilder sb = path(qPath, domain);
query(sb, "subDomain", subDomain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDomainMXFilterEnum.class);
} | [
"public",
"OvhDomainMXFilterEnum",
"domain_dnsMXFilter_GET",
"(",
"String",
"domain",
",",
"String",
"subDomain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/dnsMXFilter\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Domain MX filter
REST: GET /email/domain/{domain}/dnsMXFilter
@param subDomain [required] Sub domain
@param domain [required] Name of your domain name | [
"Domain",
"MX",
"filter"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L992-L998 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/BigendianEncoding.java | BigendianEncoding.byteFromBase16String | static byte byteFromBase16String(CharSequence chars, int offset) {
Utils.checkArgument(chars.length() >= offset + 2, "chars too small");
return decodeByte(chars.charAt(offset), chars.charAt(offset + 1));
} | java | static byte byteFromBase16String(CharSequence chars, int offset) {
Utils.checkArgument(chars.length() >= offset + 2, "chars too small");
return decodeByte(chars.charAt(offset), chars.charAt(offset + 1));
} | [
"static",
"byte",
"byteFromBase16String",
"(",
"CharSequence",
"chars",
",",
"int",
"offset",
")",
"{",
"Utils",
".",
"checkArgument",
"(",
"chars",
".",
"length",
"(",
")",
">=",
"offset",
"+",
"2",
",",
"\"chars too small\"",
")",
";",
"return",
"decodeByt... | Decodes the specified two character sequence, and returns the resulting {@code byte}.
@param chars the character sequence to be decoded.
@param offset the starting offset in the {@code CharSequence}.
@return the resulting {@code byte}
@throws IllegalArgumentException if the input is not a valid encoded string according to this
encoding. | [
"Decodes",
"the",
"specified",
"two",
"character",
"sequence",
"and",
"returns",
"the",
"resulting",
"{",
"@code",
"byte",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/BigendianEncoding.java#L148-L151 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/GeometryFactory.java | GeometryFactory.createPoint | public Point createPoint(Coordinate coordinate) {
if (coordinate == null) {
return new Point(srid, precision);
}
return new Point(srid, precision, coordinate.getX(), coordinate.getY());
} | java | public Point createPoint(Coordinate coordinate) {
if (coordinate == null) {
return new Point(srid, precision);
}
return new Point(srid, precision, coordinate.getX(), coordinate.getY());
} | [
"public",
"Point",
"createPoint",
"(",
"Coordinate",
"coordinate",
")",
"{",
"if",
"(",
"coordinate",
"==",
"null",
")",
"{",
"return",
"new",
"Point",
"(",
"srid",
",",
"precision",
")",
";",
"}",
"return",
"new",
"Point",
"(",
"srid",
",",
"precision",... | Create a new {@link Point}, given a coordinate.
@param coordinate
The {@link Coordinate} object that positions the point.
@return Returns a {@link Point} object. | [
"Create",
"a",
"new",
"{",
"@link",
"Point",
"}",
"given",
"a",
"coordinate",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/GeometryFactory.java#L76-L81 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.get | public T get(String json) throws IOException, JsonFormatException {
JsonPullParser parser = JsonPullParser.newParser(json);
return get(parser, null);
} | java | public T get(String json) throws IOException, JsonFormatException {
JsonPullParser parser = JsonPullParser.newParser(json);
return get(parser, null);
} | [
"public",
"T",
"get",
"(",
"String",
"json",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"JsonPullParser",
"parser",
"=",
"JsonPullParser",
".",
"newParser",
"(",
"json",
")",
";",
"return",
"get",
"(",
"parser",
",",
"null",
")",
";",
"... | Attempts to parse the given data as an object.
@param json JSON-formatted data
@return An object instance
@throws IOException
@throws JsonFormatException The given data is malformed, or its type is unexpected | [
"Attempts",
"to",
"parse",
"the",
"given",
"data",
"as",
"an",
"object",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L157-L160 |
code4everything/util | src/main/java/com/zhazhapan/util/decryption/SimpleDecrypt.java | SimpleDecrypt.ascii | public static String ascii(String code, String key) {
return ascii(code, CryptUtils.stringToKey(key));
} | java | public static String ascii(String code, String key) {
return ascii(code, CryptUtils.stringToKey(key));
} | [
"public",
"static",
"String",
"ascii",
"(",
"String",
"code",
",",
"String",
"key",
")",
"{",
"return",
"ascii",
"(",
"code",
",",
"CryptUtils",
".",
"stringToKey",
"(",
"key",
")",
")",
";",
"}"
] | sscii解密
@param code {@link String}
@param key {@link String}
@return {@link String} | [
"sscii解密"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/decryption/SimpleDecrypt.java#L52-L54 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java | AbstractLexicalAnalyzer.acceptCustomWord | protected boolean acceptCustomWord(int begin, int end, CoreDictionary.Attribute value)
{
return config.forceCustomDictionary || (end - begin >= 4 && !value.hasNatureStartsWith("nr") && !value.hasNatureStartsWith("ns") && !value.hasNatureStartsWith("nt"));
} | java | protected boolean acceptCustomWord(int begin, int end, CoreDictionary.Attribute value)
{
return config.forceCustomDictionary || (end - begin >= 4 && !value.hasNatureStartsWith("nr") && !value.hasNatureStartsWith("ns") && !value.hasNatureStartsWith("nt"));
} | [
"protected",
"boolean",
"acceptCustomWord",
"(",
"int",
"begin",
",",
"int",
"end",
",",
"CoreDictionary",
".",
"Attribute",
"value",
")",
"{",
"return",
"config",
".",
"forceCustomDictionary",
"||",
"(",
"end",
"-",
"begin",
">=",
"4",
"&&",
"!",
"value",
... | 分词时查询到一个用户词典中的词语,此处控制是否接受它
@param begin 起始位置
@param end 终止位置
@param value 词性
@return true 表示接受
@deprecated 自1.6.7起废弃,强制模式下为最长匹配,否则按分词结果合并 | [
"分词时查询到一个用户词典中的词语,此处控制是否接受它"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java#L325-L328 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaapreauthenticationparameter.java | aaapreauthenticationparameter.get | public static aaapreauthenticationparameter get(nitro_service service, options option) throws Exception{
aaapreauthenticationparameter obj = new aaapreauthenticationparameter();
aaapreauthenticationparameter[] response = (aaapreauthenticationparameter[])obj.get_resources(service,option);
return response[0];
} | java | public static aaapreauthenticationparameter get(nitro_service service, options option) throws Exception{
aaapreauthenticationparameter obj = new aaapreauthenticationparameter();
aaapreauthenticationparameter[] response = (aaapreauthenticationparameter[])obj.get_resources(service,option);
return response[0];
} | [
"public",
"static",
"aaapreauthenticationparameter",
"get",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"aaapreauthenticationparameter",
"obj",
"=",
"new",
"aaapreauthenticationparameter",
"(",
")",
";",
"aaapreauthenticatio... | Use this API to fetch all the aaapreauthenticationparameter resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"all",
"the",
"aaapreauthenticationparameter",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaapreauthenticationparameter.java#L194-L198 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/xmlhelpers/AbstractXmlReader.java | AbstractXmlReader.readStartTag | protected XMLEvent readStartTag(XMLEventReader reader, QName tagName)
throws XMLStreamException, JournalException {
XMLEvent event = reader.nextTag();
if (!isStartTagEvent(event, tagName)) {
throw getNotStartTagException(tagName, event);
}
return event;
} | java | protected XMLEvent readStartTag(XMLEventReader reader, QName tagName)
throws XMLStreamException, JournalException {
XMLEvent event = reader.nextTag();
if (!isStartTagEvent(event, tagName)) {
throw getNotStartTagException(tagName, event);
}
return event;
} | [
"protected",
"XMLEvent",
"readStartTag",
"(",
"XMLEventReader",
"reader",
",",
"QName",
"tagName",
")",
"throws",
"XMLStreamException",
",",
"JournalException",
"{",
"XMLEvent",
"event",
"=",
"reader",
".",
"nextTag",
"(",
")",
";",
"if",
"(",
"!",
"isStartTagEv... | Read the next event and complain if it is not the Start Tag that we
expected. | [
"Read",
"the",
"next",
"event",
"and",
"complain",
"if",
"it",
"is",
"not",
"the",
"Start",
"Tag",
"that",
"we",
"expected",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/xmlhelpers/AbstractXmlReader.java#L44-L51 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderFormat.java | GenericGenbankHeaderFormat._write_single_line | private String _write_single_line(String tag, String text) {
assert tag.length() < HEADER_WIDTH;
return StringManipulationHelper.padRight(tag, HEADER_WIDTH)
+ text.replace('\n', ' ') + lineSep;
} | java | private String _write_single_line(String tag, String text) {
assert tag.length() < HEADER_WIDTH;
return StringManipulationHelper.padRight(tag, HEADER_WIDTH)
+ text.replace('\n', ' ') + lineSep;
} | [
"private",
"String",
"_write_single_line",
"(",
"String",
"tag",
",",
"String",
"text",
")",
"{",
"assert",
"tag",
".",
"length",
"(",
")",
"<",
"HEADER_WIDTH",
";",
"return",
"StringManipulationHelper",
".",
"padRight",
"(",
"tag",
",",
"HEADER_WIDTH",
")",
... | Used in the the 'header' of each GenBank record.
@param tag
@param text | [
"Used",
"in",
"the",
"the",
"header",
"of",
"each",
"GenBank",
"record",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenericGenbankHeaderFormat.java#L55-L59 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java | SimpleDateFormat.isNumeric | private static final boolean isNumeric(char formatChar, int count) {
return NUMERIC_FORMAT_CHARS.indexOf(formatChar) >= 0
|| (count <= 2 && NUMERIC_FORMAT_CHARS2.indexOf(formatChar) >= 0);
} | java | private static final boolean isNumeric(char formatChar, int count) {
return NUMERIC_FORMAT_CHARS.indexOf(formatChar) >= 0
|| (count <= 2 && NUMERIC_FORMAT_CHARS2.indexOf(formatChar) >= 0);
} | [
"private",
"static",
"final",
"boolean",
"isNumeric",
"(",
"char",
"formatChar",
",",
"int",
"count",
")",
"{",
"return",
"NUMERIC_FORMAT_CHARS",
".",
"indexOf",
"(",
"formatChar",
")",
">=",
"0",
"||",
"(",
"count",
"<=",
"2",
"&&",
"NUMERIC_FORMAT_CHARS2",
... | Return true if the given format character, occuring count
times, represents a numeric field. | [
"Return",
"true",
"if",
"the",
"given",
"format",
"character",
"occuring",
"count",
"times",
"represents",
"a",
"numeric",
"field",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L2309-L2312 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Single.java | Single.ambWith | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@SuppressWarnings("unchecked")
public final Single<T> ambWith(SingleSource<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return ambArray(this, other);
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
@SuppressWarnings("unchecked")
public final Single<T> ambWith(SingleSource<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return ambArray(this, other);
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"Single",
"<",
"T",
">",
"ambWith",
"(",
"SingleSource",
"<",
"?",
"extends",
"T",
">",
"other",... | Signals the event of this or the other SingleSource whichever signals first.
<p>
<img width="640" height="463" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.ambWith.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code ambWith} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>
@param other the other SingleSource to race for the first emission of success or error
@return the new Single instance. A subscription to this provided source will occur after subscribing
to the current source.
@since 2.0 | [
"Signals",
"the",
"event",
"of",
"this",
"or",
"the",
"other",
"SingleSource",
"whichever",
"signals",
"first",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"463",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Single.java#L1944-L1950 |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/util/MTPUtility.java | MTPUtility.copyBackRouteHeader | public static void copyBackRouteHeader(byte[] source, byte[] dest) {
int thisPointCode = getFromSif_DPC(source, 1);
int remotePointCode = getFromSif_OPC(source, 1);
int sls = getFromSif_SLS(source, 1);
int si = getFromSif_SI(source);
int ssi = getFromSif_SSI(source);
writeRoutingLabel(dest, si, ssi, sls, remotePointCode, thisPointCode);
} | java | public static void copyBackRouteHeader(byte[] source, byte[] dest) {
int thisPointCode = getFromSif_DPC(source, 1);
int remotePointCode = getFromSif_OPC(source, 1);
int sls = getFromSif_SLS(source, 1);
int si = getFromSif_SI(source);
int ssi = getFromSif_SSI(source);
writeRoutingLabel(dest, si, ssi, sls, remotePointCode, thisPointCode);
} | [
"public",
"static",
"void",
"copyBackRouteHeader",
"(",
"byte",
"[",
"]",
"source",
",",
"byte",
"[",
"]",
"dest",
")",
"{",
"int",
"thisPointCode",
"=",
"getFromSif_DPC",
"(",
"source",
",",
"1",
")",
";",
"int",
"remotePointCode",
"=",
"getFromSif_OPC",
... | Extract routing information from source[], it expects that source is properly encoded routing label atleast(5bytes long,
same as dest). It copies data to <b>dest</b> and swamp <i>DPC</i> with <i>OPC</i>.
@param source
@param dest | [
"Extract",
"routing",
"information",
"from",
"source",
"[]",
"it",
"expects",
"that",
"source",
"is",
"properly",
"encoded",
"routing",
"label",
"atleast",
"(",
"5bytes",
"long",
"same",
"as",
"dest",
")",
".",
"It",
"copies",
"data",
"to",
"<b",
">",
"des... | train | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/util/MTPUtility.java#L40-L47 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.importModule | public void importModule(String importFile) throws Exception {
CmsImportParameters params = new CmsImportParameters(importFile, "/", true);
OpenCms.getImportExportManager().importData(
m_cms,
new CmsShellReport(m_cms.getRequestContext().getLocale()),
params);
} | java | public void importModule(String importFile) throws Exception {
CmsImportParameters params = new CmsImportParameters(importFile, "/", true);
OpenCms.getImportExportManager().importData(
m_cms,
new CmsShellReport(m_cms.getRequestContext().getLocale()),
params);
} | [
"public",
"void",
"importModule",
"(",
"String",
"importFile",
")",
"throws",
"Exception",
"{",
"CmsImportParameters",
"params",
"=",
"new",
"CmsImportParameters",
"(",
"importFile",
",",
"\"/\"",
",",
"true",
")",
";",
"OpenCms",
".",
"getImportExportManager",
"(... | Imports a module.<p>
@param importFile the absolute path of the import module file
@throws Exception if something goes wrong
@see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) | [
"Imports",
"a",
"module",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L862-L870 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/MonetizationApi.java | MonetizationApi.getUpgradePath | public UpgradePathEnvelope getUpgradePath(String did, String action) throws ApiException {
ApiResponse<UpgradePathEnvelope> resp = getUpgradePathWithHttpInfo(did, action);
return resp.getData();
} | java | public UpgradePathEnvelope getUpgradePath(String did, String action) throws ApiException {
ApiResponse<UpgradePathEnvelope> resp = getUpgradePathWithHttpInfo(did, action);
return resp.getData();
} | [
"public",
"UpgradePathEnvelope",
"getUpgradePath",
"(",
"String",
"did",
",",
"String",
"action",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"UpgradePathEnvelope",
">",
"resp",
"=",
"getUpgradePathWithHttpInfo",
"(",
"did",
",",
"action",
")",
";",
"r... | Get upgrade path
Get upgrade path
@param did Device ID (required)
@param action Action to perform (required)
@return UpgradePathEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Get",
"upgrade",
"path",
"Get",
"upgrade",
"path"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/MonetizationApi.java#L515-L518 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfDocument.java | PdfDocument.remoteGoto | void remoteGoto(String filename, String name, float llx, float lly, float urx, float ury) {
annotationsImp.addPlainAnnotation(new PdfAnnotation(writer, llx, lly, urx, ury, new PdfAction(filename, name)));
} | java | void remoteGoto(String filename, String name, float llx, float lly, float urx, float ury) {
annotationsImp.addPlainAnnotation(new PdfAnnotation(writer, llx, lly, urx, ury, new PdfAction(filename, name)));
} | [
"void",
"remoteGoto",
"(",
"String",
"filename",
",",
"String",
"name",
",",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
")",
"{",
"annotationsImp",
".",
"addPlainAnnotation",
"(",
"new",
"PdfAnnotation",
"(",
"writer",
"... | Implements a link to another document.
@param filename the filename for the remote document
@param name the name to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper right y corner of the activation area | [
"Implements",
"a",
"link",
"to",
"another",
"document",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfDocument.java#L2027-L2029 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICULocaleService.java | ICULocaleService.registerObject | public Factory registerObject(Object obj, ULocale locale, int kind, boolean visible) {
Factory factory = new SimpleLocaleKeyFactory(obj, locale, kind, visible);
return registerFactory(factory);
} | java | public Factory registerObject(Object obj, ULocale locale, int kind, boolean visible) {
Factory factory = new SimpleLocaleKeyFactory(obj, locale, kind, visible);
return registerFactory(factory);
} | [
"public",
"Factory",
"registerObject",
"(",
"Object",
"obj",
",",
"ULocale",
"locale",
",",
"int",
"kind",
",",
"boolean",
"visible",
")",
"{",
"Factory",
"factory",
"=",
"new",
"SimpleLocaleKeyFactory",
"(",
"obj",
",",
"locale",
",",
"kind",
",",
"visible"... | Convenience function for callers using locales. This instantiates
a SimpleLocaleKeyFactory, and registers the factory. | [
"Convenience",
"function",
"for",
"callers",
"using",
"locales",
".",
"This",
"instantiates",
"a",
"SimpleLocaleKeyFactory",
"and",
"registers",
"the",
"factory",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICULocaleService.java#L119-L122 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java | ThreadUtil.newNamedThreadFactory | public static ThreadFactory newNamedThreadFactory(String prefix, ThreadGroup threadGroup, boolean isDeamon) {
return new NamedThreadFactory(prefix, threadGroup, isDeamon);
} | java | public static ThreadFactory newNamedThreadFactory(String prefix, ThreadGroup threadGroup, boolean isDeamon) {
return new NamedThreadFactory(prefix, threadGroup, isDeamon);
} | [
"public",
"static",
"ThreadFactory",
"newNamedThreadFactory",
"(",
"String",
"prefix",
",",
"ThreadGroup",
"threadGroup",
",",
"boolean",
"isDeamon",
")",
"{",
"return",
"new",
"NamedThreadFactory",
"(",
"prefix",
",",
"threadGroup",
",",
"isDeamon",
")",
";",
"}"... | 创建线程工厂
@param prefix 线程名前缀
@param threadGroup 线程组,可以为null
@param isDeamon 是否守护线程
@since 4.0.0 | [
"创建线程工厂"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java#L407-L409 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ExtensionScript.java | ExtensionScript.addScriptsFromDir | private int addScriptsFromDir(File dir, ScriptType type, String targetEngineName) {
int addedScripts = 0;
File typeDir = new File(dir, type.getName());
if (typeDir.exists()) {
for (File f : typeDir.listFiles()) {
String ext = f.getName().substring(f.getName().lastIndexOf(".") + 1);
String engineName = this.getEngineNameForExtension(ext);
if (engineName != null && (targetEngineName == null || engineName.equals(targetEngineName))) {
try {
if (f.canWrite()) {
String scriptName = this.getUniqueScriptName(f.getName(), ext);
logger.debug("Loading script " + scriptName);
ScriptWrapper sw = new ScriptWrapper(scriptName, "",
this.getEngineWrapper(engineName), type, false, f);
this.loadScript(sw);
this.addScript(sw, false);
} else {
// Cant write so add as a template
String scriptName = this.getUniqueTemplateName(f.getName(), ext);
logger.debug("Loading script " + scriptName);
ScriptWrapper sw = new ScriptWrapper(scriptName, "",
this.getEngineWrapper(engineName), type, false, f);
this.loadScript(sw);
this.addTemplate(sw, false);
}
addedScripts++;
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
} else {
logger.debug("Ignoring " + f.getName());
}
}
}
return addedScripts;
} | java | private int addScriptsFromDir(File dir, ScriptType type, String targetEngineName) {
int addedScripts = 0;
File typeDir = new File(dir, type.getName());
if (typeDir.exists()) {
for (File f : typeDir.listFiles()) {
String ext = f.getName().substring(f.getName().lastIndexOf(".") + 1);
String engineName = this.getEngineNameForExtension(ext);
if (engineName != null && (targetEngineName == null || engineName.equals(targetEngineName))) {
try {
if (f.canWrite()) {
String scriptName = this.getUniqueScriptName(f.getName(), ext);
logger.debug("Loading script " + scriptName);
ScriptWrapper sw = new ScriptWrapper(scriptName, "",
this.getEngineWrapper(engineName), type, false, f);
this.loadScript(sw);
this.addScript(sw, false);
} else {
// Cant write so add as a template
String scriptName = this.getUniqueTemplateName(f.getName(), ext);
logger.debug("Loading script " + scriptName);
ScriptWrapper sw = new ScriptWrapper(scriptName, "",
this.getEngineWrapper(engineName), type, false, f);
this.loadScript(sw);
this.addTemplate(sw, false);
}
addedScripts++;
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
} else {
logger.debug("Ignoring " + f.getName());
}
}
}
return addedScripts;
} | [
"private",
"int",
"addScriptsFromDir",
"(",
"File",
"dir",
",",
"ScriptType",
"type",
",",
"String",
"targetEngineName",
")",
"{",
"int",
"addedScripts",
"=",
"0",
";",
"File",
"typeDir",
"=",
"new",
"File",
"(",
"dir",
",",
"type",
".",
"getName",
"(",
... | Adds the scripts from the given directory of the given script type and, optionally, for the engine with the given name.
@param dir the directory from where to add the scripts.
@param type the script type, must not be {@code null}.
@param targetEngineName the engine that the scripts must be of, {@code null} for all engines.
@return the number of scripts added. | [
"Adds",
"the",
"scripts",
"from",
"the",
"given",
"directory",
"of",
"the",
"given",
"script",
"type",
"and",
"optionally",
"for",
"the",
"engine",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L883-L919 |
Red5/red5-websocket | src/main/java/org/red5/net/websocket/WebSocketScopeManager.java | WebSocketScopeManager.removeListener | public void removeListener(IWebSocketDataListener listener, String path) {
log.trace("removeListener: {}", listener);
WebSocketScope scope = getScope(path);
if (scope != null) {
scope.removeListener(listener);
if (!scope.isValid()) {
// scope is not valid. delete this
removeWebSocketScope(scope);
}
} else {
log.info("Scope not found for path: {}", path);
}
} | java | public void removeListener(IWebSocketDataListener listener, String path) {
log.trace("removeListener: {}", listener);
WebSocketScope scope = getScope(path);
if (scope != null) {
scope.removeListener(listener);
if (!scope.isValid()) {
// scope is not valid. delete this
removeWebSocketScope(scope);
}
} else {
log.info("Scope not found for path: {}", path);
}
} | [
"public",
"void",
"removeListener",
"(",
"IWebSocketDataListener",
"listener",
",",
"String",
"path",
")",
"{",
"log",
".",
"trace",
"(",
"\"removeListener: {}\"",
",",
"listener",
")",
";",
"WebSocketScope",
"scope",
"=",
"getScope",
"(",
"path",
")",
";",
"i... | Remove listener from scope via its path.
@param listener
IWebSocketDataListener
@param path | [
"Remove",
"listener",
"from",
"scope",
"via",
"its",
"path",
"."
] | train | https://github.com/Red5/red5-websocket/blob/24b53f2f3875624fb01f0a2604f4117583aeab40/src/main/java/org/red5/net/websocket/WebSocketScopeManager.java#L229-L241 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslHandler.java | SslHandler.setHandshakeFailure | private void setHandshakeFailure(ChannelHandlerContext ctx, Throwable cause) {
setHandshakeFailure(ctx, cause, true, true, false);
} | java | private void setHandshakeFailure(ChannelHandlerContext ctx, Throwable cause) {
setHandshakeFailure(ctx, cause, true, true, false);
} | [
"private",
"void",
"setHandshakeFailure",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Throwable",
"cause",
")",
"{",
"setHandshakeFailure",
"(",
"ctx",
",",
"cause",
",",
"true",
",",
"true",
",",
"false",
")",
";",
"}"
] | Notify all the handshake futures about the failure during the handshake. | [
"Notify",
"all",
"the",
"handshake",
"futures",
"about",
"the",
"failure",
"during",
"the",
"handshake",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslHandler.java#L1759-L1761 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCBlobClient.java | JDBCBlobClient.setBytes | public synchronized int setBytes(long pos, byte[] bytes, int offset,
int len) throws SQLException {
if (!isInLimits(bytes.length, offset, len)) {
throw Util.outOfRangeArgument();
}
if (offset != 0 || len != bytes.length) {
byte[] newBytes = new byte[len];
System.arraycopy(bytes, (int) offset, newBytes, 0, len);
bytes = newBytes;
}
return setBytes(pos, bytes);
} | java | public synchronized int setBytes(long pos, byte[] bytes, int offset,
int len) throws SQLException {
if (!isInLimits(bytes.length, offset, len)) {
throw Util.outOfRangeArgument();
}
if (offset != 0 || len != bytes.length) {
byte[] newBytes = new byte[len];
System.arraycopy(bytes, (int) offset, newBytes, 0, len);
bytes = newBytes;
}
return setBytes(pos, bytes);
} | [
"public",
"synchronized",
"int",
"setBytes",
"(",
"long",
"pos",
",",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"!",
"isInLimits",
"(",
"bytes",
".",
"length",
",",
"offset",
",",... | Writes all or part of the given <code>byte</code> array to the
<code>BLOB</code> value that this <code>Blob</code> object represents
and returns the number of bytes written.
@param pos the position in the <code>BLOB</code> object at which to
start writing
@param bytes the array of bytes to be written to this
<code>BLOB</code> object
@param offset the offset into the array <code>bytes</code> at which
to start reading the bytes to be set
@param len the number of bytes to be written to the <code>BLOB</code>
value from the array of bytes <code>bytes</code>
@return the number of bytes written
@throws SQLException if there is an error accessing the
<code>BLOB</code> value | [
"Writes",
"all",
"or",
"part",
"of",
"the",
"given",
"<code",
">",
"byte<",
"/",
"code",
">",
"array",
"to",
"the",
"<code",
">",
"BLOB<",
"/",
"code",
">",
"value",
"that",
"this",
"<code",
">",
"Blob<",
"/",
"code",
">",
"object",
"represents",
"an... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCBlobClient.java#L205-L221 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/BOMUtil.java | BOMUtil.getBOMType | public static int getBOMType(File file)
throws IOException
{
FileInputStream fIn = null;
try
{
fIn = new FileInputStream( file );
byte[] buff = new byte[MAXBOMBYTES];
int read = fIn.read( buff );
return getBOMType( buff, read );
}
finally
{
IOUtil.closeQuietly( fIn );
}
} | java | public static int getBOMType(File file)
throws IOException
{
FileInputStream fIn = null;
try
{
fIn = new FileInputStream( file );
byte[] buff = new byte[MAXBOMBYTES];
int read = fIn.read( buff );
return getBOMType( buff, read );
}
finally
{
IOUtil.closeQuietly( fIn );
}
} | [
"public",
"static",
"int",
"getBOMType",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fIn",
"=",
"null",
";",
"try",
"{",
"fIn",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"byte",
"[",
"]",
"buff",
"=",
"new",
... | <p>getBOMType.</p>
@param file a {@link java.io.File} object.
@return a int.
@throws java.io.IOException if any. | [
"<p",
">",
"getBOMType",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/BOMUtil.java#L104-L120 |
radkovo/Pdf2Dom | src/main/java/org/fit/pdfdom/PDFDomTree.java | PDFDomTree.createLineElement | protected Element createLineElement(float x1, float y1, float x2, float y2)
{
HtmlDivLine line = new HtmlDivLine(x1, y1, x2, y2);
String color = colorString(getGraphicsState().getStrokingColor());
StringBuilder pstyle = new StringBuilder(50);
pstyle.append("left:").append(style.formatLength(line.getLeft())).append(';');
pstyle.append("top:").append(style.formatLength(line.getTop())).append(';');
pstyle.append("width:").append(style.formatLength(line.getWidth())).append(';');
pstyle.append("height:").append(style.formatLength(line.getHeight())).append(';');
pstyle.append(line.getBorderSide()).append(':').append(style.formatLength(line.getLineStrokeWidth())).append(" solid ").append(color).append(';');
if (line.getAngleDegrees() != 0)
pstyle.append("transform:").append("rotate(").append(line.getAngleDegrees()).append("deg);");
Element el = doc.createElement("div");
el.setAttribute("class", "r");
el.setAttribute("style", pstyle.toString());
el.appendChild(doc.createEntityReference("nbsp"));
return el;
} | java | protected Element createLineElement(float x1, float y1, float x2, float y2)
{
HtmlDivLine line = new HtmlDivLine(x1, y1, x2, y2);
String color = colorString(getGraphicsState().getStrokingColor());
StringBuilder pstyle = new StringBuilder(50);
pstyle.append("left:").append(style.formatLength(line.getLeft())).append(';');
pstyle.append("top:").append(style.formatLength(line.getTop())).append(';');
pstyle.append("width:").append(style.formatLength(line.getWidth())).append(';');
pstyle.append("height:").append(style.formatLength(line.getHeight())).append(';');
pstyle.append(line.getBorderSide()).append(':').append(style.formatLength(line.getLineStrokeWidth())).append(" solid ").append(color).append(';');
if (line.getAngleDegrees() != 0)
pstyle.append("transform:").append("rotate(").append(line.getAngleDegrees()).append("deg);");
Element el = doc.createElement("div");
el.setAttribute("class", "r");
el.setAttribute("style", pstyle.toString());
el.appendChild(doc.createEntityReference("nbsp"));
return el;
} | [
"protected",
"Element",
"createLineElement",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
")",
"{",
"HtmlDivLine",
"line",
"=",
"new",
"HtmlDivLine",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
")",
";",
"String",
"... | Create an element that represents a horizntal or vertical line.
@param x1
@param y1
@param x2
@param y2
@return the created DOM element | [
"Create",
"an",
"element",
"that",
"represents",
"a",
"horizntal",
"or",
"vertical",
"line",
"."
] | train | https://github.com/radkovo/Pdf2Dom/blob/12e52b80eca7f57fc41e6ed895bf1db72c38da53/src/main/java/org/fit/pdfdom/PDFDomTree.java#L379-L398 |
openbase/jul | processing/xml/src/main/java/org/openbase/jul/processing/xml/processing/XMLProcessor.java | XMLProcessor.xorCheck | public static void xorCheck(final Nodes nodes1, final Nodes nodes2, final String nodeTypeForDebugging) throws XMLParsingException {
if (nodes1.size() > 0 && nodes2.size() > 0) {
throw new XMLParsingException("Message contains more than one " + nodeTypeForDebugging + " node. Only one permitted.");
}
} | java | public static void xorCheck(final Nodes nodes1, final Nodes nodes2, final String nodeTypeForDebugging) throws XMLParsingException {
if (nodes1.size() > 0 && nodes2.size() > 0) {
throw new XMLParsingException("Message contains more than one " + nodeTypeForDebugging + " node. Only one permitted.");
}
} | [
"public",
"static",
"void",
"xorCheck",
"(",
"final",
"Nodes",
"nodes1",
",",
"final",
"Nodes",
"nodes2",
",",
"final",
"String",
"nodeTypeForDebugging",
")",
"throws",
"XMLParsingException",
"{",
"if",
"(",
"nodes1",
".",
"size",
"(",
")",
">",
"0",
"&&",
... | Does nothing if only one of nodes1 or nodes2 contains more than zero nodes. Throws InvalidCfgDocException otherwise.
@param nodes1
@param nodes2
@param nodeTypeForDebugging
@throws XMLParsingException | [
"Does",
"nothing",
"if",
"only",
"one",
"of",
"nodes1",
"or",
"nodes2",
"contains",
"more",
"than",
"zero",
"nodes",
".",
"Throws",
"InvalidCfgDocException",
"otherwise",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/processing/xml/src/main/java/org/openbase/jul/processing/xml/processing/XMLProcessor.java#L340-L344 |
tvesalainen/util | rpm/src/main/java/org/vesalainen/pm/rpm/RPMBuilder.java | RPMBuilder.addProvide | @Override
public RPMBuilder addProvide(String name, String version, Condition... dependency)
{
addString(RPMTAG_PROVIDENAME, name);
addString(RPMTAG_PROVIDEVERSION, version);
addInt32(RPMTAG_PROVIDEFLAGS, Dependency.or(dependency));
ensureVersionReq(version);
return this;
} | java | @Override
public RPMBuilder addProvide(String name, String version, Condition... dependency)
{
addString(RPMTAG_PROVIDENAME, name);
addString(RPMTAG_PROVIDEVERSION, version);
addInt32(RPMTAG_PROVIDEFLAGS, Dependency.or(dependency));
ensureVersionReq(version);
return this;
} | [
"@",
"Override",
"public",
"RPMBuilder",
"addProvide",
"(",
"String",
"name",
",",
"String",
"version",
",",
"Condition",
"...",
"dependency",
")",
"{",
"addString",
"(",
"RPMTAG_PROVIDENAME",
",",
"name",
")",
";",
"addString",
"(",
"RPMTAG_PROVIDEVERSION",
","... | Add RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION and RPMTAG_PROVIDEFLAGS
@param name
@param version
@param dependency
@return | [
"Add",
"RPMTAG_PROVIDENAME",
"RPMTAG_PROVIDEVERSION",
"and",
"RPMTAG_PROVIDEFLAGS"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/rpm/src/main/java/org/vesalainen/pm/rpm/RPMBuilder.java#L254-L262 |
reactor/reactor-netty | src/main/java/reactor/netty/ByteBufMono.java | ByteBufMono.asInputStream | public Mono<InputStream> asInputStream() {
return handle((bb, sink) -> {
try {
sink.next(new ReleasingInputStream(bb));
}
catch (IllegalReferenceCountException e) {
sink.complete();
}
});
} | java | public Mono<InputStream> asInputStream() {
return handle((bb, sink) -> {
try {
sink.next(new ReleasingInputStream(bb));
}
catch (IllegalReferenceCountException e) {
sink.complete();
}
});
} | [
"public",
"Mono",
"<",
"InputStream",
">",
"asInputStream",
"(",
")",
"{",
"return",
"handle",
"(",
"(",
"bb",
",",
"sink",
")",
"->",
"{",
"try",
"{",
"sink",
".",
"next",
"(",
"new",
"ReleasingInputStream",
"(",
"bb",
")",
")",
";",
"}",
"catch",
... | Convert to an {@link InputStream} inbound {@link Mono}
@return a {@link InputStream} inbound {@link Mono} | [
"Convert",
"to",
"an",
"{",
"@link",
"InputStream",
"}",
"inbound",
"{",
"@link",
"Mono",
"}"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/ByteBufMono.java#L106-L115 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowVersionsInner.java | WorkflowVersionsInner.listAsync | public Observable<Page<WorkflowVersionInner>> listAsync(final String resourceGroupName, final String workflowName, final Integer top) {
return listWithServiceResponseAsync(resourceGroupName, workflowName, top)
.map(new Func1<ServiceResponse<Page<WorkflowVersionInner>>, Page<WorkflowVersionInner>>() {
@Override
public Page<WorkflowVersionInner> call(ServiceResponse<Page<WorkflowVersionInner>> response) {
return response.body();
}
});
} | java | public Observable<Page<WorkflowVersionInner>> listAsync(final String resourceGroupName, final String workflowName, final Integer top) {
return listWithServiceResponseAsync(resourceGroupName, workflowName, top)
.map(new Func1<ServiceResponse<Page<WorkflowVersionInner>>, Page<WorkflowVersionInner>>() {
@Override
public Page<WorkflowVersionInner> call(ServiceResponse<Page<WorkflowVersionInner>> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"Page",
"<",
"WorkflowVersionInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"workflowName",
",",
"final",
"Integer",
"top",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"... | Gets a list of workflow versions.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param top The number of items to be included in the result.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<WorkflowVersionInner> object | [
"Gets",
"a",
"list",
"of",
"workflow",
"versions",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowVersionsInner.java#L251-L259 |
openengsb/openengsb | components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraph.java | OrientModelGraph.getEdgeWithPossibleId | private ODocument getEdgeWithPossibleId(String start, String end, List<String> ids) {
List<ODocument> edges = getEdgesBetweenModels(start, end);
for (ODocument edge : edges) {
if (ids.contains(OrientModelGraphUtils.getIdFieldValue(edge))) {
return edge;
}
}
return edges.size() != 0 ? edges.get(0) : null;
} | java | private ODocument getEdgeWithPossibleId(String start, String end, List<String> ids) {
List<ODocument> edges = getEdgesBetweenModels(start, end);
for (ODocument edge : edges) {
if (ids.contains(OrientModelGraphUtils.getIdFieldValue(edge))) {
return edge;
}
}
return edges.size() != 0 ? edges.get(0) : null;
} | [
"private",
"ODocument",
"getEdgeWithPossibleId",
"(",
"String",
"start",
",",
"String",
"end",
",",
"List",
"<",
"String",
">",
"ids",
")",
"{",
"List",
"<",
"ODocument",
">",
"edges",
"=",
"getEdgesBetweenModels",
"(",
"start",
",",
"end",
")",
";",
"for"... | Returns an edge between the start and the end model. If there is an edge which has an id which is contained in
the given id list, then this transformation is returned. If not, then the first found is returned. | [
"Returns",
"an",
"edge",
"between",
"the",
"start",
"and",
"the",
"end",
"model",
".",
"If",
"there",
"is",
"an",
"edge",
"which",
"has",
"an",
"id",
"which",
"is",
"contained",
"in",
"the",
"given",
"id",
"list",
"then",
"this",
"transformation",
"is",
... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraph.java#L349-L357 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java | GraphLoader.loadUndirectedGraphEdgeListFile | public static Graph<String, String> loadUndirectedGraphEdgeListFile(String path, int numVertices, String delim,
boolean allowMultipleEdges) throws IOException {
Graph<String, String> graph = new Graph<>(numVertices, allowMultipleEdges, new StringVertexFactory());
EdgeLineProcessor<String> lineProcessor = new DelimitedEdgeLineProcessor(delim, false);
try (BufferedReader br = new BufferedReader(new FileReader(new File(path)))) {
String line;
while ((line = br.readLine()) != null) {
Edge<String> edge = lineProcessor.processLine(line);
if (edge != null) {
graph.addEdge(edge);
}
}
}
return graph;
} | java | public static Graph<String, String> loadUndirectedGraphEdgeListFile(String path, int numVertices, String delim,
boolean allowMultipleEdges) throws IOException {
Graph<String, String> graph = new Graph<>(numVertices, allowMultipleEdges, new StringVertexFactory());
EdgeLineProcessor<String> lineProcessor = new DelimitedEdgeLineProcessor(delim, false);
try (BufferedReader br = new BufferedReader(new FileReader(new File(path)))) {
String line;
while ((line = br.readLine()) != null) {
Edge<String> edge = lineProcessor.processLine(line);
if (edge != null) {
graph.addEdge(edge);
}
}
}
return graph;
} | [
"public",
"static",
"Graph",
"<",
"String",
",",
"String",
">",
"loadUndirectedGraphEdgeListFile",
"(",
"String",
"path",
",",
"int",
"numVertices",
",",
"String",
"delim",
",",
"boolean",
"allowMultipleEdges",
")",
"throws",
"IOException",
"{",
"Graph",
"<",
"S... | Simple method for loading an undirected graph, where the graph is represented by a edge list with one edge
per line with a delimiter in between<br>
This method assumes that all lines in the file are of the form {@code i<delim>j} where i and j are integers
in range 0 to numVertices inclusive, and "<delim>" is the user-provided delimiter
@param path Path to the edge list file
@param numVertices number of vertices in the graph
@param allowMultipleEdges If set to false, the graph will not allow multiple edges between any two vertices to exist. However,
checking for duplicates during graph loading can be costly, so use allowMultipleEdges=true when
possible.
@return graph
@throws IOException if file cannot be read | [
"Simple",
"method",
"for",
"loading",
"an",
"undirected",
"graph",
"where",
"the",
"graph",
"is",
"represented",
"by",
"a",
"edge",
"list",
"with",
"one",
"edge",
"per",
"line",
"with",
"a",
"delimiter",
"in",
"between<br",
">",
"This",
"method",
"assumes",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java#L67-L82 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsTabDialog.java | CmsTabDialog.dialogTabContentStart | public String dialogTabContentStart(String title, String attributes) {
return dialogTabContent(HTML_START, title, attributes);
} | java | public String dialogTabContentStart(String title, String attributes) {
return dialogTabContent(HTML_START, title, attributes);
} | [
"public",
"String",
"dialogTabContentStart",
"(",
"String",
"title",
",",
"String",
"attributes",
")",
"{",
"return",
"dialogTabContent",
"(",
"HTML_START",
",",
"title",
",",
"attributes",
")",
";",
"}"
] | Returns the start html for the tab content area of the dialog window.<p>
@param title the title for the dialog
@param attributes additional attributes for the content <div> area of the tab dialog
@return the start html for the tab content area of the dialog window | [
"Returns",
"the",
"start",
"html",
"for",
"the",
"tab",
"content",
"area",
"of",
"the",
"dialog",
"window",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsTabDialog.java#L164-L167 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.downloadAreaAsync | public CacheManagerTask downloadAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) {
final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), geoPoints, zoomMin, zoomMax);
task.addCallback(callback);
task.addCallback(getDownloadingDialog(ctx, task));
return execute(task);
} | java | public CacheManagerTask downloadAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) {
final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), geoPoints, zoomMin, zoomMax);
task.addCallback(callback);
task.addCallback(getDownloadingDialog(ctx, task));
return execute(task);
} | [
"public",
"CacheManagerTask",
"downloadAreaAsync",
"(",
"Context",
"ctx",
",",
"ArrayList",
"<",
"GeoPoint",
">",
"geoPoints",
",",
"final",
"int",
"zoomMin",
",",
"final",
"int",
"zoomMax",
",",
"final",
"CacheManagerCallback",
"callback",
")",
"{",
"final",
"C... | Download in background all tiles covered by the GePoints list in osmdroid cache.
@param ctx
@param geoPoints
@param zoomMin
@param zoomMax | [
"Download",
"in",
"background",
"all",
"tiles",
"covered",
"by",
"the",
"GePoints",
"list",
"in",
"osmdroid",
"cache",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L436-L441 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/io/Files.java | Files.equal | public static boolean equal(File file1, File file2) throws IOException {
checkNotNull(file1);
checkNotNull(file2);
if (file1 == file2 || file1.equals(file2)) {
return true;
}
/*
* Some operating systems may return zero as the length for files denoting system-dependent
* entities such as devices or pipes, in which case we must fall back on comparing the bytes
* directly.
*/
long len1 = file1.length();
long len2 = file2.length();
if (len1 != 0 && len2 != 0 && len1 != len2) {
return false;
}
return asByteSource(file1).contentEquals(asByteSource(file2));
} | java | public static boolean equal(File file1, File file2) throws IOException {
checkNotNull(file1);
checkNotNull(file2);
if (file1 == file2 || file1.equals(file2)) {
return true;
}
/*
* Some operating systems may return zero as the length for files denoting system-dependent
* entities such as devices or pipes, in which case we must fall back on comparing the bytes
* directly.
*/
long len1 = file1.length();
long len2 = file2.length();
if (len1 != 0 && len2 != 0 && len1 != len2) {
return false;
}
return asByteSource(file1).contentEquals(asByteSource(file2));
} | [
"public",
"static",
"boolean",
"equal",
"(",
"File",
"file1",
",",
"File",
"file2",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file1",
")",
";",
"checkNotNull",
"(",
"file2",
")",
";",
"if",
"(",
"file1",
"==",
"file2",
"||",
"file1",
".",
... | Returns true if the files contains the same bytes.
@throws IOException if an I/O error occurs | [
"Returns",
"true",
"if",
"the",
"files",
"contains",
"the",
"same",
"bytes",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/io/Files.java#L366-L384 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.