id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,300 | aehrc/snorocket | snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java | SnorocketOWLReasoner.classify | private void classify() {
// Classify
monitor.taskStarted("Classifying");
monitor.taskBusy();
reasoner = reasoner.classify();
monitor.taskEnded();
monitor.taskStarted("Building taxonomy");
monitor.taskBusy();
taxonomy = reasoner.getClassifiedOntolo... | java | private void classify() {
// Classify
monitor.taskStarted("Classifying");
monitor.taskBusy();
reasoner = reasoner.classify();
monitor.taskEnded();
monitor.taskStarted("Building taxonomy");
monitor.taskBusy();
taxonomy = reasoner.getClassifiedOntolo... | [
"private",
"void",
"classify",
"(",
")",
"{",
"// Classify\r",
"monitor",
".",
"taskStarted",
"(",
"\"Classifying\"",
")",
";",
"monitor",
".",
"taskBusy",
"(",
")",
";",
"reasoner",
"=",
"reasoner",
".",
"classify",
"(",
")",
";",
"monitor",
".",
"taskEnd... | Performs a full classification on the current ontology. | [
"Performs",
"a",
"full",
"classification",
"on",
"the",
"current",
"ontology",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L350-L360 |
11,301 | aehrc/snorocket | snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java | SnorocketOWLReasoner.flush | @Override
public void flush() {
if (rawChanges.isEmpty() || !buffering) {
return;
}
// Get the changed axioms
boolean hasRemoveAxiom = false;
List<OWLAxiom> newAxioms = new ArrayList<OWLAxiom>();
for (OWLOntologyChange change : rawChanges) {
... | java | @Override
public void flush() {
if (rawChanges.isEmpty() || !buffering) {
return;
}
// Get the changed axioms
boolean hasRemoveAxiom = false;
List<OWLAxiom> newAxioms = new ArrayList<OWLAxiom>();
for (OWLOntologyChange change : rawChanges) {
... | [
"@",
"Override",
"public",
"void",
"flush",
"(",
")",
"{",
"if",
"(",
"rawChanges",
".",
"isEmpty",
"(",
")",
"||",
"!",
"buffering",
")",
"{",
"return",
";",
"}",
"// Get the changed axioms\r",
"boolean",
"hasRemoveAxiom",
"=",
"false",
";",
"List",
"<",
... | Classifies the ontology incrementally if no import changes have occurred.
Flushes any changes stored in the buffer, which causes the reasoner to
take into consideration the changes the current root ontology specified
by the changes. If the reasoner buffering mode is
{@link org.semanticweb.owlapi.reasoner.BufferingMode... | [
"Classifies",
"the",
"ontology",
"incrementally",
"if",
"no",
"import",
"changes",
"have",
"occurred",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L419-L459 |
11,302 | aehrc/snorocket | snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java | SnorocketOWLReasoner.isPrecomputed | @Override
public boolean isPrecomputed(InferenceType inferenceType) {
if (inferenceType.equals(InferenceType.CLASS_HIERARCHY)) {
return reasoner.isClassified();
} else {
return false;
}
} | java | @Override
public boolean isPrecomputed(InferenceType inferenceType) {
if (inferenceType.equals(InferenceType.CLASS_HIERARCHY)) {
return reasoner.isClassified();
} else {
return false;
}
} | [
"@",
"Override",
"public",
"boolean",
"isPrecomputed",
"(",
"InferenceType",
"inferenceType",
")",
"{",
"if",
"(",
"inferenceType",
".",
"equals",
"(",
"InferenceType",
".",
"CLASS_HIERARCHY",
")",
")",
"{",
"return",
"reasoner",
".",
"isClassified",
"(",
")",
... | Determines if a specific set of inferences have been precomputed.
@param inferenceType The type of inference to check for.
@return <code>true</code> if the specified type of inferences have been
precomputed, otherwise <code>false</code>. | [
"Determines",
"if",
"a",
"specific",
"set",
"of",
"inferences",
"have",
"been",
"precomputed",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L603-L610 |
11,303 | aehrc/snorocket | snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java | SnorocketOWLReasoner.isSatisfiable | @Override
public boolean isSatisfiable(OWLClassExpression classExpression)
throws ReasonerInterruptedException, TimeOutException,
ClassExpressionNotInProfileException, FreshEntitiesException,
InconsistentOntologyException {
if (classExpression.isAnonymous()) {
... | java | @Override
public boolean isSatisfiable(OWLClassExpression classExpression)
throws ReasonerInterruptedException, TimeOutException,
ClassExpressionNotInProfileException, FreshEntitiesException,
InconsistentOntologyException {
if (classExpression.isAnonymous()) {
... | [
"@",
"Override",
"public",
"boolean",
"isSatisfiable",
"(",
"OWLClassExpression",
"classExpression",
")",
"throws",
"ReasonerInterruptedException",
",",
"TimeOutException",
",",
"ClassExpressionNotInProfileException",
",",
"FreshEntitiesException",
",",
"InconsistentOntologyExcep... | A convenience method that determines if the specified class expression is
satisfiable with respect to the reasoner axioms.
@param classExpression
The class expression
@return <code>true</code> if classExpression is satisfiable with respect
to the set of axioms, or <code>false</code> if classExpression is
unsatisfiable... | [
"A",
"convenience",
"method",
"that",
"determines",
"if",
"the",
"specified",
"class",
"expression",
"is",
"satisfiable",
"with",
"respect",
"to",
"the",
"reasoner",
"axioms",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L681-L695 |
11,304 | aehrc/snorocket | snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java | SnorocketOWLReasoner.getUnsatisfiableClasses | @Override
public Node<OWLClass> getUnsatisfiableClasses()
throws ReasonerInterruptedException, TimeOutException,
InconsistentOntologyException {
return nodeToOwlClassNode(getTaxonomy().getBottomNode());
} | java | @Override
public Node<OWLClass> getUnsatisfiableClasses()
throws ReasonerInterruptedException, TimeOutException,
InconsistentOntologyException {
return nodeToOwlClassNode(getTaxonomy().getBottomNode());
} | [
"@",
"Override",
"public",
"Node",
"<",
"OWLClass",
">",
"getUnsatisfiableClasses",
"(",
")",
"throws",
"ReasonerInterruptedException",
",",
"TimeOutException",
",",
"InconsistentOntologyException",
"{",
"return",
"nodeToOwlClassNode",
"(",
"getTaxonomy",
"(",
")",
".",... | A convenience method that obtains the classes in the signature of the
root ontology that are unsatisfiable.
@return A <code>Node</code> that is the bottom node in the class
hierarchy. This node represents <code>owl:Nothing</code> and
contains <code>owl:Nothing</code> itself plus classes that are
equivalent to <code>ow... | [
"A",
"convenience",
"method",
"that",
"obtains",
"the",
"classes",
"in",
"the",
"signature",
"of",
"the",
"root",
"ontology",
"that",
"are",
"unsatisfiable",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L716-L721 |
11,305 | aehrc/snorocket | snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java | SnorocketOWLReasoner.isEntailed | @Override
public boolean isEntailed(Set<? extends OWLAxiom> axioms)
throws ReasonerInterruptedException,
UnsupportedEntailmentTypeException, TimeOutException,
AxiomNotInProfileException, FreshEntitiesException,
InconsistentOntologyException {
throw new U... | java | @Override
public boolean isEntailed(Set<? extends OWLAxiom> axioms)
throws ReasonerInterruptedException,
UnsupportedEntailmentTypeException, TimeOutException,
AxiomNotInProfileException, FreshEntitiesException,
InconsistentOntologyException {
throw new U... | [
"@",
"Override",
"public",
"boolean",
"isEntailed",
"(",
"Set",
"<",
"?",
"extends",
"OWLAxiom",
">",
"axioms",
")",
"throws",
"ReasonerInterruptedException",
",",
"UnsupportedEntailmentTypeException",
",",
"TimeOutException",
",",
"AxiomNotInProfileException",
",",
"Fr... | Determines if the specified set of axioms is entailed by the reasoner
axioms.
@param axioms
The set of axioms to be tested
@return <code>true</code> if the set of axioms is entailed by the axioms
in the imports closure of the root ontology, otherwise
<code>false</code>. If the set of reasoner axioms is inconsistent
th... | [
"Determines",
"if",
"the",
"specified",
"set",
"of",
"axioms",
"is",
"entailed",
"by",
"the",
"reasoner",
"axioms",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L796-L803 |
11,306 | aehrc/snorocket | snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java | SnorocketOWLReasoner.getDataPropertyValues | @Override
public Set<OWLLiteral> getDataPropertyValues(OWLNamedIndividual ind,
OWLDataProperty pe) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException,
TimeOutException {
return Collections.emptySet();
} | java | @Override
public Set<OWLLiteral> getDataPropertyValues(OWLNamedIndividual ind,
OWLDataProperty pe) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException,
TimeOutException {
return Collections.emptySet();
} | [
"@",
"Override",
"public",
"Set",
"<",
"OWLLiteral",
">",
"getDataPropertyValues",
"(",
"OWLNamedIndividual",
"ind",
",",
"OWLDataProperty",
"pe",
")",
"throws",
"InconsistentOntologyException",
",",
"FreshEntitiesException",
",",
"ReasonerInterruptedException",
",",
"Tim... | Gets the data property values for the specified individual and data
property expression. The values are a set of literals. Note that the
results are not guaranteed to be complete for this method. The reasoner
may also return canonical literals or they may be in a form that bears a
resemblance to the syntax of the liter... | [
"Gets",
"the",
"data",
"property",
"values",
"for",
"the",
"specified",
"individual",
"and",
"data",
"property",
"expression",
".",
"The",
"values",
"are",
"a",
"set",
"of",
"literals",
".",
"Note",
"that",
"the",
"results",
"are",
"not",
"guaranteed",
"to",... | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L1942-L1948 |
11,307 | aehrc/snorocket | snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java | SnorocketOWLReasoner.getSameIndividuals | @Override
public Node<OWLNamedIndividual> getSameIndividuals(OWLNamedIndividual ind)
throws InconsistentOntologyException, FreshEntitiesException,
ReasonerInterruptedException, TimeOutException {
throw new ReasonerInternalException(
"getSameIndividuals not implem... | java | @Override
public Node<OWLNamedIndividual> getSameIndividuals(OWLNamedIndividual ind)
throws InconsistentOntologyException, FreshEntitiesException,
ReasonerInterruptedException, TimeOutException {
throw new ReasonerInternalException(
"getSameIndividuals not implem... | [
"@",
"Override",
"public",
"Node",
"<",
"OWLNamedIndividual",
">",
"getSameIndividuals",
"(",
"OWLNamedIndividual",
"ind",
")",
"throws",
"InconsistentOntologyException",
",",
"FreshEntitiesException",
",",
"ReasonerInterruptedException",
",",
"TimeOutException",
"{",
"thro... | Gets the individuals that are the same as the specified individual.
@param ind
The individual whose same individuals are to be retrieved.
@return A node containing individuals such that for each individual
<code>j</code> in the node, the root ontology imports closure
entails <code>SameIndividual(j, ind)</code>. Note t... | [
"Gets",
"the",
"individuals",
"that",
"are",
"the",
"same",
"as",
"the",
"specified",
"individual",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L1975-L1981 |
11,308 | j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/util/ReflectionUtils.java | ReflectionUtils.methodBelongsTo | public static boolean methodBelongsTo(Method m, Method[] methods){
boolean result = false;
for (int i = 0; i < methods.length && !result; i++) {
if(methodEquals (methods [i], m)){
result = true;
}
}
return result;
} | java | public static boolean methodBelongsTo(Method m, Method[] methods){
boolean result = false;
for (int i = 0; i < methods.length && !result; i++) {
if(methodEquals (methods [i], m)){
result = true;
}
}
return result;
} | [
"public",
"static",
"boolean",
"methodBelongsTo",
"(",
"Method",
"m",
",",
"Method",
"[",
"]",
"methods",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"methods",
".",
"length",
"&&",
"!",
"result"... | Returns true if the method is in the method array.
@param m the method
@param methods the method array
@return true if the method is in the method array. | [
"Returns",
"true",
"if",
"the",
"method",
"is",
"in",
"the",
"method",
"array",
"."
] | 1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/util/ReflectionUtils.java#L31-L41 |
11,309 | j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/util/ReflectionUtils.java | ReflectionUtils.methodEquals | public static boolean methodEquals( Method method, Method other){
if ((method.getDeclaringClass().equals( other.getDeclaringClass()))
&& (method.getName().equals( other.getName()))) {
if (!method.getReturnType().equals(other.getReturnType()))
return false;
Class<?>[... | java | public static boolean methodEquals( Method method, Method other){
if ((method.getDeclaringClass().equals( other.getDeclaringClass()))
&& (method.getName().equals( other.getName()))) {
if (!method.getReturnType().equals(other.getReturnType()))
return false;
Class<?>[... | [
"public",
"static",
"boolean",
"methodEquals",
"(",
"Method",
"method",
",",
"Method",
"other",
")",
"{",
"if",
"(",
"(",
"method",
".",
"getDeclaringClass",
"(",
")",
".",
"equals",
"(",
"other",
".",
"getDeclaringClass",
"(",
")",
")",
")",
"&&",
"(",
... | Checks if the 2 methods are equals.
@param method the first method
@param other the second method
@return true if the 2 methods are equals | [
"Checks",
"if",
"the",
"2",
"methods",
"are",
"equals",
"."
] | 1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/util/ReflectionUtils.java#L50-L68 |
11,310 | d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixupMin | @SuppressWarnings("unchecked")
private void fixupMin(int k) {
K key = array[k];
int gp = k / 4;
while (gp > 0 && ((Comparable<? super K>) array[gp]).compareTo(key) > 0) {
array[k] = array[gp];
k = gp;
gp = k / 4;
}
array[k] = key;
} | java | @SuppressWarnings("unchecked")
private void fixupMin(int k) {
K key = array[k];
int gp = k / 4;
while (gp > 0 && ((Comparable<? super K>) array[gp]).compareTo(key) > 0) {
array[k] = array[gp];
k = gp;
gp = k / 4;
}
array[k] = key;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"fixupMin",
"(",
"int",
"k",
")",
"{",
"K",
"key",
"=",
"array",
"[",
"k",
"]",
";",
"int",
"gp",
"=",
"k",
"/",
"4",
";",
"while",
"(",
"gp",
">",
"0",
"&&",
"(",
"(",
"Com... | Upwards fix starting from a particular element at a minimum level
@param k
the index of the starting element | [
"Upwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"minimum",
"level"
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L424-L434 |
11,311 | d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixupMinWithComparator | private void fixupMinWithComparator(int k) {
K key = array[k];
int gp = k / 4;
while (gp > 0 && comparator.compare(array[gp], key) > 0) {
array[k] = array[gp];
k = gp;
gp = k / 4;
}
array[k] = key;
} | java | private void fixupMinWithComparator(int k) {
K key = array[k];
int gp = k / 4;
while (gp > 0 && comparator.compare(array[gp], key) > 0) {
array[k] = array[gp];
k = gp;
gp = k / 4;
}
array[k] = key;
} | [
"private",
"void",
"fixupMinWithComparator",
"(",
"int",
"k",
")",
"{",
"K",
"key",
"=",
"array",
"[",
"k",
"]",
";",
"int",
"gp",
"=",
"k",
"/",
"4",
";",
"while",
"(",
"gp",
">",
"0",
"&&",
"comparator",
".",
"compare",
"(",
"array",
"[",
"gp",... | Upwards fix starting from a particular element at a minimum level.
Performs comparisons using the comparator.
@param k
the index of the starting element | [
"Upwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"minimum",
"level",
".",
"Performs",
"comparisons",
"using",
"the",
"comparator",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L443-L452 |
11,312 | d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixupMaxWithComparator | private void fixupMaxWithComparator(int k) {
K key = array[k];
int gp = k / 4;
while (gp > 0 && comparator.compare(array[gp], key) < 0) {
array[k] = array[gp];
k = gp;
gp = k / 4;
}
array[k] = key;
} | java | private void fixupMaxWithComparator(int k) {
K key = array[k];
int gp = k / 4;
while (gp > 0 && comparator.compare(array[gp], key) < 0) {
array[k] = array[gp];
k = gp;
gp = k / 4;
}
array[k] = key;
} | [
"private",
"void",
"fixupMaxWithComparator",
"(",
"int",
"k",
")",
"{",
"K",
"key",
"=",
"array",
"[",
"k",
"]",
";",
"int",
"gp",
"=",
"k",
"/",
"4",
";",
"while",
"(",
"gp",
">",
"0",
"&&",
"comparator",
".",
"compare",
"(",
"array",
"[",
"gp",... | Upwards fix starting from a particular element at a maximum level.
Performs comparisons using the comparator.
@param k
the index of the starting element | [
"Upwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"maximum",
"level",
".",
"Performs",
"comparisons",
"using",
"the",
"comparator",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L479-L488 |
11,313 | d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixdownMin | @SuppressWarnings("unchecked")
private void fixdownMin(int k) {
int c = 2 * k;
while (c <= size) {
int m = minChildOrGrandchild(k);
if (m > c + 1) { // grandchild
if (((Comparable<? super K>) array[m]).compareTo(array[k]) >= 0) {
break;
... | java | @SuppressWarnings("unchecked")
private void fixdownMin(int k) {
int c = 2 * k;
while (c <= size) {
int m = minChildOrGrandchild(k);
if (m > c + 1) { // grandchild
if (((Comparable<? super K>) array[m]).compareTo(array[k]) >= 0) {
break;
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"fixdownMin",
"(",
"int",
"k",
")",
"{",
"int",
"c",
"=",
"2",
"*",
"k",
";",
"while",
"(",
"c",
"<=",
"size",
")",
"{",
"int",
"m",
"=",
"minChildOrGrandchild",
"(",
"k",
")",
... | Downwards fix starting from a particular element at a minimum level.
@param k
the index of the starting element | [
"Downwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"minimum",
"level",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L527-L556 |
11,314 | d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixdownMinWithComparator | private void fixdownMinWithComparator(int k) {
int c = 2 * k;
while (c <= size) {
int m = minChildOrGrandchildWithComparator(k);
if (m > c + 1) { // grandchild
if (comparator.compare(array[m], array[k]) >= 0) {
break;
}
... | java | private void fixdownMinWithComparator(int k) {
int c = 2 * k;
while (c <= size) {
int m = minChildOrGrandchildWithComparator(k);
if (m > c + 1) { // grandchild
if (comparator.compare(array[m], array[k]) >= 0) {
break;
}
... | [
"private",
"void",
"fixdownMinWithComparator",
"(",
"int",
"k",
")",
"{",
"int",
"c",
"=",
"2",
"*",
"k",
";",
"while",
"(",
"c",
"<=",
"size",
")",
"{",
"int",
"m",
"=",
"minChildOrGrandchildWithComparator",
"(",
"k",
")",
";",
"if",
"(",
"m",
">",
... | Downwards fix starting from a particular element at a minimum level.
Performs comparisons using the comparator.
@param k
the index of the starting element | [
"Downwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"minimum",
"level",
".",
"Performs",
"comparisons",
"using",
"the",
"comparator",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L565-L593 |
11,315 | d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixdownMax | @SuppressWarnings("unchecked")
private void fixdownMax(int k) {
int c = 2 * k;
while (c <= size) {
int m = maxChildOrGrandchild(k);
if (m > c + 1) { // grandchild
if (((Comparable<? super K>) array[m]).compareTo(array[k]) <= 0) {
break;
... | java | @SuppressWarnings("unchecked")
private void fixdownMax(int k) {
int c = 2 * k;
while (c <= size) {
int m = maxChildOrGrandchild(k);
if (m > c + 1) { // grandchild
if (((Comparable<? super K>) array[m]).compareTo(array[k]) <= 0) {
break;
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"fixdownMax",
"(",
"int",
"k",
")",
"{",
"int",
"c",
"=",
"2",
"*",
"k",
";",
"while",
"(",
"c",
"<=",
"size",
")",
"{",
"int",
"m",
"=",
"maxChildOrGrandchild",
"(",
"k",
")",
... | Downwards fix starting from a particular element at a maximum level.
@param k
the index of the starting element | [
"Downwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"maximum",
"level",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L601-L630 |
11,316 | d-michail/jheaps | src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java | MinMaxBinaryArrayDoubleEndedHeap.fixdownMaxWithComparator | private void fixdownMaxWithComparator(int k) {
int c = 2 * k;
while (c <= size) {
int m = maxChildOrGrandchildWithComparator(k);
if (m > c + 1) { // grandchild
if (comparator.compare(array[m], array[k]) <= 0) {
break;
}
... | java | private void fixdownMaxWithComparator(int k) {
int c = 2 * k;
while (c <= size) {
int m = maxChildOrGrandchildWithComparator(k);
if (m > c + 1) { // grandchild
if (comparator.compare(array[m], array[k]) <= 0) {
break;
}
... | [
"private",
"void",
"fixdownMaxWithComparator",
"(",
"int",
"k",
")",
"{",
"int",
"c",
"=",
"2",
"*",
"k",
";",
"while",
"(",
"c",
"<=",
"size",
")",
"{",
"int",
"m",
"=",
"maxChildOrGrandchildWithComparator",
"(",
"k",
")",
";",
"if",
"(",
"m",
">",
... | Downwards fix starting from a particular element at a maximum level.
Performs comparisons using the comparator.
@param k
the index of the starting element | [
"Downwards",
"fix",
"starting",
"from",
"a",
"particular",
"element",
"at",
"a",
"maximum",
"level",
".",
"Performs",
"comparisons",
"using",
"the",
"comparator",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/array/MinMaxBinaryArrayDoubleEndedHeap.java#L639-L667 |
11,317 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/NetworkMonitor.java | NetworkMonitor.getCurrentConnectionType | public NetworkConnectionType getCurrentConnectionType() {
NetworkInfo activeNetworkInfo = getActiveNetworkInfo();
if (activeNetworkInfo == null || !isInternetAccessAvailable()) {
return NetworkConnectionType.NO_CONNECTION;
}
switch (activeNetworkInfo.getType()) {
... | java | public NetworkConnectionType getCurrentConnectionType() {
NetworkInfo activeNetworkInfo = getActiveNetworkInfo();
if (activeNetworkInfo == null || !isInternetAccessAvailable()) {
return NetworkConnectionType.NO_CONNECTION;
}
switch (activeNetworkInfo.getType()) {
... | [
"public",
"NetworkConnectionType",
"getCurrentConnectionType",
"(",
")",
"{",
"NetworkInfo",
"activeNetworkInfo",
"=",
"getActiveNetworkInfo",
"(",
")",
";",
"if",
"(",
"activeNetworkInfo",
"==",
"null",
"||",
"!",
"isInternetAccessAvailable",
"(",
")",
")",
"{",
"r... | Get the type of network connection that the device is currently using
to connect to the internet.
@return The type of network connection that the device is currently using. | [
"Get",
"the",
"type",
"of",
"network",
"connection",
"that",
"the",
"device",
"is",
"currently",
"using",
"to",
"connect",
"to",
"the",
"internet",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/NetworkMonitor.java#L154-L172 |
11,318 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/NetworkMonitor.java | NetworkMonitor.getActiveNetworkInfo | protected NetworkInfo getActiveNetworkInfo() {
ConnectivityManager connectivityManager
= (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
return connectivityManager.getActiveNetworkInfo();
} | java | protected NetworkInfo getActiveNetworkInfo() {
ConnectivityManager connectivityManager
= (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
return connectivityManager.getActiveNetworkInfo();
} | [
"protected",
"NetworkInfo",
"getActiveNetworkInfo",
"(",
")",
"{",
"ConnectivityManager",
"connectivityManager",
"=",
"(",
"ConnectivityManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"CONNECTIVITY_SERVICE",
")",
";",
"return",
"connectivityManager... | Retrieves information on the current type of network connection that the device is using | [
"Retrieves",
"information",
"on",
"the",
"current",
"type",
"of",
"network",
"connection",
"that",
"the",
"device",
"is",
"using"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/api/NetworkMonitor.java#L194-L198 |
11,319 | aehrc/snorocket | snorocket-examples/src/main/java/au/csiro/snorocket/core/benchmark/Benchmark.java | Benchmark.runBechmarkRF1 | public Stats runBechmarkRF1() {
Stats res = new Stats();
String version = "20110731";
// Classify ontology from stated form
System.out.println("Classifying ontology");
long start = System.currentTimeMillis();
IFactory factory = new CoreFactory();... | java | public Stats runBechmarkRF1() {
Stats res = new Stats();
String version = "20110731";
// Classify ontology from stated form
System.out.println("Classifying ontology");
long start = System.currentTimeMillis();
IFactory factory = new CoreFactory();... | [
"public",
"Stats",
"runBechmarkRF1",
"(",
")",
"{",
"Stats",
"res",
"=",
"new",
"Stats",
"(",
")",
";",
"String",
"version",
"=",
"\"20110731\"",
";",
"// Classify ontology from stated form\r",
"System",
".",
"out",
".",
"println",
"(",
"\"Classifying ontology\"",... | Runs the benchmark using an RF1 file as input.
@param concepts
The concepts file.
@param relationships
The stated relationships file. | [
"Runs",
"the",
"benchmark",
"using",
"an",
"RF1",
"file",
"as",
"input",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-examples/src/main/java/au/csiro/snorocket/core/benchmark/Benchmark.java#L49-L100 |
11,320 | d-michail/jheaps | src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java | CostlessMeldPairingHeap.delete | private void delete(Node<K, V> n) {
if (n != root && n.o_s == null && n.poolIndex == Node.NO_INDEX) {
// no root, no parent and no pool index
throw new IllegalArgumentException("Invalid handle!");
}
// node has a parent
if (n.o_s != null) {
// cut old... | java | private void delete(Node<K, V> n) {
if (n != root && n.o_s == null && n.poolIndex == Node.NO_INDEX) {
// no root, no parent and no pool index
throw new IllegalArgumentException("Invalid handle!");
}
// node has a parent
if (n.o_s != null) {
// cut old... | [
"private",
"void",
"delete",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"n",
")",
"{",
"if",
"(",
"n",
"!=",
"root",
"&&",
"n",
".",
"o_s",
"==",
"null",
"&&",
"n",
".",
"poolIndex",
"==",
"Node",
".",
"NO_INDEX",
")",
"{",
"// no root, no parent and no... | Delete a node.
@param n
the node | [
"Delete",
"a",
"node",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java#L595-L653 |
11,321 | d-michail/jheaps | src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java | CostlessMeldPairingHeap.addPool | @SuppressWarnings("unchecked")
private void addPool(Node<K, V> n, boolean updateMinimum) {
decreasePool[decreasePoolSize] = n;
n.poolIndex = decreasePoolSize;
decreasePoolSize++;
if (updateMinimum && decreasePoolSize > 1) {
Node<K, V> poolMin = decreasePool[decreasePoolM... | java | @SuppressWarnings("unchecked")
private void addPool(Node<K, V> n, boolean updateMinimum) {
decreasePool[decreasePoolSize] = n;
n.poolIndex = decreasePoolSize;
decreasePoolSize++;
if (updateMinimum && decreasePoolSize > 1) {
Node<K, V> poolMin = decreasePool[decreasePoolM... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"addPool",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"n",
",",
"boolean",
"updateMinimum",
")",
"{",
"decreasePool",
"[",
"decreasePoolSize",
"]",
"=",
"n",
";",
"n",
".",
"poolIndex",
"=... | Append to decrease pool. | [
"Append",
"to",
"decrease",
"pool",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java#L727-L745 |
11,322 | d-michail/jheaps | src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java | CostlessMeldPairingHeap.cutOldestChild | private Node<K, V> cutOldestChild(Node<K, V> n) {
Node<K, V> oldestChild = n.o_c;
if (oldestChild != null) {
if (oldestChild.y_s != null) {
oldestChild.y_s.o_s = n;
}
n.o_c = oldestChild.y_s;
oldestChild.y_s = null;
oldestChild.... | java | private Node<K, V> cutOldestChild(Node<K, V> n) {
Node<K, V> oldestChild = n.o_c;
if (oldestChild != null) {
if (oldestChild.y_s != null) {
oldestChild.y_s.o_s = n;
}
n.o_c = oldestChild.y_s;
oldestChild.y_s = null;
oldestChild.... | [
"private",
"Node",
"<",
"K",
",",
"V",
">",
"cutOldestChild",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"n",
")",
"{",
"Node",
"<",
"K",
",",
"V",
">",
"oldestChild",
"=",
"n",
".",
"o_c",
";",
"if",
"(",
"oldestChild",
"!=",
"null",
")",
"{",
"i... | Cut the oldest child of a node.
@param n
the node
@return the oldest child of a node or null | [
"Cut",
"the",
"oldest",
"child",
"of",
"a",
"node",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java#L867-L878 |
11,323 | d-michail/jheaps | src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java | CostlessMeldPairingHeap.cutFromParent | private void cutFromParent(Node<K, V> n) {
if (n.o_s != null) {
if (n.y_s != null) {
n.y_s.o_s = n.o_s;
}
if (n.o_s.o_c == n) { // I am the oldest :(
n.o_s.o_c = n.y_s;
} else { // I have an older sibling!
n.o_s.y_s ... | java | private void cutFromParent(Node<K, V> n) {
if (n.o_s != null) {
if (n.y_s != null) {
n.y_s.o_s = n.o_s;
}
if (n.o_s.o_c == n) { // I am the oldest :(
n.o_s.o_c = n.y_s;
} else { // I have an older sibling!
n.o_s.y_s ... | [
"private",
"void",
"cutFromParent",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"n",
")",
"{",
"if",
"(",
"n",
".",
"o_s",
"!=",
"null",
")",
"{",
"if",
"(",
"n",
".",
"y_s",
"!=",
"null",
")",
"{",
"n",
".",
"y_s",
".",
"o_s",
"=",
"n",
".",
"... | Cut a node from its parent.
@param n
the node | [
"Cut",
"a",
"node",
"from",
"its",
"parent",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java#L886-L899 |
11,324 | d-michail/jheaps | src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java | CostlessMeldPairingHeap.linkInPlace | private void linkInPlace(Node<K, V> orphan, Node<K, V> n) {
// link orphan at node's position
orphan.y_s = n.y_s;
if (n.y_s != null) {
n.y_s.o_s = orphan;
}
orphan.o_s = n.o_s;
if (n.o_s != null) {
if (n.o_s.o_c == n) { // node is the oldest :(
... | java | private void linkInPlace(Node<K, V> orphan, Node<K, V> n) {
// link orphan at node's position
orphan.y_s = n.y_s;
if (n.y_s != null) {
n.y_s.o_s = orphan;
}
orphan.o_s = n.o_s;
if (n.o_s != null) {
if (n.o_s.o_c == n) { // node is the oldest :(
... | [
"private",
"void",
"linkInPlace",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"orphan",
",",
"Node",
"<",
"K",
",",
"V",
">",
"n",
")",
"{",
"// link orphan at node's position",
"orphan",
".",
"y_s",
"=",
"n",
".",
"y_s",
";",
"if",
"(",
"n",
".",
"y_s",... | Put an orphan node into the position of another node. The other node
becomes an orphan.
@param orphan
the orphan node
@param n
the node which will become an orphan | [
"Put",
"an",
"orphan",
"node",
"into",
"the",
"position",
"of",
"another",
"node",
".",
"The",
"other",
"node",
"becomes",
"an",
"orphan",
"."
] | 7146451dd6591c2a8559dc564c9c40428c4a2c10 | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java#L910-L926 |
11,325 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.createInstance | public static synchronized MCAAuthorizationManager createInstance(Context context) {
if (instance == null) {
instance = new MCAAuthorizationManager(context.getApplicationContext());
instance.bluemixRegionSuffix = BMSClient.getInstance().getBluemixRegionSuffix();
instance.ten... | java | public static synchronized MCAAuthorizationManager createInstance(Context context) {
if (instance == null) {
instance = new MCAAuthorizationManager(context.getApplicationContext());
instance.bluemixRegionSuffix = BMSClient.getInstance().getBluemixRegionSuffix();
instance.ten... | [
"public",
"static",
"synchronized",
"MCAAuthorizationManager",
"createInstance",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"instance",
"=",
"new",
"MCAAuthorizationManager",
"(",
"context",
".",
"getApplicationContext",
"(",... | Init singleton instance with context
@param context Application context
@return The singleton instance | [
"Init",
"singleton",
"instance",
"with",
"context"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L82-L92 |
11,326 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.createInstance | public static synchronized MCAAuthorizationManager createInstance(Context context, String tenantId) {
instance = createInstance(context);
if (null != tenantId) {
instance.tenantId = tenantId;
}
return instance;
} | java | public static synchronized MCAAuthorizationManager createInstance(Context context, String tenantId) {
instance = createInstance(context);
if (null != tenantId) {
instance.tenantId = tenantId;
}
return instance;
} | [
"public",
"static",
"synchronized",
"MCAAuthorizationManager",
"createInstance",
"(",
"Context",
"context",
",",
"String",
"tenantId",
")",
"{",
"instance",
"=",
"createInstance",
"(",
"context",
")",
";",
"if",
"(",
"null",
"!=",
"tenantId",
")",
"{",
"instance... | Init singleton instance with context and tenantId
@param context Application context
@param tenantId the unique tenant id of the MCA service instance that the application connects to.
@return The singleton instance | [
"Init",
"singleton",
"instance",
"with",
"context",
"and",
"tenantId"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L100-L107 |
11,327 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.createInstance | public static synchronized MCAAuthorizationManager createInstance(Context context, String tenantId, String bluemixRegion) {
instance = createInstance(context, tenantId);
if (null != bluemixRegion) {
instance.bluemixRegionSuffix = bluemixRegion;
}
return instance;
} | java | public static synchronized MCAAuthorizationManager createInstance(Context context, String tenantId, String bluemixRegion) {
instance = createInstance(context, tenantId);
if (null != bluemixRegion) {
instance.bluemixRegionSuffix = bluemixRegion;
}
return instance;
} | [
"public",
"static",
"synchronized",
"MCAAuthorizationManager",
"createInstance",
"(",
"Context",
"context",
",",
"String",
"tenantId",
",",
"String",
"bluemixRegion",
")",
"{",
"instance",
"=",
"createInstance",
"(",
"context",
",",
"tenantId",
")",
";",
"if",
"("... | Init singleton instance with context, tenantId and Bluemix region.
@param context Application context
@param tenantId the unique tenant id of the MCA service instance that the application connects to.
@param bluemixRegion Specifies the Bluemix deployment to use.
@return The singleton instance | [
"Init",
"singleton",
"instance",
"with",
"context",
"tenantId",
"and",
"Bluemix",
"region",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L116-L123 |
11,328 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.obtainAuthorization | public synchronized void obtainAuthorization(Context context, ResponseListener listener, Object... params) {
authorizationProcessManager.startAuthorizationProcess(context, listener);
} | java | public synchronized void obtainAuthorization(Context context, ResponseListener listener, Object... params) {
authorizationProcessManager.startAuthorizationProcess(context, listener);
} | [
"public",
"synchronized",
"void",
"obtainAuthorization",
"(",
"Context",
"context",
",",
"ResponseListener",
"listener",
",",
"Object",
"...",
"params",
")",
"{",
"authorizationProcessManager",
".",
"startAuthorizationProcess",
"(",
"context",
",",
"listener",
")",
";... | Invoke process for obtaining authorization header. during this process
@param context Android Activity that will handle the authorization (like facebook or google)
@param listener Response listener | [
"Invoke",
"process",
"for",
"obtaining",
"authorization",
"header",
".",
"during",
"this",
"process"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L154-L156 |
11,329 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.clearAuthorizationData | public void clearAuthorizationData() {
preferences.accessToken.clear();
preferences.idToken.clear();
preferences.userIdentity.clear();
if (BMSClient.getInstance() != null && BMSClient.getInstance().getCookieManager() != null) {
CookieStore cookieStore = BMSClient.getInstance(... | java | public void clearAuthorizationData() {
preferences.accessToken.clear();
preferences.idToken.clear();
preferences.userIdentity.clear();
if (BMSClient.getInstance() != null && BMSClient.getInstance().getCookieManager() != null) {
CookieStore cookieStore = BMSClient.getInstance(... | [
"public",
"void",
"clearAuthorizationData",
"(",
")",
"{",
"preferences",
".",
"accessToken",
".",
"clear",
"(",
")",
";",
"preferences",
".",
"idToken",
".",
"clear",
"(",
")",
";",
"preferences",
".",
"userIdentity",
".",
"clear",
"(",
")",
";",
"if",
... | Clear the local stored authorization data | [
"Clear",
"the",
"local",
"stored",
"authorization",
"data"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L190-L206 |
11,330 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.setAuthorizationPersistencePolicy | public void setAuthorizationPersistencePolicy(PersistencePolicy policy) {
if (policy == null) {
throw new IllegalArgumentException("The policy argument cannot be null");
}
if (preferences.persistencePolicy.get() != policy) {
preferences.persistencePolicy.set(policy);
... | java | public void setAuthorizationPersistencePolicy(PersistencePolicy policy) {
if (policy == null) {
throw new IllegalArgumentException("The policy argument cannot be null");
}
if (preferences.persistencePolicy.get() != policy) {
preferences.persistencePolicy.set(policy);
... | [
"public",
"void",
"setAuthorizationPersistencePolicy",
"(",
"PersistencePolicy",
"policy",
")",
"{",
"if",
"(",
"policy",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The policy argument cannot be null\"",
")",
";",
"}",
"if",
"(",
"pr... | Change the sate of the current authorization persistence policy
@param policy new policy to use | [
"Change",
"the",
"sate",
"of",
"the",
"current",
"authorization",
"persistence",
"policy"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L229-L240 |
11,331 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.registerAuthenticationListener | public void registerAuthenticationListener(String realm, AuthenticationListener listener) {
if (realm == null || realm.isEmpty()) {
throw new InvalidParameterException("The realm name can't be null or empty.");
}
if (listener == null) {
throw new InvalidParameterExceptio... | java | public void registerAuthenticationListener(String realm, AuthenticationListener listener) {
if (realm == null || realm.isEmpty()) {
throw new InvalidParameterException("The realm name can't be null or empty.");
}
if (listener == null) {
throw new InvalidParameterExceptio... | [
"public",
"void",
"registerAuthenticationListener",
"(",
"String",
"realm",
",",
"AuthenticationListener",
"listener",
")",
"{",
"if",
"(",
"realm",
"==",
"null",
"||",
"realm",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidParameterException",
"("... | Registers authentication listener for specified realm.
@param realm authentication realm.
@param listener authentication listener. | [
"Registers",
"authentication",
"listener",
"for",
"specified",
"realm",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L291-L303 |
11,332 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java | MCAAuthorizationManager.unregisterAuthenticationListener | public void unregisterAuthenticationListener(String realm) {
if (realm != null && !realm.isEmpty()) {
challengeHandlers.remove(realm);
}
} | java | public void unregisterAuthenticationListener(String realm) {
if (realm != null && !realm.isEmpty()) {
challengeHandlers.remove(realm);
}
} | [
"public",
"void",
"unregisterAuthenticationListener",
"(",
"String",
"realm",
")",
"{",
"if",
"(",
"realm",
"!=",
"null",
"&&",
"!",
"realm",
".",
"isEmpty",
"(",
")",
")",
"{",
"challengeHandlers",
".",
"remove",
"(",
"realm",
")",
";",
"}",
"}"
] | Unregisters authentication listener
@param realm the realm the listener was registered for | [
"Unregisters",
"authentication",
"listener"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/api/MCAAuthorizationManager.java#L310-L314 |
11,333 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationHeaderHelper.java | AuthorizationHeaderHelper.addAuthorizationHeader | public static void addAuthorizationHeader(URLConnection urlConnection, String header) {
if (header != null) {
urlConnection.setRequestProperty(AUTHORIZATION_HEADER, header);
}
} | java | public static void addAuthorizationHeader(URLConnection urlConnection, String header) {
if (header != null) {
urlConnection.setRequestProperty(AUTHORIZATION_HEADER, header);
}
} | [
"public",
"static",
"void",
"addAuthorizationHeader",
"(",
"URLConnection",
"urlConnection",
",",
"String",
"header",
")",
"{",
"if",
"(",
"header",
"!=",
"null",
")",
"{",
"urlConnection",
".",
"setRequestProperty",
"(",
"AUTHORIZATION_HEADER",
",",
"header",
")"... | Adds the authorization header to the given URL connection object.
@param urlConnection The URL connection to add the header to. | [
"Adds",
"the",
"authorization",
"header",
"to",
"the",
"given",
"URL",
"connection",
"object",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationHeaderHelper.java#L60-L64 |
11,334 | j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/taglib/jsf/ImagePathTag.java | ImagePathTag.getBinaryResourcesHandler | protected BinaryResourcesHandler getBinaryResourcesHandler(FacesContext context) {
// Generate the path for the image element
BinaryResourcesHandler binaryRsHandler = (BinaryResourcesHandler) context.getExternalContext()
.getApplicationMap().get(JawrConstant.BINARY_CONTEXT_ATTRIBUTE);
if (binaryRsHandler == ... | java | protected BinaryResourcesHandler getBinaryResourcesHandler(FacesContext context) {
// Generate the path for the image element
BinaryResourcesHandler binaryRsHandler = (BinaryResourcesHandler) context.getExternalContext()
.getApplicationMap().get(JawrConstant.BINARY_CONTEXT_ATTRIBUTE);
if (binaryRsHandler == ... | [
"protected",
"BinaryResourcesHandler",
"getBinaryResourcesHandler",
"(",
"FacesContext",
"context",
")",
"{",
"// Generate the path for the image element",
"BinaryResourcesHandler",
"binaryRsHandler",
"=",
"(",
"BinaryResourcesHandler",
")",
"context",
".",
"getExternalContext",
... | Returns the image resource handler
@param context
the faces context
@return the image resource handler | [
"Returns",
"the",
"image",
"resource",
"handler"
] | 1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/taglib/jsf/ImagePathTag.java#L112-L122 |
11,335 | dottydingo/hyperion | jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java | AbstractEntityJpaQueryBuilder.createPredicate | protected Predicate createPredicate(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyName,
ComparisonOperator operator, Object argument, PersistenceContext context)
{
logger.debug("Creating criterion: {} {} {}", propertyName, operator, argument);
... | java | protected Predicate createPredicate(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyName,
ComparisonOperator operator, Object argument, PersistenceContext context)
{
logger.debug("Creating criterion: {} {} {}", propertyName, operator, argument);
... | [
"protected",
"Predicate",
"createPredicate",
"(",
"Path",
"root",
",",
"CriteriaQuery",
"<",
"?",
">",
"query",
",",
"CriteriaBuilder",
"cb",
",",
"String",
"propertyName",
",",
"ComparisonOperator",
"operator",
",",
"Object",
"argument",
",",
"PersistenceContext",
... | Delegate creating of a Predicate to an appropriate method according to
operator.
@param root root
@param query query
@param propertyName property name
@param operator comparison operator
@param argument argument
@param context context
@return Predicate | [
"Delegate",
"creating",
"of",
"a",
"Predicate",
"to",
"an",
"appropriate",
"method",
"according",
"to",
"operator",
"."
] | c4d119c90024a88c0335d7d318e9ccdb70149764 | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java#L43-L86 |
11,336 | dottydingo/hyperion | jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java | AbstractEntityJpaQueryBuilder.createEqual | protected Predicate createEqual(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyPath,
Object argument, PersistenceContext context)
{
return cb.equal(root.get(propertyPath), argument);
} | java | protected Predicate createEqual(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyPath,
Object argument, PersistenceContext context)
{
return cb.equal(root.get(propertyPath), argument);
} | [
"protected",
"Predicate",
"createEqual",
"(",
"Path",
"root",
",",
"CriteriaQuery",
"<",
"?",
">",
"query",
",",
"CriteriaBuilder",
"cb",
",",
"String",
"propertyPath",
",",
"Object",
"argument",
",",
"PersistenceContext",
"context",
")",
"{",
"return",
"cb",
... | Apply an "equal" constraint to the named property.
@param query
@param propertyPath property name prefixed with an association alias
@param argument value
@param context
@return Predicate | [
"Apply",
"an",
"equal",
"constraint",
"to",
"the",
"named",
"property",
"."
] | c4d119c90024a88c0335d7d318e9ccdb70149764 | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java#L98-L102 |
11,337 | dottydingo/hyperion | jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java | AbstractEntityJpaQueryBuilder.createNotEqual | protected Predicate createNotEqual(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyPath, Object argument,
PersistenceContext context)
{
return cb.notEqual(root.get(propertyPath), argument);
} | java | protected Predicate createNotEqual(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyPath, Object argument,
PersistenceContext context)
{
return cb.notEqual(root.get(propertyPath), argument);
} | [
"protected",
"Predicate",
"createNotEqual",
"(",
"Path",
"root",
",",
"CriteriaQuery",
"<",
"?",
">",
"query",
",",
"CriteriaBuilder",
"cb",
",",
"String",
"propertyPath",
",",
"Object",
"argument",
",",
"PersistenceContext",
"context",
")",
"{",
"return",
"cb",... | Apply a "not equal" constraint to the named property.
@param query
@param propertyPath property name prefixed with an association alias
@param argument value
@param context
@return Predicate | [
"Apply",
"a",
"not",
"equal",
"constraint",
"to",
"the",
"named",
"property",
"."
] | c4d119c90024a88c0335d7d318e9ccdb70149764 | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java#L134-L138 |
11,338 | dottydingo/hyperion | jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java | AbstractEntityJpaQueryBuilder.createLessThan | protected Predicate createLessThan(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyPath, Object argument,
PersistenceContext context)
{
if(!(argument instanceof Comparable))
throw new BadRequestException(context.getMessageSource().getE... | java | protected Predicate createLessThan(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyPath, Object argument,
PersistenceContext context)
{
if(!(argument instanceof Comparable))
throw new BadRequestException(context.getMessageSource().getE... | [
"protected",
"Predicate",
"createLessThan",
"(",
"Path",
"root",
",",
"CriteriaQuery",
"<",
"?",
">",
"query",
",",
"CriteriaBuilder",
"cb",
",",
"String",
"propertyPath",
",",
"Object",
"argument",
",",
"PersistenceContext",
"context",
")",
"{",
"if",
"(",
"!... | Apply a "less than" constraint to the named property.
@param query
@param propertyPath property name prefixed with an association alias
@param argument value
@param context
@return Predicate | [
"Apply",
"a",
"less",
"than",
"constraint",
"to",
"the",
"named",
"property",
"."
] | c4d119c90024a88c0335d7d318e9ccdb70149764 | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java#L207-L215 |
11,339 | dottydingo/hyperion | jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java | AbstractEntityJpaQueryBuilder.containWildcard | protected boolean containWildcard(Object value)
{
if (!(value instanceof String))
{
return false;
}
String casted = (String) value;
return casted.contains(LIKE_WILDCARD.toString());
} | java | protected boolean containWildcard(Object value)
{
if (!(value instanceof String))
{
return false;
}
String casted = (String) value;
return casted.contains(LIKE_WILDCARD.toString());
} | [
"protected",
"boolean",
"containWildcard",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"String",
")",
")",
"{",
"return",
"false",
";",
"}",
"String",
"casted",
"=",
"(",
"String",
")",
"value",
";",
"return",
"casted",
... | Check if given value contains wildcard.
@param value the value
@return Return <tt>true</tt> if argument contains {@link #LIKE_WILDCARD}. | [
"Check",
"if",
"given",
"value",
"contains",
"wildcard",
"."
] | c4d119c90024a88c0335d7d318e9ccdb70149764 | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/jpa/src/main/java/com/dottydingo/hyperion/jpa/persistence/query/AbstractEntityJpaQueryBuilder.java#L265-L275 |
11,340 | dottydingo/hyperion | api/src/main/java/com/dottydingo/hyperion/api/exception/HyperionException.java | HyperionException.getDetailMessage | public String getDetailMessage()
{
if(errorDetails == null || errorDetails.isEmpty())
return getMessage();
StringBuilder sb = new StringBuilder(512);
sb.append(getMessage());
sb.append(" [");
for (int i = 0; i < errorDetails.size(); i++)
{
Er... | java | public String getDetailMessage()
{
if(errorDetails == null || errorDetails.isEmpty())
return getMessage();
StringBuilder sb = new StringBuilder(512);
sb.append(getMessage());
sb.append(" [");
for (int i = 0; i < errorDetails.size(); i++)
{
Er... | [
"public",
"String",
"getDetailMessage",
"(",
")",
"{",
"if",
"(",
"errorDetails",
"==",
"null",
"||",
"errorDetails",
".",
"isEmpty",
"(",
")",
")",
"return",
"getMessage",
"(",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"512",
")",... | Return a detail message. If errorDetails is not empty then the returned message will combine these together,
otherwise the standard exception message is returned.
@return The message | [
"Return",
"a",
"detail",
"message",
".",
"If",
"errorDetails",
"is",
"not",
"empty",
"then",
"the",
"returned",
"message",
"will",
"combine",
"these",
"together",
"otherwise",
"the",
"standard",
"exception",
"message",
"is",
"returned",
"."
] | c4d119c90024a88c0335d7d318e9ccdb70149764 | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/api/src/main/java/com/dottydingo/hyperion/api/exception/HyperionException.java#L125-L144 |
11,341 | j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/cache/CacheManagerFactory.java | CacheManagerFactory.getCacheManager | public static JawrCacheManager getCacheManager(JawrConfig config, String resourceType) {
String cacheMgrAttributeName = CACHE_ATTR_PREFIX + resourceType.toUpperCase() + CACHE_ATTR_SUFFIX;
JawrCacheManager cacheManager = (JawrCacheManager) config.getContext().getAttribute(cacheMgrAttributeName);
if (cacheManager ... | java | public static JawrCacheManager getCacheManager(JawrConfig config, String resourceType) {
String cacheMgrAttributeName = CACHE_ATTR_PREFIX + resourceType.toUpperCase() + CACHE_ATTR_SUFFIX;
JawrCacheManager cacheManager = (JawrCacheManager) config.getContext().getAttribute(cacheMgrAttributeName);
if (cacheManager ... | [
"public",
"static",
"JawrCacheManager",
"getCacheManager",
"(",
"JawrConfig",
"config",
",",
"String",
"resourceType",
")",
"{",
"String",
"cacheMgrAttributeName",
"=",
"CACHE_ATTR_PREFIX",
"+",
"resourceType",
".",
"toUpperCase",
"(",
")",
"+",
"CACHE_ATTR_SUFFIX",
"... | Retrieves the cache manager for a resource type
@param config
the jawr config
@param resourceType
the resource type
@return the cache manager for a resource type | [
"Retrieves",
"the",
"cache",
"manager",
"for",
"a",
"resource",
"type"
] | 1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/cache/CacheManagerFactory.java#L44-L55 |
11,342 | j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/cache/CacheManagerFactory.java | CacheManagerFactory.resetCacheManager | public static synchronized JawrCacheManager resetCacheManager(JawrConfig config, String resourceType) {
String cacheMgrAttributeName = CACHE_ATTR_PREFIX + resourceType.toUpperCase() + CACHE_ATTR_SUFFIX;
JawrCacheManager cacheManager = (JawrCacheManager) config.getContext().getAttribute(cacheMgrAttributeName);
if... | java | public static synchronized JawrCacheManager resetCacheManager(JawrConfig config, String resourceType) {
String cacheMgrAttributeName = CACHE_ATTR_PREFIX + resourceType.toUpperCase() + CACHE_ATTR_SUFFIX;
JawrCacheManager cacheManager = (JawrCacheManager) config.getContext().getAttribute(cacheMgrAttributeName);
if... | [
"public",
"static",
"synchronized",
"JawrCacheManager",
"resetCacheManager",
"(",
"JawrConfig",
"config",
",",
"String",
"resourceType",
")",
"{",
"String",
"cacheMgrAttributeName",
"=",
"CACHE_ATTR_PREFIX",
"+",
"resourceType",
".",
"toUpperCase",
"(",
")",
"+",
"CAC... | Resets the cache manager for a resource type
@param config
the jawr config
@param resourceType
the resource type
@return the cache manager for a resource type | [
"Resets",
"the",
"cache",
"manager",
"for",
"a",
"resource",
"type"
] | 1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/cache/CacheManagerFactory.java#L66-L76 |
11,343 | j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/mapper/AbstractResourceMapper.java | AbstractResourceMapper.addBundleToMap | protected final void addBundleToMap(String bundleId, String mapping) throws DuplicateBundlePathException {
for (JoinableResourceBundle bundle : currentBundles) {
if (bundleId.equals(bundle.getId()) || this.bundleMapping.containsKey(bundleId)) {
Marker fatal = MarkerFactory.getMarker("FATAL");
LOGGER.error... | java | protected final void addBundleToMap(String bundleId, String mapping) throws DuplicateBundlePathException {
for (JoinableResourceBundle bundle : currentBundles) {
if (bundleId.equals(bundle.getId()) || this.bundleMapping.containsKey(bundleId)) {
Marker fatal = MarkerFactory.getMarker("FATAL");
LOGGER.error... | [
"protected",
"final",
"void",
"addBundleToMap",
"(",
"String",
"bundleId",
",",
"String",
"mapping",
")",
"throws",
"DuplicateBundlePathException",
"{",
"for",
"(",
"JoinableResourceBundle",
"bundle",
":",
"currentBundles",
")",
"{",
"if",
"(",
"bundleId",
".",
"e... | Add a bundle and its mapping to the resulting Map.
@param bundleId
the bundle Id
@param mapping
the mapping
@throws DuplicateBundlePathException
if we try to add a bundle with a name, which already exists. | [
"Add",
"a",
"bundle",
"and",
"its",
"mapping",
"to",
"the",
"resulting",
"Map",
"."
] | 1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/mapper/AbstractResourceMapper.java#L107-L118 |
11,344 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.loadAxioms | public void loadAxioms(final Set<? extends Axiom> inclusions) {
long start = System.currentTimeMillis();
if(log.isInfoEnabled())
log.info("Loading " + inclusions.size() + " axioms");
Set<Inclusion> normInclusions = normalise(inclusions);
if(log.isInfoEnabled()) log.info("Proc... | java | public void loadAxioms(final Set<? extends Axiom> inclusions) {
long start = System.currentTimeMillis();
if(log.isInfoEnabled())
log.info("Loading " + inclusions.size() + " axioms");
Set<Inclusion> normInclusions = normalise(inclusions);
if(log.isInfoEnabled()) log.info("Proc... | [
"public",
"void",
"loadAxioms",
"(",
"final",
"Set",
"<",
"?",
"extends",
"Axiom",
">",
"inclusions",
")",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"log",
".",
"isInfoEnabled",
"(",
")",
")",
"log",
".",
... | Normalises and loads a set of axioms.
@param inclusions | [
"Normalises",
"and",
"loads",
"a",
"set",
"of",
"axioms",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L377-L390 |
11,345 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.printInternalObject | private String printInternalObject(Object o) {
if(o instanceof Conjunction) {
Conjunction con = (Conjunction)o;
StringBuilder sb = new StringBuilder();
AbstractConcept[] cons = con.getConcepts();
if(cons != null && cons.length > 0) {
sb.append(prin... | java | private String printInternalObject(Object o) {
if(o instanceof Conjunction) {
Conjunction con = (Conjunction)o;
StringBuilder sb = new StringBuilder();
AbstractConcept[] cons = con.getConcepts();
if(cons != null && cons.length > 0) {
sb.append(prin... | [
"private",
"String",
"printInternalObject",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Conjunction",
")",
"{",
"Conjunction",
"con",
"=",
"(",
"Conjunction",
")",
"o",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";"... | Prints an object of the internal model using the string representation
of the corresponding object in the external model.
@param o
@return | [
"Prints",
"an",
"object",
"of",
"the",
"internal",
"model",
"using",
"the",
"string",
"representation",
"of",
"the",
"corresponding",
"object",
"in",
"the",
"external",
"model",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L722-L767 |
11,346 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.addTerm | protected void addTerm(NormalFormGCI term) {
if (term instanceof NF1a) {
final NF1a nf1 = (NF1a) term;
final int a = nf1.lhsA();
addTerms(ontologyNF1, a, nf1.getQueueEntry());
} else if (term instanceof NF1b) {
final NF1b nf1 = (NF1b) term;
fin... | java | protected void addTerm(NormalFormGCI term) {
if (term instanceof NF1a) {
final NF1a nf1 = (NF1a) term;
final int a = nf1.lhsA();
addTerms(ontologyNF1, a, nf1.getQueueEntry());
} else if (term instanceof NF1b) {
final NF1b nf1 = (NF1b) term;
fin... | [
"protected",
"void",
"addTerm",
"(",
"NormalFormGCI",
"term",
")",
"{",
"if",
"(",
"term",
"instanceof",
"NF1a",
")",
"{",
"final",
"NF1a",
"nf1",
"=",
"(",
"NF1a",
")",
"term",
";",
"final",
"int",
"a",
"=",
"nf1",
".",
"lhsA",
"(",
")",
";",
"add... | Adds a normalised term to the ontology.
@param term
The normalised term. | [
"Adds",
"a",
"normalised",
"term",
"to",
"the",
"ontology",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L775-L808 |
11,347 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.rePrimeNF6 | private void rePrimeNF6(AxiomSet as, IConceptMap<IConceptSet> subsumptions) {
int size = as.getNf6Axioms().size();
if (size == 0)
return;
IConceptSet deltaNF6 = new SparseConceptSet(size);
for (NF6 nf6 : as.getNf6Axioms()) {
deltaNF6.add(nf6.getR());
}
... | java | private void rePrimeNF6(AxiomSet as, IConceptMap<IConceptSet> subsumptions) {
int size = as.getNf6Axioms().size();
if (size == 0)
return;
IConceptSet deltaNF6 = new SparseConceptSet(size);
for (NF6 nf6 : as.getNf6Axioms()) {
deltaNF6.add(nf6.getR());
}
... | [
"private",
"void",
"rePrimeNF6",
"(",
"AxiomSet",
"as",
",",
"IConceptMap",
"<",
"IConceptSet",
">",
"subsumptions",
")",
"{",
"int",
"size",
"=",
"as",
".",
"getNf6Axioms",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"0",
")",
"re... | These are reflexive role axioms. If an axiom of this kind is added, then
an "external edge" must be added to all the contexts that contain that
role and don't contain a successor to themselves.
@param as
@param subsumptions | [
"These",
"are",
"reflexive",
"role",
"axioms",
".",
"If",
"an",
"axiom",
"of",
"this",
"kind",
"is",
"added",
"then",
"an",
"external",
"edge",
"must",
"be",
"added",
"to",
"all",
"the",
"contexts",
"that",
"contain",
"that",
"role",
"and",
"don",
"t",
... | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L1306-L1330 |
11,348 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.classify | public void classify() {
long start = System.currentTimeMillis();
if(log.isInfoEnabled())
log.info("Classifying with " + numThreads + " threads");
// Create contexts for init concepts in the ontology
int numConcepts = factory.getTotalConcepts();
for (int i = 0; i < n... | java | public void classify() {
long start = System.currentTimeMillis();
if(log.isInfoEnabled())
log.info("Classifying with " + numThreads + " threads");
// Create contexts for init concepts in the ontology
int numConcepts = factory.getTotalConcepts();
for (int i = 0; i < n... | [
"public",
"void",
"classify",
"(",
")",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"log",
".",
"isInfoEnabled",
"(",
")",
")",
"log",
".",
"info",
"(",
"\"Classifying with \"",
"+",
"numThreads",
"+",
"\" thr... | Starts the concurrent classification process. | [
"Starts",
"the",
"concurrent",
"classification",
"process",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L1422-L1466 |
11,349 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.getNewSubsumptions | public IConceptMap<IConceptSet> getNewSubsumptions() {
IConceptMap<IConceptSet> res = new DenseConceptMap<IConceptSet>(
newContexts.size());
// Collect subsumptions from new contexts
for (Context ctx : newContexts) {
res.put(ctx.getConcept(), ctx.getS());
}
... | java | public IConceptMap<IConceptSet> getNewSubsumptions() {
IConceptMap<IConceptSet> res = new DenseConceptMap<IConceptSet>(
newContexts.size());
// Collect subsumptions from new contexts
for (Context ctx : newContexts) {
res.put(ctx.getConcept(), ctx.getS());
}
... | [
"public",
"IConceptMap",
"<",
"IConceptSet",
">",
"getNewSubsumptions",
"(",
")",
"{",
"IConceptMap",
"<",
"IConceptSet",
">",
"res",
"=",
"new",
"DenseConceptMap",
"<",
"IConceptSet",
">",
"(",
"newContexts",
".",
"size",
"(",
")",
")",
";",
"// Collect subsu... | Returns the subsumptions for the new concepts added in an incremental
classification.
@return | [
"Returns",
"the",
"subsumptions",
"for",
"the",
"new",
"concepts",
"added",
"in",
"an",
"incremental",
"classification",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L1486-L1494 |
11,350 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.getAffectedSubsumptions | public IConceptMap<IConceptSet> getAffectedSubsumptions() {
int size = 0;
for (Context ctx : affectedContexts) {
if (ctx.hasNewSubsumptions()) {
size++;
}
}
IConceptMap<IConceptSet> res = new DenseConceptMap<IConceptSet>(size);
// Collect ... | java | public IConceptMap<IConceptSet> getAffectedSubsumptions() {
int size = 0;
for (Context ctx : affectedContexts) {
if (ctx.hasNewSubsumptions()) {
size++;
}
}
IConceptMap<IConceptSet> res = new DenseConceptMap<IConceptSet>(size);
// Collect ... | [
"public",
"IConceptMap",
"<",
"IConceptSet",
">",
"getAffectedSubsumptions",
"(",
")",
"{",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"Context",
"ctx",
":",
"affectedContexts",
")",
"{",
"if",
"(",
"ctx",
".",
"hasNewSubsumptions",
"(",
")",
")",
"{",
"s... | Returns the subsumptions for the existing concepts that have additional
subsumptions due to the axioms added in an incremental classification.
@return | [
"Returns",
"the",
"subsumptions",
"for",
"the",
"existing",
"concepts",
"that",
"have",
"additional",
"subsumptions",
"due",
"to",
"the",
"axioms",
"added",
"in",
"an",
"incremental",
"classification",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L1502-L1520 |
11,351 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.getRelationships | public R getRelationships() {
R r = new R(factory.getTotalConcepts(), factory.getTotalRoles());
// Collect subsumptions from context index
for (IntIterator it = contextIndex.keyIterator(); it.hasNext();) {
int key = it.next();
Context ctx = contextIndex.get(key);... | java | public R getRelationships() {
R r = new R(factory.getTotalConcepts(), factory.getTotalRoles());
// Collect subsumptions from context index
for (IntIterator it = contextIndex.keyIterator(); it.hasNext();) {
int key = it.next();
Context ctx = contextIndex.get(key);... | [
"public",
"R",
"getRelationships",
"(",
")",
"{",
"R",
"r",
"=",
"new",
"R",
"(",
"factory",
".",
"getTotalConcepts",
"(",
")",
",",
"factory",
".",
"getTotalRoles",
"(",
")",
")",
";",
"// Collect subsumptions from context index",
"for",
"(",
"IntIterator",
... | Collects all the information contained in the concurrent R structures in
every context and returns a single R structure with all their content.
@return R | [
"Collects",
"all",
"the",
"information",
"contained",
"in",
"the",
"concurrent",
"R",
"structures",
"in",
"every",
"context",
"and",
"returns",
"a",
"single",
"R",
"structure",
"with",
"all",
"their",
"content",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L1528-L1559 |
11,352 | aehrc/snorocket | snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java | NormalisedOntology.isChild | private boolean isChild(Node cn, Node cn2) {
if (cn == cn2)
return false;
Queue<Node> toProcess = new LinkedList<Node>();
toProcess.addAll(cn.getParents());
while (!toProcess.isEmpty()) {
Node tcn = toProcess.poll();
if (tcn.equals(cn2))
... | java | private boolean isChild(Node cn, Node cn2) {
if (cn == cn2)
return false;
Queue<Node> toProcess = new LinkedList<Node>();
toProcess.addAll(cn.getParents());
while (!toProcess.isEmpty()) {
Node tcn = toProcess.poll();
if (tcn.equals(cn2))
... | [
"private",
"boolean",
"isChild",
"(",
"Node",
"cn",
",",
"Node",
"cn2",
")",
"{",
"if",
"(",
"cn",
"==",
"cn2",
")",
"return",
"false",
";",
"Queue",
"<",
"Node",
">",
"toProcess",
"=",
"new",
"LinkedList",
"<",
"Node",
">",
"(",
")",
";",
"toProce... | Indicates if cn is a child of cn2.
@param cn
@param cn2
@return | [
"Indicates",
"if",
"cn",
"is",
"a",
"child",
"of",
"cn2",
"."
] | e33c1e216f8a66d6502e3a14e80876811feedd8b | https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java#L2339-L2356 |
11,353 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java | BaseRequest.setHeaders | public void setHeaders(Map<String, List<String>> headerMap) {
headers = new Headers.Builder();
for (Map.Entry<String, List<String>> e : headerMap.entrySet()) {
for (String headerValue : e.getValue()) {
addHeader(e.getKey(), headerValue);
}
}
} | java | public void setHeaders(Map<String, List<String>> headerMap) {
headers = new Headers.Builder();
for (Map.Entry<String, List<String>> e : headerMap.entrySet()) {
for (String headerValue : e.getValue()) {
addHeader(e.getKey(), headerValue);
}
}
} | [
"public",
"void",
"setHeaders",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headerMap",
")",
"{",
"headers",
"=",
"new",
"Headers",
".",
"Builder",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<... | Sets headers for this resource request. Overrides all headers previously added.
@param headerMap A multimap containing the header names and corresponding values | [
"Sets",
"headers",
"for",
"this",
"resource",
"request",
".",
"Overrides",
"all",
"headers",
"previously",
"added",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java#L296-L304 |
11,354 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java | BaseRequest.addAppIDHeader | public void addAppIDHeader(Context contextValue) {
BaseAppIdentity appIdDetails = new BaseAppIdentity(contextValue);
headers.add(APPLICATION_BUNDLE_ID, appIdDetails.getId());
} | java | public void addAppIDHeader(Context contextValue) {
BaseAppIdentity appIdDetails = new BaseAppIdentity(contextValue);
headers.add(APPLICATION_BUNDLE_ID, appIdDetails.getId());
} | [
"public",
"void",
"addAppIDHeader",
"(",
"Context",
"contextValue",
")",
"{",
"BaseAppIdentity",
"appIdDetails",
"=",
"new",
"BaseAppIdentity",
"(",
"contextValue",
")",
";",
"headers",
".",
"add",
"(",
"APPLICATION_BUNDLE_ID",
",",
"appIdDetails",
".",
"getId",
"... | Adds the App budle ID to this resource request.
@param contextValue context of teh application | [
"Adds",
"the",
"App",
"budle",
"ID",
"to",
"this",
"resource",
"request",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java#L321-L324 |
11,355 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java | BaseRequest.setTimeout | public void setTimeout(int timeout) {
this.timeout = timeout;
httpClient.connectTimeout(timeout, TimeUnit.MILLISECONDS);
httpClient.readTimeout(timeout, TimeUnit.MILLISECONDS);
httpClient.writeTimeout(timeout, TimeUnit.MILLISECONDS);
} | java | public void setTimeout(int timeout) {
this.timeout = timeout;
httpClient.connectTimeout(timeout, TimeUnit.MILLISECONDS);
httpClient.readTimeout(timeout, TimeUnit.MILLISECONDS);
httpClient.writeTimeout(timeout, TimeUnit.MILLISECONDS);
} | [
"public",
"void",
"setTimeout",
"(",
"int",
"timeout",
")",
"{",
"this",
".",
"timeout",
"=",
"timeout",
";",
"httpClient",
".",
"connectTimeout",
"(",
"timeout",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
";",
"httpClient",
".",
"readTimeout",
"(",
"timeout... | Sets the timeout for this resource request.
@param timeout The timeout for this request procedure | [
"Sets",
"the",
"timeout",
"for",
"this",
"resource",
"request",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java#L340-L349 |
11,356 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java | BaseRequest.sendOKHttpRequest | protected void sendOKHttpRequest(Request request, final Callback callback) {
OkHttpClient client = httpClient.build();
client.newCall(request).enqueue(callback);
} | java | protected void sendOKHttpRequest(Request request, final Callback callback) {
OkHttpClient client = httpClient.build();
client.newCall(request).enqueue(callback);
} | [
"protected",
"void",
"sendOKHttpRequest",
"(",
"Request",
"request",
",",
"final",
"Callback",
"callback",
")",
"{",
"OkHttpClient",
"client",
"=",
"httpClient",
".",
"build",
"(",
")",
";",
"client",
".",
"newCall",
"(",
"request",
")",
".",
"enqueue",
"(",... | Hands off the request to OkHttp | [
"Hands",
"off",
"the",
"request",
"to",
"OkHttp"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java#L745-L748 |
11,357 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java | BaseRequest.updateProgressListener | protected void updateProgressListener(ProgressListener progressListener, Response response) {
InputStream responseStream = response.getResponseByteStream();
int bytesDownloaded = 0;
long totalBytesExpected = response.getContentLength();
// Reading 2 KiB at a time to be consistent with t... | java | protected void updateProgressListener(ProgressListener progressListener, Response response) {
InputStream responseStream = response.getResponseByteStream();
int bytesDownloaded = 0;
long totalBytesExpected = response.getContentLength();
// Reading 2 KiB at a time to be consistent with t... | [
"protected",
"void",
"updateProgressListener",
"(",
"ProgressListener",
"progressListener",
",",
"Response",
"response",
")",
"{",
"InputStream",
"responseStream",
"=",
"response",
".",
"getResponseByteStream",
"(",
")",
";",
"int",
"bytesDownloaded",
"=",
"0",
";",
... | As a download request progresses, periodically call the user's ProgressListener | [
"As",
"a",
"download",
"request",
"progresses",
"periodically",
"call",
"the",
"user",
"s",
"ProgressListener"
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/internal/BaseRequest.java#L794-L832 |
11,358 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.initialize | public void initialize(Context context, ResponseListener listener) {
this.context = context;
this.listener = (listener != null) ? listener : new ResponseListener() {
final String message = "ResponseListener is not specified. Defaulting to empty listener.";
@Override
... | java | public void initialize(Context context, ResponseListener listener) {
this.context = context;
this.listener = (listener != null) ? listener : new ResponseListener() {
final String message = "ResponseListener is not specified. Defaulting to empty listener.";
@Override
... | [
"public",
"void",
"initialize",
"(",
"Context",
"context",
",",
"ResponseListener",
"listener",
")",
"{",
"this",
".",
"context",
"=",
"context",
";",
"this",
".",
"listener",
"=",
"(",
"listener",
"!=",
"null",
")",
"?",
"listener",
":",
"new",
"ResponseL... | Initializes the request manager.
@param context Context to be cached and passed to challenge handlers later.
@param listener Response listener. Called when an authorization response has been processed. | [
"Initializes",
"the",
"request",
"manager",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L131-L148 |
11,359 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.sendRequest | public void sendRequest(String path, RequestOptions options) throws IOException, JSONException {
String rootUrl;
if (path == null) {
throw new IllegalArgumentException("'path' parameter can't be null.");
}
if (path.indexOf(BMSClient.HTTP_SCHEME) == 0 && path.contains(":")) ... | java | public void sendRequest(String path, RequestOptions options) throws IOException, JSONException {
String rootUrl;
if (path == null) {
throw new IllegalArgumentException("'path' parameter can't be null.");
}
if (path.indexOf(BMSClient.HTTP_SCHEME) == 0 && path.contains(":")) ... | [
"public",
"void",
"sendRequest",
"(",
"String",
"path",
",",
"RequestOptions",
"options",
")",
"throws",
"IOException",
",",
"JSONException",
"{",
"String",
"rootUrl",
";",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Assembles the request path from root and path to authorization endpoint and sends the request.
@param path Path to authorization endpoint
@param options BaseRequest options
@throws IOException
@throws JSONException | [
"Assembles",
"the",
"request",
"path",
"from",
"root",
"and",
"path",
"to",
"authorization",
"endpoint",
"and",
"sends",
"the",
"request",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L158-L197 |
11,360 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.sendRequestInternal | private void sendRequestInternal(String rootUrl, String path, RequestOptions options) throws IOException, JSONException {
logger.debug("Sending request to root: " + rootUrl + " with path: " + path);
// create default options object with GET request method.
if (options == null) {
opt... | java | private void sendRequestInternal(String rootUrl, String path, RequestOptions options) throws IOException, JSONException {
logger.debug("Sending request to root: " + rootUrl + " with path: " + path);
// create default options object with GET request method.
if (options == null) {
opt... | [
"private",
"void",
"sendRequestInternal",
"(",
"String",
"rootUrl",
",",
"String",
"path",
",",
"RequestOptions",
"options",
")",
"throws",
"IOException",
",",
"JSONException",
"{",
"logger",
".",
"debug",
"(",
"\"Sending request to root: \"",
"+",
"rootUrl",
"+",
... | Builds an authorization request and sends it. It also caches the request url and request options in
order to be able to re-send the request when authorization challenges have been handled.
@param rootUrl Root of authorization server.
@param path Path to authorization endpoint.
@param options BaseRequest options.
@t... | [
"Builds",
"an",
"authorization",
"request",
"and",
"sends",
"it",
".",
"It",
"also",
"caches",
"the",
"request",
"url",
"and",
"request",
"options",
"in",
"order",
"to",
"be",
"able",
"to",
"re",
"-",
"send",
"the",
"request",
"when",
"authorization",
"cha... | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L219-L260 |
11,361 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.setExpectedAnswers | private void setExpectedAnswers(ArrayList<String> realms) {
if (answers == null) {
return;
}
for (String realm : realms) {
try {
answers.put(realm, "");
} catch (JSONException t) {
logger.error("setExpectedAnswers failed with e... | java | private void setExpectedAnswers(ArrayList<String> realms) {
if (answers == null) {
return;
}
for (String realm : realms) {
try {
answers.put(realm, "");
} catch (JSONException t) {
logger.error("setExpectedAnswers failed with e... | [
"private",
"void",
"setExpectedAnswers",
"(",
"ArrayList",
"<",
"String",
">",
"realms",
")",
"{",
"if",
"(",
"answers",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"String",
"realm",
":",
"realms",
")",
"{",
"try",
"{",
"answers",
".",
"... | Initializes the collection of expected challenge answers.
@param realms List of realms | [
"Initializes",
"the",
"collection",
"of",
"expected",
"challenge",
"answers",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L267-L279 |
11,362 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.removeExpectedAnswer | public void removeExpectedAnswer(String realm) {
if (answers != null) {
answers.remove(realm);
}
try {
if (isAnswersFilled()) {
resendRequest();
}
} catch (Throwable t) {
logger.error("removeExpectedAnswer failed with excep... | java | public void removeExpectedAnswer(String realm) {
if (answers != null) {
answers.remove(realm);
}
try {
if (isAnswersFilled()) {
resendRequest();
}
} catch (Throwable t) {
logger.error("removeExpectedAnswer failed with excep... | [
"public",
"void",
"removeExpectedAnswer",
"(",
"String",
"realm",
")",
"{",
"if",
"(",
"answers",
"!=",
"null",
")",
"{",
"answers",
".",
"remove",
"(",
"realm",
")",
";",
"}",
"try",
"{",
"if",
"(",
"isAnswersFilled",
"(",
")",
")",
"{",
"resendReques... | Removes an expected challenge answer from collection.
@param realm Realm of the answer to remove. | [
"Removes",
"an",
"expected",
"challenge",
"answer",
"from",
"collection",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L286-L298 |
11,363 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.submitAnswer | public void submitAnswer(JSONObject answer, String realm) {
if (answers == null) {
answers = new JSONObject();
}
try {
answers.put(realm, answer);
if (isAnswersFilled()) {
resendRequest();
}
} catch (Throwable t) {
... | java | public void submitAnswer(JSONObject answer, String realm) {
if (answers == null) {
answers = new JSONObject();
}
try {
answers.put(realm, answer);
if (isAnswersFilled()) {
resendRequest();
}
} catch (Throwable t) {
... | [
"public",
"void",
"submitAnswer",
"(",
"JSONObject",
"answer",
",",
"String",
"realm",
")",
"{",
"if",
"(",
"answers",
"==",
"null",
")",
"{",
"answers",
"=",
"new",
"JSONObject",
"(",
")",
";",
"}",
"try",
"{",
"answers",
".",
"put",
"(",
"realm",
"... | Adds an expected challenge answer to collection of answers.
@param answer Answer to add.
@param realm Authentication realm for the answer. | [
"Adds",
"an",
"expected",
"challenge",
"answer",
"to",
"collection",
"of",
"answers",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L306-L319 |
11,364 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.isAnswersFilled | public boolean isAnswersFilled() throws JSONException {
if (answers == null) {
return true;
}
Iterator<String> it = answers.keys();
while (it.hasNext()) {
String key = it.next();
Object value = answers.get(key);
if ((value instanceof Stri... | java | public boolean isAnswersFilled() throws JSONException {
if (answers == null) {
return true;
}
Iterator<String> it = answers.keys();
while (it.hasNext()) {
String key = it.next();
Object value = answers.get(key);
if ((value instanceof Stri... | [
"public",
"boolean",
"isAnswersFilled",
"(",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"answers",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"Iterator",
"<",
"String",
">",
"it",
"=",
"answers",
".",
"keys",
"(",
")",
";",
"while",
"(",
... | Verifies whether all expected challenges have been answered, or not.
@return <code>true</code> if all answers have been submitted, otherwise <code>false</code>.
@throws JSONException | [
"Verifies",
"whether",
"all",
"expected",
"challenges",
"have",
"been",
"answered",
"or",
"not",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L327-L343 |
11,365 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.processRedirectResponse | private void processRedirectResponse(Response response) throws RuntimeException, JSONException, MalformedURLException {
// a valid redirect response must contain the Location header.
ResponseImpl responseImpl = (ResponseImpl)response;
List<String> locationHeaders = responseImpl.getHeader(LOCATIO... | java | private void processRedirectResponse(Response response) throws RuntimeException, JSONException, MalformedURLException {
// a valid redirect response must contain the Location header.
ResponseImpl responseImpl = (ResponseImpl)response;
List<String> locationHeaders = responseImpl.getHeader(LOCATIO... | [
"private",
"void",
"processRedirectResponse",
"(",
"Response",
"response",
")",
"throws",
"RuntimeException",
",",
"JSONException",
",",
"MalformedURLException",
"{",
"// a valid redirect response must contain the Location header.",
"ResponseImpl",
"responseImpl",
"=",
"(",
"Re... | Processes redirect response from authorization endpoint.
@param response Response from the server. | [
"Processes",
"redirect",
"response",
"from",
"authorization",
"endpoint",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L350-L388 |
11,366 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.processResponse | private void processResponse(Response response) {
// at this point a server response should contain a secure JSON with challenges
JSONObject jsonResponse = Utils.extractSecureJson(response);
JSONObject jsonChallenges = (jsonResponse == null) ? null : jsonResponse.optJSONObject(CHALLENGES_VALUE_N... | java | private void processResponse(Response response) {
// at this point a server response should contain a secure JSON with challenges
JSONObject jsonResponse = Utils.extractSecureJson(response);
JSONObject jsonChallenges = (jsonResponse == null) ? null : jsonResponse.optJSONObject(CHALLENGES_VALUE_N... | [
"private",
"void",
"processResponse",
"(",
"Response",
"response",
")",
"{",
"// at this point a server response should contain a secure JSON with challenges",
"JSONObject",
"jsonResponse",
"=",
"Utils",
".",
"extractSecureJson",
"(",
"response",
")",
";",
"JSONObject",
"json... | Process a response from the server.
@param response Server response. | [
"Process",
"a",
"response",
"from",
"the",
"server",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L395-L405 |
11,367 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.startHandleChallenges | private void startHandleChallenges(JSONObject jsonChallenges, Response response) {
ArrayList<String> challenges = getRealmsFromJson(jsonChallenges);
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
if (isAuthorizationRequired(re... | java | private void startHandleChallenges(JSONObject jsonChallenges, Response response) {
ArrayList<String> challenges = getRealmsFromJson(jsonChallenges);
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
if (isAuthorizationRequired(re... | [
"private",
"void",
"startHandleChallenges",
"(",
"JSONObject",
"jsonChallenges",
",",
"Response",
"response",
")",
"{",
"ArrayList",
"<",
"String",
">",
"challenges",
"=",
"getRealmsFromJson",
"(",
"jsonChallenges",
")",
";",
"MCAAuthorizationManager",
"authManager",
... | Handles authentication challenges.
@param jsonChallenges Collection of challenges.
@param response Server response. | [
"Handles",
"authentication",
"challenges",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L413-L431 |
11,368 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.isAuthorizationRequired | private boolean isAuthorizationRequired(Response response) {
if (response != null && response.getStatus() == 401) {
ResponseImpl responseImpl = (ResponseImpl)response;
String challengesHeader = responseImpl.getFirstHeader(AUTHENTICATE_HEADER_NAME);
if (AUTHENTICATE_HEADER_VA... | java | private boolean isAuthorizationRequired(Response response) {
if (response != null && response.getStatus() == 401) {
ResponseImpl responseImpl = (ResponseImpl)response;
String challengesHeader = responseImpl.getFirstHeader(AUTHENTICATE_HEADER_NAME);
if (AUTHENTICATE_HEADER_VA... | [
"private",
"boolean",
"isAuthorizationRequired",
"(",
"Response",
"response",
")",
"{",
"if",
"(",
"response",
"!=",
"null",
"&&",
"response",
".",
"getStatus",
"(",
")",
"==",
"401",
")",
"{",
"ResponseImpl",
"responseImpl",
"=",
"(",
"ResponseImpl",
")",
"... | Checks server response for MFP 401 error. This kind of response should contain MFP authentication challenges.
@param response Server response.
@return <code>true</code> if the server response contains 401 status code along with MFP challenges. | [
"Checks",
"server",
"response",
"for",
"MFP",
"401",
"error",
".",
"This",
"kind",
"of",
"response",
"should",
"contain",
"MFP",
"authentication",
"challenges",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L439-L450 |
11,369 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.processFailures | private void processFailures(JSONObject jsonFailures) {
if (jsonFailures == null) {
return;
}
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
ArrayList<String> challenges = getRealmsFromJson(jsonFailures);
... | java | private void processFailures(JSONObject jsonFailures) {
if (jsonFailures == null) {
return;
}
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
ArrayList<String> challenges = getRealmsFromJson(jsonFailures);
... | [
"private",
"void",
"processFailures",
"(",
"JSONObject",
"jsonFailures",
")",
"{",
"if",
"(",
"jsonFailures",
"==",
"null",
")",
"{",
"return",
";",
"}",
"MCAAuthorizationManager",
"authManager",
"=",
"(",
"MCAAuthorizationManager",
")",
"BMSClient",
".",
"getInst... | Processes authentication failures.
@param jsonFailures Collection of authentication failures. | [
"Processes",
"authentication",
"failures",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L457-L473 |
11,370 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.processSuccesses | private void processSuccesses(JSONObject jsonSuccesses) {
if (jsonSuccesses == null) {
return;
}
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
ArrayList<String> challenges = getRealmsFromJson(jsonSuccesses)... | java | private void processSuccesses(JSONObject jsonSuccesses) {
if (jsonSuccesses == null) {
return;
}
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
ArrayList<String> challenges = getRealmsFromJson(jsonSuccesses)... | [
"private",
"void",
"processSuccesses",
"(",
"JSONObject",
"jsonSuccesses",
")",
"{",
"if",
"(",
"jsonSuccesses",
"==",
"null",
")",
"{",
"return",
";",
"}",
"MCAAuthorizationManager",
"authManager",
"=",
"(",
"MCAAuthorizationManager",
")",
"BMSClient",
".",
"getI... | Processes authentication successes.
@param jsonSuccesses Collection of authentication successes. | [
"Processes",
"authentication",
"successes",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L480-L496 |
11,371 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.requestFailed | public void requestFailed(JSONObject info) {
logger.error("BaseRequest failed with info: " + (info == null ? "info is null" : info.toString()));
listener.onFailure(null, null, info);
} | java | public void requestFailed(JSONObject info) {
logger.error("BaseRequest failed with info: " + (info == null ? "info is null" : info.toString()));
listener.onFailure(null, null, info);
} | [
"public",
"void",
"requestFailed",
"(",
"JSONObject",
"info",
")",
"{",
"logger",
".",
"error",
"(",
"\"BaseRequest failed with info: \"",
"+",
"(",
"info",
"==",
"null",
"?",
"\"info is null\"",
":",
"info",
".",
"toString",
"(",
")",
")",
")",
";",
"listen... | Called when a request to authorization server failed.
@param info Extended information about the failure. | [
"Called",
"when",
"a",
"request",
"to",
"authorization",
"server",
"failed",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L503-L506 |
11,372 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.getRealmsFromJson | private ArrayList<String> getRealmsFromJson(JSONObject jsonChallenges) {
Iterator<String> challengesIterator = jsonChallenges.keys();
ArrayList<String> challenges = new ArrayList<>();
while (challengesIterator.hasNext()) {
challenges.add(challengesIterator.next());
}
... | java | private ArrayList<String> getRealmsFromJson(JSONObject jsonChallenges) {
Iterator<String> challengesIterator = jsonChallenges.keys();
ArrayList<String> challenges = new ArrayList<>();
while (challengesIterator.hasNext()) {
challenges.add(challengesIterator.next());
}
... | [
"private",
"ArrayList",
"<",
"String",
">",
"getRealmsFromJson",
"(",
"JSONObject",
"jsonChallenges",
")",
"{",
"Iterator",
"<",
"String",
">",
"challengesIterator",
"=",
"jsonChallenges",
".",
"keys",
"(",
")",
";",
"ArrayList",
"<",
"String",
">",
"challenges"... | Iterates a JSON object containing authorization challenges and builds a list of reals.
@param jsonChallenges Collection of challenges.
@return Array with realms. | [
"Iterates",
"a",
"JSON",
"object",
"containing",
"authorization",
"challenges",
"and",
"builds",
"a",
"list",
"of",
"reals",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L514-L523 |
11,373 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.onFailure | @Override
public void onFailure(Response response, Throwable t, JSONObject extendedInfo) {
if (isAuthorizationRequired(response)) {
processResponseWrapper(response, true);
} else {
listener.onFailure(response, t, extendedInfo);
}
} | java | @Override
public void onFailure(Response response, Throwable t, JSONObject extendedInfo) {
if (isAuthorizationRequired(response)) {
processResponseWrapper(response, true);
} else {
listener.onFailure(response, t, extendedInfo);
}
} | [
"@",
"Override",
"public",
"void",
"onFailure",
"(",
"Response",
"response",
",",
"Throwable",
"t",
",",
"JSONObject",
"extendedInfo",
")",
"{",
"if",
"(",
"isAuthorizationRequired",
"(",
"response",
")",
")",
"{",
"processResponseWrapper",
"(",
"response",
",",... | Called when request fails.
@param response Contains detail regarding why the request failed
@param t Exception that could have caused the request to fail. Null if no Exception thrown. | [
"Called",
"when",
"request",
"fails",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L541-L548 |
11,374 | ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.processResponseWrapper | private void processResponseWrapper(Response response, boolean isFailure) {
try {
ResponseImpl responseImpl = (ResponseImpl)response;
if (isFailure || !responseImpl.isRedirect()) {
processResponse(response);
} else {
processRedirectResponse(res... | java | private void processResponseWrapper(Response response, boolean isFailure) {
try {
ResponseImpl responseImpl = (ResponseImpl)response;
if (isFailure || !responseImpl.isRedirect()) {
processResponse(response);
} else {
processRedirectResponse(res... | [
"private",
"void",
"processResponseWrapper",
"(",
"Response",
"response",
",",
"boolean",
"isFailure",
")",
"{",
"try",
"{",
"ResponseImpl",
"responseImpl",
"=",
"(",
"ResponseImpl",
")",
"response",
";",
"if",
"(",
"isFailure",
"||",
"!",
"responseImpl",
".",
... | Called from onSuccess and onFailure. Handles all possible exceptions and notifies the listener
if an exception occurs.
@param response server response
@param isFailure specifies whether this method is called from onSuccess (false) or onFailure (true). | [
"Called",
"from",
"onSuccess",
"and",
"onFailure",
".",
"Handles",
"all",
"possible",
"exceptions",
"and",
"notifies",
"the",
"listener",
"if",
"an",
"exception",
"occurs",
"."
] | 8db4f00d0d564792397bfc0e5bd57d52a238b858 | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L557-L569 |
11,375 | taimos/RESTUtils | src/main/java/de/taimos/restutils/RESTAssert.java | RESTAssert.assertNotNull | public static void assertNotNull(final Object object, final StatusType status) {
RESTAssert.assertTrue(object != null, status);
} | java | public static void assertNotNull(final Object object, final StatusType status) {
RESTAssert.assertTrue(object != null, status);
} | [
"public",
"static",
"void",
"assertNotNull",
"(",
"final",
"Object",
"object",
",",
"final",
"StatusType",
"status",
")",
"{",
"RESTAssert",
".",
"assertTrue",
"(",
"object",
"!=",
"null",
",",
"status",
")",
";",
"}"
] | assert that object is not null
@param object the object to check
@param status the status code to throw
@throws WebApplicationException with given status code | [
"assert",
"that",
"object",
"is",
"not",
"null"
] | bdb1bf9a2eb13ede0eec6f071c10cb2698313501 | https://github.com/taimos/RESTUtils/blob/bdb1bf9a2eb13ede0eec6f071c10cb2698313501/src/main/java/de/taimos/restutils/RESTAssert.java#L160-L162 |
11,376 | taimos/RESTUtils | src/main/java/de/taimos/restutils/RESTAssert.java | RESTAssert.assertNotEmpty | public static void assertNotEmpty(final String string, final StatusType status) {
RESTAssert.assertNotNull(string, status);
RESTAssert.assertFalse(string.isEmpty(), status);
} | java | public static void assertNotEmpty(final String string, final StatusType status) {
RESTAssert.assertNotNull(string, status);
RESTAssert.assertFalse(string.isEmpty(), status);
} | [
"public",
"static",
"void",
"assertNotEmpty",
"(",
"final",
"String",
"string",
",",
"final",
"StatusType",
"status",
")",
"{",
"RESTAssert",
".",
"assertNotNull",
"(",
"string",
",",
"status",
")",
";",
"RESTAssert",
".",
"assertFalse",
"(",
"string",
".",
... | assert that string is not null nor empty
@param string the string to check
@param status the status code to throw
@throws WebApplicationException with given status code | [
"assert",
"that",
"string",
"is",
"not",
"null",
"nor",
"empty"
] | bdb1bf9a2eb13ede0eec6f071c10cb2698313501 | https://github.com/taimos/RESTUtils/blob/bdb1bf9a2eb13ede0eec6f071c10cb2698313501/src/main/java/de/taimos/restutils/RESTAssert.java#L181-L184 |
11,377 | taimos/RESTUtils | src/main/java/de/taimos/restutils/RESTAssert.java | RESTAssert.assertNotEmpty | public static void assertNotEmpty(final Collection<?> collection, final StatusType status) {
RESTAssert.assertNotNull(collection, status);
RESTAssert.assertFalse(collection.isEmpty(), status);
} | java | public static void assertNotEmpty(final Collection<?> collection, final StatusType status) {
RESTAssert.assertNotNull(collection, status);
RESTAssert.assertFalse(collection.isEmpty(), status);
} | [
"public",
"static",
"void",
"assertNotEmpty",
"(",
"final",
"Collection",
"<",
"?",
">",
"collection",
",",
"final",
"StatusType",
"status",
")",
"{",
"RESTAssert",
".",
"assertNotNull",
"(",
"collection",
",",
"status",
")",
";",
"RESTAssert",
".",
"assertFal... | assert that collection is not empty
@param collection the collection to check
@param status the status code to throw
@throws WebApplicationException with given status code | [
"assert",
"that",
"collection",
"is",
"not",
"empty"
] | bdb1bf9a2eb13ede0eec6f071c10cb2698313501 | https://github.com/taimos/RESTUtils/blob/bdb1bf9a2eb13ede0eec6f071c10cb2698313501/src/main/java/de/taimos/restutils/RESTAssert.java#L203-L206 |
11,378 | taimos/RESTUtils | src/main/java/de/taimos/restutils/RESTAssert.java | RESTAssert.assertSingleElement | public static void assertSingleElement(final Collection<?> collection, final StatusType status) {
RESTAssert.assertNotNull(collection, status);
RESTAssert.assertTrue(collection.size() == 1, status);
} | java | public static void assertSingleElement(final Collection<?> collection, final StatusType status) {
RESTAssert.assertNotNull(collection, status);
RESTAssert.assertTrue(collection.size() == 1, status);
} | [
"public",
"static",
"void",
"assertSingleElement",
"(",
"final",
"Collection",
"<",
"?",
">",
"collection",
",",
"final",
"StatusType",
"status",
")",
"{",
"RESTAssert",
".",
"assertNotNull",
"(",
"collection",
",",
"status",
")",
";",
"RESTAssert",
".",
"asse... | assert that collection has one element
@param collection the collection to check
@param status the status code to throw
@throws WebApplicationException with given status code | [
"assert",
"that",
"collection",
"has",
"one",
"element"
] | bdb1bf9a2eb13ede0eec6f071c10cb2698313501 | https://github.com/taimos/RESTUtils/blob/bdb1bf9a2eb13ede0eec6f071c10cb2698313501/src/main/java/de/taimos/restutils/RESTAssert.java#L225-L228 |
11,379 | j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/ClassLoaderResourceUtils.java | ClassLoaderResourceUtils.getClass | public static Class<?> getClass(String classname) {
Class<?> clazz = null;
try {
clazz = Class.forName(classname);
} catch (Exception e) {
// Try the second approach
}
if (null == clazz) {
Exception classNotFoundEx = null;
try {
clazz = Class.forName(classname, true, new ClassLoaderResourceUt... | java | public static Class<?> getClass(String classname) {
Class<?> clazz = null;
try {
clazz = Class.forName(classname);
} catch (Exception e) {
// Try the second approach
}
if (null == clazz) {
Exception classNotFoundEx = null;
try {
clazz = Class.forName(classname, true, new ClassLoaderResourceUt... | [
"public",
"static",
"Class",
"<",
"?",
">",
"getClass",
"(",
"String",
"classname",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"null",
";",
"try",
"{",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"classname",
")",
";",
"}",
"catch",
"(",
"Exce... | Returns the class associated to the class name given in parameter
@param classname
the class name
@return the class | [
"Returns",
"the",
"class",
"associated",
"to",
"the",
"class",
"name",
"given",
"in",
"parameter"
] | 1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/ClassLoaderResourceUtils.java#L272-L310 |
11,380 | telly/groundy | library/src/main/java/com/telly/groundy/TaskResult.java | TaskResult.add | public TaskResult add(String key, SparseArray<? extends Parcelable> value) {
mBundle.putSparseParcelableArray(key, value);
return this;
} | java | public TaskResult add(String key, SparseArray<? extends Parcelable> value) {
mBundle.putSparseParcelableArray(key, value);
return this;
} | [
"public",
"TaskResult",
"add",
"(",
"String",
"key",
",",
"SparseArray",
"<",
"?",
"extends",
"Parcelable",
">",
"value",
")",
"{",
"mBundle",
".",
"putSparseParcelableArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a SparseArray of Parcelable values into the mapping of this Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a SparseArray of Parcelable objects, or null | [
"Inserts",
"a",
"SparseArray",
"of",
"Parcelable",
"values",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | e90baf9901a8be20b348bd1575d5ad782560cec8 | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L215-L218 |
11,381 | Terracotta-OSS/statistics | src/main/java/org/terracotta/statistics/derived/latency/DefaultLatencyHistogramStatistic.java | DefaultLatencyHistogramStatistic.tryExpire | private void tryExpire(boolean force, LongSupplier time) {
long now = time.getAsLong();
if (force || now >= nextPruning) {
nextPruning = now + pruningDelay;
histogram.expire(now);
}
} | java | private void tryExpire(boolean force, LongSupplier time) {
long now = time.getAsLong();
if (force || now >= nextPruning) {
nextPruning = now + pruningDelay;
histogram.expire(now);
}
} | [
"private",
"void",
"tryExpire",
"(",
"boolean",
"force",
",",
"LongSupplier",
"time",
")",
"{",
"long",
"now",
"=",
"time",
".",
"getAsLong",
"(",
")",
";",
"if",
"(",
"force",
"||",
"now",
">=",
"nextPruning",
")",
"{",
"nextPruning",
"=",
"now",
"+",... | Expire the histogram if it is time to expire it, or if force is true AND it is dirty | [
"Expire",
"the",
"histogram",
"if",
"it",
"is",
"time",
"to",
"expire",
"it",
"or",
"if",
"force",
"is",
"true",
"AND",
"it",
"is",
"dirty"
] | d24e4989b8c8dbe4f5210e49c7945d51b6585881 | https://github.com/Terracotta-OSS/statistics/blob/d24e4989b8c8dbe4f5210e49c7945d51b6585881/src/main/java/org/terracotta/statistics/derived/latency/DefaultLatencyHistogramStatistic.java#L169-L175 |
11,382 | telly/groundy | library/src/main/java/com/telly/groundy/DeviceStatus.java | DeviceStatus.isOnline | public static boolean isOnline(Context context) {
ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm == null) {
return false;
}
NetworkInfo info = cm.getActiveNetworkInfo();
return info != null && info.isConnectedOrConnecting()... | java | public static boolean isOnline(Context context) {
ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm == null) {
return false;
}
NetworkInfo info = cm.getActiveNetworkInfo();
return info != null && info.isConnectedOrConnecting()... | [
"public",
"static",
"boolean",
"isOnline",
"(",
"Context",
"context",
")",
"{",
"ConnectivityManager",
"cm",
"=",
"(",
"ConnectivityManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"CONNECTIVITY_SERVICE",
")",
";",
"if",
"(",
"cm",
"==",
... | Checks whether there's a network connection.
@param context Context to use
@return true if there's an active network connection, false otherwise | [
"Checks",
"whether",
"there",
"s",
"a",
"network",
"connection",
"."
] | e90baf9901a8be20b348bd1575d5ad782560cec8 | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/DeviceStatus.java#L47-L55 |
11,383 | telly/groundy | library/src/main/java/com/telly/groundy/DeviceStatus.java | DeviceStatus.isCurrentConnectionWifi | public static boolean isCurrentConnectionWifi(Context context) {
ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm == null) {
return false;
}
NetworkInfo info = cm.getActiveNetworkInfo();
return info != null && info.getType() ... | java | public static boolean isCurrentConnectionWifi(Context context) {
ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm == null) {
return false;
}
NetworkInfo info = cm.getActiveNetworkInfo();
return info != null && info.getType() ... | [
"public",
"static",
"boolean",
"isCurrentConnectionWifi",
"(",
"Context",
"context",
")",
"{",
"ConnectivityManager",
"cm",
"=",
"(",
"ConnectivityManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"CONNECTIVITY_SERVICE",
")",
";",
"if",
"(",
... | Check if current connection is Wi-Fi.
@param context Context to use
@return true if current connection is Wi-Fi false otherwise | [
"Check",
"if",
"current",
"connection",
"is",
"Wi",
"-",
"Fi",
"."
] | e90baf9901a8be20b348bd1575d5ad782560cec8 | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/DeviceStatus.java#L63-L71 |
11,384 | telly/groundy | library/src/main/java/com/telly/groundy/DeviceStatus.java | DeviceStatus.keepCpuAwake | public static void keepCpuAwake(Context context, boolean awake) {
if (cpuWakeLock == null) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
if (pm != null) {
cpuWakeLock =
pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE... | java | public static void keepCpuAwake(Context context, boolean awake) {
if (cpuWakeLock == null) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
if (pm != null) {
cpuWakeLock =
pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE... | [
"public",
"static",
"void",
"keepCpuAwake",
"(",
"Context",
"context",
",",
"boolean",
"awake",
")",
"{",
"if",
"(",
"cpuWakeLock",
"==",
"null",
")",
"{",
"PowerManager",
"pm",
"=",
"(",
"PowerManager",
")",
"context",
".",
"getSystemService",
"(",
"Context... | Register a wake lock to power management in the device.
@param context Context to use
@param awake if true the device cpu will keep awake until false is called back. if true is
passed several times only the first time after a false call will take effect,
also if false is passed and previously the cpu was not turned on... | [
"Register",
"a",
"wake",
"lock",
"to",
"power",
"management",
"in",
"the",
"device",
"."
] | e90baf9901a8be20b348bd1575d5ad782560cec8 | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/DeviceStatus.java#L85-L103 |
11,385 | telly/groundy | library/src/main/java/com/telly/groundy/DeviceStatus.java | DeviceStatus.keepWiFiOn | public static void keepWiFiOn(Context context, boolean on) {
if (wifiLock == null) {
WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
if (wm != null) {
wifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL, TAG);
wifiLock.setReferenceCounted(true);
}... | java | public static void keepWiFiOn(Context context, boolean on) {
if (wifiLock == null) {
WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
if (wm != null) {
wifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL, TAG);
wifiLock.setReferenceCounted(true);
}... | [
"public",
"static",
"void",
"keepWiFiOn",
"(",
"Context",
"context",
",",
"boolean",
"on",
")",
"{",
"if",
"(",
"wifiLock",
"==",
"null",
")",
"{",
"WifiManager",
"wm",
"=",
"(",
"WifiManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
... | Register a WiFi lock to WiFi management in the device.
@param context Context to use
@param on if true the device WiFi radio will keep awake until false is called back. if
true is passed several times only the first time after a false call will take
effect, also if false is passed and previously the WiFi radio was not... | [
"Register",
"a",
"WiFi",
"lock",
"to",
"WiFi",
"management",
"in",
"the",
"device",
"."
] | e90baf9901a8be20b348bd1575d5ad782560cec8 | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/DeviceStatus.java#L117-L134 |
11,386 | eirbjo/jetty-console | jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java | JettyConsoleBootstrapMainClass.createClassLoader | private ClassLoader createClassLoader(File warFile, File tempDirectory) {
try {
File condiLibDirectory = new File(tempDirectory, "condi");
condiLibDirectory.mkdirs();
File jettyWebappDirectory = new File(tempDirectory, "webapp");
jettyWebappDirectory.mkdirs();
... | java | private ClassLoader createClassLoader(File warFile, File tempDirectory) {
try {
File condiLibDirectory = new File(tempDirectory, "condi");
condiLibDirectory.mkdirs();
File jettyWebappDirectory = new File(tempDirectory, "webapp");
jettyWebappDirectory.mkdirs();
... | [
"private",
"ClassLoader",
"createClassLoader",
"(",
"File",
"warFile",
",",
"File",
"tempDirectory",
")",
"{",
"try",
"{",
"File",
"condiLibDirectory",
"=",
"new",
"File",
"(",
"tempDirectory",
",",
"\"condi\"",
")",
";",
"condiLibDirectory",
".",
"mkdirs",
"(",... | Create a URL class loader containing all jar files in the given directory
@param warFile the war file to look for libs dirs in
@return | [
"Create",
"a",
"URL",
"class",
"loader",
"containing",
"all",
"jar",
"files",
"in",
"the",
"given",
"directory"
] | 5bd32ecab12837394dd45fd15c51c3934afcd76b | https://github.com/eirbjo/jetty-console/blob/5bd32ecab12837394dd45fd15c51c3934afcd76b/jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java#L247-L287 |
11,387 | eirbjo/jetty-console | jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java | JettyConsoleBootstrapMainClass.getWarLocation | private static File getWarLocation() {
URL resource = JettyConsoleBootstrapMainClass.class.getResource("/META-INF/jettyconsole/jettyconsole.properties");
String file = resource.getFile();
file = file.substring("file:".length(), file.indexOf("!"));
try {
file = URLDecoder.deco... | java | private static File getWarLocation() {
URL resource = JettyConsoleBootstrapMainClass.class.getResource("/META-INF/jettyconsole/jettyconsole.properties");
String file = resource.getFile();
file = file.substring("file:".length(), file.indexOf("!"));
try {
file = URLDecoder.deco... | [
"private",
"static",
"File",
"getWarLocation",
"(",
")",
"{",
"URL",
"resource",
"=",
"JettyConsoleBootstrapMainClass",
".",
"class",
".",
"getResource",
"(",
"\"/META-INF/jettyconsole/jettyconsole.properties\"",
")",
";",
"String",
"file",
"=",
"resource",
".",
"getF... | Return a File pointing to the location of the Jar file this Main method is executed from. | [
"Return",
"a",
"File",
"pointing",
"to",
"the",
"location",
"of",
"the",
"Jar",
"file",
"this",
"Main",
"method",
"is",
"executed",
"from",
"."
] | 5bd32ecab12837394dd45fd15c51c3934afcd76b | https://github.com/eirbjo/jetty-console/blob/5bd32ecab12837394dd45fd15c51c3934afcd76b/jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java#L303-L313 |
11,388 | eirbjo/jetty-console | jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java | JettyConsoleBootstrapMainClass.unpackFile | private static void unpackFile(InputStream in, File file) {
byte[] buffer = new byte[4096];
try {
OutputStream out = new FileOutputStream(file);
int read;
while ((read = in.read(buffer)) != -1) {
out.write(buffer, 0, read);
}
o... | java | private static void unpackFile(InputStream in, File file) {
byte[] buffer = new byte[4096];
try {
OutputStream out = new FileOutputStream(file);
int read;
while ((read = in.read(buffer)) != -1) {
out.write(buffer, 0, read);
}
o... | [
"private",
"static",
"void",
"unpackFile",
"(",
"InputStream",
"in",
",",
"File",
"file",
")",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"4096",
"]",
";",
"try",
"{",
"OutputStream",
"out",
"=",
"new",
"FileOutputStream",
"(",
"file",
"... | Write the contents of an InputStream to a file
@param in the input stream to read
@param file the File to write to | [
"Write",
"the",
"contents",
"of",
"an",
"InputStream",
"to",
"a",
"file"
] | 5bd32ecab12837394dd45fd15c51c3934afcd76b | https://github.com/eirbjo/jetty-console/blob/5bd32ecab12837394dd45fd15c51c3934afcd76b/jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java#L319-L332 |
11,389 | connect-group/thymesheet | src/main/java/com/connect_group/thymesheet/css/selectors/dom/DOMHelper.java | DOMHelper.getFirstChildElement | public static Element getFirstChildElement(Node node) {
if(node instanceof NestableNode) {
return ((NestableNode) node).getFirstElementChild();
}
return null;
} | java | public static Element getFirstChildElement(Node node) {
if(node instanceof NestableNode) {
return ((NestableNode) node).getFirstElementChild();
}
return null;
} | [
"public",
"static",
"Element",
"getFirstChildElement",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"node",
"instanceof",
"NestableNode",
")",
"{",
"return",
"(",
"(",
"NestableNode",
")",
"node",
")",
".",
"getFirstElementChild",
"(",
")",
";",
"}",
"return",
... | Get the first child node that is an element node.
@param node The node whose children should be iterated.
@return The first child element or {@code null}. | [
"Get",
"the",
"first",
"child",
"node",
"that",
"is",
"an",
"element",
"node",
"."
] | b6384e385d3e3b54944d53993bbd396d2668a5a0 | https://github.com/connect-group/thymesheet/blob/b6384e385d3e3b54944d53993bbd396d2668a5a0/src/main/java/com/connect_group/thymesheet/css/selectors/dom/DOMHelper.java#L42-L49 |
11,390 | connect-group/thymesheet | src/main/java/com/connect_group/thymesheet/css/selectors/dom/DOMHelper.java | DOMHelper.getNextSiblingElement | public static final Element getNextSiblingElement(Node node) {
List<Node> siblings = node.getParent().getChildren();
Node n = null;
int index = siblings.indexOf(node) + 1;
if(index>0 && index<siblings.size()) {
n = siblings.get(index);
while(!(n instanceof Element) &&... | java | public static final Element getNextSiblingElement(Node node) {
List<Node> siblings = node.getParent().getChildren();
Node n = null;
int index = siblings.indexOf(node) + 1;
if(index>0 && index<siblings.size()) {
n = siblings.get(index);
while(!(n instanceof Element) &&... | [
"public",
"static",
"final",
"Element",
"getNextSiblingElement",
"(",
"Node",
"node",
")",
"{",
"List",
"<",
"Node",
">",
"siblings",
"=",
"node",
".",
"getParent",
"(",
")",
".",
"getChildren",
"(",
")",
";",
"Node",
"n",
"=",
"null",
";",
"int",
"ind... | Get the next sibling element.
@param node The start node.
@return The next sibling element or {@code null}. | [
"Get",
"the",
"next",
"sibling",
"element",
"."
] | b6384e385d3e3b54944d53993bbd396d2668a5a0 | https://github.com/connect-group/thymesheet/blob/b6384e385d3e3b54944d53993bbd396d2668a5a0/src/main/java/com/connect_group/thymesheet/css/selectors/dom/DOMHelper.java#L57-L75 |
11,391 | Terracotta-OSS/statistics | src/main/java/org/terracotta/statistics/registry/StatisticRegistry.java | StatisticRegistry.registerTable | public void registerTable(String fullStatName, Supplier<Table> accessor) {
registerStatistic(fullStatName, table(accessor));
} | java | public void registerTable(String fullStatName, Supplier<Table> accessor) {
registerStatistic(fullStatName, table(accessor));
} | [
"public",
"void",
"registerTable",
"(",
"String",
"fullStatName",
",",
"Supplier",
"<",
"Table",
">",
"accessor",
")",
"{",
"registerStatistic",
"(",
"fullStatName",
",",
"table",
"(",
"accessor",
")",
")",
";",
"}"
] | Directly register a TABLE stat with its accessors | [
"Directly",
"register",
"a",
"TABLE",
"stat",
"with",
"its",
"accessors"
] | d24e4989b8c8dbe4f5210e49c7945d51b6585881 | https://github.com/Terracotta-OSS/statistics/blob/d24e4989b8c8dbe4f5210e49c7945d51b6585881/src/main/java/org/terracotta/statistics/registry/StatisticRegistry.java#L121-L123 |
11,392 | Terracotta-OSS/statistics | src/main/java/org/terracotta/statistics/registry/StatisticRegistry.java | StatisticRegistry.registerGauge | public void registerGauge(String fullStatName, Supplier<Number> accessor) {
registerStatistic(fullStatName, gauge(accessor));
} | java | public void registerGauge(String fullStatName, Supplier<Number> accessor) {
registerStatistic(fullStatName, gauge(accessor));
} | [
"public",
"void",
"registerGauge",
"(",
"String",
"fullStatName",
",",
"Supplier",
"<",
"Number",
">",
"accessor",
")",
"{",
"registerStatistic",
"(",
"fullStatName",
",",
"gauge",
"(",
"accessor",
")",
")",
";",
"}"
] | Directly register a GAUGE stat with its accessor | [
"Directly",
"register",
"a",
"GAUGE",
"stat",
"with",
"its",
"accessor"
] | d24e4989b8c8dbe4f5210e49c7945d51b6585881 | https://github.com/Terracotta-OSS/statistics/blob/d24e4989b8c8dbe4f5210e49c7945d51b6585881/src/main/java/org/terracotta/statistics/registry/StatisticRegistry.java#L128-L130 |
11,393 | Terracotta-OSS/statistics | src/main/java/org/terracotta/statistics/registry/StatisticRegistry.java | StatisticRegistry.registerCounter | public void registerCounter(String fullStatName, Supplier<Number> accessor) {
registerStatistic(fullStatName, counter(accessor));
} | java | public void registerCounter(String fullStatName, Supplier<Number> accessor) {
registerStatistic(fullStatName, counter(accessor));
} | [
"public",
"void",
"registerCounter",
"(",
"String",
"fullStatName",
",",
"Supplier",
"<",
"Number",
">",
"accessor",
")",
"{",
"registerStatistic",
"(",
"fullStatName",
",",
"counter",
"(",
"accessor",
")",
")",
";",
"}"
] | Directly register a COUNTER stat with its accessor | [
"Directly",
"register",
"a",
"COUNTER",
"stat",
"with",
"its",
"accessor"
] | d24e4989b8c8dbe4f5210e49c7945d51b6585881 | https://github.com/Terracotta-OSS/statistics/blob/d24e4989b8c8dbe4f5210e49c7945d51b6585881/src/main/java/org/terracotta/statistics/registry/StatisticRegistry.java#L135-L137 |
11,394 | eirbjo/jetty-console | jetty-console-creator/src/main/java/org/simplericity/jettyconsole/creator/DefaultCreator.java | DefaultCreator.writePathDescriptor | private void writePathDescriptor(File consoleDir, Set<String> paths) {
try (PrintWriter writer = new PrintWriter(new FileOutputStream(new File(consoleDir, "jettyconsolepaths.txt")))){
for (String path : paths) {
writer.println(path);
}
} catch (FileNotFoundExcepti... | java | private void writePathDescriptor(File consoleDir, Set<String> paths) {
try (PrintWriter writer = new PrintWriter(new FileOutputStream(new File(consoleDir, "jettyconsolepaths.txt")))){
for (String path : paths) {
writer.println(path);
}
} catch (FileNotFoundExcepti... | [
"private",
"void",
"writePathDescriptor",
"(",
"File",
"consoleDir",
",",
"Set",
"<",
"String",
">",
"paths",
")",
"{",
"try",
"(",
"PrintWriter",
"writer",
"=",
"new",
"PrintWriter",
"(",
"new",
"FileOutputStream",
"(",
"new",
"File",
"(",
"consoleDir",
","... | Write a txt file with one line for each unpacked class or resource
from dependencies. | [
"Write",
"a",
"txt",
"file",
"with",
"one",
"line",
"for",
"each",
"unpacked",
"class",
"or",
"resource",
"from",
"dependencies",
"."
] | 5bd32ecab12837394dd45fd15c51c3934afcd76b | https://github.com/eirbjo/jetty-console/blob/5bd32ecab12837394dd45fd15c51c3934afcd76b/jetty-console-creator/src/main/java/org/simplericity/jettyconsole/creator/DefaultCreator.java#L104-L113 |
11,395 | connect-group/thymesheet | src/main/java/com/connect_group/thymesheet/css/selectors/dom/internal/TagChecker.java | TagChecker.tagEquals | private boolean tagEquals(String tag1, String tag2) {
if (caseSensitive) {
return tag1.equals(tag2);
}
return tag1.equalsIgnoreCase(tag2);
} | java | private boolean tagEquals(String tag1, String tag2) {
if (caseSensitive) {
return tag1.equals(tag2);
}
return tag1.equalsIgnoreCase(tag2);
} | [
"private",
"boolean",
"tagEquals",
"(",
"String",
"tag1",
",",
"String",
"tag2",
")",
"{",
"if",
"(",
"caseSensitive",
")",
"{",
"return",
"tag1",
".",
"equals",
"(",
"tag2",
")",
";",
"}",
"return",
"tag1",
".",
"equalsIgnoreCase",
"(",
"tag2",
")",
"... | Determine if the two specified tag names are equal.
@param tag1 A tag name.
@param tag2 A tag name.
@return <code>true</code> if the tag names are equal, <code>false</code> otherwise. | [
"Determine",
"if",
"the",
"two",
"specified",
"tag",
"names",
"are",
"equal",
"."
] | b6384e385d3e3b54944d53993bbd396d2668a5a0 | https://github.com/connect-group/thymesheet/blob/b6384e385d3e3b54944d53993bbd396d2668a5a0/src/main/java/com/connect_group/thymesheet/css/selectors/dom/internal/TagChecker.java#L168-L174 |
11,396 | telly/groundy | library/src/main/java/com/telly/groundy/GroundyService.java | GroundyService.onHandleIntent | private void onHandleIntent(GroundyTask groundyTask) {
if (groundyTask == null) {
return;
}
boolean requiresWifi = groundyTask.keepWifiOn();
if (requiresWifi) {
mWakeLockHelper.acquire();
}
L.d(TAG, "Executing value: " + groundyTask);
TaskResult taskResult;
try {
task... | java | private void onHandleIntent(GroundyTask groundyTask) {
if (groundyTask == null) {
return;
}
boolean requiresWifi = groundyTask.keepWifiOn();
if (requiresWifi) {
mWakeLockHelper.acquire();
}
L.d(TAG, "Executing value: " + groundyTask);
TaskResult taskResult;
try {
task... | [
"private",
"void",
"onHandleIntent",
"(",
"GroundyTask",
"groundyTask",
")",
"{",
"if",
"(",
"groundyTask",
"==",
"null",
")",
"{",
"return",
";",
"}",
"boolean",
"requiresWifi",
"=",
"groundyTask",
".",
"keepWifiOn",
"(",
")",
";",
"if",
"(",
"requiresWifi"... | This method is invoked on the worker thread with a request to process. Only one Intent is
processed at a time, but the processing happens on a worker thread that runs independently
from other application logic. So, if this code takes a long time, it will hold up other
requests to the same IntentService, but it will not... | [
"This",
"method",
"is",
"invoked",
"on",
"the",
"worker",
"thread",
"with",
"a",
"request",
"to",
"process",
".",
"Only",
"one",
"Intent",
"is",
"processed",
"at",
"a",
"time",
"but",
"the",
"processing",
"happens",
"on",
"a",
"worker",
"thread",
"that",
... | e90baf9901a8be20b348bd1575d5ad782560cec8 | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/GroundyService.java#L342-L389 |
11,397 | Terracotta-OSS/statistics | src/main/java/org/terracotta/statistics/derived/histogram/BarSplittingBiasedHistogram.java | BarSplittingBiasedHistogram.expire | public void expire(long time) {
long calculatedSize = 0;
Iterator<Bar> it = bars.iterator();
while (it.hasNext()) {
long barSize = it.next().expire(time);
if (barSize == 0) {
it.remove();
}
calculatedSize += barSize;
}
this.size = calculatedSize;
if (bars.isEmpty(... | java | public void expire(long time) {
long calculatedSize = 0;
Iterator<Bar> it = bars.iterator();
while (it.hasNext()) {
long barSize = it.next().expire(time);
if (barSize == 0) {
it.remove();
}
calculatedSize += barSize;
}
this.size = calculatedSize;
if (bars.isEmpty(... | [
"public",
"void",
"expire",
"(",
"long",
"time",
")",
"{",
"long",
"calculatedSize",
"=",
"0",
";",
"Iterator",
"<",
"Bar",
">",
"it",
"=",
"bars",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"long",
"b... | Expire old events from all buckets.
@param time current timestamp | [
"Expire",
"old",
"events",
"from",
"all",
"buckets",
"."
] | d24e4989b8c8dbe4f5210e49c7945d51b6585881 | https://github.com/Terracotta-OSS/statistics/blob/d24e4989b8c8dbe4f5210e49c7945d51b6585881/src/main/java/org/terracotta/statistics/derived/histogram/BarSplittingBiasedHistogram.java#L163-L177 |
11,398 | airomem/airomem | airomem-core/src/main/java/pl/setblack/airomem/core/kryo/ReferenceResolver.java | ReferenceResolver.useReferences | @SuppressWarnings("rawtypes")
public boolean useReferences(Class type) {
return !Util.isWrapperClass(type) && !type.equals(String.class) && !type.equals(Date.class) && !type.equals(BigDecimal.class) && !type.equals(BigInteger.class);
} | java | @SuppressWarnings("rawtypes")
public boolean useReferences(Class type) {
return !Util.isWrapperClass(type) && !type.equals(String.class) && !type.equals(Date.class) && !type.equals(BigDecimal.class) && !type.equals(BigInteger.class);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"boolean",
"useReferences",
"(",
"Class",
"type",
")",
"{",
"return",
"!",
"Util",
".",
"isWrapperClass",
"(",
"type",
")",
"&&",
"!",
"type",
".",
"equals",
"(",
"String",
".",
"class",
")",
"... | Returns false for all primitive wrappers. | [
"Returns",
"false",
"for",
"all",
"primitive",
"wrappers",
"."
] | 281ce18ff64836fccfb0edab18b8d677f1101a32 | https://github.com/airomem/airomem/blob/281ce18ff64836fccfb0edab18b8d677f1101a32/airomem-core/src/main/java/pl/setblack/airomem/core/kryo/ReferenceResolver.java#L98-L101 |
11,399 | phax/ph-ebinterface | src/main/java/com/helger/ebinterface/builder/EbInterfaceWriter.java | EbInterfaceWriter.ebInterface30 | @Nonnull
public static EbInterfaceWriter <Ebi30InvoiceType> ebInterface30 ()
{
final EbInterfaceWriter <Ebi30InvoiceType> ret = EbInterfaceWriter.create (Ebi30InvoiceType.class);
ret.setNamespaceContext (EbInterface30NamespaceContext.getInstance ());
return ret;
} | java | @Nonnull
public static EbInterfaceWriter <Ebi30InvoiceType> ebInterface30 ()
{
final EbInterfaceWriter <Ebi30InvoiceType> ret = EbInterfaceWriter.create (Ebi30InvoiceType.class);
ret.setNamespaceContext (EbInterface30NamespaceContext.getInstance ());
return ret;
} | [
"@",
"Nonnull",
"public",
"static",
"EbInterfaceWriter",
"<",
"Ebi30InvoiceType",
">",
"ebInterface30",
"(",
")",
"{",
"final",
"EbInterfaceWriter",
"<",
"Ebi30InvoiceType",
">",
"ret",
"=",
"EbInterfaceWriter",
".",
"create",
"(",
"Ebi30InvoiceType",
".",
"class",
... | Create a writer builder for Ebi30InvoiceType.
@return The builder and never <code>null</code> | [
"Create",
"a",
"writer",
"builder",
"for",
"Ebi30InvoiceType",
"."
] | e3d2381f25c2fdfcc98acff2509bf5f33752d087 | https://github.com/phax/ph-ebinterface/blob/e3d2381f25c2fdfcc98acff2509bf5f33752d087/src/main/java/com/helger/ebinterface/builder/EbInterfaceWriter.java#L84-L90 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.