repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/HasNode.java | HasNode.evaluate | public String evaluate(Features features, Set<String> discovered, boolean coerceUndefinedToFalse) {
if (feature != null && discovered != null) {
discovered.add(feature);
}
if (feature == null) {
return nodeName;
} else if (!coerceUndefinedToFalse && !features.contains(feature)) {
return null;
... | java | public String evaluate(Features features, Set<String> discovered, boolean coerceUndefinedToFalse) {
if (feature != null && discovered != null) {
discovered.add(feature);
}
if (feature == null) {
return nodeName;
} else if (!coerceUndefinedToFalse && !features.contains(feature)) {
return null;
... | [
"public",
"String",
"evaluate",
"(",
"Features",
"features",
",",
"Set",
"<",
"String",
">",
"discovered",
",",
"boolean",
"coerceUndefinedToFalse",
")",
"{",
"if",
"(",
"feature",
"!=",
"null",
"&&",
"discovered",
"!=",
"null",
")",
"{",
"discovered",
".",
... | Evaluate the has plugin for the given set of features.
@param features
The features passed to the aggregator.
@param discovered
A map in which all features encountered in the evaluation will
be placed. This will not necessarily contain all features in
the dependency expression. Only the ones in the evaluation
chain wi... | [
"Evaluate",
"the",
"has",
"plugin",
"for",
"the",
"given",
"set",
"of",
"features",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/HasNode.java#L79-L94 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/HasNode.java | HasNode.replaceWith | public void replaceWith(HasNode node) {
feature = node.feature;
nodeName = node.nodeName;
trueNode = node.trueNode;
falseNode = node.falseNode;
} | java | public void replaceWith(HasNode node) {
feature = node.feature;
nodeName = node.nodeName;
trueNode = node.trueNode;
falseNode = node.falseNode;
} | [
"public",
"void",
"replaceWith",
"(",
"HasNode",
"node",
")",
"{",
"feature",
"=",
"node",
".",
"feature",
";",
"nodeName",
"=",
"node",
".",
"nodeName",
";",
"trueNode",
"=",
"node",
".",
"trueNode",
";",
"falseNode",
"=",
"node",
".",
"falseNode",
";",... | Replaces the properties of the current node with the properties of the specified node.
@param node
The node to replace this node with | [
"Replaces",
"the",
"properties",
"of",
"the",
"current",
"node",
"with",
"the",
"properties",
"of",
"the",
"specified",
"node",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/HasNode.java#L170-L175 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/HasNode.java | HasNode.replaceWith | public void replaceWith(String nodeName) {
feature = null;
this.nodeName = nodeName;
trueNode = falseNode = null;
} | java | public void replaceWith(String nodeName) {
feature = null;
this.nodeName = nodeName;
trueNode = falseNode = null;
} | [
"public",
"void",
"replaceWith",
"(",
"String",
"nodeName",
")",
"{",
"feature",
"=",
"null",
";",
"this",
".",
"nodeName",
"=",
"nodeName",
";",
"trueNode",
"=",
"falseNode",
"=",
"null",
";",
"}"
] | Replaces the properties of the current node with the specified node name, making this node
into an end point node.
@param nodeName
The name of the end point. | [
"Replaces",
"the",
"properties",
"of",
"the",
"current",
"node",
"with",
"the",
"specified",
"node",
"name",
"making",
"this",
"node",
"into",
"an",
"end",
"point",
"node",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/HasNode.java#L184-L188 | train |
OpenNTF/JavascriptAggregator | jaggr-blueprint/src/main/java/com/ibm/jaggr/blueprint/AbstractOsgiCommandSupport.java | AbstractOsgiCommandSupport.invoke | protected String invoke(CommandProvider provider, CommandInterpreterWrapper interpreter) throws Exception {
Method method = provider.getClass().getMethod("_aggregator", new Class[]{CommandInterpreter.class}); //$NON-NLS-1$
method.invoke(provider, new Object[]{interpreter});
return interpreter.getOutput();
} | java | protected String invoke(CommandProvider provider, CommandInterpreterWrapper interpreter) throws Exception {
Method method = provider.getClass().getMethod("_aggregator", new Class[]{CommandInterpreter.class}); //$NON-NLS-1$
method.invoke(provider, new Object[]{interpreter});
return interpreter.getOutput();
} | [
"protected",
"String",
"invoke",
"(",
"CommandProvider",
"provider",
",",
"CommandInterpreterWrapper",
"interpreter",
")",
"throws",
"Exception",
"{",
"Method",
"method",
"=",
"provider",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"_aggregator\"",
",",
"n... | Invokes the aggregator command processor using reflection in order avoid framework dependencies
on the aggregator classes.
@param provider an instance of the aggregator command processor
@param interpreter the command interpreter
@return the command response
@throws Exception | [
"Invokes",
"the",
"aggregator",
"command",
"processor",
"using",
"reflection",
"in",
"order",
"avoid",
"framework",
"dependencies",
"on",
"the",
"aggregator",
"classes",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-blueprint/src/main/java/com/ibm/jaggr/blueprint/AbstractOsgiCommandSupport.java#L77-L81 | train |
berkesa/datatree | src/main/java/io/datatree/dom/TreeWriterRegistry.java | TreeWriterRegistry.setWriter | public static final void setWriter(String format, TreeWriter writer) {
String key = format.toLowerCase();
writers.put(key, writer);
if (JSON.equals(key)) {
cachedJsonWriter = writer;
}
} | java | public static final void setWriter(String format, TreeWriter writer) {
String key = format.toLowerCase();
writers.put(key, writer);
if (JSON.equals(key)) {
cachedJsonWriter = writer;
}
} | [
"public",
"static",
"final",
"void",
"setWriter",
"(",
"String",
"format",
",",
"TreeWriter",
"writer",
")",
"{",
"String",
"key",
"=",
"format",
".",
"toLowerCase",
"(",
")",
";",
"writers",
".",
"put",
"(",
"key",
",",
"writer",
")",
";",
"if",
"(",
... | Binds the given TreeWriter instance to the specified data format.
@param format
name of the format (eg. "json", "xml", "csv", etc.)
@param writer
TreeWriter instance for generating the specified format | [
"Binds",
"the",
"given",
"TreeWriter",
"instance",
"to",
"the",
"specified",
"data",
"format",
"."
] | 79aea9b45c7b46ab28af0a09310bc01c421c6b3a | https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/dom/TreeWriterRegistry.java#L65-L71 | train |
protegeproject/jpaul | src/main/java/jpaul/Misc/Predicate.java | Predicate.TRUE | public static <T> Predicate<T> TRUE() {
return new Predicate<T>() {
public boolean check(T obj) { return true; }
};
} | java | public static <T> Predicate<T> TRUE() {
return new Predicate<T>() {
public boolean check(T obj) { return true; }
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"TRUE",
"(",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"public",
"boolean",
"check",
"(",
"T",
"obj",
")",
"{",
"return",
"true",
";",
"}",
"}",
";",
"}"... | Returns an always-true predicate. | [
"Returns",
"an",
"always",
"-",
"true",
"predicate",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Misc/Predicate.java#L22-L26 | train |
protegeproject/jpaul | src/main/java/jpaul/Misc/Predicate.java | Predicate.FALSE | public static <T> Predicate<T> FALSE() {
return Predicate.<T>NOT(Predicate.<T>TRUE());
} | java | public static <T> Predicate<T> FALSE() {
return Predicate.<T>NOT(Predicate.<T>TRUE());
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"FALSE",
"(",
")",
"{",
"return",
"Predicate",
".",
"<",
"T",
">",
"NOT",
"(",
"Predicate",
".",
"<",
"T",
">",
"TRUE",
"(",
")",
")",
";",
"}"
] | Returns an always-false predicate. | [
"Returns",
"an",
"always",
"-",
"false",
"predicate",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Misc/Predicate.java#L30-L32 | train |
protegeproject/jpaul | src/main/java/jpaul/Misc/Predicate.java | Predicate.NOT | public static <T> Predicate<T> NOT(final Predicate<T> pred) {
return new Predicate<T>() {
public boolean check(T obj) {
return !pred.check(obj);
}
};
} | java | public static <T> Predicate<T> NOT(final Predicate<T> pred) {
return new Predicate<T>() {
public boolean check(T obj) {
return !pred.check(obj);
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"NOT",
"(",
"final",
"Predicate",
"<",
"T",
">",
"pred",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"public",
"boolean",
"check",
"(",
"T",
"obj",
")",
"{",... | Predicate negation.
@return A predicate that is true iff <code>pred</code> is
false. | [
"Predicate",
"negation",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Misc/Predicate.java#L39-L45 | train |
protegeproject/jpaul | src/main/java/jpaul/Misc/Predicate.java | Predicate.AND | public static <T> Predicate<T> AND(final Predicate<T> a, final Predicate<T> b) {
return new Predicate<T>() {
public boolean check(T obj) {
return a.check(obj) && b.check(obj);
}
};
} | java | public static <T> Predicate<T> AND(final Predicate<T> a, final Predicate<T> b) {
return new Predicate<T>() {
public boolean check(T obj) {
return a.check(obj) && b.check(obj);
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"AND",
"(",
"final",
"Predicate",
"<",
"T",
">",
"a",
",",
"final",
"Predicate",
"<",
"T",
">",
"b",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"public",
... | Short-circuited AND operation.
@return A predicate that is true iff both <code>a</code> and
<code>b</code> are true. Evaluation stops as soon as the
final result is known. | [
"Short",
"-",
"circuited",
"AND",
"operation",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Misc/Predicate.java#L52-L58 | train |
protegeproject/jpaul | src/main/java/jpaul/Misc/Predicate.java | Predicate.OR | public static <T> Predicate<T> OR(final Predicate<T> a, final Predicate<T> b) {
return new Predicate<T>() {
public boolean check(T obj) {
return a.check(obj) || b.check(obj);
}
};
} | java | public static <T> Predicate<T> OR(final Predicate<T> a, final Predicate<T> b) {
return new Predicate<T>() {
public boolean check(T obj) {
return a.check(obj) || b.check(obj);
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"OR",
"(",
"final",
"Predicate",
"<",
"T",
">",
"a",
",",
"final",
"Predicate",
"<",
"T",
">",
"b",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"public",
"... | Short-circuited OR operation.
@return A predicate that is false iff both <code>a</code> and
<code>b</code> are false. Evaluation stops as soon as the
final result is known. | [
"Short",
"-",
"circuited",
"OR",
"operation",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Misc/Predicate.java#L65-L71 | train |
btrplace/scheduler | split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SubMapping.java | SubMapping.fillVMIndex | public void fillVMIndex(TIntIntHashMap index, int p) {
for (Node n : scope) {
for (VM v : parent.getRunningVMs(n)) {
index.put(v.id(), p);
}
for (VM v : parent.getSleepingVMs(n)) {
index.put(v.id(), p);
}
}
for (VM v... | java | public void fillVMIndex(TIntIntHashMap index, int p) {
for (Node n : scope) {
for (VM v : parent.getRunningVMs(n)) {
index.put(v.id(), p);
}
for (VM v : parent.getSleepingVMs(n)) {
index.put(v.id(), p);
}
}
for (VM v... | [
"public",
"void",
"fillVMIndex",
"(",
"TIntIntHashMap",
"index",
",",
"int",
"p",
")",
"{",
"for",
"(",
"Node",
"n",
":",
"scope",
")",
"{",
"for",
"(",
"VM",
"v",
":",
"parent",
".",
"getRunningVMs",
"(",
"n",
")",
")",
"{",
"index",
".",
"put",
... | Fill an index with the VM presents in this mapping
@param index the index to fill
@param p the index value to use for each VM in the mapping | [
"Fill",
"an",
"index",
"with",
"the",
"VM",
"presents",
"in",
"this",
"mapping"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/split/src/main/java/org/btrplace/scheduler/runner/disjoint/model/SubMapping.java#L269-L281 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDepInfo.java | ModuleDepInfo.getIncludeStatus | public Boolean getIncludeStatus() {
if (formula.isTrue()) {
return Boolean.TRUE;
} else if (formula.isFalse()) {
return Boolean.FALSE;
}
return null;
} | java | public Boolean getIncludeStatus() {
if (formula.isTrue()) {
return Boolean.TRUE;
} else if (formula.isFalse()) {
return Boolean.FALSE;
}
return null;
} | [
"public",
"Boolean",
"getIncludeStatus",
"(",
")",
"{",
"if",
"(",
"formula",
".",
"isTrue",
"(",
")",
")",
"{",
"return",
"Boolean",
".",
"TRUE",
";",
"}",
"else",
"if",
"(",
"formula",
".",
"isFalse",
"(",
")",
")",
"{",
"return",
"Boolean",
".",
... | Returns a Boolean value indicating the value of the formula expression, or null if
the formula expression contains undefined features. The formula is NOT simplified
prior to returning the result for performance reasons, so some expressions that may
simplify to TRUE can return a null value.
@return the value of the fo... | [
"Returns",
"a",
"Boolean",
"value",
"indicating",
"the",
"value",
"of",
"the",
"formula",
"expression",
"or",
"null",
"if",
"the",
"formula",
"expression",
"contains",
"undefined",
"features",
".",
"The",
"formula",
"is",
"NOT",
"simplified",
"prior",
"to",
"r... | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDepInfo.java#L211-L218 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDepInfo.java | ModuleDepInfo.andWith | public ModuleDepInfo andWith(ModuleDepInfo other) {
if (other == null) {
return this;
}
formula.andWith(other.formula);
if (!isPluginNameDeclared && other.isPluginNameDeclared) {
pluginName = other.pluginName;
isPluginNameDeclared = true;
} else if (pluginName == null) {
pluginName = othe... | java | public ModuleDepInfo andWith(ModuleDepInfo other) {
if (other == null) {
return this;
}
formula.andWith(other.formula);
if (!isPluginNameDeclared && other.isPluginNameDeclared) {
pluginName = other.pluginName;
isPluginNameDeclared = true;
} else if (pluginName == null) {
pluginName = othe... | [
"public",
"ModuleDepInfo",
"andWith",
"(",
"ModuleDepInfo",
"other",
")",
"{",
"if",
"(",
"other",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"formula",
".",
"andWith",
"(",
"other",
".",
"formula",
")",
";",
"if",
"(",
"!",
"isPluginNameDeclare... | logically ands the provided terms with the formula belonging to this
object, updating this object with the result.
@param other
the {@link ModuleDepInfo} to and with this object.
@return this object | [
"logically",
"ands",
"the",
"provided",
"terms",
"with",
"the",
"formula",
"belonging",
"to",
"this",
"object",
"updating",
"this",
"object",
"with",
"the",
"result",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDepInfo.java#L269-L282 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDepInfo.java | ModuleDepInfo.add | public boolean add(ModuleDepInfo other) {
Boolean modified = false;
if (formula.isTrue()) {
// No terms added to a true formula will change the evaluation.
return false;
}
if (other.formula.isTrue()) {
// Adding true to this formula makes this formula true.
modified = !formula.isTrue();
... | java | public boolean add(ModuleDepInfo other) {
Boolean modified = false;
if (formula.isTrue()) {
// No terms added to a true formula will change the evaluation.
return false;
}
if (other.formula.isTrue()) {
// Adding true to this formula makes this formula true.
modified = !formula.isTrue();
... | [
"public",
"boolean",
"add",
"(",
"ModuleDepInfo",
"other",
")",
"{",
"Boolean",
"modified",
"=",
"false",
";",
"if",
"(",
"formula",
".",
"isTrue",
"(",
")",
")",
"{",
"// No terms added to a true formula will change the evaluation.\r",
"return",
"false",
";",
"}"... | Adds the terms and comments from the specified object to this object.
@param other
The object to add
@return True if this object was modified | [
"Adds",
"the",
"terms",
"and",
"comments",
"from",
"the",
"specified",
"object",
"to",
"this",
"object",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/deps/ModuleDepInfo.java#L301-L332 | train |
jMotif/GI | src/main/java/net/seninp/gi/logic/GrammarRuleRecord.java | GrammarRuleRecord.setMinMaxLength | public void setMinMaxLength(int[] lengths) {
Arrays.sort(lengths);
this.minLength = lengths[0];
this.maxLength = lengths[lengths.length - 1];
} | java | public void setMinMaxLength(int[] lengths) {
Arrays.sort(lengths);
this.minLength = lengths[0];
this.maxLength = lengths[lengths.length - 1];
} | [
"public",
"void",
"setMinMaxLength",
"(",
"int",
"[",
"]",
"lengths",
")",
"{",
"Arrays",
".",
"sort",
"(",
"lengths",
")",
";",
"this",
".",
"minLength",
"=",
"lengths",
"[",
"0",
"]",
";",
"this",
".",
"maxLength",
"=",
"lengths",
"[",
"lengths",
"... | Set min and max lengths.
@param lengths the lengths to set. | [
"Set",
"min",
"and",
"max",
"lengths",
"."
] | 381212dd4f193246a6df82bd46f0d2bcd04a68d6 | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/logic/GrammarRuleRecord.java#L163-L167 | train |
m-m-m/util | reflect/src/main/java/net/sf/mmm/util/reflect/impl/GenericTypeImpl.java | GenericTypeImpl.create | @SuppressWarnings({ "rawtypes", "unchecked" })
protected AbstractGenericType<T> create(Type genericType, GenericType<?> genericDefiningType) {
return new GenericTypeImpl(genericType, genericDefiningType);
} | java | @SuppressWarnings({ "rawtypes", "unchecked" })
protected AbstractGenericType<T> create(Type genericType, GenericType<?> genericDefiningType) {
return new GenericTypeImpl(genericType, genericDefiningType);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"protected",
"AbstractGenericType",
"<",
"T",
">",
"create",
"(",
"Type",
"genericType",
",",
"GenericType",
"<",
"?",
">",
"genericDefiningType",
")",
"{",
"return",
"new",
"Ge... | This method creates a new instance of this class. It may be overridden to create the appropriate sub-type.
@param genericType is the {@link #getType() value-type}.
@param genericDefiningType is the {@link #getDefiningType() defining-type}.
@return a new {@link GenericType} instance. | [
"This",
"method",
"creates",
"a",
"new",
"instance",
"of",
"this",
"class",
".",
"It",
"may",
"be",
"overridden",
"to",
"create",
"the",
"appropriate",
"sub",
"-",
"type",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/reflect/src/main/java/net/sf/mmm/util/reflect/impl/GenericTypeImpl.java#L155-L159 | train |
protegeproject/jpaul | src/main/java/jpaul/Graphs/BinTreeUtil.java | BinTreeUtil.inOrder | public static <T> void inOrder(T root, BinTreeNavigator<T> binTreeNav, Action<T> action) {
for(Iterator<T> it = inOrder(root, binTreeNav); it.hasNext(); ) {
T treeVertex = it.next();
action.action(treeVertex);
}
} | java | public static <T> void inOrder(T root, BinTreeNavigator<T> binTreeNav, Action<T> action) {
for(Iterator<T> it = inOrder(root, binTreeNav); it.hasNext(); ) {
T treeVertex = it.next();
action.action(treeVertex);
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"inOrder",
"(",
"T",
"root",
",",
"BinTreeNavigator",
"<",
"T",
">",
"binTreeNav",
",",
"Action",
"<",
"T",
">",
"action",
")",
"{",
"for",
"(",
"Iterator",
"<",
"T",
">",
"it",
"=",
"inOrder",
"(",
"root"... | Executes an action on all nodes from a tree, in inorder. For
trees with sharing, the same tree node object will be visited
multiple times.
@param root Binary tree root.
@param binTreeNav Binary tree navigator.
@param action Action to execute on each tree node. | [
"Executes",
"an",
"action",
"on",
"all",
"nodes",
"from",
"a",
"tree",
"in",
"inorder",
".",
"For",
"trees",
"with",
"sharing",
"the",
"same",
"tree",
"node",
"object",
"will",
"be",
"visited",
"multiple",
"times",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Graphs/BinTreeUtil.java#L35-L40 | train |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/network/DefaultRouting.java | DefaultRouting.getFirstPhysicalPath | private Map<Link, Boolean> getFirstPhysicalPath(Map<Link, Boolean> currentPath, Switch sw, Node dst) {
// Iterate through the current switch's links
for (Link l : net.getConnectedLinks(sw)) {
// Wrong link
if (currentPath.containsKey(l)) {
continue;
}... | java | private Map<Link, Boolean> getFirstPhysicalPath(Map<Link, Boolean> currentPath, Switch sw, Node dst) {
// Iterate through the current switch's links
for (Link l : net.getConnectedLinks(sw)) {
// Wrong link
if (currentPath.containsKey(l)) {
continue;
}... | [
"private",
"Map",
"<",
"Link",
",",
"Boolean",
">",
"getFirstPhysicalPath",
"(",
"Map",
"<",
"Link",
",",
"Boolean",
">",
"currentPath",
",",
"Switch",
"sw",
",",
"Node",
"dst",
")",
"{",
"// Iterate through the current switch's links",
"for",
"(",
"Link",
"l"... | Recursive method to get the first physical path found from a switch to a destination node
@param currentPath the current or initial path containing the link(s) crossed
@param sw the current switch to browse
@param dst the destination node to reach
@return the ordered list of links that make the path to dst | [
"Recursive",
"method",
"to",
"get",
"the",
"first",
"physical",
"path",
"found",
"from",
"a",
"switch",
"to",
"a",
"destination",
"node"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/DefaultRouting.java#L45-L82 | train |
OpenNTF/JavascriptAggregator | jaggr-service/src/main/java/com/ibm/jaggr/service/util/FrameworkWiringBundleResolver.java | FrameworkWiringBundleResolver.getBundle | public Bundle getBundle(String symbolicName) {
final String sourceMethod = "getBundle"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(FrameworkWiringBundleResolver.class.getName(), sourceMethod, new Object[]{symbolicName});
}
Bundle[] candidate... | java | public Bundle getBundle(String symbolicName) {
final String sourceMethod = "getBundle"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(FrameworkWiringBundleResolver.class.getName(), sourceMethod, new Object[]{symbolicName});
}
Bundle[] candidate... | [
"public",
"Bundle",
"getBundle",
"(",
"String",
"symbolicName",
")",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"getBundle\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"isTraceLogging",
"=",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
";",
"if",
"... | Returns the bundle with the requested symbolic name that is wired to the contributing bundle,
or the bundle with the latest version if unable to determine wiring.
@param symbolicName
@return the requested bundle | [
"Returns",
"the",
"bundle",
"with",
"the",
"requested",
"symbolic",
"name",
"that",
"is",
"wired",
"to",
"the",
"contributing",
"bundle",
"or",
"the",
"bundle",
"with",
"the",
"latest",
"version",
"if",
"unable",
"to",
"determine",
"wiring",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/util/FrameworkWiringBundleResolver.java#L99-L154 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerBuilder.java | LayerBuilder.getSourcesMappingEpilogue | protected String getSourcesMappingEpilogue() {
String root = ""; //$NON-NLS-1$
String contextPath = request.getRequestURI();
if (contextPath != null) {
// We may be re-building a layer for a source map request where the layer
// has been flushed from the cache. If that's the case, then the context
... | java | protected String getSourcesMappingEpilogue() {
String root = ""; //$NON-NLS-1$
String contextPath = request.getRequestURI();
if (contextPath != null) {
// We may be re-building a layer for a source map request where the layer
// has been flushed from the cache. If that's the case, then the context
... | [
"protected",
"String",
"getSourcesMappingEpilogue",
"(",
")",
"{",
"String",
"root",
"=",
"\"\"",
";",
"//$NON-NLS-1$\r",
"String",
"contextPath",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"if",
"(",
"contextPath",
"!=",
"null",
")",
"{",
"// We may... | Returns the source mapping epilogue for the layer that gets added to the end of the response.
@see <a
href="https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.lmz475t4mvbx">Source
Map Revision 3 Proposal - Linking generated code to source maps</a>
@return the source mapping... | [
"Returns",
"the",
"source",
"mapping",
"epilogue",
"for",
"the",
"layer",
"that",
"gets",
"added",
"to",
"the",
"end",
"of",
"the",
"response",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerBuilder.java#L256-L286 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerBuilder.java | LayerBuilder.collectFutures | protected List<ModuleBuildFuture> collectFutures(ModuleList moduleList, HttpServletRequest request)
throws IOException {
final String sourceMethod = "collectFutures"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod... | java | protected List<ModuleBuildFuture> collectFutures(ModuleList moduleList, HttpServletRequest request)
throws IOException {
final String sourceMethod = "collectFutures"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod... | [
"protected",
"List",
"<",
"ModuleBuildFuture",
">",
"collectFutures",
"(",
"ModuleList",
"moduleList",
",",
"HttpServletRequest",
"request",
")",
"throws",
"IOException",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"collectFutures\"",
";",
"//$NON-NLS-1$\r",
"final",... | Dispatch the modules specified in the request to the module builders and
collect the build futures returned by the builders into the returned
list.
@param moduleList
The list of modules in the layer
@param request
The request object
@return The list of {@link ModuleBuildFuture} objects.
@throws IOException | [
"Dispatch",
"the",
"modules",
"specified",
"in",
"the",
"request",
"to",
"the",
"module",
"builders",
"and",
"collect",
"the",
"build",
"futures",
"returned",
"by",
"the",
"builders",
"into",
"the",
"returned",
"list",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerBuilder.java#L407-L482 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerBuilder.java | LayerBuilder.notifyLayerListeners | protected String notifyLayerListeners(ILayerListener.EventType type, HttpServletRequest request, IModule module) throws IOException {
StringBuffer sb = new StringBuffer();
// notify any listeners that the config has been updated
List<IServiceReference> refs = null;
if(aggr.getPlatformServices() != null){
... | java | protected String notifyLayerListeners(ILayerListener.EventType type, HttpServletRequest request, IModule module) throws IOException {
StringBuffer sb = new StringBuffer();
// notify any listeners that the config has been updated
List<IServiceReference> refs = null;
if(aggr.getPlatformServices() != null){
... | [
"protected",
"String",
"notifyLayerListeners",
"(",
"ILayerListener",
".",
"EventType",
"type",
",",
"HttpServletRequest",
"request",
",",
"IModule",
"module",
")",
"throws",
"IOException",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// ... | Calls the registered layer listeners.
@param type
The type of notification (begin or end)
@param request
The request object.
@param module
the associated module reference, depending on the value of {@code type}.
@return The string to include in the layer output
@throws IOException | [
"Calls",
"the",
"registered",
"layer",
"listeners",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerBuilder.java#L496-L535 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/PathUtil.java | PathUtil.getModuleName | public static String getModuleName(URI uri) {
String name = uri.getPath();
if (name.endsWith("/")) { //$NON-NLS-1$
name = name.substring(0, name.length()-1);
}
int idx = name.lastIndexOf("/"); //$NON-NLS-1$
if (idx != -1) {
name = name.substring(idx+1);
}
if (name.endsWith(".js")) { //$NON-... | java | public static String getModuleName(URI uri) {
String name = uri.getPath();
if (name.endsWith("/")) { //$NON-NLS-1$
name = name.substring(0, name.length()-1);
}
int idx = name.lastIndexOf("/"); //$NON-NLS-1$
if (idx != -1) {
name = name.substring(idx+1);
}
if (name.endsWith(".js")) { //$NON-... | [
"public",
"static",
"String",
"getModuleName",
"(",
"URI",
"uri",
")",
"{",
"String",
"name",
"=",
"uri",
".",
"getPath",
"(",
")",
";",
"if",
"(",
"name",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"//$NON-NLS-1$\r",
"name",
"=",
"name",
".",
"su... | Returns the module name for the specified URI. This is the name part of
the URI with path information removed, and with the .js extension removed
if present.
@param uri
the uri to return the name for
@return the module name | [
"Returns",
"the",
"module",
"name",
"for",
"the",
"specified",
"URI",
".",
"This",
"is",
"the",
"name",
"part",
"of",
"the",
"URI",
"with",
"path",
"information",
"removed",
"and",
"with",
"the",
".",
"js",
"extension",
"removed",
"if",
"present",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/PathUtil.java#L128-L141 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/PathUtil.java | PathUtil.getExtension | public static String getExtension(String path) {
int idx = path.lastIndexOf("/"); //$NON-NLS-1$
String filename = idx == -1 ? path : path.substring(idx+1);
idx = filename.lastIndexOf("."); //$NON-NLS-1$
return idx == -1 ? "" : filename.substring(idx+1); //$NON-NLS-1$
} | java | public static String getExtension(String path) {
int idx = path.lastIndexOf("/"); //$NON-NLS-1$
String filename = idx == -1 ? path : path.substring(idx+1);
idx = filename.lastIndexOf("."); //$NON-NLS-1$
return idx == -1 ? "" : filename.substring(idx+1); //$NON-NLS-1$
} | [
"public",
"static",
"String",
"getExtension",
"(",
"String",
"path",
")",
"{",
"int",
"idx",
"=",
"path",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
";",
"//$NON-NLS-1$\r",
"String",
"filename",
"=",
"idx",
"==",
"-",
"1",
"?",
"path",
":",
"path",
".",
"s... | Returns the file extension part of the specified path
@param path the filname path of the file
@return the file extension | [
"Returns",
"the",
"file",
"extension",
"part",
"of",
"the",
"specified",
"path"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/PathUtil.java#L192-L197 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/i18n/I18nModuleBuilder.java | I18nModuleBuilder.tryAddModule | private boolean tryAddModule(
IAggregator aggregator,
List<String> list,
String bundleRoot,
IResource bundleRootRes,
String locale,
String resource,
Collection<String> availableLocales)
throws IOException {
if (availableLocales != null && !availableLocales.contains(locale)) {
re... | java | private boolean tryAddModule(
IAggregator aggregator,
List<String> list,
String bundleRoot,
IResource bundleRootRes,
String locale,
String resource,
Collection<String> availableLocales)
throws IOException {
if (availableLocales != null && !availableLocales.contains(locale)) {
re... | [
"private",
"boolean",
"tryAddModule",
"(",
"IAggregator",
"aggregator",
",",
"List",
"<",
"String",
">",
"list",
",",
"String",
"bundleRoot",
",",
"IResource",
"bundleRootRes",
",",
"String",
"locale",
",",
"String",
"resource",
",",
"Collection",
"<",
"String",... | Adds the source for the locale specific i18n resource if it exists.
@param list
The list of source files to add the i18n resource to
@param bundleRoot
The module path for the bundle root (e.g. 'foo/nls')
@param bundleRootRes
The bundle root resource that was requested
@param localePath
The path relative to the bundle ... | [
"Adds",
"the",
"source",
"for",
"the",
"locale",
"specific",
"i18n",
"resource",
"if",
"it",
"exists",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/i18n/I18nModuleBuilder.java#L272-L294 | train |
protegeproject/jpaul | src/main/java/jpaul/RegExps/RegExp.java | RegExp.unionNav | private static <A> ForwardNavigator<RegExp<A>> unionNav() {
return new ForwardNavigator<RegExp<A>>() {
private Visitor<A,List<RegExp<A>>> unionVis = new Visitor<A,List<RegExp<A>>>() {
public List<RegExp<A>> visit(Union<A> ure) {
return Arrays.<RegExp<A>>asList(ure.left, ure.right);
}
public List<RegEx... | java | private static <A> ForwardNavigator<RegExp<A>> unionNav() {
return new ForwardNavigator<RegExp<A>>() {
private Visitor<A,List<RegExp<A>>> unionVis = new Visitor<A,List<RegExp<A>>>() {
public List<RegExp<A>> visit(Union<A> ure) {
return Arrays.<RegExp<A>>asList(ure.left, ure.right);
}
public List<RegEx... | [
"private",
"static",
"<",
"A",
">",
"ForwardNavigator",
"<",
"RegExp",
"<",
"A",
">",
">",
"unionNav",
"(",
")",
"{",
"return",
"new",
"ForwardNavigator",
"<",
"RegExp",
"<",
"A",
">",
">",
"(",
")",
"{",
"private",
"Visitor",
"<",
"A",
",",
"List",
... | forward navigator through the sons of Union nodes. | [
"forward",
"navigator",
"through",
"the",
"sons",
"of",
"Union",
"nodes",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/RegExps/RegExp.java#L346-L360 | train |
protegeproject/jpaul | src/main/java/jpaul/RegExps/RegExp.java | RegExp.concatNav | private static <A> ForwardNavigator<RegExp<A>> concatNav() {
return new ForwardNavigator<RegExp<A>>() {
private Visitor<A,List<RegExp<A>>> concatVis = new Visitor<A,List<RegExp<A>>>() {
public List<RegExp<A>> visit(Concat<A> ure) {
return Arrays.<RegExp<A>>asList(ure.left, ure.right);
}
public List<Re... | java | private static <A> ForwardNavigator<RegExp<A>> concatNav() {
return new ForwardNavigator<RegExp<A>>() {
private Visitor<A,List<RegExp<A>>> concatVis = new Visitor<A,List<RegExp<A>>>() {
public List<RegExp<A>> visit(Concat<A> ure) {
return Arrays.<RegExp<A>>asList(ure.left, ure.right);
}
public List<Re... | [
"private",
"static",
"<",
"A",
">",
"ForwardNavigator",
"<",
"RegExp",
"<",
"A",
">",
">",
"concatNav",
"(",
")",
"{",
"return",
"new",
"ForwardNavigator",
"<",
"RegExp",
"<",
"A",
">",
">",
"(",
")",
"{",
"private",
"Visitor",
"<",
"A",
",",
"List",... | forward navigator through the sons of Concat nodes. | [
"forward",
"navigator",
"through",
"the",
"sons",
"of",
"Concat",
"nodes",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/RegExps/RegExp.java#L363-L377 | train |
m-m-m/util | xml/src/main/java/net/sf/mmm/util/xml/base/DomUtilImpl.java | DomUtilImpl.createTransformer | private Transformer createTransformer(boolean indent) {
try {
Transformer result = this.transformerFactory.newTransformer();
if (indent) {
result.setOutputProperty(OutputKeys.INDENT, "yes");
}
return result;
} catch (TransformerConfigurationException e) {
throw new Illegal... | java | private Transformer createTransformer(boolean indent) {
try {
Transformer result = this.transformerFactory.newTransformer();
if (indent) {
result.setOutputProperty(OutputKeys.INDENT, "yes");
}
return result;
} catch (TransformerConfigurationException e) {
throw new Illegal... | [
"private",
"Transformer",
"createTransformer",
"(",
"boolean",
"indent",
")",
"{",
"try",
"{",
"Transformer",
"result",
"=",
"this",
".",
"transformerFactory",
".",
"newTransformer",
"(",
")",
";",
"if",
"(",
"indent",
")",
"{",
"result",
".",
"setOutputProper... | This method creates a new transformer.
@param indent - {@code true} if the XML should be indented (automatically add linebreaks before opening
tags), {@code false} otherwise.
@return the new transformer. | [
"This",
"method",
"creates",
"a",
"new",
"transformer",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/base/DomUtilImpl.java#L176-L187 | train |
btrplace/scheduler | bench/src/main/java/org/btrplace/bench/Options.java | Options.parameters | public Parameters parameters() {
Parameters ps = new DefaultParameters()
.setTimeLimit(timeout)
.doRepair(repair)
.doOptimize(optimize);
if (single()) {
ps.setVerbosity(verbosity);
}
if (chunk) {
ps.setEnvironmentFa... | java | public Parameters parameters() {
Parameters ps = new DefaultParameters()
.setTimeLimit(timeout)
.doRepair(repair)
.doOptimize(optimize);
if (single()) {
ps.setVerbosity(verbosity);
}
if (chunk) {
ps.setEnvironmentFa... | [
"public",
"Parameters",
"parameters",
"(",
")",
"{",
"Parameters",
"ps",
"=",
"new",
"DefaultParameters",
"(",
")",
".",
"setTimeLimit",
"(",
"timeout",
")",
".",
"doRepair",
"(",
"repair",
")",
".",
"doOptimize",
"(",
"optimize",
")",
";",
"if",
"(",
"s... | Get the parameters from the options.
@return the resulting parameters | [
"Get",
"the",
"parameters",
"from",
"the",
"options",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/bench/src/main/java/org/btrplace/bench/Options.java#L72-L85 | train |
btrplace/scheduler | bench/src/main/java/org/btrplace/bench/Options.java | Options.instances | public Stream<LabelledInstance> instances() throws IOException {
if (single()) {
return Collections.singletonList(instance(new File(instance))).stream();
}
@SuppressWarnings("resource")
Stream<String> s = Files.lines(Paths.get(instances), StandardCharsets.UTF_8);
ret... | java | public Stream<LabelledInstance> instances() throws IOException {
if (single()) {
return Collections.singletonList(instance(new File(instance))).stream();
}
@SuppressWarnings("resource")
Stream<String> s = Files.lines(Paths.get(instances), StandardCharsets.UTF_8);
ret... | [
"public",
"Stream",
"<",
"LabelledInstance",
">",
"instances",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"single",
"(",
")",
")",
"{",
"return",
"Collections",
".",
"singletonList",
"(",
"instance",
"(",
"new",
"File",
"(",
"instance",
")",
")",
... | List all the instances to solve.
@return a list of instances
@throws IOException if it was not possible to get all the instances | [
"List",
"all",
"the",
"instances",
"to",
"solve",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/bench/src/main/java/org/btrplace/bench/Options.java#L110-L118 | train |
btrplace/scheduler | bench/src/main/java/org/btrplace/bench/Options.java | Options.output | public File output() throws IOException {
File o = new File(output);
if (!o.exists() && !o.mkdirs()) {
throw new IOException("Unable to create output folder '" + output + "'");
}
return o;
} | java | public File output() throws IOException {
File o = new File(output);
if (!o.exists() && !o.mkdirs()) {
throw new IOException("Unable to create output folder '" + output + "'");
}
return o;
} | [
"public",
"File",
"output",
"(",
")",
"throws",
"IOException",
"{",
"File",
"o",
"=",
"new",
"File",
"(",
"output",
")",
";",
"if",
"(",
"!",
"o",
".",
"exists",
"(",
")",
"&&",
"!",
"o",
".",
"mkdirs",
"(",
")",
")",
"{",
"throw",
"new",
"IOEx... | Get the output directory.
@return an existing output directory
@throws IOException if the directory does not exists or was not created | [
"Get",
"the",
"output",
"directory",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/bench/src/main/java/org/btrplace/bench/Options.java#L126-L132 | train |
btrplace/scheduler | bench/src/main/java/org/btrplace/bench/Options.java | Options.instance | public static LabelledInstance instance(File f) {
String path = f.getAbsolutePath();
return new LabelledInstance(path, JSON.readInstance(f));
} | java | public static LabelledInstance instance(File f) {
String path = f.getAbsolutePath();
return new LabelledInstance(path, JSON.readInstance(f));
} | [
"public",
"static",
"LabelledInstance",
"instance",
"(",
"File",
"f",
")",
"{",
"String",
"path",
"=",
"f",
".",
"getAbsolutePath",
"(",
")",
";",
"return",
"new",
"LabelledInstance",
"(",
"path",
",",
"JSON",
".",
"readInstance",
"(",
"f",
")",
")",
";"... | Make an instance.
@param f the file that store the instance
@return the parsed instance. The instance label is the file name | [
"Make",
"an",
"instance",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/bench/src/main/java/org/btrplace/bench/Options.java#L139-L142 | train |
protegeproject/jpaul | src/main/java/jpaul/Misc/Function.java | Function.comp | public static <T1,T2,T3> Function<T1,T3> comp(final Function<T2,T3> func1, final Function<T1,T2> func2) {
return new Function<T1,T3>() {
public T3 f(T1 x) {
return func1.f(func2.f(x));
}
};
} | java | public static <T1,T2,T3> Function<T1,T3> comp(final Function<T2,T3> func1, final Function<T1,T2> func2) {
return new Function<T1,T3>() {
public T3 f(T1 x) {
return func1.f(func2.f(x));
}
};
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"Function",
"<",
"T1",
",",
"T3",
">",
"comp",
"(",
"final",
"Function",
"<",
"T2",
",",
"T3",
">",
"func1",
",",
"final",
"Function",
"<",
"T1",
",",
"T2",
">",
"func2",
")",
"{",
"retu... | Computes the composition of two functions. | [
"Computes",
"the",
"composition",
"of",
"two",
"functions",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Misc/Function.java#L20-L26 | train |
btrplace/scheduler | api/src/main/java/org/btrplace/model/constraint/Split.java | Split.getAssociatedVGroup | public Collection<VM> getAssociatedVGroup(VM u) {
for (Collection<VM> vGrp : sets) {
if (vGrp.contains(u)) {
return vGrp;
}
}
return Collections.emptySet();
} | java | public Collection<VM> getAssociatedVGroup(VM u) {
for (Collection<VM> vGrp : sets) {
if (vGrp.contains(u)) {
return vGrp;
}
}
return Collections.emptySet();
} | [
"public",
"Collection",
"<",
"VM",
">",
"getAssociatedVGroup",
"(",
"VM",
"u",
")",
"{",
"for",
"(",
"Collection",
"<",
"VM",
">",
"vGrp",
":",
"sets",
")",
"{",
"if",
"(",
"vGrp",
".",
"contains",
"(",
"u",
")",
")",
"{",
"return",
"vGrp",
";",
... | Get the group of VMs that contains the given VM.
@param u the VM identifier
@return the group of VM if exists, an empty collection otherwise | [
"Get",
"the",
"group",
"of",
"VMs",
"that",
"contains",
"the",
"given",
"VM",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/constraint/Split.java#L96-L103 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java | OptionsImpl.loadProps | protected Properties loadProps(Properties props) {
// try to load the properties file first from the user's home directory
File file = getPropsFile();
if (file != null) {
// Try to load the file from the user's home directory
if (file.exists()) {
try {
URL url = file.toURI().toURL();
... | java | protected Properties loadProps(Properties props) {
// try to load the properties file first from the user's home directory
File file = getPropsFile();
if (file != null) {
// Try to load the file from the user's home directory
if (file.exists()) {
try {
URL url = file.toURI().toURL();
... | [
"protected",
"Properties",
"loadProps",
"(",
"Properties",
"props",
")",
"{",
"// try to load the properties file first from the user's home directory\r",
"File",
"file",
"=",
"getPropsFile",
"(",
")",
";",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"// Try to load the ... | Loads the Options properties from the aggregator properties file
into the specified properties object. If the properties file
does not exist, then try to load from the bundle.
@param props
The properties object to load. May be initialized with default
values.
@return The properties file specified by {@code props}. | [
"Loads",
"the",
"Options",
"properties",
"from",
"the",
"aggregator",
"properties",
"file",
"into",
"the",
"specified",
"properties",
"object",
".",
"If",
"the",
"properties",
"file",
"does",
"not",
"exist",
"then",
"try",
"to",
"load",
"from",
"the",
"bundle"... | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java#L270-L288 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java | OptionsImpl.saveProps | protected void saveProps(Properties props) throws IOException {
if (loadFromPropertiesFile) {
// Persist the change to the properties file.
File file = getPropsFile();
if (file != null) {
FileWriter writer = new FileWriter(file);
try {
props.store(writer, null);
} finally {
w... | java | protected void saveProps(Properties props) throws IOException {
if (loadFromPropertiesFile) {
// Persist the change to the properties file.
File file = getPropsFile();
if (file != null) {
FileWriter writer = new FileWriter(file);
try {
props.store(writer, null);
} finally {
w... | [
"protected",
"void",
"saveProps",
"(",
"Properties",
"props",
")",
"throws",
"IOException",
"{",
"if",
"(",
"loadFromPropertiesFile",
")",
"{",
"// Persist the change to the properties file.\r",
"File",
"file",
"=",
"getPropsFile",
"(",
")",
";",
"if",
"(",
"file",
... | Saves the specified Options properties to the properties file for the
aggregator.
@param props
The properties to save
@throws IOException | [
"Saves",
"the",
"specified",
"Options",
"properties",
"to",
"the",
"properties",
"file",
"for",
"the",
"aggregator",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java#L298-L312 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java | OptionsImpl.updateNotify | protected void updateNotify (long sequence) {
IServiceReference[] refs = null;
try {
if(aggregator != null && aggregator.getPlatformServices() != null){
refs = aggregator.getPlatformServices().getServiceReferences(IOptionsListener.class.getName(),"(name=" + registrationName + ")"); //$NON-NLS-1$ //$NON... | java | protected void updateNotify (long sequence) {
IServiceReference[] refs = null;
try {
if(aggregator != null && aggregator.getPlatformServices() != null){
refs = aggregator.getPlatformServices().getServiceReferences(IOptionsListener.class.getName(),"(name=" + registrationName + ")"); //$NON-NLS-1$ //$NON... | [
"protected",
"void",
"updateNotify",
"(",
"long",
"sequence",
")",
"{",
"IServiceReference",
"[",
"]",
"refs",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"aggregator",
"!=",
"null",
"&&",
"aggregator",
".",
"getPlatformServices",
"(",
")",
"!=",
"null",
")",... | Notify options change listeners that Options have been updated
@param sequence The change sequence number. | [
"Notify",
"options",
"change",
"listeners",
"that",
"Options",
"have",
"been",
"updated"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java#L319-L344 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java | OptionsImpl.propertiesFileUpdated | protected void propertiesFileUpdated(Properties updated, long sequence) {
Properties newProps = new Properties(getDefaultOptions());
Enumeration<?> propsEnum = updated.propertyNames();
while (propsEnum.hasMoreElements()) {
String name = (String)propsEnum.nextElement();
newProps.setProperty(name, update... | java | protected void propertiesFileUpdated(Properties updated, long sequence) {
Properties newProps = new Properties(getDefaultOptions());
Enumeration<?> propsEnum = updated.propertyNames();
while (propsEnum.hasMoreElements()) {
String name = (String)propsEnum.nextElement();
newProps.setProperty(name, update... | [
"protected",
"void",
"propertiesFileUpdated",
"(",
"Properties",
"updated",
",",
"long",
"sequence",
")",
"{",
"Properties",
"newProps",
"=",
"new",
"Properties",
"(",
"getDefaultOptions",
"(",
")",
")",
";",
"Enumeration",
"<",
"?",
">",
"propsEnum",
"=",
"up... | Listener method for being informed of changes to the properties file by another
instance of this class. Called by other instances of this class for instances
that use the same properties file when properties are saved.
@param updated
the updated properties
@param sequence
the update sequence number | [
"Listener",
"method",
"for",
"being",
"informed",
"of",
"changes",
"to",
"the",
"properties",
"file",
"by",
"another",
"instance",
"of",
"this",
"class",
".",
"Called",
"by",
"other",
"instances",
"of",
"this",
"class",
"for",
"instances",
"that",
"use",
"th... | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java#L356-L365 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java | OptionsImpl.propsFileUpdateNotify | protected void propsFileUpdateNotify(Properties updatedProps, long sequence) {
if(aggregator == null || aggregator.getPlatformServices() == null // unit tests?
|| !loadFromPropertiesFile) return;
IPlatformServices platformServices = aggregator.getPlatformServices();
try {
IServiceReference[] refs = ... | java | protected void propsFileUpdateNotify(Properties updatedProps, long sequence) {
if(aggregator == null || aggregator.getPlatformServices() == null // unit tests?
|| !loadFromPropertiesFile) return;
IPlatformServices platformServices = aggregator.getPlatformServices();
try {
IServiceReference[] refs = ... | [
"protected",
"void",
"propsFileUpdateNotify",
"(",
"Properties",
"updatedProps",
",",
"long",
"sequence",
")",
"{",
"if",
"(",
"aggregator",
"==",
"null",
"||",
"aggregator",
".",
"getPlatformServices",
"(",
")",
"==",
"null",
"// unit tests?\r",
"||",
"!",
"loa... | Notify implementations of this class that are listening for properties file updates
on the same properties file that the properties file has been updated.
@param updatedProps
the updated properties
@param sequence
the update sequence number | [
"Notify",
"implementations",
"of",
"this",
"class",
"that",
"are",
"listening",
"for",
"properties",
"file",
"updates",
"on",
"the",
"same",
"properties",
"file",
"that",
"the",
"properties",
"file",
"has",
"been",
"updated",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java#L391-L420 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java | OptionsImpl.initDefaultOptions | protected Properties initDefaultOptions() {
Properties defaultValues = new Properties();
defaultValues.putAll(defaults);
// See if there's an aggregator.properties in the class loader's root
ClassLoader cl = OptionsImpl.class.getClassLoader();
URL url = cl.getResource(getPropsFilename());
if (url !=... | java | protected Properties initDefaultOptions() {
Properties defaultValues = new Properties();
defaultValues.putAll(defaults);
// See if there's an aggregator.properties in the class loader's root
ClassLoader cl = OptionsImpl.class.getClassLoader();
URL url = cl.getResource(getPropsFilename());
if (url !=... | [
"protected",
"Properties",
"initDefaultOptions",
"(",
")",
"{",
"Properties",
"defaultValues",
"=",
"new",
"Properties",
"(",
")",
";",
"defaultValues",
".",
"putAll",
"(",
"defaults",
")",
";",
"// See if there's an aggregator.properties in the class loader's root\r",
"C... | Returns the default options for this the aggregator service.
@return The default options. | [
"Returns",
"the",
"default",
"options",
"for",
"this",
"the",
"aggregator",
"service",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/options/OptionsImpl.java#L460-L485 | train |
mapcode-foundation/mapcode-java | src/main/java/com/mapcode/MapcodeZone.java | MapcodeZone.setFromFractions | void setFromFractions(final double latFraction, final double lonFraction,
final double latFractionDelta, final double lonFractionDelta) {
assert (lonFractionDelta >= 0.0);
assert (latFractionDelta != 0.0);
lonFractionMin = lonFraction;
lonFractionMax = lonFracti... | java | void setFromFractions(final double latFraction, final double lonFraction,
final double latFractionDelta, final double lonFractionDelta) {
assert (lonFractionDelta >= 0.0);
assert (latFractionDelta != 0.0);
lonFractionMin = lonFraction;
lonFractionMax = lonFracti... | [
"void",
"setFromFractions",
"(",
"final",
"double",
"latFraction",
",",
"final",
"double",
"lonFraction",
",",
"final",
"double",
"latFractionDelta",
",",
"final",
"double",
"lonFractionDelta",
")",
"{",
"assert",
"(",
"lonFractionDelta",
">=",
"0.0",
")",
";",
... | Generate upper and lower limits based on x and y, and delta's. | [
"Generate",
"upper",
"and",
"lower",
"limits",
"based",
"on",
"x",
"and",
"y",
"and",
"delta",
"s",
"."
] | f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8 | https://github.com/mapcode-foundation/mapcode-java/blob/f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8/src/main/java/com/mapcode/MapcodeZone.java#L89-L102 | train |
btrplace/scheduler | api/src/main/java/org/btrplace/plan/event/ShutdownNode.java | ShutdownNode.applyAction | @Override
public boolean applyAction(Model c) {
Mapping map = c.getMapping();
return !map.isOffline(node) && map.addOfflineNode(node);
} | java | @Override
public boolean applyAction(Model c) {
Mapping map = c.getMapping();
return !map.isOffline(node) && map.addOfflineNode(node);
} | [
"@",
"Override",
"public",
"boolean",
"applyAction",
"(",
"Model",
"c",
")",
"{",
"Mapping",
"map",
"=",
"c",
".",
"getMapping",
"(",
")",
";",
"return",
"!",
"map",
".",
"isOffline",
"(",
"node",
")",
"&&",
"map",
".",
"addOfflineNode",
"(",
"node",
... | Put the node offline on a model
@param c the model
@return {@code true} if the node was online and is set offline. {@code false} otherwise | [
"Put",
"the",
"node",
"offline",
"on",
"a",
"model"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/event/ShutdownNode.java#L86-L90 | train |
jMotif/GI | src/main/java/net/seninp/gi/sequitur/SAXSymbol.java | SAXSymbol.join | public static void join(SAXSymbol left, SAXSymbol right) {
// System.out.println(" performing the join of " + getPayload(left) + " and "
// + getPayload(right));
// check for an OLD digram existence - i.e. left must have a next symbol
// if .n exists then we are joining TERMINAL symbols within t... | java | public static void join(SAXSymbol left, SAXSymbol right) {
// System.out.println(" performing the join of " + getPayload(left) + " and "
// + getPayload(right));
// check for an OLD digram existence - i.e. left must have a next symbol
// if .n exists then we are joining TERMINAL symbols within t... | [
"public",
"static",
"void",
"join",
"(",
"SAXSymbol",
"left",
",",
"SAXSymbol",
"right",
")",
"{",
"// System.out.println(\" performing the join of \" + getPayload(left) + \" and \"\r",
"// + getPayload(right));\r",
"// check for an OLD digram existence - i.e. left must have a next symbo... | Links left and right symbols together, i.e. removes this symbol from the string, also removing
any old digram from the hash table.
@param left the left symbol.
@param right the right symbol. | [
"Links",
"left",
"and",
"right",
"symbols",
"together",
"i",
".",
"e",
".",
"removes",
"this",
"symbol",
"from",
"the",
"string",
"also",
"removing",
"any",
"old",
"digram",
"from",
"the",
"hash",
"table",
"."
] | 381212dd4f193246a6df82bd46f0d2bcd04a68d6 | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/sequitur/SAXSymbol.java#L66-L83 | train |
jMotif/GI | src/main/java/net/seninp/gi/sequitur/SAXSymbol.java | SAXSymbol.substitute | public void substitute(SAXRule r) {
// System.out.println("[sequitur debug] *substitute* " + this.value + " with rule "
// + r.asDebugLine());
// clean up this place and the next
// here we keep the original position in the input string
//
r.addIndex(this.originalPosition);
this.c... | java | public void substitute(SAXRule r) {
// System.out.println("[sequitur debug] *substitute* " + this.value + " with rule "
// + r.asDebugLine());
// clean up this place and the next
// here we keep the original position in the input string
//
r.addIndex(this.originalPosition);
this.c... | [
"public",
"void",
"substitute",
"(",
"SAXRule",
"r",
")",
"{",
"// System.out.println(\"[sequitur debug] *substitute* \" + this.value + \" with rule \"\r",
"// + r.asDebugLine());\r",
"// clean up this place and the next\r",
"// here we keep the original position in the input string\r",
"//\... | Replace a digram with a non-terminal.
@param r a rule to use. | [
"Replace",
"a",
"digram",
"with",
"a",
"non",
"-",
"terminal",
"."
] | 381212dd4f193246a6df82bd46f0d2bcd04a68d6 | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/sequitur/SAXSymbol.java#L217-L238 | train |
jMotif/GI | src/main/java/net/seninp/gi/sequitur/SAXSymbol.java | SAXSymbol.match | public void match(SAXSymbol theDigram, SAXSymbol matchingDigram) {
SAXRule rule;
SAXSymbol first, second;
// System.out.println("[sequitur debug] *match* newDigram [" + newDigram.value + ","
// + newDigram.n.value + "], old matching one [" + matchingDigram.value + ","
// + matchingDigram.n.... | java | public void match(SAXSymbol theDigram, SAXSymbol matchingDigram) {
SAXRule rule;
SAXSymbol first, second;
// System.out.println("[sequitur debug] *match* newDigram [" + newDigram.value + ","
// + newDigram.n.value + "], old matching one [" + matchingDigram.value + ","
// + matchingDigram.n.... | [
"public",
"void",
"match",
"(",
"SAXSymbol",
"theDigram",
",",
"SAXSymbol",
"matchingDigram",
")",
"{",
"SAXRule",
"rule",
";",
"SAXSymbol",
"first",
",",
"second",
";",
"// System.out.println(\"[sequitur debug] *match* newDigram [\" + newDigram.value + \",\"\r",
"// + newDig... | Deals with a matching digram.
@param theDigram the first matching digram.
@param matchingDigram the second matching digram. | [
"Deals",
"with",
"a",
"matching",
"digram",
"."
] | 381212dd4f193246a6df82bd46f0d2bcd04a68d6 | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/sequitur/SAXSymbol.java#L246-L309 | train |
jMotif/GI | src/main/java/net/seninp/gi/sequitur/SAXSymbol.java | SAXSymbol.getPayload | protected static String getPayload(SAXSymbol symbol) {
if (symbol.isGuard()) {
return "guard of the rule " + ((SAXGuard) symbol).r.ruleIndex;
}
else if (symbol.isNonTerminal()) {
return "nonterminal " + ((SAXNonTerminal) symbol).value;
}
return "symbol " + symbol.value;
} | java | protected static String getPayload(SAXSymbol symbol) {
if (symbol.isGuard()) {
return "guard of the rule " + ((SAXGuard) symbol).r.ruleIndex;
}
else if (symbol.isNonTerminal()) {
return "nonterminal " + ((SAXNonTerminal) symbol).value;
}
return "symbol " + symbol.value;
} | [
"protected",
"static",
"String",
"getPayload",
"(",
"SAXSymbol",
"symbol",
")",
"{",
"if",
"(",
"symbol",
".",
"isGuard",
"(",
")",
")",
"{",
"return",
"\"guard of the rule \"",
"+",
"(",
"(",
"SAXGuard",
")",
"symbol",
")",
".",
"r",
".",
"ruleIndex",
"... | This routine is used for the debugging.
@param symbol the symbol we looking into.
@return symbol's payload. | [
"This",
"routine",
"is",
"used",
"for",
"the",
"debugging",
"."
] | 381212dd4f193246a6df82bd46f0d2bcd04a68d6 | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/sequitur/SAXSymbol.java#L394-L402 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/modulebuilder/ModuleBuild.java | ModuleBuild.getExtraModules | public List<String> getExtraModules() {
return extraModules == null ? Collections.<String>emptyList() : Collections.unmodifiableList(extraModules);
} | java | public List<String> getExtraModules() {
return extraModules == null ? Collections.<String>emptyList() : Collections.unmodifiableList(extraModules);
} | [
"public",
"List",
"<",
"String",
">",
"getExtraModules",
"(",
")",
"{",
"return",
"extraModules",
"==",
"null",
"?",
"Collections",
".",
"<",
"String",
">",
"emptyList",
"(",
")",
":",
"Collections",
".",
"unmodifiableList",
"(",
"extraModules",
")",
";",
... | Returns the list of additional modules that should be included ahead
of this module build in the layer
@return The list of before modules. | [
"Returns",
"the",
"list",
"of",
"additional",
"modules",
"that",
"should",
"be",
"included",
"ahead",
"of",
"this",
"module",
"build",
"in",
"the",
"layer"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/modulebuilder/ModuleBuild.java#L134-L136 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblemBuilder.java | DefaultReconfigurationProblemBuilder.setNextVMsStates | public DefaultReconfigurationProblemBuilder setNextVMsStates(Set<VM> ready,
Set<VM> running,
Set<VM> sleeping,
Set<VM> killed... | java | public DefaultReconfigurationProblemBuilder setNextVMsStates(Set<VM> ready,
Set<VM> running,
Set<VM> sleeping,
Set<VM> killed... | [
"public",
"DefaultReconfigurationProblemBuilder",
"setNextVMsStates",
"(",
"Set",
"<",
"VM",
">",
"ready",
",",
"Set",
"<",
"VM",
">",
"running",
",",
"Set",
"<",
"VM",
">",
"sleeping",
",",
"Set",
"<",
"VM",
">",
"killed",
")",
"{",
"runs",
"=",
"runnin... | Set the next state of the VMs.
Sets must be disjoint
@param ready the future VMs in the ready state
@param running the future VMs in the running state
@param sleeping the future VMs in the sleeping state
@param killed the VMs to kill
@return the current builder | [
"Set",
"the",
"next",
"state",
"of",
"the",
"VMs",
".",
"Sets",
"must",
"be",
"disjoint"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblemBuilder.java#L86-L95 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblemBuilder.java | DefaultReconfigurationProblemBuilder.build | public DefaultReconfigurationProblem build() throws SchedulerException {
if (runs == null) {
//The others are supposed to be null too as they are set using the same method
Mapping map = model.getMapping();
runs = new HashSet<>();
sleep = new HashSet<>();
... | java | public DefaultReconfigurationProblem build() throws SchedulerException {
if (runs == null) {
//The others are supposed to be null too as they are set using the same method
Mapping map = model.getMapping();
runs = new HashSet<>();
sleep = new HashSet<>();
... | [
"public",
"DefaultReconfigurationProblem",
"build",
"(",
")",
"throws",
"SchedulerException",
"{",
"if",
"(",
"runs",
"==",
"null",
")",
"{",
"//The others are supposed to be null too as they are set using the same method",
"Mapping",
"map",
"=",
"model",
".",
"getMapping",... | Build the problem
@return the builder problem
@throws org.btrplace.scheduler.SchedulerException if an error occurred | [
"Build",
"the",
"problem"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblemBuilder.java#L114-L140 | train |
smallnest/fastjson-jaxrs-json-provider | src/main/java/com/colobu/fastjson/IOUtils.java | IOUtils.inputStreamToString | public static String inputStreamToString(InputStream in) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(in));
StringBuffer buffer = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
buffer.append(line);
}
return buffer.toString();
} | java | public static String inputStreamToString(InputStream in) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(in));
StringBuffer buffer = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
buffer.append(line);
}
return buffer.toString();
} | [
"public",
"static",
"String",
"inputStreamToString",
"(",
"InputStream",
"in",
")",
"throws",
"Exception",
"{",
"BufferedReader",
"br",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"in",
")",
")",
";",
"StringBuffer",
"buffer",
"=",
"new",... | read a String from an InputStream object.
@param in InputStream
@return String
@throws Exception | [
"read",
"a",
"String",
"from",
"an",
"InputStream",
"object",
"."
] | bbdb2e3d101069bf62c026976ff9d00967671ec0 | https://github.com/smallnest/fastjson-jaxrs-json-provider/blob/bbdb2e3d101069bf62c026976ff9d00967671ec0/src/main/java/com/colobu/fastjson/IOUtils.java#L15-L23 | train |
jMotif/GI | src/main/java/net/seninp/gi/repair/RepairDigramRecord.java | RepairDigramRecord.compareTo | @Override
public int compareTo(RepairDigramRecord o) {
if (this.freq > o.freq) {
return 1;
}
else if (this.freq < o.freq) {
return -1;
}
return 0;
} | java | @Override
public int compareTo(RepairDigramRecord o) {
if (this.freq > o.freq) {
return 1;
}
else if (this.freq < o.freq) {
return -1;
}
return 0;
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"RepairDigramRecord",
"o",
")",
"{",
"if",
"(",
"this",
".",
"freq",
">",
"o",
".",
"freq",
")",
"{",
"return",
"1",
";",
"}",
"else",
"if",
"(",
"this",
".",
"freq",
"<",
"o",
".",
"freq",
")",... | A comparator built upon occurrence frequency only. | [
"A",
"comparator",
"built",
"upon",
"occurrence",
"frequency",
"only",
"."
] | 381212dd4f193246a6df82bd46f0d2bcd04a68d6 | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/repair/RepairDigramRecord.java#L31-L40 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/resource/FileResourceFactory.java | FileResourceFactory.getNIOFileResourceClass | protected Class<?> getNIOFileResourceClass() {
final String method = "getNIOFileResourceClass"; //$NON-NLS-1$
if (tryNIO && nioFileResourceClass == null) {
try {
nioFileResourceClass = classLoader
.loadClass("com.ibm.jaggr.core.impl.resource.NIOFileResource"); //$NON-NLS-1$
} catch (ClassNot... | java | protected Class<?> getNIOFileResourceClass() {
final String method = "getNIOFileResourceClass"; //$NON-NLS-1$
if (tryNIO && nioFileResourceClass == null) {
try {
nioFileResourceClass = classLoader
.loadClass("com.ibm.jaggr.core.impl.resource.NIOFileResource"); //$NON-NLS-1$
} catch (ClassNot... | [
"protected",
"Class",
"<",
"?",
">",
"getNIOFileResourceClass",
"(",
")",
"{",
"final",
"String",
"method",
"=",
"\"getNIOFileResourceClass\"",
";",
"//$NON-NLS-1$\r",
"if",
"(",
"tryNIO",
"&&",
"nioFileResourceClass",
"==",
"null",
")",
"{",
"try",
"{",
"nioFil... | Utility method for acquiring a reference to the NIOFileResource class without
asking the class loader every single time after we know it's not there.
@return the NIO class object | [
"Utility",
"method",
"for",
"acquiring",
"a",
"reference",
"to",
"the",
"NIOFileResource",
"class",
"without",
"asking",
"the",
"class",
"loader",
"every",
"single",
"time",
"after",
"we",
"know",
"it",
"s",
"not",
"there",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/resource/FileResourceFactory.java#L93-L115 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/resource/FileResourceFactory.java | FileResourceFactory.getNIOFileResourceConstructor | protected Constructor<?> getNIOFileResourceConstructor(Class<?>... args) {
final String method = "getNIOFileResourceConstructor"; //$NON-NLS-1$
if (tryNIO && nioFileResourceConstructor == null) {
try {
Class<?> clazz = getNIOFileResourceClass();
if (clazz != null)
nioFileResourceConstructor ... | java | protected Constructor<?> getNIOFileResourceConstructor(Class<?>... args) {
final String method = "getNIOFileResourceConstructor"; //$NON-NLS-1$
if (tryNIO && nioFileResourceConstructor == null) {
try {
Class<?> clazz = getNIOFileResourceClass();
if (clazz != null)
nioFileResourceConstructor ... | [
"protected",
"Constructor",
"<",
"?",
">",
"getNIOFileResourceConstructor",
"(",
"Class",
"<",
"?",
">",
"...",
"args",
")",
"{",
"final",
"String",
"method",
"=",
"\"getNIOFileResourceConstructor\"",
";",
"//$NON-NLS-1$\r",
"if",
"(",
"tryNIO",
"&&",
"nioFileReso... | Utility method for acquiring a reference to the NIOFileResource class constructor
without asking the class loader every single time after we know it's not there.
@param args
The constructor argument types
@return the constructor object | [
"Utility",
"method",
"for",
"acquiring",
"a",
"reference",
"to",
"the",
"NIOFileResource",
"class",
"constructor",
"without",
"asking",
"the",
"class",
"loader",
"every",
"single",
"time",
"after",
"we",
"know",
"it",
"s",
"not",
"there",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/resource/FileResourceFactory.java#L125-L150 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/resource/FileResourceFactory.java | FileResourceFactory.getNIOInstance | protected Object getNIOInstance(Constructor<?> constructor, Object... args) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
final String method = "getInstance"; //$NON-NLS-1$
Object ret = null;
if (tryNIO) {
if (constructor != null) {
try ... | java | protected Object getNIOInstance(Constructor<?> constructor, Object... args) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
final String method = "getInstance"; //$NON-NLS-1$
Object ret = null;
if (tryNIO) {
if (constructor != null) {
try ... | [
"protected",
"Object",
"getNIOInstance",
"(",
"Constructor",
"<",
"?",
">",
"constructor",
",",
"Object",
"...",
"args",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
"{",
"fina... | Utility method to catch class loading issues and prevent repeated attempts to use reflection.
@param constructor The constructor to invoke
@param args The args to pass the constructor
@return The instance.
@throws InstantiationException
@throws IllegalAccessException
@throws IllegalArgumentException
@throws Invocatio... | [
"Utility",
"method",
"to",
"catch",
"class",
"loading",
"issues",
"and",
"prevent",
"repeated",
"attempts",
"to",
"use",
"reflection",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/resource/FileResourceFactory.java#L164-L188 | train |
m-m-m/util | validation/src/main/java/net/sf/mmm/util/validation/base/jsr303/ConstraintContext.java | ConstraintContext.complete | @SuppressWarnings({ "rawtypes", "unchecked" })
void complete() {
if (this.range != null) {
AbstractValidatorRange validator = null;
if (this.valueType != null) {
Class<?> valueClass = this.valueType.getAssignmentClass();
if (this.valueType.isCollection()) {
validator = new V... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
void complete() {
if (this.range != null) {
AbstractValidatorRange validator = null;
if (this.valueType != null) {
Class<?> valueClass = this.valueType.getAssignmentClass();
if (this.valueType.isCollection()) {
validator = new V... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"void",
"complete",
"(",
")",
"{",
"if",
"(",
"this",
".",
"range",
"!=",
"null",
")",
"{",
"AbstractValidatorRange",
"validator",
"=",
"null",
";",
"if",
"(",
"this",
"."... | Has to be called at the end to complete the processing. | [
"Has",
"to",
"be",
"called",
"at",
"the",
"end",
"to",
"complete",
"the",
"processing",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/validation/src/main/java/net/sf/mmm/util/validation/base/jsr303/ConstraintContext.java#L131-L153 | train |
m-m-m/util | value/src/main/java/net/sf/mmm/util/value/impl/AbstractValueConverterToCompatiblePojo.java | AbstractValueConverterToCompatiblePojo.handleNoGetterForSetter | protected void handleNoGetterForSetter(PojoPropertyAccessorOneArg setter, Class<?> targetClass, Object sourceObject, Class<?> sourceClass) {
throw new PojoPropertyNotFoundException(sourceClass, setter.getName());
} | java | protected void handleNoGetterForSetter(PojoPropertyAccessorOneArg setter, Class<?> targetClass, Object sourceObject, Class<?> sourceClass) {
throw new PojoPropertyNotFoundException(sourceClass, setter.getName());
} | [
"protected",
"void",
"handleNoGetterForSetter",
"(",
"PojoPropertyAccessorOneArg",
"setter",
",",
"Class",
"<",
"?",
">",
"targetClass",
",",
"Object",
"sourceObject",
",",
"Class",
"<",
"?",
">",
"sourceClass",
")",
"{",
"throw",
"new",
"PojoPropertyNotFoundExcepti... | Called if the target object of the conversion has a setter that has no corresponding getter in the source
object to convert.
@param setter is the existing setter.
@param targetClass is the {@link Class} reflecting the target object to convert to.
@param sourceObject is the source object to convert that has no correspo... | [
"Called",
"if",
"the",
"target",
"object",
"of",
"the",
"conversion",
"has",
"a",
"setter",
"that",
"has",
"no",
"corresponding",
"getter",
"in",
"the",
"source",
"object",
"to",
"convert",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/value/src/main/java/net/sf/mmm/util/value/impl/AbstractValueConverterToCompatiblePojo.java#L115-L118 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/RequireExpansionCompilerPass.java | RequireExpansionCompilerPass.appendConsoleLogging | private void appendConsoleLogging(Node root) {
if (logDebug && consoleDebugOutput.size() > 0) {
// Emit code to call console.log on the client
Node node = root;
if (node.getType() == Token.BLOCK) {
node = node.getFirstChild();
}
if (node.getType() == Token.SCRIPT) {
if (source == null) ... | java | private void appendConsoleLogging(Node root) {
if (logDebug && consoleDebugOutput.size() > 0) {
// Emit code to call console.log on the client
Node node = root;
if (node.getType() == Token.BLOCK) {
node = node.getFirstChild();
}
if (node.getType() == Token.SCRIPT) {
if (source == null) ... | [
"private",
"void",
"appendConsoleLogging",
"(",
"Node",
"root",
")",
"{",
"if",
"(",
"logDebug",
"&&",
"consoleDebugOutput",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"// Emit code to call console.log on the client\r",
"Node",
"node",
"=",
"root",
";",
"if",
... | Appends the console log output, if any, to the end of the module
@param root
the root node for the module | [
"Appends",
"the",
"console",
"log",
"output",
"if",
"any",
"to",
"the",
"end",
"of",
"the",
"module"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/RequireExpansionCompilerPass.java#L513-L550 | train |
ept/warc-hadoop | src/main/java/com/martinkl/warc/WARCFileReader.java | WARCFileReader.close | public void close() throws IOException {
if (dataStream != null) dataStream.close();
byteStream = null;
dataStream = null;
} | java | public void close() throws IOException {
if (dataStream != null) dataStream.close();
byteStream = null;
dataStream = null;
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dataStream",
"!=",
"null",
")",
"dataStream",
".",
"close",
"(",
")",
";",
"byteStream",
"=",
"null",
";",
"dataStream",
"=",
"null",
";",
"}"
] | Closes the file. No more reading is possible after the file has been closed.
@throws IOException | [
"Closes",
"the",
"file",
".",
"No",
"more",
"reading",
"is",
"possible",
"after",
"the",
"file",
"has",
"been",
"closed",
"."
] | f41cbb8002c29053eed9206e50ab9787de7da67f | https://github.com/ept/warc-hadoop/blob/f41cbb8002c29053eed9206e50ab9787de7da67f/src/main/java/com/martinkl/warc/WARCFileReader.java#L63-L67 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.getRequestedLocales | protected Collection<String> getRequestedLocales(HttpServletRequest request) {
final String sourceMethod = "getRequestedLocales"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request.getQueryString()});
}
... | java | protected Collection<String> getRequestedLocales(HttpServletRequest request) {
final String sourceMethod = "getRequestedLocales"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request.getQueryString()});
}
... | [
"protected",
"Collection",
"<",
"String",
">",
"getRequestedLocales",
"(",
"HttpServletRequest",
"request",
")",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"getRequestedLocales\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"isTraceLogging",
"=",
"log",
".",
"isLoggable",
... | Returns the requested locales as a collection of locale strings
@param request the request object
@return the locale strings | [
"Returns",
"the",
"requested",
"locales",
"as",
"a",
"collection",
"of",
"locale",
"strings"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L357-L375 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.getHasConditionsFromRequest | protected String getHasConditionsFromRequest(HttpServletRequest request) throws IOException {
final String sourceMethod = "getHasConditionsFromRequest"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request})... | java | protected String getHasConditionsFromRequest(HttpServletRequest request) throws IOException {
final String sourceMethod = "getHasConditionsFromRequest"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request})... | [
"protected",
"String",
"getHasConditionsFromRequest",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"IOException",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"getHasConditionsFromRequest\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"isTraceLogging",
"=",
"log",
".",
... | This method checks the request for the has conditions which may either be contained in URL
query arguments or in a cookie sent from the client.
@param request
the request object
@return The has conditions from the request.
@throws IOException
@throws UnsupportedEncodingException | [
"This",
"method",
"checks",
"the",
"request",
"for",
"the",
"has",
"conditions",
"which",
"may",
"either",
"be",
"contained",
"in",
"URL",
"query",
"arguments",
"or",
"in",
"a",
"cookie",
"sent",
"from",
"the",
"client",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L446-L494 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.getParameter | protected static String getParameter(HttpServletRequest request, String[] aliases) {
final String sourceMethod = "getParameter"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request.getQueryString(), Arrays.as... | java | protected static String getParameter(HttpServletRequest request, String[] aliases) {
final String sourceMethod = "getParameter"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request.getQueryString(), Arrays.as... | [
"protected",
"static",
"String",
"getParameter",
"(",
"HttpServletRequest",
"request",
",",
"String",
"[",
"]",
"aliases",
")",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"getParameter\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"isTraceLogging",
"=",
"log",
".",
"... | Returns the value of the requested parameter from the request, or null
@param request
the request object
@param aliases
array of query arg names by which the request may be specified
@return the value of the param, or null if it is not specified under the
specified names | [
"Returns",
"the",
"value",
"of",
"the",
"requested",
"parameter",
"from",
"the",
"request",
"or",
"null"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L506-L527 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.getOptimizationLevelFromRequest | protected OptimizationLevel getOptimizationLevelFromRequest(HttpServletRequest request) {
final String sourceMethod = "getOptimizationLevelFromRequest"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request.get... | java | protected OptimizationLevel getOptimizationLevelFromRequest(HttpServletRequest request) {
final String sourceMethod = "getOptimizationLevelFromRequest"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{request.get... | [
"protected",
"OptimizationLevel",
"getOptimizationLevelFromRequest",
"(",
"HttpServletRequest",
"request",
")",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"getOptimizationLevelFromRequest\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"isTraceLogging",
"=",
"log",
".",
"isLoggabl... | Returns the requested optimization level from the request.
@param request the request object
@return the optimization level specified in the request | [
"Returns",
"the",
"requested",
"optimization",
"level",
"from",
"the",
"request",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L535-L556 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.getDynamicLoaderExtensionJavaScript | protected String getDynamicLoaderExtensionJavaScript(HttpServletRequest request) {
final String sourceMethod = "getDynamicLoaderExtensionJavaScript"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod);
}
StringBuffer sb = ... | java | protected String getDynamicLoaderExtensionJavaScript(HttpServletRequest request) {
final String sourceMethod = "getDynamicLoaderExtensionJavaScript"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod);
}
StringBuffer sb = ... | [
"protected",
"String",
"getDynamicLoaderExtensionJavaScript",
"(",
"HttpServletRequest",
"request",
")",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"getDynamicLoaderExtensionJavaScript\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"isTraceLogging",
"=",
"log",
".",
"isLoggable",... | Returns the dynamic portion of the loader extension javascript for this transport. This
includes all registered extension contributions.
@param request
The http request object
@return the dynamic portion of the loader extension javascript | [
"Returns",
"the",
"dynamic",
"portion",
"of",
"the",
"loader",
"extension",
"javascript",
"for",
"this",
"transport",
".",
"This",
"includes",
"all",
"registered",
"extension",
"contributions",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L784-L812 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.newFeatureListResourceFactory | protected FeatureListResourceFactory newFeatureListResourceFactory(URI resourceUri) {
final String methodName = "newFeatureMapJSResourceFactory"; //$NON-NLS-1$
boolean traceLogging = log.isLoggable(Level.FINER);
if (traceLogging) {
log.entering(sourceClass, methodName, new Object[]{resourceUri});
}
F... | java | protected FeatureListResourceFactory newFeatureListResourceFactory(URI resourceUri) {
final String methodName = "newFeatureMapJSResourceFactory"; //$NON-NLS-1$
boolean traceLogging = log.isLoggable(Level.FINER);
if (traceLogging) {
log.entering(sourceClass, methodName, new Object[]{resourceUri});
}
F... | [
"protected",
"FeatureListResourceFactory",
"newFeatureListResourceFactory",
"(",
"URI",
"resourceUri",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"newFeatureMapJSResourceFactory\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"traceLogging",
"=",
"log",
".",
"isLoggable",
"("... | Returns an instance of a FeatureMapJSResourceFactory.
@param resourceUri
the resource {@link URI}
@return a new factory object | [
"Returns",
"an",
"instance",
"of",
"a",
"FeatureMapJSResourceFactory",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L1004-L1015 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java | AbstractHttpTransport.clientRegisterSyntheticModules | protected String clientRegisterSyntheticModules() {
final String methodName = "clientRegisterSyntheticModules"; //$NON-NLS-1$
boolean traceLogging = log.isLoggable(Level.FINER);
if (traceLogging) {
log.entering(sourceClass, methodName);
}
StringBuffer sb = new StringBuffer();
Map<String, Integer> ... | java | protected String clientRegisterSyntheticModules() {
final String methodName = "clientRegisterSyntheticModules"; //$NON-NLS-1$
boolean traceLogging = log.isLoggable(Level.FINER);
if (traceLogging) {
log.entering(sourceClass, methodName);
}
StringBuffer sb = new StringBuffer();
Map<String, Integer> ... | [
"protected",
"String",
"clientRegisterSyntheticModules",
"(",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"clientRegisterSyntheticModules\"",
";",
"//$NON-NLS-1$\r",
"boolean",
"traceLogging",
"=",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
";",
... | Returns the JavaScript code for calling the client-side module name id registration function
to register name ids for the transport synthetic modules.
@return the registration JavaScript or an empty string if no synthetic modules. | [
"Returns",
"the",
"JavaScript",
"code",
"for",
"calling",
"the",
"client",
"-",
"side",
"module",
"name",
"id",
"registration",
"function",
"to",
"register",
"name",
"ids",
"for",
"the",
"transport",
"synthetic",
"modules",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/AbstractHttpTransport.java#L1169-L1203 | train |
protegeproject/jpaul | src/main/java/jpaul/Version.java | Version.main | public static void main(String[] args) {
System.out.println(LONG_NAME + " - Release " + RELEASE);
System.out.println();
System.out.println(" " + CREDO);
System.out.println();
System.out.println("Project maintainer: " + MAINTAINER);
System.out.println("Javadoc accessible from the official website on SourceForge:\... | java | public static void main(String[] args) {
System.out.println(LONG_NAME + " - Release " + RELEASE);
System.out.println();
System.out.println(" " + CREDO);
System.out.println();
System.out.println("Project maintainer: " + MAINTAINER);
System.out.println("Javadoc accessible from the official website on SourceForge:\... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"LONG_NAME",
"+",
"\" - Release \"",
"+",
"RELEASE",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
")",
";",
"System",
".... | Prints a small informative message about the current release. | [
"Prints",
"a",
"small",
"informative",
"message",
"about",
"the",
"current",
"release",
"."
] | db579ffb16faaa4b0c577ec82c246f7349427714 | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Version.java#L37-L45 | train |
jMotif/GI | src/main/java/net/seninp/gi/rulepruner/RulePrunerPrinter.java | RulePrunerPrinter.toBoundaries | private static int[] toBoundaries(String str) {
int[] res = new int[9];
String[] split = str.split("\\s+");
for (int i = 0; i < 9; i++) {
res[i] = Integer.valueOf(split[i]).intValue();
}
return res;
} | java | private static int[] toBoundaries(String str) {
int[] res = new int[9];
String[] split = str.split("\\s+");
for (int i = 0; i < 9; i++) {
res[i] = Integer.valueOf(split[i]).intValue();
}
return res;
} | [
"private",
"static",
"int",
"[",
"]",
"toBoundaries",
"(",
"String",
"str",
")",
"{",
"int",
"[",
"]",
"res",
"=",
"new",
"int",
"[",
"9",
"]",
";",
"String",
"[",
"]",
"split",
"=",
"str",
".",
"split",
"(",
"\"\\\\s+\"",
")",
";",
"for",
"(",
... | Converts a param string to boundaries array.
@param str
@return | [
"Converts",
"a",
"param",
"string",
"to",
"boundaries",
"array",
"."
] | 381212dd4f193246a6df82bd46f0d2bcd04a68d6 | https://github.com/jMotif/GI/blob/381212dd4f193246a6df82bd46f0d2bcd04a68d6/src/main/java/net/seninp/gi/rulepruner/RulePrunerPrinter.java#L155-L162 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/SliceBuilder.java | SliceBuilder.build | public Slice build() throws SchedulerException {
if (hoster == null) {
hoster = rp.makeHostVariable(lblPrefix, "_hoster");
}
if (start == null) {
start = rp.getStart();
}
if (end == null) {
end = rp.getEnd();
}
if (duration == n... | java | public Slice build() throws SchedulerException {
if (hoster == null) {
hoster = rp.makeHostVariable(lblPrefix, "_hoster");
}
if (start == null) {
start = rp.getStart();
}
if (end == null) {
end = rp.getEnd();
}
if (duration == n... | [
"public",
"Slice",
"build",
"(",
")",
"throws",
"SchedulerException",
"{",
"if",
"(",
"hoster",
"==",
"null",
")",
"{",
"hoster",
"=",
"rp",
".",
"makeHostVariable",
"(",
"lblPrefix",
",",
"\"_hoster\"",
")",
";",
"}",
"if",
"(",
"start",
"==",
"null",
... | Build the slice.
@return the resulting slice
@throws org.btrplace.scheduler.SchedulerException if an error occurred | [
"Build",
"the",
"slice",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/SliceBuilder.java#L68-L89 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/SliceBuilder.java | SliceBuilder.makeDuration | private IntVar makeDuration() throws SchedulerException {
if (start.isInstantiated() && end.isInstantiated()) {
int d = end.getValue() - start.getValue();
return rp.makeDuration(d, d, lblPrefix, "_duration");
} else if (start.isInstantiated()) {
if (start.isInstantiat... | java | private IntVar makeDuration() throws SchedulerException {
if (start.isInstantiated() && end.isInstantiated()) {
int d = end.getValue() - start.getValue();
return rp.makeDuration(d, d, lblPrefix, "_duration");
} else if (start.isInstantiated()) {
if (start.isInstantiat... | [
"private",
"IntVar",
"makeDuration",
"(",
")",
"throws",
"SchedulerException",
"{",
"if",
"(",
"start",
".",
"isInstantiated",
"(",
")",
"&&",
"end",
".",
"isInstantiated",
"(",
")",
")",
"{",
"int",
"d",
"=",
"end",
".",
"getValue",
"(",
")",
"-",
"st... | Make the duration variable depending on the others. | [
"Make",
"the",
"duration",
"variable",
"depending",
"on",
"the",
"others",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/SliceBuilder.java#L94-L110 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/IdentitySourceMapGenerator.java | IdentitySourceMapGenerator.generateSourceMap | public String generateSourceMap() throws IOException {
final String sourceMethod = "generateSourceMap"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{name});
}
String result = null;
lineLengths =... | java | public String generateSourceMap() throws IOException {
final String sourceMethod = "generateSourceMap"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{name});
}
String result = null;
lineLengths =... | [
"public",
"String",
"generateSourceMap",
"(",
")",
"throws",
"IOException",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"generateSourceMap\"",
";",
"//$NON-NLS-1$\r",
"final",
"boolean",
"isTraceLogging",
"=",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",... | Generate the identity source map and return the result.
@return the identity source map
@throws IOException | [
"Generate",
"the",
"identity",
"source",
"map",
"and",
"return",
"the",
"result",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/IdentitySourceMapGenerator.java#L63-L96 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/IdentitySourceMapGenerator.java | IdentitySourceMapGenerator.processNode | private void processNode(Node node) throws IOException {
for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) {
int lineno = cursor.getLineno()-1; // adjust for rhino line numbers being 1 based
int charno = cursor.getCharno();
if (lineno > currentLine || lineno == currentLi... | java | private void processNode(Node node) throws IOException {
for (Node cursor = node.getFirstChild(); cursor != null; cursor = cursor.getNext()) {
int lineno = cursor.getLineno()-1; // adjust for rhino line numbers being 1 based
int charno = cursor.getCharno();
if (lineno > currentLine || lineno == currentLi... | [
"private",
"void",
"processNode",
"(",
"Node",
"node",
")",
"throws",
"IOException",
"{",
"for",
"(",
"Node",
"cursor",
"=",
"node",
".",
"getFirstChild",
"(",
")",
";",
"cursor",
"!=",
"null",
";",
"cursor",
"=",
"cursor",
".",
"getNext",
"(",
")",
")... | Recursively processes the input node, adding a mapping for the node to the source map
generator.
@param node
the node to map
@throws IOException | [
"Recursively",
"processes",
"the",
"input",
"node",
"adding",
"a",
"mapping",
"for",
"the",
"node",
"to",
"the",
"source",
"map",
"generator",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/modulebuilder/javascript/IdentitySourceMapGenerator.java#L106-L123 | train |
m-m-m/util | event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java | AbstractEventBus.dispatchEvents | protected void dispatchEvents() {
while (true) {
Object event = this.eventQueue.poll();
if (event == null) {
return;
}
Collection<Throwable> errors = new LinkedList<>();
dispatchEvent(event, errors);
if (!errors.isEmpty()) {
handleErrors(errors, event);
}
... | java | protected void dispatchEvents() {
while (true) {
Object event = this.eventQueue.poll();
if (event == null) {
return;
}
Collection<Throwable> errors = new LinkedList<>();
dispatchEvent(event, errors);
if (!errors.isEmpty()) {
handleErrors(errors, event);
}
... | [
"protected",
"void",
"dispatchEvents",
"(",
")",
"{",
"while",
"(",
"true",
")",
"{",
"Object",
"event",
"=",
"this",
".",
"eventQueue",
".",
"poll",
"(",
")",
";",
"if",
"(",
"event",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Collection",
"<",
... | Dispatches all events in the event queue. | [
"Dispatches",
"all",
"events",
"in",
"the",
"event",
"queue",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java#L107-L121 | train |
m-m-m/util | event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java | AbstractEventBus.handleErrors | protected void handleErrors(Collection<Throwable> errors, Object event) {
if (this.globalExceptionHandler == null) {
for (Throwable error : errors) {
LOG.error("Failed to dispatch event {}", event, error);
}
} else {
this.globalExceptionHandler.handleErrors(event, errors.toArray(new T... | java | protected void handleErrors(Collection<Throwable> errors, Object event) {
if (this.globalExceptionHandler == null) {
for (Throwable error : errors) {
LOG.error("Failed to dispatch event {}", event, error);
}
} else {
this.globalExceptionHandler.handleErrors(event, errors.toArray(new T... | [
"protected",
"void",
"handleErrors",
"(",
"Collection",
"<",
"Throwable",
">",
"errors",
",",
"Object",
"event",
")",
"{",
"if",
"(",
"this",
".",
"globalExceptionHandler",
"==",
"null",
")",
"{",
"for",
"(",
"Throwable",
"error",
":",
"errors",
")",
"{",
... | This method is called if errors occurred while dispatching events.
@param errors is the {@link Collection} with the errors. Will NOT be {@link Collection#isEmpty() empty}.
@param event is the event that has been send and caused the errors. | [
"This",
"method",
"is",
"called",
"if",
"errors",
"occurred",
"while",
"dispatching",
"events",
"."
] | f0e4e084448f8dfc83ca682a9e1618034a094ce6 | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java#L161-L170 | train |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java | BtrPlaceTree.go | public BtrpOperand go(BtrPlaceTree parent) {
append(token, "Unhandled token " + token.getText() + " (type=" + token.getType() + ")");
return IgnorableOperand.getInstance();
} | java | public BtrpOperand go(BtrPlaceTree parent) {
append(token, "Unhandled token " + token.getText() + " (type=" + token.getType() + ")");
return IgnorableOperand.getInstance();
} | [
"public",
"BtrpOperand",
"go",
"(",
"BtrPlaceTree",
"parent",
")",
"{",
"append",
"(",
"token",
",",
"\"Unhandled token \"",
"+",
"token",
".",
"getText",
"(",
")",
"+",
"\" (type=\"",
"+",
"token",
".",
"getType",
"(",
")",
"+",
"\")\"",
")",
";",
"retu... | Parse the root of the tree.
@param parent the parent of the root
@return a content | [
"Parse",
"the",
"root",
"of",
"the",
"tree",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java#L57-L60 | train |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java | BtrPlaceTree.ignoreError | public IgnorableOperand ignoreError(Exception e) {
append(token, e.getMessage());
return IgnorableOperand.getInstance();
} | java | public IgnorableOperand ignoreError(Exception e) {
append(token, e.getMessage());
return IgnorableOperand.getInstance();
} | [
"public",
"IgnorableOperand",
"ignoreError",
"(",
"Exception",
"e",
")",
"{",
"append",
"(",
"token",
",",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"return",
"IgnorableOperand",
".",
"getInstance",
"(",
")",
";",
"}"
] | Report an error from an exception for the current token
@param e the exception
@return an empty operand | [
"Report",
"an",
"error",
"from",
"an",
"exception",
"for",
"the",
"current",
"token"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java#L79-L82 | train |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java | BtrPlaceTree.ignoreErrors | public IgnorableOperand ignoreErrors(ErrorReporter err) {
errors.getErrors().addAll(err.getErrors());
return IgnorableOperand.getInstance();
} | java | public IgnorableOperand ignoreErrors(ErrorReporter err) {
errors.getErrors().addAll(err.getErrors());
return IgnorableOperand.getInstance();
} | [
"public",
"IgnorableOperand",
"ignoreErrors",
"(",
"ErrorReporter",
"err",
")",
"{",
"errors",
".",
"getErrors",
"(",
")",
".",
"addAll",
"(",
"err",
".",
"getErrors",
"(",
")",
")",
";",
"return",
"IgnorableOperand",
".",
"getInstance",
"(",
")",
";",
"}"... | Add all the error messages included in a reporter.
@param err the error reporter
@return {@link IgnorableOperand} to indicate to skip the operand | [
"Add",
"all",
"the",
"error",
"messages",
"included",
"in",
"a",
"reporter",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java#L90-L93 | train |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java | BtrPlaceTree.ignoreError | public IgnorableOperand ignoreError(Token t, String msg) {
append(t, msg);
return IgnorableOperand.getInstance();
} | java | public IgnorableOperand ignoreError(Token t, String msg) {
append(t, msg);
return IgnorableOperand.getInstance();
} | [
"public",
"IgnorableOperand",
"ignoreError",
"(",
"Token",
"t",
",",
"String",
"msg",
")",
"{",
"append",
"(",
"t",
",",
"msg",
")",
";",
"return",
"IgnorableOperand",
".",
"getInstance",
"(",
")",
";",
"}"
] | Add an error message to a given error
@param t the token that points to the error
@param msg the error message
@return {@link IgnorableOperand} to indicate to skip the operand | [
"Add",
"an",
"error",
"message",
"to",
"a",
"given",
"error"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java#L102-L105 | train |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java | BtrPlaceTree.append | public void append(Token t, String msg) {
errors.append(t.getLine(), t.getCharPositionInLine(), msg);
} | java | public void append(Token t, String msg) {
errors.append(t.getLine(), t.getCharPositionInLine(), msg);
} | [
"public",
"void",
"append",
"(",
"Token",
"t",
",",
"String",
"msg",
")",
"{",
"errors",
".",
"append",
"(",
"t",
".",
"getLine",
"(",
")",
",",
"t",
".",
"getCharPositionInLine",
"(",
")",
",",
"msg",
")",
";",
"}"
] | Add an error message related to a given token
@param t the token that points to the error
@param msg the error message | [
"Add",
"an",
"error",
"message",
"related",
"to",
"a",
"given",
"token"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java#L113-L115 | train |
nikolavp/approval | approval-core/src/main/java/com/github/approval/utils/CrossPlatformCommand.java | CrossPlatformCommand.execute | public T execute() {
if (isWindows()) {
return onWindows();
} else if (isMac()) {
return onMac();
} else if (isUnix()) {
return onUnix();
} else if (isSolaris()) {
return onSolaris();
} else {
throw new IllegalStateExcep... | java | public T execute() {
if (isWindows()) {
return onWindows();
} else if (isMac()) {
return onMac();
} else if (isUnix()) {
return onUnix();
} else if (isSolaris()) {
return onSolaris();
} else {
throw new IllegalStateExcep... | [
"public",
"T",
"execute",
"(",
")",
"{",
"if",
"(",
"isWindows",
"(",
")",
")",
"{",
"return",
"onWindows",
"(",
")",
";",
"}",
"else",
"if",
"(",
"isMac",
"(",
")",
")",
"{",
"return",
"onMac",
"(",
")",
";",
"}",
"else",
"if",
"(",
"isUnix",
... | Main method that should be executed. This will return the proper result depending on your platform.
@return the result | [
"Main",
"method",
"that",
"should",
"be",
"executed",
".",
"This",
"will",
"return",
"the",
"proper",
"result",
"depending",
"on",
"your",
"platform",
"."
] | 5e32ecc3bc7f631e94a7049894fdd99a3aa5b1b8 | https://github.com/nikolavp/approval/blob/5e32ecc3bc7f631e94a7049894fdd99a3aa5b1b8/approval-core/src/main/java/com/github/approval/utils/CrossPlatformCommand.java#L96-L108 | train |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/tree/EnumVar.java | EnumVar.expand | public BtrpOperand expand() {
String head = getChild(0).getText().substring(0, getChild(0).getText().length() - 1);
String tail = getChild(getChildCount() - 1).getText().substring(1);
BtrpSet res = new BtrpSet(1, BtrpOperand.Type.STRING);
for (int i = 1; i < getChildCount() - 1; i++) {
... | java | public BtrpOperand expand() {
String head = getChild(0).getText().substring(0, getChild(0).getText().length() - 1);
String tail = getChild(getChildCount() - 1).getText().substring(1);
BtrpSet res = new BtrpSet(1, BtrpOperand.Type.STRING);
for (int i = 1; i < getChildCount() - 1; i++) {
... | [
"public",
"BtrpOperand",
"expand",
"(",
")",
"{",
"String",
"head",
"=",
"getChild",
"(",
"0",
")",
".",
"getText",
"(",
")",
".",
"substring",
"(",
"0",
",",
"getChild",
"(",
"0",
")",
".",
"getText",
"(",
")",
".",
"length",
"(",
")",
"-",
"1",... | Expand the enumeration.
Variables are not evaluated nor checked
@return a set of string or an error | [
"Expand",
"the",
"enumeration",
".",
"Variables",
"are",
"not",
"evaluated",
"nor",
"checked"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/tree/EnumVar.java#L56-L73 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.add | public void add(DepTreeNode child) {
if (children == null) {
children = new HashMap<String, DepTreeNode>();
}
children.put(child.getName(), child);
child.setParent(this);
} | java | public void add(DepTreeNode child) {
if (children == null) {
children = new HashMap<String, DepTreeNode>();
}
children.put(child.getName(), child);
child.setParent(this);
} | [
"public",
"void",
"add",
"(",
"DepTreeNode",
"child",
")",
"{",
"if",
"(",
"children",
"==",
"null",
")",
"{",
"children",
"=",
"new",
"HashMap",
"<",
"String",
",",
"DepTreeNode",
">",
"(",
")",
";",
"}",
"children",
".",
"put",
"(",
"child",
".",
... | Add the specified node to this node's children.
@param child
The node to add to this node's children | [
"Add",
"the",
"specified",
"node",
"to",
"this",
"node",
"s",
"children",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L255-L261 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.overlay | public void overlay(DepTreeNode node) {
if (node.defineDependencies != null || node.requireDependencies != null) {
setDependencies(node.defineDependencies, node.requireDependencies, node.dependentFeatures, node.lastModified(), node.lastModifiedDep());
}
node.uri = uri;
if (node.getChildren() == null) {
... | java | public void overlay(DepTreeNode node) {
if (node.defineDependencies != null || node.requireDependencies != null) {
setDependencies(node.defineDependencies, node.requireDependencies, node.dependentFeatures, node.lastModified(), node.lastModifiedDep());
}
node.uri = uri;
if (node.getChildren() == null) {
... | [
"public",
"void",
"overlay",
"(",
"DepTreeNode",
"node",
")",
"{",
"if",
"(",
"node",
".",
"defineDependencies",
"!=",
"null",
"||",
"node",
".",
"requireDependencies",
"!=",
"null",
")",
"{",
"setDependencies",
"(",
"node",
".",
"defineDependencies",
",",
"... | Overlay the specified node and its descendants over this node. The
specified node will be merged with this node, with the dependencies
of any nodes from the specified node replacing the dependencies of
the corresponding node in this node's tree.
@param node | [
"Overlay",
"the",
"specified",
"node",
"and",
"its",
"descendants",
"over",
"this",
"node",
".",
"The",
"specified",
"node",
"will",
"be",
"merged",
"with",
"this",
"node",
"with",
"the",
"dependencies",
"of",
"any",
"nodes",
"from",
"the",
"specified",
"nod... | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L271-L287 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.createOrGet | public DepTreeNode createOrGet(String path, URI uri) {
if (path.startsWith("/")) { //$NON-NLS-1$
throw new IllegalArgumentException(path);
}
if (path.length() == 0)
return this;
String[] pathComps = path.split("/"); //$NON-NLS-1$
DepTreeNode node = this;
int i = 0;
for (String comp : path... | java | public DepTreeNode createOrGet(String path, URI uri) {
if (path.startsWith("/")) { //$NON-NLS-1$
throw new IllegalArgumentException(path);
}
if (path.length() == 0)
return this;
String[] pathComps = path.split("/"); //$NON-NLS-1$
DepTreeNode node = this;
int i = 0;
for (String comp : path... | [
"public",
"DepTreeNode",
"createOrGet",
"(",
"String",
"path",
",",
"URI",
"uri",
")",
"{",
"if",
"(",
"path",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"//$NON-NLS-1$\r",
"throw",
"new",
"IllegalArgumentException",
"(",
"path",
")",
";",
"}",
"if",
... | Returns the node at the specified path location within the tree, or
creates it if it is not already in the tree. Will create any required
parent nodes.
@param path
The path name, relative to this node, of the node to return.
@param uri
the source URI
@return The node at the specified path. | [
"Returns",
"the",
"node",
"at",
"the",
"specified",
"path",
"location",
"within",
"the",
"tree",
"or",
"creates",
"it",
"if",
"it",
"is",
"not",
"already",
"in",
"the",
"tree",
".",
"Will",
"create",
"any",
"required",
"parent",
"nodes",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L306-L326 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.remove | public void remove(DepTreeNode child) {
if (children != null) {
DepTreeNode node = children.get(child.getName());
if (node == child) {
children.remove(child.getName());
}
}
child.setParent(null);
} | java | public void remove(DepTreeNode child) {
if (children != null) {
DepTreeNode node = children.get(child.getName());
if (node == child) {
children.remove(child.getName());
}
}
child.setParent(null);
} | [
"public",
"void",
"remove",
"(",
"DepTreeNode",
"child",
")",
"{",
"if",
"(",
"children",
"!=",
"null",
")",
"{",
"DepTreeNode",
"node",
"=",
"children",
".",
"get",
"(",
"child",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"node",
"==",
"child",
... | Removes the specified child node
@param child
The node to remove | [
"Removes",
"the",
"specified",
"child",
"node"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L367-L375 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.prune | public void prune() {
if (children != null) {
List<String> removeList = new ArrayList<String>();
for (Entry<String, DepTreeNode> entry : children.entrySet()) {
DepTreeNode child = entry.getValue();
child.prune();
if ((child.defineDependencies == null && child.requireDependencies == null && chi... | java | public void prune() {
if (children != null) {
List<String> removeList = new ArrayList<String>();
for (Entry<String, DepTreeNode> entry : children.entrySet()) {
DepTreeNode child = entry.getValue();
child.prune();
if ((child.defineDependencies == null && child.requireDependencies == null && chi... | [
"public",
"void",
"prune",
"(",
")",
"{",
"if",
"(",
"children",
"!=",
"null",
")",
"{",
"List",
"<",
"String",
">",
"removeList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"DepTreeNode",
"... | Recursively walks the node tree removing folder nodes that have not children. | [
"Recursively",
"walks",
"the",
"node",
"tree",
"removing",
"folder",
"nodes",
"that",
"have",
"not",
"children",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L412-L427 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.setDependencies | public void setDependencies(String[] defineDependencies, String[] requireDependencies, String[] dependentFeatures, long lastModifiedFile, long lastModifiedDep) {
this.defineDependencies = defineDependencies;
this.requireDependencies = requireDependencies;
this.dependentFeatures = dependentFeatures;
this.las... | java | public void setDependencies(String[] defineDependencies, String[] requireDependencies, String[] dependentFeatures, long lastModifiedFile, long lastModifiedDep) {
this.defineDependencies = defineDependencies;
this.requireDependencies = requireDependencies;
this.dependentFeatures = dependentFeatures;
this.las... | [
"public",
"void",
"setDependencies",
"(",
"String",
"[",
"]",
"defineDependencies",
",",
"String",
"[",
"]",
"requireDependencies",
",",
"String",
"[",
"]",
"dependentFeatures",
",",
"long",
"lastModifiedFile",
",",
"long",
"lastModifiedDep",
")",
"{",
"this",
"... | Specifies the dependency list of modules for the module named by this
node, along with the last modified date of the javascript file that the
dependency list was obtained from.
@param defineDependencies
The define() dependency list of module names
@param requireDependencies
The require() dependency list of module name... | [
"Specifies",
"the",
"dependency",
"list",
"of",
"modules",
"for",
"the",
"module",
"named",
"by",
"this",
"node",
"along",
"with",
"the",
"last",
"modified",
"date",
"of",
"the",
"javascript",
"file",
"that",
"the",
"dependency",
"list",
"was",
"obtained",
"... | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L446-L452 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.lastModifiedDepTree | private long lastModifiedDepTree(long lm) {
long result = (defineDependencies == null && requireDependencies == null) ? lm : Math.max(lm, this.lastModifiedDep);
if (children != null) {
for (Entry<String, DepTreeNode> entry : this.children.entrySet()) {
result = entry.getValue().lastModifiedDepTree(result... | java | private long lastModifiedDepTree(long lm) {
long result = (defineDependencies == null && requireDependencies == null) ? lm : Math.max(lm, this.lastModifiedDep);
if (children != null) {
for (Entry<String, DepTreeNode> entry : this.children.entrySet()) {
result = entry.getValue().lastModifiedDepTree(result... | [
"private",
"long",
"lastModifiedDepTree",
"(",
"long",
"lm",
")",
"{",
"long",
"result",
"=",
"(",
"defineDependencies",
"==",
"null",
"&&",
"requireDependencies",
"==",
"null",
")",
"?",
"lm",
":",
"Math",
".",
"max",
"(",
"lm",
",",
"this",
".",
"lastM... | Returns the most recent last modified date for all the dependencies that
are descendants of this node, including this node.
@param lm
The most recent last modified date so far
@return The most recent last modified date including this node and it
descendants | [
"Returns",
"the",
"most",
"recent",
"last",
"modified",
"date",
"for",
"all",
"the",
"dependencies",
"that",
"are",
"descendants",
"of",
"this",
"node",
"including",
"this",
"node",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L550-L558 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.populateDepMap | void populateDepMap(Map<String, DependencyInfo> depMap) {
if (uri != null) {
depMap.put(getFullPathName(), new DependencyInfo(defineDependencies, requireDependencies, dependentFeatures, uri));
}
if (children != null) {
for (Entry<String, DepTreeNode> entry : children.entrySet()) {
entry.getValue()... | java | void populateDepMap(Map<String, DependencyInfo> depMap) {
if (uri != null) {
depMap.put(getFullPathName(), new DependencyInfo(defineDependencies, requireDependencies, dependentFeatures, uri));
}
if (children != null) {
for (Entry<String, DepTreeNode> entry : children.entrySet()) {
entry.getValue()... | [
"void",
"populateDepMap",
"(",
"Map",
"<",
"String",
",",
"DependencyInfo",
">",
"depMap",
")",
"{",
"if",
"(",
"uri",
"!=",
"null",
")",
"{",
"depMap",
".",
"put",
"(",
"getFullPathName",
"(",
")",
",",
"new",
"DependencyInfo",
"(",
"defineDependencies",
... | Populates the provided map with the dependencies, keyed by
full path name. This is done to facilitate more efficient
lookups of the dependencies.
@param depMap | [
"Populates",
"the",
"provided",
"map",
"with",
"the",
"dependencies",
"keyed",
"by",
"full",
"path",
"name",
".",
"This",
"is",
"done",
"to",
"facilitate",
"more",
"efficient",
"lookups",
"of",
"the",
"dependencies",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L612-L621 | train |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.readObject | private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
// Call the default implementation to de-serialize our object
in.defaultReadObject();
parent = new WeakReference<DepTreeNode>(null);
// restore parent reference on all children
if (children != null) {
f... | java | private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
// Call the default implementation to de-serialize our object
in.defaultReadObject();
parent = new WeakReference<DepTreeNode>(null);
// restore parent reference on all children
if (children != null) {
f... | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// Call the default implementation to de-serialize our object\r",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"parent",
"=",
"new",
"Weak... | Method called when this object is de-serialized
@param in The {@link ObjectInputStream} to read from
@throws IOException
@throws ClassNotFoundException | [
"Method",
"called",
"when",
"this",
"object",
"is",
"de",
"-",
"serialized"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L630-L644 | train |
OpenNTF/JavascriptAggregator | jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java | AggregatorImpl.getOptionsServiceTracker | protected ServiceTracker<IOptions, ?> getOptionsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException {
ServiceTracker<IOptions, ?> tracker = new ServiceTracker<IOptions, Object>(
bundleContext,
bundleContext.createFilter(
"(&(" + Constants.OBJECTCLASS + "=" + IOptions.class.getN... | java | protected ServiceTracker<IOptions, ?> getOptionsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException {
ServiceTracker<IOptions, ?> tracker = new ServiceTracker<IOptions, Object>(
bundleContext,
bundleContext.createFilter(
"(&(" + Constants.OBJECTCLASS + "=" + IOptions.class.getN... | [
"protected",
"ServiceTracker",
"<",
"IOptions",
",",
"?",
">",
"getOptionsServiceTracker",
"(",
"BundleContext",
"bundleContext",
")",
"throws",
"InvalidSyntaxException",
"{",
"ServiceTracker",
"<",
"IOptions",
",",
"?",
">",
"tracker",
"=",
"new",
"ServiceTracker",
... | Returns an opened ServiceTracker for the Aggregator options. Aggregator options
are created by the bundle activator and are shared by all Aggregator instances
created from the same bundle.
@param bundleContext The contributing bundle context
@return The opened service tracker
@throws InvalidSyntaxException | [
"Returns",
"an",
"opened",
"ServiceTracker",
"for",
"the",
"Aggregator",
"options",
".",
"Aggregator",
"options",
"are",
"created",
"by",
"the",
"bundle",
"activator",
"and",
"are",
"shared",
"by",
"all",
"Aggregator",
"instances",
"created",
"from",
"the",
"sam... | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java#L405-L414 | train |
OpenNTF/JavascriptAggregator | jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java | AggregatorImpl.getExecutorsServiceTracker | protected ServiceTracker<IExecutors, ?> getExecutorsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException {
ServiceTracker<IExecutors, ?> tracker = new ServiceTracker<IExecutors, Object>(
bundleContext,
bundleContext.createFilter(
"(&(" + Constants.OBJECTCLASS + "=" + IExecutors.... | java | protected ServiceTracker<IExecutors, ?> getExecutorsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException {
ServiceTracker<IExecutors, ?> tracker = new ServiceTracker<IExecutors, Object>(
bundleContext,
bundleContext.createFilter(
"(&(" + Constants.OBJECTCLASS + "=" + IExecutors.... | [
"protected",
"ServiceTracker",
"<",
"IExecutors",
",",
"?",
">",
"getExecutorsServiceTracker",
"(",
"BundleContext",
"bundleContext",
")",
"throws",
"InvalidSyntaxException",
"{",
"ServiceTracker",
"<",
"IExecutors",
",",
"?",
">",
"tracker",
"=",
"new",
"ServiceTrack... | Returns an opened ServiceTracker for the Aggregator exectors provider.
The executors provider is are created by the bundle activator and is
shared by all Aggregator instances created from the same bundle.
@param bundleContext
The contributing bundle context
@return The opened service tracker
@throws InvalidSyntaxExcep... | [
"Returns",
"an",
"opened",
"ServiceTracker",
"for",
"the",
"Aggregator",
"exectors",
"provider",
".",
"The",
"executors",
"provider",
"is",
"are",
"created",
"by",
"the",
"bundle",
"activator",
"and",
"is",
"shared",
"by",
"all",
"Aggregator",
"instances",
"crea... | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java#L426-L435 | train |
OpenNTF/JavascriptAggregator | jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java | AggregatorImpl.createCacheBundle | public String createCacheBundle(String bundleSymbolicName, String bundleFileName) throws IOException {
final String sourceMethod = "createCacheBundle"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{bundle... | java | public String createCacheBundle(String bundleSymbolicName, String bundleFileName) throws IOException {
final String sourceMethod = "createCacheBundle"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{bundle... | [
"public",
"String",
"createCacheBundle",
"(",
"String",
"bundleSymbolicName",
",",
"String",
"bundleFileName",
")",
"throws",
"IOException",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"createCacheBundle\"",
";",
"//$NON-NLS-1$\r",
"final",
"boolean",
"isTraceLogging",... | Command handler to create a cache primer bundle containing the contents of the cache
directory.
@param bundleSymbolicName
the symbolic name of the bundle to be created
@param bundleFileName
the filename of the bundle to be created
@return the string to be displayed in the console (the fully qualified filename of the
b... | [
"Command",
"handler",
"to",
"create",
"a",
"cache",
"primer",
"bundle",
"containing",
"the",
"contents",
"of",
"the",
"cache",
"directory",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java#L783-L833 | train |
OpenNTF/JavascriptAggregator | jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java | AggregatorImpl.processRequestUrl | public String processRequestUrl(String requestUrl) throws IOException, ServletException {
ConsoleHttpServletRequest req = new ConsoleHttpServletRequest(getServletConfig().getServletContext(), requestUrl);
OutputStream nulOutputStream = new OutputStream() {
@Override public void write(int b) throws IOException... | java | public String processRequestUrl(String requestUrl) throws IOException, ServletException {
ConsoleHttpServletRequest req = new ConsoleHttpServletRequest(getServletConfig().getServletContext(), requestUrl);
OutputStream nulOutputStream = new OutputStream() {
@Override public void write(int b) throws IOException... | [
"public",
"String",
"processRequestUrl",
"(",
"String",
"requestUrl",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"ConsoleHttpServletRequest",
"req",
"=",
"new",
"ConsoleHttpServletRequest",
"(",
"getServletConfig",
"(",
")",
".",
"getServletContext",
"(... | Implementation of eponymous console command. Provided to allow cache priming requests to be
issued via the server console by automation scripts.
@param requestUrl
the URL to process
@return the status code as a string
@throws IOException
@throws ServletException | [
"Implementation",
"of",
"eponymous",
"console",
"command",
".",
"Provided",
"to",
"allow",
"cache",
"priming",
"requests",
"to",
"be",
"issued",
"via",
"the",
"server",
"console",
"by",
"automation",
"scripts",
"."
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/AggregatorImpl.java#L845-L853 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java | TransitionFactory.add | public void add(VMTransitionBuilder b) {
Map<VMState, VMTransitionBuilder> m = vmAMB2.get(b.getDestinationState());
for (VMState src : b.getSourceStates()) {
m.put(src, b);
}
} | java | public void add(VMTransitionBuilder b) {
Map<VMState, VMTransitionBuilder> m = vmAMB2.get(b.getDestinationState());
for (VMState src : b.getSourceStates()) {
m.put(src, b);
}
} | [
"public",
"void",
"add",
"(",
"VMTransitionBuilder",
"b",
")",
"{",
"Map",
"<",
"VMState",
",",
"VMTransitionBuilder",
">",
"m",
"=",
"vmAMB2",
".",
"get",
"(",
"b",
".",
"getDestinationState",
"(",
")",
")",
";",
"for",
"(",
"VMState",
"src",
":",
"b"... | Add a builder for a VM.
Every builder that supports the same transition will be replaced.
@param b the builder to add | [
"Add",
"a",
"builder",
"for",
"a",
"VM",
".",
"Every",
"builder",
"that",
"supports",
"the",
"same",
"transition",
"will",
"be",
"replaced",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java#L61-L66 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java | TransitionFactory.remove | public boolean remove(VMTransitionBuilder b) {
Map<VMState, VMTransitionBuilder> m = vmAMB2.get(b.getDestinationState());
for (VMState src : b.getSourceStates()) {
m.remove(src);
}
return true;
} | java | public boolean remove(VMTransitionBuilder b) {
Map<VMState, VMTransitionBuilder> m = vmAMB2.get(b.getDestinationState());
for (VMState src : b.getSourceStates()) {
m.remove(src);
}
return true;
} | [
"public",
"boolean",
"remove",
"(",
"VMTransitionBuilder",
"b",
")",
"{",
"Map",
"<",
"VMState",
",",
"VMTransitionBuilder",
">",
"m",
"=",
"vmAMB2",
".",
"get",
"(",
"b",
".",
"getDestinationState",
"(",
")",
")",
";",
"for",
"(",
"VMState",
"src",
":",... | Remove a builder for an action on a VM.
@param b the builder to remove
@return {@code true} if it has been removed | [
"Remove",
"a",
"builder",
"for",
"an",
"action",
"on",
"a",
"VM",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java#L74-L80 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java | TransitionFactory.getBuilder | public VMTransitionBuilder getBuilder(VMState srcState, VMState dstState) {
Map<VMState, VMTransitionBuilder> dstCompliant = vmAMB2.get(dstState);
if (dstCompliant == null) {
return null;
}
return dstCompliant.get(srcState);
} | java | public VMTransitionBuilder getBuilder(VMState srcState, VMState dstState) {
Map<VMState, VMTransitionBuilder> dstCompliant = vmAMB2.get(dstState);
if (dstCompliant == null) {
return null;
}
return dstCompliant.get(srcState);
} | [
"public",
"VMTransitionBuilder",
"getBuilder",
"(",
"VMState",
"srcState",
",",
"VMState",
"dstState",
")",
"{",
"Map",
"<",
"VMState",
",",
"VMTransitionBuilder",
">",
"dstCompliant",
"=",
"vmAMB2",
".",
"get",
"(",
"dstState",
")",
";",
"if",
"(",
"dstCompli... | Get the model builder for a given transition
@param srcState the current VM state
@param dstState the current VM state
@return the list of possible transitions. {@code null} if no transition is available | [
"Get",
"the",
"model",
"builder",
"for",
"a",
"given",
"transition"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java#L108-L114 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java | TransitionFactory.newBundle | public static TransitionFactory newBundle() {
TransitionFactory f = new TransitionFactory();
f.add(new BootVM.Builder());
f.add(new ShutdownVM.Builder());
f.add(new SuspendVM.Builder());
f.add(new ResumeVM.Builder());
f.add(new KillVM.Builder());
f.add(new Relocat... | java | public static TransitionFactory newBundle() {
TransitionFactory f = new TransitionFactory();
f.add(new BootVM.Builder());
f.add(new ShutdownVM.Builder());
f.add(new SuspendVM.Builder());
f.add(new ResumeVM.Builder());
f.add(new KillVM.Builder());
f.add(new Relocat... | [
"public",
"static",
"TransitionFactory",
"newBundle",
"(",
")",
"{",
"TransitionFactory",
"f",
"=",
"new",
"TransitionFactory",
"(",
")",
";",
"f",
".",
"add",
"(",
"new",
"BootVM",
".",
"Builder",
"(",
")",
")",
";",
"f",
".",
"add",
"(",
"new",
"Shut... | a new factory that embeds the default builders.
@return a viable factory | [
"a",
"new",
"factory",
"that",
"embeds",
"the",
"default",
"builders",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/transition/TransitionFactory.java#L131-L146 | train |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/network/Routing.java | Routing.getMaxBW | public int getMaxBW(Node n1, Node n2) {
int max = Integer.MAX_VALUE;
for (Link inf : getPath(n1, n2)) {
if (inf.getCapacity() < max) {
max = inf.getCapacity();
}
Switch sw = inf.getSwitch();
if (sw.getCapacity() >= 0 && sw.getCapacity() < m... | java | public int getMaxBW(Node n1, Node n2) {
int max = Integer.MAX_VALUE;
for (Link inf : getPath(n1, n2)) {
if (inf.getCapacity() < max) {
max = inf.getCapacity();
}
Switch sw = inf.getSwitch();
if (sw.getCapacity() >= 0 && sw.getCapacity() < m... | [
"public",
"int",
"getMaxBW",
"(",
"Node",
"n1",
",",
"Node",
"n2",
")",
"{",
"int",
"max",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"for",
"(",
"Link",
"inf",
":",
"getPath",
"(",
"n1",
",",
"n2",
")",
")",
"{",
"if",
"(",
"inf",
".",
"getCapacity"... | Get the maximal bandwidth available between two nodes.
@param n1 the source node
@param n2 the destination node
@return the bandwidth | [
"Get",
"the",
"maximal",
"bandwidth",
"available",
"between",
"two",
"nodes",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Routing.java#L89-L103 | train |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/network/Routing.java | Routing.getFirstPhysicalPath | protected List<Link> getFirstPhysicalPath(List<Link> currentPath, Switch sw, Node dst) {
// Iterate through the current switch's links
for (Link l : net.getConnectedLinks(sw)) {
// Wrong link
if (currentPath.contains(l)) {
continue;
}
// G... | java | protected List<Link> getFirstPhysicalPath(List<Link> currentPath, Switch sw, Node dst) {
// Iterate through the current switch's links
for (Link l : net.getConnectedLinks(sw)) {
// Wrong link
if (currentPath.contains(l)) {
continue;
}
// G... | [
"protected",
"List",
"<",
"Link",
">",
"getFirstPhysicalPath",
"(",
"List",
"<",
"Link",
">",
"currentPath",
",",
"Switch",
"sw",
",",
"Node",
"dst",
")",
"{",
"// Iterate through the current switch's links",
"for",
"(",
"Link",
"l",
":",
"net",
".",
"getConne... | Recursive method to get the first physical path found from a switch to a destination node.
@param currentPath the current or initial path containing the link(s) crossed
@param sw the current switch to browse
@param dst the destination node to reach
@return the ordered list of links that make the path ... | [
"Recursive",
"method",
"to",
"get",
"the",
"first",
"physical",
"path",
"found",
"from",
"a",
"switch",
"to",
"a",
"destination",
"node",
"."
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Routing.java#L123-L153 | train |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingHeapDecorator.java | VectorPackingHeapDecorator.loadSlack | private int loadSlack(int dim, int bin) {
return p.loads[dim][bin].getUB() - p.loads[dim][bin].getLB();
} | java | private int loadSlack(int dim, int bin) {
return p.loads[dim][bin].getUB() - p.loads[dim][bin].getLB();
} | [
"private",
"int",
"loadSlack",
"(",
"int",
"dim",
",",
"int",
"bin",
")",
"{",
"return",
"p",
".",
"loads",
"[",
"dim",
"]",
"[",
"bin",
"]",
".",
"getUB",
"(",
")",
"-",
"p",
".",
"loads",
"[",
"dim",
"]",
"[",
"bin",
"]",
".",
"getLB",
"(",... | compute the load slack of a bin
@param dim the dimension
@param bin the bin
@return the load slack of bin on dimension bin | [
"compute",
"the",
"load",
"slack",
"of",
"a",
"bin"
] | 611063aad0b47a016e57ebf36fa4dfdf24de09e8 | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/pack/VectorPackingHeapDecorator.java#L65-L67 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.