repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/bin/BeanReferences.java | BeanReferences.findReferencesBean | private void findReferencesBean(
Object base,
Class<?> declaredClass,
Map<Object, Integer> objects,
SerIterator parentIterator) {
if (base == null) {
return;
}
// has this object been seen before, if so no need to check it again
... | java | private void findReferencesBean(
Object base,
Class<?> declaredClass,
Map<Object, Integer> objects,
SerIterator parentIterator) {
if (base == null) {
return;
}
// has this object been seen before, if so no need to check it again
... | [
"private",
"void",
"findReferencesBean",
"(",
"Object",
"base",
",",
"Class",
"<",
"?",
">",
"declaredClass",
",",
"Map",
"<",
"Object",
",",
"Integer",
">",
"objects",
",",
"SerIterator",
"parentIterator",
")",
"{",
"if",
"(",
"base",
"==",
"null",
")",
... | recursively find the references | [
"recursively",
"find",
"the",
"references"
] | f07dbe42947150b23a173f35984c6ab33c5529bf | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/BeanReferences.java#L126-L180 | train |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/bin/BeanReferences.java | BeanReferences.findReferencesIterable | private void findReferencesIterable(SerIterator itemIterator, Map<Object, Integer> objects) {
if (itemIterator.category() == SerCategory.MAP) {
while (itemIterator.hasNext()) {
itemIterator.next();
findReferencesBean(itemIterator.key(), itemIterator.keyType(), objects... | java | private void findReferencesIterable(SerIterator itemIterator, Map<Object, Integer> objects) {
if (itemIterator.category() == SerCategory.MAP) {
while (itemIterator.hasNext()) {
itemIterator.next();
findReferencesBean(itemIterator.key(), itemIterator.keyType(), objects... | [
"private",
"void",
"findReferencesIterable",
"(",
"SerIterator",
"itemIterator",
",",
"Map",
"<",
"Object",
",",
"Integer",
">",
"objects",
")",
"{",
"if",
"(",
"itemIterator",
".",
"category",
"(",
")",
"==",
"SerCategory",
".",
"MAP",
")",
"{",
"while",
... | recursively find the references in an iterable | [
"recursively",
"find",
"the",
"references",
"in",
"an",
"iterable"
] | f07dbe42947150b23a173f35984c6ab33c5529bf | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/BeanReferences.java#L183-L213 | train |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/bin/BeanReferences.java | BeanReferences.addClassInfoAndIncrementCount | private void addClassInfoAndIncrementCount(Class<?> type, ClassInfo classInfo) {
classes.putIfAbsent(type, classInfo);
classSerializationCount.compute(type, BeanReferences::incrementOrOne);
} | java | private void addClassInfoAndIncrementCount(Class<?> type, ClassInfo classInfo) {
classes.putIfAbsent(type, classInfo);
classSerializationCount.compute(type, BeanReferences::incrementOrOne);
} | [
"private",
"void",
"addClassInfoAndIncrementCount",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"ClassInfo",
"classInfo",
")",
"{",
"classes",
".",
"putIfAbsent",
"(",
"type",
",",
"classInfo",
")",
";",
"classSerializationCount",
".",
"compute",
"(",
"type",
",... | adds the class, incrementing the number of times it is used | [
"adds",
"the",
"class",
"incrementing",
"the",
"number",
"of",
"times",
"it",
"is",
"used"
] | f07dbe42947150b23a173f35984c6ab33c5529bf | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/BeanReferences.java#L277-L280 | train |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/bin/BeanReferences.java | BeanReferences.classInfoFromMetaBean | private ClassInfo classInfoFromMetaBean(MetaBean metaBean, Class<?> aClass) {
MetaProperty<?>[] metaProperties = StreamSupport.stream(metaBean.metaPropertyIterable().spliterator(), false)
.filter(metaProp -> settings.isSerialized(metaProp))
.toArray(MetaProperty<?>[]::new);
// P... | java | private ClassInfo classInfoFromMetaBean(MetaBean metaBean, Class<?> aClass) {
MetaProperty<?>[] metaProperties = StreamSupport.stream(metaBean.metaPropertyIterable().spliterator(), false)
.filter(metaProp -> settings.isSerialized(metaProp))
.toArray(MetaProperty<?>[]::new);
// P... | [
"private",
"ClassInfo",
"classInfoFromMetaBean",
"(",
"MetaBean",
"metaBean",
",",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"MetaProperty",
"<",
"?",
">",
"[",
"]",
"metaProperties",
"=",
"StreamSupport",
".",
"stream",
"(",
"metaBean",
".",
"metaPropertyIt... | converts a meta-bean to a ClassInfo | [
"converts",
"a",
"meta",
"-",
"bean",
"to",
"a",
"ClassInfo"
] | f07dbe42947150b23a173f35984c6ab33c5529bf | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/BeanReferences.java#L283-L290 | train |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/bin/BeanReferences.java | BeanReferences.getClassInfo | ClassInfo getClassInfo(Class<?> effectiveType) {
ClassInfo classInfo = classes.get(effectiveType);
if (classInfo == null) {
throw new IllegalStateException(
"Tried to serialise class that wasn't present in bean on first pass: " + effectiveType.getName());
}
... | java | ClassInfo getClassInfo(Class<?> effectiveType) {
ClassInfo classInfo = classes.get(effectiveType);
if (classInfo == null) {
throw new IllegalStateException(
"Tried to serialise class that wasn't present in bean on first pass: " + effectiveType.getName());
}
... | [
"ClassInfo",
"getClassInfo",
"(",
"Class",
"<",
"?",
">",
"effectiveType",
")",
"{",
"ClassInfo",
"classInfo",
"=",
"classes",
".",
"get",
"(",
"effectiveType",
")",
";",
"if",
"(",
"classInfo",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException"... | lookup the class info by type | [
"lookup",
"the",
"class",
"info",
"by",
"type"
] | f07dbe42947150b23a173f35984c6ab33c5529bf | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/BeanReferences.java#L308-L315 | train |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/json/JodaBeanSimpleJsonWriter.java | JodaBeanSimpleJsonWriter.writeObject | private void writeObject(Class<?> declaredType, Object obj, SerIterator parentIterator) throws IOException {
if (obj == null) {
output.writeNull();
} else if (settings.getConverter().isConvertible(obj.getClass())) {
writeSimple(declaredType, obj);
} else if (obj instanceo... | java | private void writeObject(Class<?> declaredType, Object obj, SerIterator parentIterator) throws IOException {
if (obj == null) {
output.writeNull();
} else if (settings.getConverter().isConvertible(obj.getClass())) {
writeSimple(declaredType, obj);
} else if (obj instanceo... | [
"private",
"void",
"writeObject",
"(",
"Class",
"<",
"?",
">",
"declaredType",
",",
"Object",
"obj",
",",
"SerIterator",
"parentIterator",
")",
"throws",
"IOException",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"output",
".",
"writeNull",
"(",
")",
... | write collection object | [
"write",
"collection",
"object"
] | f07dbe42947150b23a173f35984c6ab33c5529bf | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/json/JodaBeanSimpleJsonWriter.java#L269-L286 | train |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/bin/JodaBeanBinReader.java | JodaBeanBinReader.parseVersion | private <T> T parseVersion(DataInputStream input, Class<T> declaredType) throws Exception {
// root array
int arrayByte = input.readByte();
int versionByte = input.readByte();
switch (versionByte) {
case 1:
if (arrayByte != MIN_FIX_ARRAY + 2) {
... | java | private <T> T parseVersion(DataInputStream input, Class<T> declaredType) throws Exception {
// root array
int arrayByte = input.readByte();
int versionByte = input.readByte();
switch (versionByte) {
case 1:
if (arrayByte != MIN_FIX_ARRAY + 2) {
... | [
"private",
"<",
"T",
">",
"T",
"parseVersion",
"(",
"DataInputStream",
"input",
",",
"Class",
"<",
"T",
">",
"declaredType",
")",
"throws",
"Exception",
"{",
"// root array",
"int",
"arrayByte",
"=",
"input",
".",
"readByte",
"(",
")",
";",
"int",
"version... | parses the version | [
"parses",
"the",
"version"
] | f07dbe42947150b23a173f35984c6ab33c5529bf | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/JodaBeanBinReader.java#L135-L156 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/jvmti/ThrowableCache.java | ThrowableCache.get | public static CacheFrame[] get(Throwable throwable) {
if (throwable == null) {
return null;
}
Map<Throwable, CacheFrame[]> weakMap = cache.get();
return weakMap.get(throwable);
} | java | public static CacheFrame[] get(Throwable throwable) {
if (throwable == null) {
return null;
}
Map<Throwable, CacheFrame[]> weakMap = cache.get();
return weakMap.get(throwable);
} | [
"public",
"static",
"CacheFrame",
"[",
"]",
"get",
"(",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Map",
"<",
"Throwable",
",",
"CacheFrame",
"[",
"]",
">",
"weakMap",
"=",
"cache",
... | Get the cached frames associated with the given throwable.
@param throwable a throwable to use as a cache key.
@return the list of frames previously cached or null. | [
"Get",
"the",
"cached",
"frames",
"associated",
"with",
"the",
"given",
"throwable",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/jvmti/ThrowableCache.java#L43-L49 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.setPersonData | public void setPersonData(final String id, final String username, final String email) {
this.rollbar.configure(new ConfigProvider() {
@Override
public Config provide(ConfigBuilder builder) {
return builder
.person(new PersonProvider(id, username, email))
.build();
}... | java | public void setPersonData(final String id, final String username, final String email) {
this.rollbar.configure(new ConfigProvider() {
@Override
public Config provide(ConfigBuilder builder) {
return builder
.person(new PersonProvider(id, username, email))
.build();
}... | [
"public",
"void",
"setPersonData",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"username",
",",
"final",
"String",
"email",
")",
"{",
"this",
".",
"rollbar",
".",
"configure",
"(",
"new",
"ConfigProvider",
"(",
")",
"{",
"@",
"Override",
"public"... | Set the person data to include with future items.
@param id an identifier for this user.
@param username the username of the user.
@param email the email of this user. | [
"Set",
"the",
"person",
"data",
"to",
"include",
"with",
"future",
"items",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L301-L310 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.clearPersonData | public void clearPersonData() {
this.rollbar.configure(new ConfigProvider() {
@Override
public Config provide(ConfigBuilder builder) {
return builder
.person(null)
.build();
}
});
} | java | public void clearPersonData() {
this.rollbar.configure(new ConfigProvider() {
@Override
public Config provide(ConfigBuilder builder) {
return builder
.person(null)
.build();
}
});
} | [
"public",
"void",
"clearPersonData",
"(",
")",
"{",
"this",
".",
"rollbar",
".",
"configure",
"(",
"new",
"ConfigProvider",
"(",
")",
"{",
"@",
"Override",
"public",
"Config",
"provide",
"(",
"ConfigBuilder",
"builder",
")",
"{",
"return",
"builder",
".",
... | Remove any person data that might be set. | [
"Remove",
"any",
"person",
"data",
"that",
"might",
"be",
"set",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L315-L324 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.setIncludeLogcat | public void setIncludeLogcat(final boolean includeLogcat) {
final int versionCode = this.versionCode;
final String versionName = this.versionName;
this.rollbar.configure(new ConfigProvider() {
@Override
public Config provide(ConfigBuilder builder) {
ClientProvider clientProvider = new Cl... | java | public void setIncludeLogcat(final boolean includeLogcat) {
final int versionCode = this.versionCode;
final String versionName = this.versionName;
this.rollbar.configure(new ConfigProvider() {
@Override
public Config provide(ConfigBuilder builder) {
ClientProvider clientProvider = new Cl... | [
"public",
"void",
"setIncludeLogcat",
"(",
"final",
"boolean",
"includeLogcat",
")",
"{",
"final",
"int",
"versionCode",
"=",
"this",
".",
"versionCode",
";",
"final",
"String",
"versionName",
"=",
"this",
".",
"versionName",
";",
"this",
".",
"rollbar",
".",
... | Toggle whether to include logcat output in items.
@param includeLogcat whether or not to include logcat output. | [
"Toggle",
"whether",
"to",
"include",
"logcat",
"output",
"in",
"items",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L331-L347 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.critical | public void critical(Throwable error, Map<String, Object> custom) {
critical(error, custom, null);
} | java | public void critical(Throwable error, Map<String, Object> custom) {
critical(error, custom, null);
} | [
"public",
"void",
"critical",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
")",
"{",
"critical",
"(",
"error",
",",
"custom",
",",
"null",
")",
";",
"}"
] | Record a critical error with extra information attached.
@param error the error.
@param custom the extra information. | [
"Record",
"a",
"critical",
"error",
"with",
"extra",
"information",
"attached",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L393-L395 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.critical | public void critical(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, Level.CRITICAL);
} | java | public void critical(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, Level.CRITICAL);
} | [
"public",
"void",
"critical",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"custom",
",",
"description",
",",
"Level",
".",
"CRITICAL",
")",
";",
"... | Record a critical error with custom parameters and human readable description.
@param error the error.
@param custom the custom data.
@param description the human readable description of error. | [
"Record",
"a",
"critical",
"error",
"with",
"custom",
"parameters",
"and",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L423-L425 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.warning | public void warning(Throwable error, Map<String, Object> custom) {
warning(error, custom, null);
} | java | public void warning(Throwable error, Map<String, Object> custom) {
warning(error, custom, null);
} | [
"public",
"void",
"warning",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
")",
"{",
"warning",
"(",
"error",
",",
"custom",
",",
"null",
")",
";",
"}"
] | Record a warning error with extra information attached.
@param error the error.
@param custom the extra information. | [
"Record",
"a",
"warning",
"error",
"with",
"extra",
"information",
"attached",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L511-L513 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.warning | public void warning(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, Level.WARNING);
} | java | public void warning(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, Level.WARNING);
} | [
"public",
"void",
"warning",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"custom",
",",
"description",
",",
"Level",
".",
"WARNING",
")",
";",
"}"... | Record a warning error with custom parameters and human readable description.
@param error the error.
@param custom the custom data.
@param description the human readable description of error. | [
"Record",
"a",
"warning",
"error",
"with",
"custom",
"parameters",
"and",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L541-L543 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.info | public void info(Throwable error, Map<String, Object> custom) {
info(error, custom, null);
} | java | public void info(Throwable error, Map<String, Object> custom) {
info(error, custom, null);
} | [
"public",
"void",
"info",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
")",
"{",
"info",
"(",
"error",
",",
"custom",
",",
"null",
")",
";",
"}"
] | Record an info error with extra information attached.
@param error the error.
@param custom the extra information. | [
"Record",
"an",
"info",
"error",
"with",
"extra",
"information",
"attached",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L570-L572 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.info | public void info(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, Level.INFO);
} | java | public void info(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, Level.INFO);
} | [
"public",
"void",
"info",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"custom",
",",
"description",
",",
"Level",
".",
"INFO",
")",
";",
"}"
] | Record an info error with custom parameters and human readable description.
@param error the error.
@param custom the custom data.
@param description the human readable description of error. | [
"Record",
"an",
"info",
"error",
"with",
"custom",
"parameters",
"and",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L600-L602 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.debug | public void debug(Throwable error, Map<String, Object> custom) {
debug(error, custom, null);
} | java | public void debug(Throwable error, Map<String, Object> custom) {
debug(error, custom, null);
} | [
"public",
"void",
"debug",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
")",
"{",
"debug",
"(",
"error",
",",
"custom",
",",
"null",
")",
";",
"}"
] | Record a debug error with extra information attached.
@param error the error.
@param custom the extra information. | [
"Record",
"a",
"debug",
"error",
"with",
"extra",
"information",
"attached",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L629-L631 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.debug | public void debug(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, Level.DEBUG);
} | java | public void debug(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, Level.DEBUG);
} | [
"public",
"void",
"debug",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"custom",
",",
"description",
",",
"Level",
".",
"DEBUG",
")",
";",
"}"
] | Record a debug error with custom parameters and human readable description.
@param error the error.
@param custom the custom data.
@param description the human readable description of error. | [
"Record",
"a",
"debug",
"error",
"with",
"custom",
"parameters",
"and",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L659-L661 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.log | public void log(Throwable error, Level level) {
log(error, null, null, level);
} | java | public void log(Throwable error, Level level) {
log(error, null, null, level);
} | [
"public",
"void",
"log",
"(",
"Throwable",
"error",
",",
"Level",
"level",
")",
"{",
"log",
"(",
"error",
",",
"null",
",",
"null",
",",
"level",
")",
";",
"}"
] | Log an error at level specified.
@param error the error.
@param level the level of the error. | [
"Log",
"an",
"error",
"at",
"level",
"specified",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L711-L713 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.log | public void log(Throwable error, String description, Level level) {
log(error, null, description, level);
} | java | public void log(Throwable error, String description, Level level) {
log(error, null, description, level);
} | [
"public",
"void",
"log",
"(",
"Throwable",
"error",
",",
"String",
"description",
",",
"Level",
"level",
")",
"{",
"log",
"(",
"error",
",",
"null",
",",
"description",
",",
"level",
")",
";",
"}"
] | Record a debug error with human readable description at the specified level.
@param error the error.
@param description human readable description of error.
@param level the level. | [
"Record",
"a",
"debug",
"error",
"with",
"human",
"readable",
"description",
"at",
"the",
"specified",
"level",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L722-L724 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.log | public void log(String message, Level level) {
log(null, null, message, level);
} | java | public void log(String message, Level level) {
log(null, null, message, level);
} | [
"public",
"void",
"log",
"(",
"String",
"message",
",",
"Level",
"level",
")",
"{",
"log",
"(",
"null",
",",
"null",
",",
"message",
",",
"level",
")",
";",
"}"
] | Record a message at the level specified.
@param message the message.
@param level the level. | [
"Record",
"a",
"message",
"at",
"the",
"level",
"specified",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L765-L767 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.log | public void log(String message, Map<String, Object> custom, Level level) {
log(null, custom, message, level);
} | java | public void log(String message, Map<String, Object> custom, Level level) {
log(null, custom, message, level);
} | [
"public",
"void",
"log",
"(",
"String",
"message",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
",",
"Level",
"level",
")",
"{",
"log",
"(",
"null",
",",
"custom",
",",
"message",
",",
"level",
")",
";",
"}"
] | Record a message with extra information attached at the specified level.
@param message the message.
@param custom the extra information.
@param level the level. | [
"Record",
"a",
"message",
"with",
"extra",
"information",
"attached",
"at",
"the",
"specified",
"level",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L776-L778 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.reportException | @Deprecated
public static void reportException(final Throwable throwable, final String level) {
reportException(throwable, level, null, null);
} | java | @Deprecated
public static void reportException(final Throwable throwable, final String level) {
reportException(throwable, level, null, null);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"reportException",
"(",
"final",
"Throwable",
"throwable",
",",
"final",
"String",
"level",
")",
"{",
"reportException",
"(",
"throwable",
",",
"level",
",",
"null",
",",
"null",
")",
";",
"}"
] | report an exception to Rollbar, specifying the level.
@param throwable the exception that occurred.
@param level the severity level. | [
"report",
"an",
"exception",
"to",
"Rollbar",
"specifying",
"the",
"level",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L820-L823 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.reportException | @Deprecated
public static void reportException(final Throwable throwable, final String level, final String description, final Map<String, String> params) {
ensureInit(new Runnable() {
@Override
public void run() {
notifier.log(throwable, params != null ? Collections.<String, Object>unmodifiabl... | java | @Deprecated
public static void reportException(final Throwable throwable, final String level, final String description, final Map<String, String> params) {
ensureInit(new Runnable() {
@Override
public void run() {
notifier.log(throwable, params != null ? Collections.<String, Object>unmodifiabl... | [
"@",
"Deprecated",
"public",
"static",
"void",
"reportException",
"(",
"final",
"Throwable",
"throwable",
",",
"final",
"String",
"level",
",",
"final",
"String",
"description",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"ens... | report an exception to Rollbar, specifying the level, adding a custom description,
and including extra data.
@param throwable the exception that occurred.
@param level the severity level.
@param description the extra description.
@param params the extra custom data. | [
"report",
"an",
"exception",
"to",
"Rollbar",
"specifying",
"the",
"level",
"adding",
"a",
"custom",
"description",
"and",
"including",
"extra",
"data",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L845-L853 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.reportMessage | @Deprecated
public static void reportMessage(final String message, final String level) {
reportMessage(message, level, null);
} | java | @Deprecated
public static void reportMessage(final String message, final String level) {
reportMessage(message, level, null);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"reportMessage",
"(",
"final",
"String",
"message",
",",
"final",
"String",
"level",
")",
"{",
"reportMessage",
"(",
"message",
",",
"level",
",",
"null",
")",
";",
"}"
] | Report a message to Rollbar, specifying the level.
@param message the message to send.
@param level the severity level. | [
"Report",
"a",
"message",
"to",
"Rollbar",
"specifying",
"the",
"level",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L871-L874 | train |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.reportMessage | @Deprecated
public static void reportMessage(final String message, final String level, final Map<String, String> params) {
ensureInit(new Runnable() {
@Override
public void run() {
notifier.log(message, params != null ? Collections.<String, Object>unmodifiableMap(params) : null, Level.lookupBy... | java | @Deprecated
public static void reportMessage(final String message, final String level, final Map<String, String> params) {
ensureInit(new Runnable() {
@Override
public void run() {
notifier.log(message, params != null ? Collections.<String, Object>unmodifiableMap(params) : null, Level.lookupBy... | [
"@",
"Deprecated",
"public",
"static",
"void",
"reportMessage",
"(",
"final",
"String",
"message",
",",
"final",
"String",
"level",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"ensureInit",
"(",
"new",
"Runnable",
"(",
")",
... | Report a message to Rollbar, specifying the level, and including extra data.
@param message the message to send.
@param level the severity level.
@param params the extra data. | [
"Report",
"a",
"message",
"to",
"Rollbar",
"specifying",
"the",
"level",
"and",
"including",
"extra",
"data",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L883-L891 | train |
rollbar/rollbar-java | examples/rollbar-java/src/main/java/com/rollbar/example/Greeting.java | Greeting.greeting | public String greeting() {
int current = counter.getAndAdd(1);
if (current % 2 != 0) {
return format("Hello Rollbar number %d", current);
}
throw new RuntimeException("Fatal error at greeting number: " + current);
} | java | public String greeting() {
int current = counter.getAndAdd(1);
if (current % 2 != 0) {
return format("Hello Rollbar number %d", current);
}
throw new RuntimeException("Fatal error at greeting number: " + current);
} | [
"public",
"String",
"greeting",
"(",
")",
"{",
"int",
"current",
"=",
"counter",
".",
"getAndAdd",
"(",
"1",
")",
";",
"if",
"(",
"current",
"%",
"2",
"!=",
"0",
")",
"{",
"return",
"format",
"(",
"\"Hello Rollbar number %d\"",
",",
"current",
")",
";"... | Get the greeting message.
@return the greeting message. | [
"Get",
"the",
"greeting",
"message",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/examples/rollbar-java/src/main/java/com/rollbar/example/Greeting.java#L19-L26 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/notifier/config/ConfigProviderHelper.java | ConfigProviderHelper.getConfigProvider | public static ConfigProvider getConfigProvider(String configProviderClassName) {
ConfigProvider configProvider = null;
if (configProviderClassName != null && !"".equals(configProviderClassName)) {
Class userConfigProviderClass = null;
try {
userConfigProviderClass = Class.forName(configProv... | java | public static ConfigProvider getConfigProvider(String configProviderClassName) {
ConfigProvider configProvider = null;
if (configProviderClassName != null && !"".equals(configProviderClassName)) {
Class userConfigProviderClass = null;
try {
userConfigProviderClass = Class.forName(configProv... | [
"public",
"static",
"ConfigProvider",
"getConfigProvider",
"(",
"String",
"configProviderClassName",
")",
"{",
"ConfigProvider",
"configProvider",
"=",
"null",
";",
"if",
"(",
"configProviderClassName",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"configPro... | Instantiate a ConfigProvider object based on the class name given as parameter.
@param configProviderClassName the string name of the config provider class | [
"Instantiate",
"a",
"ConfigProvider",
"object",
"based",
"on",
"the",
"class",
"name",
"given",
"as",
"parameter",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/notifier/config/ConfigProviderHelper.java#L18-L39 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/Rollbar.java | Rollbar.critical | public void critical(Throwable error, String description) {
log(error, null, description, Level.CRITICAL);
} | java | public void critical(Throwable error, String description) {
log(error, null, description, Level.CRITICAL);
} | [
"public",
"void",
"critical",
"(",
"Throwable",
"error",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"null",
",",
"description",
",",
"Level",
".",
"CRITICAL",
")",
";",
"}"
] | Record a critical error with human readable description.
@param error the error
@param description human readable description of error | [
"Record",
"a",
"critical",
"error",
"with",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/Rollbar.java#L277-L279 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/Rollbar.java | Rollbar.error | public void error(Throwable error, String description) {
log(error, null, description, Level.ERROR);
} | java | public void error(Throwable error, String description) {
log(error, null, description, Level.ERROR);
} | [
"public",
"void",
"error",
"(",
"Throwable",
"error",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"null",
",",
"description",
",",
"Level",
".",
"ERROR",
")",
";",
"}"
] | Record an error with human readable description.
@param error the error
@param description human readable description of error | [
"Record",
"an",
"error",
"with",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/Rollbar.java#L286-L288 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/Rollbar.java | Rollbar.warning | public void warning(Throwable error, String description) {
log(error, null, description, Level.WARNING);
} | java | public void warning(Throwable error, String description) {
log(error, null, description, Level.WARNING);
} | [
"public",
"void",
"warning",
"(",
"Throwable",
"error",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"null",
",",
"description",
",",
"Level",
".",
"WARNING",
")",
";",
"}"
] | Record a warning with human readable description.
@param error the error
@param description human readable description of error | [
"Record",
"a",
"warning",
"with",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/Rollbar.java#L295-L297 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/Rollbar.java | Rollbar.info | public void info(Throwable error, String description) {
log(error, null, description, Level.INFO);
} | java | public void info(Throwable error, String description) {
log(error, null, description, Level.INFO);
} | [
"public",
"void",
"info",
"(",
"Throwable",
"error",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"null",
",",
"description",
",",
"Level",
".",
"INFO",
")",
";",
"}"
] | Record an info error with human readable description.
@param error the error
@param description human readable description of error | [
"Record",
"an",
"info",
"error",
"with",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/Rollbar.java#L304-L306 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/Rollbar.java | Rollbar.debug | public void debug(Throwable error, String description) {
log(error, null, description, Level.DEBUG);
} | java | public void debug(Throwable error, String description) {
log(error, null, description, Level.DEBUG);
} | [
"public",
"void",
"debug",
"(",
"Throwable",
"error",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"null",
",",
"description",
",",
"Level",
".",
"DEBUG",
")",
";",
"}"
] | Record a debug error with human readable description.
@param error the error
@param description human readable description of error | [
"Record",
"a",
"debug",
"error",
"with",
"human",
"readable",
"description",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/Rollbar.java#L313-L315 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/Rollbar.java | Rollbar.log | public void log(Throwable error, Map<String, Object> custom, String description, Level level,
boolean isUncaught) {
this.rollbar.log(error, custom, description, level, isUncaught);
} | java | public void log(Throwable error, Map<String, Object> custom, String description, Level level,
boolean isUncaught) {
this.rollbar.log(error, custom, description, level, isUncaught);
} | [
"public",
"void",
"log",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
",",
"String",
"description",
",",
"Level",
"level",
",",
"boolean",
"isUncaught",
")",
"{",
"this",
".",
"rollbar",
".",
"log",
"(",
"error",
... | Record an error or message with extra data at the level specified.
At least ene of `error` or `description` must
be non-null. If error is null, `description` will be sent as a message.
If error is non-null, description will be
sent as the description of the error.
Custom data will be attached to message if the error is... | [
"Record",
"an",
"error",
"or",
"message",
"with",
"extra",
"data",
"at",
"the",
"level",
"specified",
".",
"At",
"least",
"ene",
"of",
"error",
"or",
"description",
"must",
"be",
"non",
"-",
"null",
".",
"If",
"error",
"is",
"null",
"description",
"will"... | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/Rollbar.java#L546-L549 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/notifier/util/BodyFactory.java | BodyFactory.from | @Deprecated
public Body from(Throwable throwable, String description) {
if (throwable == null) {
return new Body.Builder().bodyContent(message(description)).build();
}
return from(new RollbarThrowableWrapper(throwable), description);
} | java | @Deprecated
public Body from(Throwable throwable, String description) {
if (throwable == null) {
return new Body.Builder().bodyContent(message(description)).build();
}
return from(new RollbarThrowableWrapper(throwable), description);
} | [
"@",
"Deprecated",
"public",
"Body",
"from",
"(",
"Throwable",
"throwable",
",",
"String",
"description",
")",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
"new",
"Body",
".",
"Builder",
"(",
")",
".",
"bodyContent",
"(",
"message",
"("... | Builds the body for the throwable and description supplied.
@param throwable the throwable.
@param description the description.
@return the body.
@deprecated Replaced by {@link #from(ThrowableWrapper, String)}. | [
"Builds",
"the",
"body",
"for",
"the",
"throwable",
"and",
"description",
"supplied",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/notifier/util/BodyFactory.java#L31-L37 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/notifier/Rollbar.java | Rollbar.init | public static Rollbar init(Config config) {
if (notifier == null) {
synchronized (Rollbar.class) {
if (notifier == null) {
notifier = new Rollbar(config);
LOGGER.debug("Rollbar managed notifier created.");
}
}
}
return notifier;
} | java | public static Rollbar init(Config config) {
if (notifier == null) {
synchronized (Rollbar.class) {
if (notifier == null) {
notifier = new Rollbar(config);
LOGGER.debug("Rollbar managed notifier created.");
}
}
}
return notifier;
} | [
"public",
"static",
"Rollbar",
"init",
"(",
"Config",
"config",
")",
"{",
"if",
"(",
"notifier",
"==",
"null",
")",
"{",
"synchronized",
"(",
"Rollbar",
".",
"class",
")",
"{",
"if",
"(",
"notifier",
"==",
"null",
")",
"{",
"notifier",
"=",
"new",
"R... | Method to initialize the library managed notifier instance.
@param config the configuration.
@return the library managed instance. | [
"Method",
"to",
"initialize",
"the",
"library",
"managed",
"notifier",
"instance",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/notifier/Rollbar.java#L66-L78 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/notifier/Rollbar.java | Rollbar.configure | public void configure(Config config) {
LOGGER.debug("Reloading configuration.");
this.configWriteLock.lock();
try {
this.config = config;
processAppPackages(config);
} finally {
this.configWriteLock.unlock();
}
} | java | public void configure(Config config) {
LOGGER.debug("Reloading configuration.");
this.configWriteLock.lock();
try {
this.config = config;
processAppPackages(config);
} finally {
this.configWriteLock.unlock();
}
} | [
"public",
"void",
"configure",
"(",
"Config",
"config",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Reloading configuration.\"",
")",
";",
"this",
".",
"configWriteLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"this",
".",
"config",
"=",
"config",
";",
"p... | Replace the configuration of this instance directly.
@param config the new configuration. | [
"Replace",
"the",
"configuration",
"of",
"this",
"instance",
"directly",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/notifier/Rollbar.java#L129-L138 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/notifier/Rollbar.java | Rollbar.sendJsonPayload | public void sendJsonPayload(String json) {
try {
this.configReadLock.lock();
Config config = this.config;
this.configReadLock.unlock();
sendPayload(config, new Payload(json));
} catch (Exception e) {
LOGGER.error("Error while sending payload to Rollbar: {}", e);
}
} | java | public void sendJsonPayload(String json) {
try {
this.configReadLock.lock();
Config config = this.config;
this.configReadLock.unlock();
sendPayload(config, new Payload(json));
} catch (Exception e) {
LOGGER.error("Error while sending payload to Rollbar: {}", e);
}
} | [
"public",
"void",
"sendJsonPayload",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"this",
".",
"configReadLock",
".",
"lock",
"(",
")",
";",
"Config",
"config",
"=",
"this",
".",
"config",
";",
"this",
".",
"configReadLock",
".",
"unlock",
"(",
")",
";... | Send JSON payload.
@param json the json payload. | [
"Send",
"JSON",
"payload",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/notifier/Rollbar.java#L650-L660 | train |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/notifier/util/ObjectsUtils.java | ObjectsUtils.requireNonNull | public static <T> T requireNonNull(T object, String errorMessage) {
if (object == null) {
throw new NullPointerException(errorMessage);
} else {
return object;
}
} | java | public static <T> T requireNonNull(T object, String errorMessage) {
if (object == null) {
throw new NullPointerException(errorMessage);
} else {
return object;
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"requireNonNull",
"(",
"T",
"object",
",",
"String",
"errorMessage",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"errorMessage",
")",
";",
"}",
"else",
"{",
... | Checks that the specified object reference is not null.
@param object the object reference to check for nullity
@param errorMessage detail message to be used in the event that a NullPointerException is
thrown
@param <T> the type of the reference
@return object if not null | [
"Checks",
"that",
"the",
"specified",
"object",
"reference",
"is",
"not",
"null",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/notifier/util/ObjectsUtils.java#L33-L39 | train |
rollbar/rollbar-java | rollbar-log4j2/src/main/java/com/rollbar/log4j2/RollbarAppender.java | RollbarAppender.createAppender | @PluginFactory
public static RollbarAppender createAppender(
@PluginAttribute("accessToken") @Required final String accessToken,
@PluginAttribute("endpoint") final String endpoint,
@PluginAttribute("environment") final String environment,
@PluginAttribute("language") final String language,
... | java | @PluginFactory
public static RollbarAppender createAppender(
@PluginAttribute("accessToken") @Required final String accessToken,
@PluginAttribute("endpoint") final String endpoint,
@PluginAttribute("environment") final String environment,
@PluginAttribute("language") final String language,
... | [
"@",
"PluginFactory",
"public",
"static",
"RollbarAppender",
"createAppender",
"(",
"@",
"PluginAttribute",
"(",
"\"accessToken\"",
")",
"@",
"Required",
"final",
"String",
"accessToken",
",",
"@",
"PluginAttribute",
"(",
"\"endpoint\"",
")",
"final",
"String",
"end... | Create appender plugin factory method.
@param accessToken the Rollbar access token.
@param endpoint the Rollbar endpoint to be used.
@param environment the environment.
@param language the language.
@param configProviderClassName The class name of the config provider implementation to get
the configuration.
@param nam... | [
"Create",
"appender",
"plugin",
"factory",
"method",
"."
] | 5eb4537d1363722b51cfcce55b427cbd8489f17b | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-log4j2/src/main/java/com/rollbar/log4j2/RollbarAppender.java#L75-L109 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/EmailIntents.java | EmailIntents.newEmailIntent | public static Intent newEmailIntent(String address, String subject, String body) {
return newEmailIntent(address, subject, body, null);
} | java | public static Intent newEmailIntent(String address, String subject, String body) {
return newEmailIntent(address, subject, body, null);
} | [
"public",
"static",
"Intent",
"newEmailIntent",
"(",
"String",
"address",
",",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"return",
"newEmailIntent",
"(",
"address",
",",
"subject",
",",
"body",
",",
"null",
")",
";",
"}"
] | Create an intent to send an email to a single recipient
@param address The recipient address (or null if not specified)
@param subject The subject of the email (or null if not specified)
@param body The body of the email (or null if not specified)
@return the intent | [
"Create",
"an",
"intent",
"to",
"send",
"an",
"email",
"to",
"a",
"single",
"recipient"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/EmailIntents.java#L37-L39 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/EmailIntents.java | EmailIntents.newEmailIntent | public static Intent newEmailIntent(String address, String subject, String body, Uri attachment) {
return newEmailIntent(address == null ? null : new String[]{address}, subject, body, attachment);
} | java | public static Intent newEmailIntent(String address, String subject, String body, Uri attachment) {
return newEmailIntent(address == null ? null : new String[]{address}, subject, body, attachment);
} | [
"public",
"static",
"Intent",
"newEmailIntent",
"(",
"String",
"address",
",",
"String",
"subject",
",",
"String",
"body",
",",
"Uri",
"attachment",
")",
"{",
"return",
"newEmailIntent",
"(",
"address",
"==",
"null",
"?",
"null",
":",
"new",
"String",
"[",
... | Create an intent to send an email with an attachment to a single recipient
@param address The recipient address (or null if not specified)
@param subject The subject of the email (or null if not specified)
@param body The body of the email (or null if not specified)
@param attachment The URI of a file to a... | [
"Create",
"an",
"intent",
"to",
"send",
"an",
"email",
"with",
"an",
"attachment",
"to",
"a",
"single",
"recipient"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/EmailIntents.java#L51-L53 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/EmailIntents.java | EmailIntents.newEmailIntent | public static Intent newEmailIntent(String[] addresses, String subject, String body, Uri attachment) {
Intent intent = new Intent(Intent.ACTION_SEND);
if (addresses != null) intent.putExtra(Intent.EXTRA_EMAIL, addresses);
if (body != null) intent.putExtra(Intent.EXTRA_TEXT, body);
if (su... | java | public static Intent newEmailIntent(String[] addresses, String subject, String body, Uri attachment) {
Intent intent = new Intent(Intent.ACTION_SEND);
if (addresses != null) intent.putExtra(Intent.EXTRA_EMAIL, addresses);
if (body != null) intent.putExtra(Intent.EXTRA_TEXT, body);
if (su... | [
"public",
"static",
"Intent",
"newEmailIntent",
"(",
"String",
"[",
"]",
"addresses",
",",
"String",
"subject",
",",
"String",
"body",
",",
"Uri",
"attachment",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_SEND",
")",
";"... | Create an intent to send an email with an attachment
@param addresses The recipients addresses (or null if not specified)
@param subject The subject of the email (or null if not specified)
@param body The body of the email (or null if not specified)
@param attachment The URI of a file to attach to the email.... | [
"Create",
"an",
"intent",
"to",
"send",
"an",
"email",
"with",
"an",
"attachment"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/EmailIntents.java#L65-L74 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/MediaIntents.java | MediaIntents.newPlayYouTubeVideoIntent | public static Intent newPlayYouTubeVideoIntent(String videoId) {
try {
return new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:" + videoId));
} catch (ActivityNotFoundException ex) {
return new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=" + videoId)... | java | public static Intent newPlayYouTubeVideoIntent(String videoId) {
try {
return new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:" + videoId));
} catch (ActivityNotFoundException ex) {
return new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=" + videoId)... | [
"public",
"static",
"Intent",
"newPlayYouTubeVideoIntent",
"(",
"String",
"videoId",
")",
"{",
"try",
"{",
"return",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_VIEW",
",",
"Uri",
".",
"parse",
"(",
"\"vnd.youtube:\"",
"+",
"videoId",
")",
")",
";",
"}",
... | Open a YouTube video. If the app is not installed, it opens it in the browser
@param videoId The video ID
@return the intent | [
"Open",
"a",
"YouTube",
"video",
".",
"If",
"the",
"app",
"is",
"not",
"installed",
"it",
"opens",
"it",
"in",
"the",
"browser"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/MediaIntents.java#L134-L140 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/MediaIntents.java | MediaIntents.newPlayMediaIntent | public static Intent newPlayMediaIntent(Uri uri, String type) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, type);
return intent;
} | java | public static Intent newPlayMediaIntent(Uri uri, String type) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, type);
return intent;
} | [
"public",
"static",
"Intent",
"newPlayMediaIntent",
"(",
"Uri",
"uri",
",",
"String",
"type",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_VIEW",
")",
";",
"intent",
".",
"setDataAndType",
"(",
"uri",
",",
"type",
")",
... | Open the media player to play the given media Uri
@param uri The Uri of the media to play.
@param type The mime type
@return the intent | [
"Open",
"the",
"media",
"player",
"to",
"play",
"the",
"given",
"media",
"Uri"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/MediaIntents.java#L182-L186 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/MediaIntents.java | MediaIntents.newTakePictureIntent | public static Intent newTakePictureIntent(File tempFile) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile));
return intent;
} | java | public static Intent newTakePictureIntent(File tempFile) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile));
return intent;
} | [
"public",
"static",
"Intent",
"newTakePictureIntent",
"(",
"File",
"tempFile",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"MediaStore",
".",
"ACTION_IMAGE_CAPTURE",
")",
";",
"intent",
".",
"putExtra",
"(",
"MediaStore",
".",
"EXTRA_OUTPUT",
",",
... | Creates an intent that will launch the camera to take a picture that's saved to a temporary file so you can use
it directly without going through the gallery.
@param tempFile the file that should be used to temporarily store the picture
@return the intent | [
"Creates",
"an",
"intent",
"that",
"will",
"launch",
"the",
"camera",
"to",
"take",
"a",
"picture",
"that",
"s",
"saved",
"to",
"a",
"temporary",
"file",
"so",
"you",
"can",
"use",
"it",
"directly",
"without",
"going",
"through",
"the",
"gallery",
"."
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/MediaIntents.java#L210-L214 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/MediaIntents.java | MediaIntents.newSelectPictureIntent | public static Intent newSelectPictureIntent() {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
return intent;
} | java | public static Intent newSelectPictureIntent() {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
return intent;
} | [
"public",
"static",
"Intent",
"newSelectPictureIntent",
"(",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_PICK",
")",
";",
"intent",
".",
"setType",
"(",
"\"image/*\"",
")",
";",
"return",
"intent",
";",
"}"
] | Creates an intent that will launch the phone's picture gallery to select a picture from it.
@return the intent | [
"Creates",
"an",
"intent",
"that",
"will",
"launch",
"the",
"phone",
"s",
"picture",
"gallery",
"to",
"select",
"a",
"picture",
"from",
"it",
"."
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/MediaIntents.java#L234-L238 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/ShareIntents.java | ShareIntents.newShareTextIntent | public static Intent newShareTextIntent(String subject, String message, String chooserDialogTitle) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, message);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
shareIntent.setType(MIME_TYPE_T... | java | public static Intent newShareTextIntent(String subject, String message, String chooserDialogTitle) {
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, message);
shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
shareIntent.setType(MIME_TYPE_T... | [
"public",
"static",
"Intent",
"newShareTextIntent",
"(",
"String",
"subject",
",",
"String",
"message",
",",
"String",
"chooserDialogTitle",
")",
"{",
"Intent",
"shareIntent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_SEND",
")",
";",
"shareIntent",
".",... | Creates a chooser to share some data.
@param subject The subject to share (might be discarded, for instance if the user picks an SMS app)
@param message The message to share
@param chooserDialogTitle The title for the chooser dialog
@return the intent | [
"Creates",
"a",
"chooser",
"to",
"share",
"some",
"data",
"."
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/ShareIntents.java#L36-L42 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/PhoneIntents.java | PhoneIntents.newSmsIntent | public static Intent newSmsIntent(Context context, String body, String[] phoneNumbers) {
Uri smsUri;
if (phoneNumbers == null || phoneNumbers.length==0) {
smsUri = Uri.parse("smsto:");
} else {
smsUri = Uri.parse("smsto:" + Uri.encode(TextUtils.join(",", phoneNumbers)));
... | java | public static Intent newSmsIntent(Context context, String body, String[] phoneNumbers) {
Uri smsUri;
if (phoneNumbers == null || phoneNumbers.length==0) {
smsUri = Uri.parse("smsto:");
} else {
smsUri = Uri.parse("smsto:" + Uri.encode(TextUtils.join(",", phoneNumbers)));
... | [
"public",
"static",
"Intent",
"newSmsIntent",
"(",
"Context",
"context",
",",
"String",
"body",
",",
"String",
"[",
"]",
"phoneNumbers",
")",
"{",
"Uri",
"smsUri",
";",
"if",
"(",
"phoneNumbers",
"==",
"null",
"||",
"phoneNumbers",
".",
"length",
"==",
"0"... | Creates an intent that will allow to send an SMS to a phone number
@param body The text to send
@param phoneNumbers The phone numbers to send the SMS to (or null if you don't want to specify it)
@return the intent | [
"Creates",
"an",
"intent",
"that",
"will",
"allow",
"to",
"send",
"an",
"SMS",
"to",
"a",
"phone",
"number"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/PhoneIntents.java#L94-L115 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/SystemIntents.java | SystemIntents.newMarketForAppIntent | public static Intent newMarketForAppIntent(Context context) {
String packageName = context.getApplicationContext().getPackageName();
return newMarketForAppIntent(context, packageName);
} | java | public static Intent newMarketForAppIntent(Context context) {
String packageName = context.getApplicationContext().getPackageName();
return newMarketForAppIntent(context, packageName);
} | [
"public",
"static",
"Intent",
"newMarketForAppIntent",
"(",
"Context",
"context",
")",
"{",
"String",
"packageName",
"=",
"context",
".",
"getApplicationContext",
"(",
")",
".",
"getPackageName",
"(",
")",
";",
"return",
"newMarketForAppIntent",
"(",
"context",
",... | Intent that should open the app store of the device on the current application page
@param context The context associated to the application
@return the intent | [
"Intent",
"that",
"should",
"open",
"the",
"app",
"store",
"of",
"the",
"device",
"on",
"the",
"current",
"application",
"page"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/SystemIntents.java#L33-L36 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/SystemIntents.java | SystemIntents.newMarketForAppIntent | public static Intent newMarketForAppIntent(Context context, String packageName) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
if (!IntentUtils.isIntentAvailable(context, intent)) {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("amzn:/... | java | public static Intent newMarketForAppIntent(Context context, String packageName) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
if (!IntentUtils.isIntentAvailable(context, intent)) {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("amzn:/... | [
"public",
"static",
"Intent",
"newMarketForAppIntent",
"(",
"Context",
"context",
",",
"String",
"packageName",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_VIEW",
",",
"Uri",
".",
"parse",
"(",
"\"market://details?id=\"",
"+",... | Intent that should open the app store of the device on the given application
@param context The context associated to the application
@param packageName The package name of the application to find on the market
@return the intent or null if no market is available for the intent | [
"Intent",
"that",
"should",
"open",
"the",
"app",
"store",
"of",
"the",
"device",
"on",
"the",
"given",
"application"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/SystemIntents.java#L45-L61 | train |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/SystemIntents.java | SystemIntents.newGooglePlayIntent | public static Intent newGooglePlayIntent(Context context, String packageName) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
if (!IntentUtils.isIntentAvailable(context, intent)) {
intent = MediaIntents.newOpenWebBrowserIntent("https://play... | java | public static Intent newGooglePlayIntent(Context context, String packageName) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
if (!IntentUtils.isIntentAvailable(context, intent)) {
intent = MediaIntents.newOpenWebBrowserIntent("https://play... | [
"public",
"static",
"Intent",
"newGooglePlayIntent",
"(",
"Context",
"context",
",",
"String",
"packageName",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_VIEW",
",",
"Uri",
".",
"parse",
"(",
"\"market://details?id=\"",
"+",
... | Intent that should open either the Google Play app or if not available, the web browser on the Google Play website
@param context The context associated to the application
@param packageName The package name of the application to find on the market
@return the intent for native application or an intent to redirect... | [
"Intent",
"that",
"should",
"open",
"either",
"the",
"Google",
"Play",
"app",
"or",
"if",
"not",
"available",
"the",
"web",
"browser",
"on",
"the",
"Google",
"Play",
"website"
] | 33e79c825188b6a97601869522533cc825801f6e | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/SystemIntents.java#L70-L83 | train |
pinball83/Masked-Edittext | masked-edittext/src/main/java/com/github/pinball83/maskededittext/MaskedEditText.java | MaskedEditText.getSymbolExceptions | private String getSymbolExceptions() {
if (TextUtils.isEmpty(filteredMask)) return "";
StringBuilder maskSymbolException = new StringBuilder();
for (char c : filteredMask.toCharArray()) {
if (!Character.isDigit(c) && maskSymbolException.indexOf(String.valueOf(c)) == -1) {
... | java | private String getSymbolExceptions() {
if (TextUtils.isEmpty(filteredMask)) return "";
StringBuilder maskSymbolException = new StringBuilder();
for (char c : filteredMask.toCharArray()) {
if (!Character.isDigit(c) && maskSymbolException.indexOf(String.valueOf(c)) == -1) {
... | [
"private",
"String",
"getSymbolExceptions",
"(",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"filteredMask",
")",
")",
"return",
"\"\"",
";",
"StringBuilder",
"maskSymbolException",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"char",
"... | Generate symbol exception for inputType = number | [
"Generate",
"symbol",
"exception",
"for",
"inputType",
"=",
"number"
] | d5d69ed62016567f99ccdd5540ce6dfd9497ffb9 | https://github.com/pinball83/Masked-Edittext/blob/d5d69ed62016567f99ccdd5540ce6dfd9497ffb9/masked-edittext/src/main/java/com/github/pinball83/maskededittext/MaskedEditText.java#L187-L198 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/utils/Bag.java | Bag.remove | public E remove (int index) {
E e = data[index]; // make copy of element to remove so it can be returned
data[index] = data[--size]; // overwrite item to remove with last element
data[size] = null; // null last element, so gc can do its work
return e;
} | java | public E remove (int index) {
E e = data[index]; // make copy of element to remove so it can be returned
data[index] = data[--size]; // overwrite item to remove with last element
data[size] = null; // null last element, so gc can do its work
return e;
} | [
"public",
"E",
"remove",
"(",
"int",
"index",
")",
"{",
"E",
"e",
"=",
"data",
"[",
"index",
"]",
";",
"// make copy of element to remove so it can be returned",
"data",
"[",
"index",
"]",
"=",
"data",
"[",
"--",
"size",
"]",
";",
"// overwrite item to remove ... | Removes the element at the specified position in this Bag. Order of elements is not preserved.
@param index
@return element that was removed from the Bag. | [
"Removes",
"the",
"element",
"at",
"the",
"specified",
"position",
"in",
"this",
"Bag",
".",
"Order",
"of",
"elements",
"is",
"not",
"preserved",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/utils/Bag.java#L48-L53 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/utils/Bag.java | Bag.removeLast | public E removeLast () {
if (size > 0) {
E e = data[--size];
data[size] = null;
return e;
}
return null;
} | java | public E removeLast () {
if (size > 0) {
E e = data[--size];
data[size] = null;
return e;
}
return null;
} | [
"public",
"E",
"removeLast",
"(",
")",
"{",
"if",
"(",
"size",
">",
"0",
")",
"{",
"E",
"e",
"=",
"data",
"[",
"--",
"size",
"]",
";",
"data",
"[",
"size",
"]",
"=",
"null",
";",
"return",
"e",
";",
"}",
"return",
"null",
";",
"}"
] | Removes and return the last object in the bag.
@return the last object in the bag, null if empty. | [
"Removes",
"and",
"return",
"the",
"last",
"object",
"in",
"the",
"bag",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/utils/Bag.java#L59-L67 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/utils/Bag.java | Bag.remove | public boolean remove (E e) {
for (int i = 0; i < size; i++) {
E e2 = data[i];
if (e == e2) {
data[i] = data[--size]; // overwrite item to remove with last element
data[size] = null; // null last element, so gc can do its work
return true;
}
}
return false;
} | java | public boolean remove (E e) {
for (int i = 0; i < size; i++) {
E e2 = data[i];
if (e == e2) {
data[i] = data[--size]; // overwrite item to remove with last element
data[size] = null; // null last element, so gc can do its work
return true;
}
}
return false;
} | [
"public",
"boolean",
"remove",
"(",
"E",
"e",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"E",
"e2",
"=",
"data",
"[",
"i",
"]",
";",
"if",
"(",
"e",
"==",
"e2",
")",
"{",
"data",
"[",
"i... | Removes the first occurrence of the specified element from this Bag, if it is present. If the Bag does not contain the
element, it is unchanged. It does not preserve order of elements.
@param e
@return true if the element was removed. | [
"Removes",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"element",
"from",
"this",
"Bag",
"if",
"it",
"is",
"present",
".",
"If",
"the",
"Bag",
"does",
"not",
"contain",
"the",
"element",
"it",
"is",
"unchanged",
".",
"It",
"does",
"not",
"pre... | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/utils/Bag.java#L75-L87 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/utils/Bag.java | Bag.contains | public boolean contains (E e) {
for (int i = 0; size > i; i++) {
if (e == data[i]) {
return true;
}
}
return false;
} | java | public boolean contains (E e) {
for (int i = 0; size > i; i++) {
if (e == data[i]) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"contains",
"(",
"E",
"e",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"size",
">",
"i",
";",
"i",
"++",
")",
"{",
"if",
"(",
"e",
"==",
"data",
"[",
"i",
"]",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
... | Check if bag contains this element. The operator == is used to check for equality. | [
"Check",
"if",
"bag",
"contains",
"this",
"element",
".",
"The",
"operator",
"==",
"is",
"used",
"to",
"check",
"for",
"equality",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/utils/Bag.java#L92-L99 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/utils/Bag.java | Bag.add | public void add (E e) {
// is size greater than capacity increase capacity
if (size == data.length) {
grow();
}
data[size++] = e;
} | java | public void add (E e) {
// is size greater than capacity increase capacity
if (size == data.length) {
grow();
}
data[size++] = e;
} | [
"public",
"void",
"add",
"(",
"E",
"e",
")",
"{",
"// is size greater than capacity increase capacity",
"if",
"(",
"size",
"==",
"data",
".",
"length",
")",
"{",
"grow",
"(",
")",
";",
"}",
"data",
"[",
"size",
"++",
"]",
"=",
"e",
";",
"}"
] | Adds the specified element to the end of this bag. if needed also increases the capacity of the bag. | [
"Adds",
"the",
"specified",
"element",
"to",
"the",
"end",
"of",
"this",
"bag",
".",
"if",
"needed",
"also",
"increases",
"the",
"capacity",
"of",
"the",
"bag",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/utils/Bag.java#L140-L147 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/utils/Bag.java | Bag.set | public void set (int index, E e) {
if (index >= data.length) {
grow(index * 2);
}
size = index + 1;
data[index] = e;
} | java | public void set (int index, E e) {
if (index >= data.length) {
grow(index * 2);
}
size = index + 1;
data[index] = e;
} | [
"public",
"void",
"set",
"(",
"int",
"index",
",",
"E",
"e",
")",
"{",
"if",
"(",
"index",
">=",
"data",
".",
"length",
")",
"{",
"grow",
"(",
"index",
"*",
"2",
")",
";",
"}",
"size",
"=",
"index",
"+",
"1",
";",
"data",
"[",
"index",
"]",
... | Set element at specified index in the bag. | [
"Set",
"element",
"at",
"specified",
"index",
"in",
"the",
"bag",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/utils/Bag.java#L152-L158 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/core/Engine.java | Engine.addEntity | public void addEntity(Entity entity){
boolean delayed = updating || familyManager.notifying();
entityManager.addEntity(entity, delayed);
} | java | public void addEntity(Entity entity){
boolean delayed = updating || familyManager.notifying();
entityManager.addEntity(entity, delayed);
} | [
"public",
"void",
"addEntity",
"(",
"Entity",
"entity",
")",
"{",
"boolean",
"delayed",
"=",
"updating",
"||",
"familyManager",
".",
"notifying",
"(",
")",
";",
"entityManager",
".",
"addEntity",
"(",
"entity",
",",
"delayed",
")",
";",
"}"
] | Adds an entity to this Engine.
This will throw an IllegalArgumentException if the given entity
was already registered with an engine. | [
"Adds",
"an",
"entity",
"to",
"this",
"Engine",
".",
"This",
"will",
"throw",
"an",
"IllegalArgumentException",
"if",
"the",
"given",
"entity",
"was",
"already",
"registered",
"with",
"an",
"engine",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/core/Engine.java#L80-L83 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/core/Engine.java | Engine.removeEntity | public void removeEntity(Entity entity){
boolean delayed = updating || familyManager.notifying();
entityManager.removeEntity(entity, delayed);
} | java | public void removeEntity(Entity entity){
boolean delayed = updating || familyManager.notifying();
entityManager.removeEntity(entity, delayed);
} | [
"public",
"void",
"removeEntity",
"(",
"Entity",
"entity",
")",
"{",
"boolean",
"delayed",
"=",
"updating",
"||",
"familyManager",
".",
"notifying",
"(",
")",
";",
"entityManager",
".",
"removeEntity",
"(",
"entity",
",",
"delayed",
")",
";",
"}"
] | Removes an entity from this Engine. | [
"Removes",
"an",
"entity",
"from",
"this",
"Engine",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/core/Engine.java#L88-L91 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/core/Engine.java | Engine.update | public void update(float deltaTime){
if (updating) {
throw new IllegalStateException("Cannot call update() on an Engine that is already updating.");
}
updating = true;
ImmutableArray<EntitySystem> systems = systemManager.getSystems();
try {
for (int i = 0; i < systems.size(); ++i) {
EntitySystem ... | java | public void update(float deltaTime){
if (updating) {
throw new IllegalStateException("Cannot call update() on an Engine that is already updating.");
}
updating = true;
ImmutableArray<EntitySystem> systems = systemManager.getSystems();
try {
for (int i = 0; i < systems.size(); ++i) {
EntitySystem ... | [
"public",
"void",
"update",
"(",
"float",
"deltaTime",
")",
"{",
"if",
"(",
"updating",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot call update() on an Engine that is already updating.\"",
")",
";",
"}",
"updating",
"=",
"true",
";",
"Immutable... | Updates all the systems in this Engine.
@param deltaTime The time passed since the last frame. | [
"Updates",
"all",
"the",
"systems",
"in",
"this",
"Engine",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/core/Engine.java#L228-L252 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/core/Entity.java | Entity.getComponent | @SuppressWarnings("unchecked")
<T extends Component> T getComponent (ComponentType componentType) {
int componentTypeIndex = componentType.getIndex();
if (componentTypeIndex < components.getCapacity()) {
return (T)components.get(componentType.getIndex());
} else {
return null;
}
} | java | @SuppressWarnings("unchecked")
<T extends Component> T getComponent (ComponentType componentType) {
int componentTypeIndex = componentType.getIndex();
if (componentTypeIndex < components.getCapacity()) {
return (T)components.get(componentType.getIndex());
} else {
return null;
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"<",
"T",
"extends",
"Component",
">",
"T",
"getComponent",
"(",
"ComponentType",
"componentType",
")",
"{",
"int",
"componentTypeIndex",
"=",
"componentType",
".",
"getIndex",
"(",
")",
";",
"if",
"(",
"comp... | Internal use.
@return The {@link Component} object for the specified class, null if the Entity does not have any components for that class. | [
"Internal",
"use",
"."
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/core/Entity.java#L141-L150 | train |
libgdx/ashley | ashley/src/com/badlogic/ashley/signals/Signal.java | Signal.dispatch | public void dispatch (T object) {
final Object[] items = listeners.begin();
for (int i = 0, n = listeners.size; i < n; i++) {
Listener<T> listener = (Listener<T>)items[i];
listener.receive(this, object);
}
listeners.end();
} | java | public void dispatch (T object) {
final Object[] items = listeners.begin();
for (int i = 0, n = listeners.size; i < n; i++) {
Listener<T> listener = (Listener<T>)items[i];
listener.receive(this, object);
}
listeners.end();
} | [
"public",
"void",
"dispatch",
"(",
"T",
"object",
")",
"{",
"final",
"Object",
"[",
"]",
"items",
"=",
"listeners",
".",
"begin",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"listeners",
".",
"size",
";",
"i",
"<",
"n",
";",... | Dispatches an event to all Listeners registered to this Signal
@param object The object to send off | [
"Dispatches",
"an",
"event",
"to",
"all",
"Listeners",
"registered",
"to",
"this",
"Signal"
] | d53addc965d8a298336636943a157c04d12d583c | https://github.com/libgdx/ashley/blob/d53addc965d8a298336636943a157c04d12d583c/ashley/src/com/badlogic/ashley/signals/Signal.java#L58-L65 | train |
phxql/argon2-jvm | src/main/java/de/mkammerer/argon2/Argon2Helper.java | Argon2Helper.warmup | private static void warmup(Argon2 argon2, char[] password) {
for (int i = 0; i < WARMUP_RUNS; i++) {
argon2.hash(MIN_ITERATIONS, MIN_MEMORY, MIN_PARALLELISM, password);
}
} | java | private static void warmup(Argon2 argon2, char[] password) {
for (int i = 0; i < WARMUP_RUNS; i++) {
argon2.hash(MIN_ITERATIONS, MIN_MEMORY, MIN_PARALLELISM, password);
}
} | [
"private",
"static",
"void",
"warmup",
"(",
"Argon2",
"argon2",
",",
"char",
"[",
"]",
"password",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"WARMUP_RUNS",
";",
"i",
"++",
")",
"{",
"argon2",
".",
"hash",
"(",
"MIN_ITERATIONS",
","... | Calls Argon2 a number of times to warm up the JIT
@param argon2 Argon2 instance.
@param password Some password. | [
"Calls",
"Argon2",
"a",
"number",
"of",
"times",
"to",
"warm",
"up",
"the",
"JIT"
] | 27a13907729e67e98cca53eba279e109b60f04f1 | https://github.com/phxql/argon2-jvm/blob/27a13907729e67e98cca53eba279e109b60f04f1/src/main/java/de/mkammerer/argon2/Argon2Helper.java#L83-L87 | train |
phxql/argon2-jvm | src/main/java/de/mkammerer/argon2/BaseArgon2.java | BaseArgon2.toByteArray | private byte[] toByteArray(char[] chars, Charset charset) {
assert chars != null;
CharBuffer charBuffer = CharBuffer.wrap(chars);
ByteBuffer byteBuffer = charset.encode(charBuffer);
byte[] bytes = Arrays.copyOfRange(byteBuffer.array(),
byteBuffer.position(), byteBuffer.l... | java | private byte[] toByteArray(char[] chars, Charset charset) {
assert chars != null;
CharBuffer charBuffer = CharBuffer.wrap(chars);
ByteBuffer byteBuffer = charset.encode(charBuffer);
byte[] bytes = Arrays.copyOfRange(byteBuffer.array(),
byteBuffer.position(), byteBuffer.l... | [
"private",
"byte",
"[",
"]",
"toByteArray",
"(",
"char",
"[",
"]",
"chars",
",",
"Charset",
"charset",
")",
"{",
"assert",
"chars",
"!=",
"null",
";",
"CharBuffer",
"charBuffer",
"=",
"CharBuffer",
".",
"wrap",
"(",
"chars",
")",
";",
"ByteBuffer",
"byte... | Converts the given char array to a UTF-8 encoded byte array.
@param chars the char array to convert
@param charset Charset of the password
@return UTF-8 encoded byte array | [
"Converts",
"the",
"given",
"char",
"array",
"to",
"a",
"UTF",
"-",
"8",
"encoded",
"byte",
"array",
"."
] | 27a13907729e67e98cca53eba279e109b60f04f1 | https://github.com/phxql/argon2-jvm/blob/27a13907729e67e98cca53eba279e109b60f04f1/src/main/java/de/mkammerer/argon2/BaseArgon2.java#L284-L293 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/OsmConnection.java | OsmConnection.makeRequest | public <T> T makeRequest(String call, String method, boolean authenticate,
ApiRequestWriter writer, ApiResponseReader<T> reader)
{
HttpURLConnection connection = null;
try
{
connection = sendRequest(call, method, authenticate, writer);
handleResponseCode(connection);
if(reader != null) return ... | java | public <T> T makeRequest(String call, String method, boolean authenticate,
ApiRequestWriter writer, ApiResponseReader<T> reader)
{
HttpURLConnection connection = null;
try
{
connection = sendRequest(call, method, authenticate, writer);
handleResponseCode(connection);
if(reader != null) return ... | [
"public",
"<",
"T",
">",
"T",
"makeRequest",
"(",
"String",
"call",
",",
"String",
"method",
",",
"boolean",
"authenticate",
",",
"ApiRequestWriter",
"writer",
",",
"ApiResponseReader",
"<",
"T",
">",
"reader",
")",
"{",
"HttpURLConnection",
"connection",
"=",... | Make a request to the Http Osm Api
@param call HTTP path and URL parameters (if any)
@param method HTTP method. Defaults to "GET"
@param authenticate whether to make this request as a logged in user
@param writer the writer to send the request payload to the server. If null, no payload is
sent
@param reader the reader... | [
"Make",
"a",
"request",
"to",
"the",
"Http",
"Osm",
"Api"
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/OsmConnection.java#L188-L214 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java | ChangesetsDao.get | public ChangesetInfo get(long id)
{
SingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();
String query = CHANGESET + "/" + id + "?include_discussion=true";
try
{
osm.makeAuthenticatedRequest(query, null, new ChangesetParser(handler));
}
catch(OsmNotFoundException e)
{
... | java | public ChangesetInfo get(long id)
{
SingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();
String query = CHANGESET + "/" + id + "?include_discussion=true";
try
{
osm.makeAuthenticatedRequest(query, null, new ChangesetParser(handler));
}
catch(OsmNotFoundException e)
{
... | [
"public",
"ChangesetInfo",
"get",
"(",
"long",
"id",
")",
"{",
"SingleElementHandler",
"<",
"ChangesetInfo",
">",
"handler",
"=",
"new",
"SingleElementHandler",
"<>",
"(",
")",
";",
"String",
"query",
"=",
"CHANGESET",
"+",
"\"/\"",
"+",
"id",
"+",
"\"?inclu... | Get the changeset information with the given id. Always includes the changeset discussion.
@param id changeset id
@throws OsmAuthorizationException if not logged in
@return info for the given changeset. Null if it does not exist. | [
"Get",
"the",
"changeset",
"information",
"with",
"the",
"given",
"id",
".",
"Always",
"includes",
"the",
"changeset",
"discussion",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java#L35-L48 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java | ChangesetsDao.find | public void find(Handler<ChangesetInfo> handler, QueryChangesetsFilters filters)
{
String query = filters != null ? "?" + filters.toParamString() : "";
try
{
osm.makeAuthenticatedRequest(CHANGESET + "s" + query, null, new ChangesetParser(handler));
}
catch(OsmNotFoundException e)
{
// ok, we... | java | public void find(Handler<ChangesetInfo> handler, QueryChangesetsFilters filters)
{
String query = filters != null ? "?" + filters.toParamString() : "";
try
{
osm.makeAuthenticatedRequest(CHANGESET + "s" + query, null, new ChangesetParser(handler));
}
catch(OsmNotFoundException e)
{
// ok, we... | [
"public",
"void",
"find",
"(",
"Handler",
"<",
"ChangesetInfo",
">",
"handler",
",",
"QueryChangesetsFilters",
"filters",
")",
"{",
"String",
"query",
"=",
"filters",
"!=",
"null",
"?",
"\"?\"",
"+",
"filters",
".",
"toParamString",
"(",
")",
":",
"\"\"",
... | Get a number of changesets that match the given filters.
@param handler The handler which is fed the incoming changeset infos
@param filters what to search for. I.e.
new QueryChangesetsFilters().byUser(123).onlyClosed()
@throws OsmAuthorizationException if not logged in | [
"Get",
"a",
"number",
"of",
"changesets",
"that",
"match",
"the",
"given",
"filters",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java#L57-L68 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java | ChangesetsDao.comment | public ChangesetInfo comment(long id, String text)
{
if(text.isEmpty())
{
throw new IllegalArgumentException("Text must not be empty");
}
SingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();
String apiCall = CHANGESET + "/" + id + "/comment?text=" + urlEncodeText(text);
... | java | public ChangesetInfo comment(long id, String text)
{
if(text.isEmpty())
{
throw new IllegalArgumentException("Text must not be empty");
}
SingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();
String apiCall = CHANGESET + "/" + id + "/comment?text=" + urlEncodeText(text);
... | [
"public",
"ChangesetInfo",
"comment",
"(",
"long",
"id",
",",
"String",
"text",
")",
"{",
"if",
"(",
"text",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Text must not be empty\"",
")",
";",
"}",
"SingleElementHandler... | Add a comment to the given changeset. The changeset must already be closed. Adding a comment
to a changeset automatically subscribes the user to it.
TODO monitor https://github.com/openstreetmap/openstreetmap-website/issues/1165
@param id id of the changeset
@param text text to add to the changeset. Must not be empty... | [
"Add",
"a",
"comment",
"to",
"the",
"given",
"changeset",
".",
"The",
"changeset",
"must",
"already",
"be",
"closed",
".",
"Adding",
"a",
"comment",
"to",
"a",
"changeset",
"automatically",
"subscribes",
"the",
"user",
"to",
"it",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java#L86-L98 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java | ChangesetsDao.subscribe | public ChangesetInfo subscribe(long id)
{
SingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();
ChangesetInfo result;
try
{
String apiCall = CHANGESET + "/" + id + "/subscribe";
osm.makeAuthenticatedRequest(apiCall, "POST", new ChangesetParser(handler));
result = handler.... | java | public ChangesetInfo subscribe(long id)
{
SingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();
ChangesetInfo result;
try
{
String apiCall = CHANGESET + "/" + id + "/subscribe";
osm.makeAuthenticatedRequest(apiCall, "POST", new ChangesetParser(handler));
result = handler.... | [
"public",
"ChangesetInfo",
"subscribe",
"(",
"long",
"id",
")",
"{",
"SingleElementHandler",
"<",
"ChangesetInfo",
">",
"handler",
"=",
"new",
"SingleElementHandler",
"<>",
"(",
")",
";",
"ChangesetInfo",
"result",
";",
"try",
"{",
"String",
"apiCall",
"=",
"C... | Subscribe the user to a changeset discussion. The changeset must be closed already.
@param id id of the changeset
@return the changeset
@throws OsmAuthorizationException if this application is not authorized to modify the map
(Permission.MODIFY_MAP)
@throws OsmNotFoundException if the given changeset does not exist | [
"Subscribe",
"the",
"user",
"to",
"a",
"changeset",
"discussion",
".",
"The",
"changeset",
"must",
"be",
"closed",
"already",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java#L122-L138 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java | ChangesetsDao.unsubscribe | public ChangesetInfo unsubscribe(long id)
{
SingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();
ChangesetInfo result;
try
{
String apiCall = CHANGESET + "/" + id + "/unsubscribe";
osm.makeAuthenticatedRequest(apiCall, "POST", new ChangesetParser(handler));
result = ha... | java | public ChangesetInfo unsubscribe(long id)
{
SingleElementHandler<ChangesetInfo> handler = new SingleElementHandler<>();
ChangesetInfo result;
try
{
String apiCall = CHANGESET + "/" + id + "/unsubscribe";
osm.makeAuthenticatedRequest(apiCall, "POST", new ChangesetParser(handler));
result = ha... | [
"public",
"ChangesetInfo",
"unsubscribe",
"(",
"long",
"id",
")",
"{",
"SingleElementHandler",
"<",
"ChangesetInfo",
">",
"handler",
"=",
"new",
"SingleElementHandler",
"<>",
"(",
")",
";",
"ChangesetInfo",
"result",
";",
"try",
"{",
"String",
"apiCall",
"=",
... | Unsubscribe the user from a changeset discussion. The changeset must be closed already.
@param id id of the changeset
@return the changeset
@throws OsmAuthorizationException if this application is not authorized to modify the map
(Permission.MODIFY_MAP)
@throws OsmNotFoundException if the given changeset does not exi... | [
"Unsubscribe",
"the",
"user",
"from",
"a",
"changeset",
"discussion",
".",
"The",
"changeset",
"must",
"be",
"closed",
"already",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java#L151-L175 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java | ChangesetsDao.getData | public void getData(long id, MapDataChangesHandler handler, MapDataFactory factory)
{
osm.makeAuthenticatedRequest(CHANGESET + "/" + id + "/download", null,
new MapDataChangesParser(handler, factory));
} | java | public void getData(long id, MapDataChangesHandler handler, MapDataFactory factory)
{
osm.makeAuthenticatedRequest(CHANGESET + "/" + id + "/download", null,
new MapDataChangesParser(handler, factory));
} | [
"public",
"void",
"getData",
"(",
"long",
"id",
",",
"MapDataChangesHandler",
"handler",
",",
"MapDataFactory",
"factory",
")",
"{",
"osm",
".",
"makeAuthenticatedRequest",
"(",
"CHANGESET",
"+",
"\"/\"",
"+",
"id",
"+",
"\"/download\"",
",",
"null",
",",
"new... | Get map data changes associated with the given changeset.
@throws OsmAuthorizationException if not logged in
@throws OsmNotFoundException if changeset with the given id does not exist | [
"Get",
"map",
"data",
"changes",
"associated",
"with",
"the",
"given",
"changeset",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/ChangesetsDao.java#L193-L197 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java | GpsTracesDao.create | public long create(
final String name, final GpsTraceDetails.Visibility visibility,
final String description, final List<String> tags,
final Iterable<GpsTrackpoint> trackpoints)
{
checkFieldLength("Name", name);
checkFieldLength("Description", description);
checkTagsLength(tags);
/*
* ... | java | public long create(
final String name, final GpsTraceDetails.Visibility visibility,
final String description, final List<String> tags,
final Iterable<GpsTrackpoint> trackpoints)
{
checkFieldLength("Name", name);
checkFieldLength("Description", description);
checkTagsLength(tags);
/*
* ... | [
"public",
"long",
"create",
"(",
"final",
"String",
"name",
",",
"final",
"GpsTraceDetails",
".",
"Visibility",
"visibility",
",",
"final",
"String",
"description",
",",
"final",
"List",
"<",
"String",
">",
"tags",
",",
"final",
"Iterable",
"<",
"GpsTrackpoint... | Upload a new trace of trackpoints.
@param name this is usually the "file name" of the GPX trace (when files are involved)
@param description short description of the trace. May not be null or empty.
@param tags keywords with which this trace can be found. May be null.
@return trace id
@throws IllegalArgumentException... | [
"Upload",
"a",
"new",
"trace",
"of",
"trackpoints",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java#L45-L79 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java | GpsTracesDao.create | public long create(String name, GpsTraceDetails.Visibility visibility, String description,
final Iterable<GpsTrackpoint> trackpoints)
{
return create(name, visibility, description, null, trackpoints);
} | java | public long create(String name, GpsTraceDetails.Visibility visibility, String description,
final Iterable<GpsTrackpoint> trackpoints)
{
return create(name, visibility, description, null, trackpoints);
} | [
"public",
"long",
"create",
"(",
"String",
"name",
",",
"GpsTraceDetails",
".",
"Visibility",
"visibility",
",",
"String",
"description",
",",
"final",
"Iterable",
"<",
"GpsTrackpoint",
">",
"trackpoints",
")",
"{",
"return",
"create",
"(",
"name",
",",
"visib... | Upload a new trace with no tags
@see #create(String, GpsTraceDetails.Visibility, String, List, Iterable) | [
"Upload",
"a",
"new",
"trace",
"with",
"no",
"tags"
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java#L84-L88 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java | GpsTracesDao.update | public void update(
long id, GpsTraceDetails.Visibility visibility, String description, List<String> tags)
{
checkFieldLength("Description", description);
checkTagsLength(tags);
GpsTraceWriter writer = new GpsTraceWriter(id, visibility, description, tags);
osm.makeAuthenticatedRequest(GPX + "/... | java | public void update(
long id, GpsTraceDetails.Visibility visibility, String description, List<String> tags)
{
checkFieldLength("Description", description);
checkTagsLength(tags);
GpsTraceWriter writer = new GpsTraceWriter(id, visibility, description, tags);
osm.makeAuthenticatedRequest(GPX + "/... | [
"public",
"void",
"update",
"(",
"long",
"id",
",",
"GpsTraceDetails",
".",
"Visibility",
"visibility",
",",
"String",
"description",
",",
"List",
"<",
"String",
">",
"tags",
")",
"{",
"checkFieldLength",
"(",
"\"Description\"",
",",
"description",
")",
";",
... | Change the visibility, description and tags of a GPS trace. description and tags may be null
if there should be none.
@throws OsmNotFoundException if the trace with the given id does not exist
@throws OsmAuthorizationException if this application is not authorized to write traces
(Permission.WRITE_GPS_TRACES)
OR if th... | [
"Change",
"the",
"visibility",
"description",
"and",
"tags",
"of",
"a",
"GPS",
"trace",
".",
"description",
"and",
"tags",
"may",
"be",
"null",
"if",
"there",
"should",
"be",
"none",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java#L131-L140 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java | GpsTracesDao.get | public GpsTraceDetails get(long id)
{
SingleElementHandler<GpsTraceDetails> handler = new SingleElementHandler<>();
try
{
osm.makeAuthenticatedRequest(GPX + "/" + id, "GET", new GpsTracesParser(handler) );
}
catch(OsmNotFoundException e)
{
return null;
}
return handler.get();
} | java | public GpsTraceDetails get(long id)
{
SingleElementHandler<GpsTraceDetails> handler = new SingleElementHandler<>();
try
{
osm.makeAuthenticatedRequest(GPX + "/" + id, "GET", new GpsTracesParser(handler) );
}
catch(OsmNotFoundException e)
{
return null;
}
return handler.get();
} | [
"public",
"GpsTraceDetails",
"get",
"(",
"long",
"id",
")",
"{",
"SingleElementHandler",
"<",
"GpsTraceDetails",
">",
"handler",
"=",
"new",
"SingleElementHandler",
"<>",
"(",
")",
";",
"try",
"{",
"osm",
".",
"makeAuthenticatedRequest",
"(",
"GPX",
"+",
"\"/\... | Get information about a given GPS trace or null if it does not exist.
@throws OsmAuthorizationException if this application is not authorized to read the user's
traces (Permission.READ_GPS_TRACES)
OR if the trace in question is not the user's own trace
and at the same time it is not public
OR if not logged in at all | [
"Get",
"information",
"about",
"a",
"given",
"GPS",
"trace",
"or",
"null",
"if",
"it",
"does",
"not",
"exist",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java#L163-L175 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java | GpsTracesDao.getData | public void getData(long id, Handler<GpsTrackpoint> handler)
{
osm.makeAuthenticatedRequest(GPX + "/" + id + "/data", "GET", new GpxTrackParser(handler));
} | java | public void getData(long id, Handler<GpsTrackpoint> handler)
{
osm.makeAuthenticatedRequest(GPX + "/" + id + "/data", "GET", new GpxTrackParser(handler));
} | [
"public",
"void",
"getData",
"(",
"long",
"id",
",",
"Handler",
"<",
"GpsTrackpoint",
">",
"handler",
")",
"{",
"osm",
".",
"makeAuthenticatedRequest",
"(",
"GPX",
"+",
"\"/\"",
"+",
"id",
"+",
"\"/data\"",
",",
"\"GET\"",
",",
"new",
"GpxTrackParser",
"("... | Get all trackpoints contained in the given trace id. Note that the trace is a GPX file, so
there is potentially much more information in there than simply the trackpoints. However,
this method only parses the trackpoints and ignores everything else.
@throws OsmNotFoundException if the trace with the given id does not ... | [
"Get",
"all",
"trackpoints",
"contained",
"in",
"the",
"given",
"trace",
"id",
".",
"Note",
"that",
"the",
"trace",
"is",
"a",
"GPX",
"file",
"so",
"there",
"is",
"potentially",
"much",
"more",
"information",
"in",
"there",
"than",
"simply",
"the",
"trackp... | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java#L189-L192 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/notes/NotesDao.java | NotesDao.create | public Note create(LatLon pos, String text)
{
if(text.isEmpty())
{
throw new IllegalArgumentException("Text may not be empty");
}
String data =
"lat=" + numberFormat.format(pos.getLatitude()) +
"&lon=" + numberFormat.format(pos.getLongitude()) +
"&text=" + urlEncode(text);
String call = NOTES... | java | public Note create(LatLon pos, String text)
{
if(text.isEmpty())
{
throw new IllegalArgumentException("Text may not be empty");
}
String data =
"lat=" + numberFormat.format(pos.getLatitude()) +
"&lon=" + numberFormat.format(pos.getLongitude()) +
"&text=" + urlEncode(text);
String call = NOTES... | [
"public",
"Note",
"create",
"(",
"LatLon",
"pos",
",",
"String",
"text",
")",
"{",
"if",
"(",
"text",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Text may not be empty\"",
")",
";",
"}",
"String",
"data",
"=",
... | Create a new note at the given location
@param pos position of the note. Must not be null.
@param text text for the new note. Must not be empty nor null.
@throws OsmAuthorizationException if this application is not authorized to write notes
(Permission.WRITE_NOTES)
@return the new note | [
"Create",
"a",
"new",
"note",
"at",
"the",
"given",
"location"
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/notes/NotesDao.java#L48-L64 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/notes/NotesDao.java | NotesDao.reopen | public Note reopen(long id, String reason)
{
SingleElementHandler<Note> noteHandler = new SingleElementHandler<>();
makeSingleNoteRequest(id, "reopen", reason, new NotesParser(noteHandler));
return noteHandler.get();
} | java | public Note reopen(long id, String reason)
{
SingleElementHandler<Note> noteHandler = new SingleElementHandler<>();
makeSingleNoteRequest(id, "reopen", reason, new NotesParser(noteHandler));
return noteHandler.get();
} | [
"public",
"Note",
"reopen",
"(",
"long",
"id",
",",
"String",
"reason",
")",
"{",
"SingleElementHandler",
"<",
"Note",
">",
"noteHandler",
"=",
"new",
"SingleElementHandler",
"<>",
"(",
")",
";",
"makeSingleNoteRequest",
"(",
"id",
",",
"\"reopen\"",
",",
"r... | Reopen the given note with the given reason. The reason is optional.
@throws OsmConflictException if the note has already been reopened.
@throws OsmAuthorizationException if this application is not authorized to write notes
(Permission.WRITE_NOTES)
@throws OsmNotFoundException if the note with the given id does not ex... | [
"Reopen",
"the",
"given",
"note",
"with",
"the",
"given",
"reason",
".",
"The",
"reason",
"is",
"optional",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/notes/NotesDao.java#L109-L114 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/notes/NotesDao.java | NotesDao.getAll | public void getAll(BoundingBox bounds, Handler<Note> handler, int limit, int hideClosedNoteAfter)
{
getAll(bounds, null, handler, limit, hideClosedNoteAfter);
} | java | public void getAll(BoundingBox bounds, Handler<Note> handler, int limit, int hideClosedNoteAfter)
{
getAll(bounds, null, handler, limit, hideClosedNoteAfter);
} | [
"public",
"void",
"getAll",
"(",
"BoundingBox",
"bounds",
",",
"Handler",
"<",
"Note",
">",
"handler",
",",
"int",
"limit",
",",
"int",
"hideClosedNoteAfter",
")",
"{",
"getAll",
"(",
"bounds",
",",
"null",
",",
"handler",
",",
"limit",
",",
"hideClosedNot... | Retrieve all notes in the given area and feed them to the given handler.
@see #getAll(BoundingBox, String, Handler, int, int) | [
"Retrieve",
"all",
"notes",
"in",
"the",
"given",
"area",
"and",
"feed",
"them",
"to",
"the",
"given",
"handler",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/notes/NotesDao.java#L172-L175 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/notes/NotesDao.java | NotesDao.getAll | public void getAll(BoundingBox bounds, String search, Handler<Note> handler, int limit,
int hideClosedNoteAfter)
{
if(limit <= 0 || limit > 10000)
{
throw new IllegalArgumentException("limit must be within 1 and 10000");
}
if(bounds.crosses180thMeridian())
{
throw new IllegalArgumentException("... | java | public void getAll(BoundingBox bounds, String search, Handler<Note> handler, int limit,
int hideClosedNoteAfter)
{
if(limit <= 0 || limit > 10000)
{
throw new IllegalArgumentException("limit must be within 1 and 10000");
}
if(bounds.crosses180thMeridian())
{
throw new IllegalArgumentException("... | [
"public",
"void",
"getAll",
"(",
"BoundingBox",
"bounds",
",",
"String",
"search",
",",
"Handler",
"<",
"Note",
">",
"handler",
",",
"int",
"limit",
",",
"int",
"hideClosedNoteAfter",
")",
"{",
"if",
"(",
"limit",
"<=",
"0",
"||",
"limit",
">",
"10000",
... | Retrieve those notes in the given area that match the given search string
@param handler The handler which is fed the incoming notes
@param bounds the area within the notes should be queried. This is usually limited at 25
square degrees. Check the server capabilities.
@param search what to search for. Null to return e... | [
"Retrieve",
"those",
"notes",
"in",
"the",
"given",
"area",
"that",
"match",
"the",
"given",
"search",
"string"
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/notes/NotesDao.java#L193-L223 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/notes/NotesDao.java | NotesDao.find | public void find(Handler<Note> handler, QueryNotesFilters filters)
{
String query = filters != null ? "?" + filters.toParamString() : "";
osm.makeAuthenticatedRequest(NOTES+"/search"+query, null, new NotesParser(handler));
} | java | public void find(Handler<Note> handler, QueryNotesFilters filters)
{
String query = filters != null ? "?" + filters.toParamString() : "";
osm.makeAuthenticatedRequest(NOTES+"/search"+query, null, new NotesParser(handler));
} | [
"public",
"void",
"find",
"(",
"Handler",
"<",
"Note",
">",
"handler",
",",
"QueryNotesFilters",
"filters",
")",
"{",
"String",
"query",
"=",
"filters",
"!=",
"null",
"?",
"\"?\"",
"+",
"filters",
".",
"toParamString",
"(",
")",
":",
"\"\"",
";",
"osm",
... | Get a number of notes that match the given filters.
@param handler The handler which is fed the incoming notes
@param filters what to search for. I.e.
new QueryNotesFilters().byUser(123).limit(1000)
@throws OsmAuthorizationException if not logged in | [
"Get",
"a",
"number",
"of",
"notes",
"that",
"match",
"the",
"given",
"filters",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/notes/NotesDao.java#L234-L238 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/map/MapDataDao.java | MapDataDao.updateMap | public long updateMap(Map<String, String> tags, Iterable<Element> elements,
Handler<DiffElement> handler)
{
tags.put("created_by", osm.getUserAgent());
long changesetId = openChangeset(tags);
/* the try-finally is not really necessary because the server closes an open changeset after
24 hours autom... | java | public long updateMap(Map<String, String> tags, Iterable<Element> elements,
Handler<DiffElement> handler)
{
tags.put("created_by", osm.getUserAgent());
long changesetId = openChangeset(tags);
/* the try-finally is not really necessary because the server closes an open changeset after
24 hours autom... | [
"public",
"long",
"updateMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
",",
"Iterable",
"<",
"Element",
">",
"elements",
",",
"Handler",
"<",
"DiffElement",
">",
"handler",
")",
"{",
"tags",
".",
"put",
"(",
"\"created_by\"",
",",
"osm",
... | Opens a changeset, uploads the data, closes the changeset and subscribes the user to it.
@param tags tags of this changeset. Usually it is comment and source.
See {@link #updateMap(String, String, Iterable, Handler)}
@param elements elements to upload. No special order required
@param handler handler that processes th... | [
"Opens",
"a",
"changeset",
"uploads",
"the",
"data",
"closes",
"the",
"changeset",
"and",
"subscribes",
"the",
"user",
"to",
"it",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/map/MapDataDao.java#L78-L97 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/map/MapDataDao.java | MapDataDao.uploadChanges | public void uploadChanges(long changesetId, Iterable<Element> elements, Handler<DiffElement> handler)
{
MapDataDiffParser parser = null;
if(handler != null)
{
parser = new MapDataDiffParser(handler);
}
osm.makeAuthenticatedRequest(
"changeset/" + changesetId + "/upload", "POST",
new MapDataChange... | java | public void uploadChanges(long changesetId, Iterable<Element> elements, Handler<DiffElement> handler)
{
MapDataDiffParser parser = null;
if(handler != null)
{
parser = new MapDataDiffParser(handler);
}
osm.makeAuthenticatedRequest(
"changeset/" + changesetId + "/upload", "POST",
new MapDataChange... | [
"public",
"void",
"uploadChanges",
"(",
"long",
"changesetId",
",",
"Iterable",
"<",
"Element",
">",
"elements",
",",
"Handler",
"<",
"DiffElement",
">",
"handler",
")",
"{",
"MapDataDiffParser",
"parser",
"=",
"null",
";",
"if",
"(",
"handler",
"!=",
"null"... | Upload changes into an opened changeset.
@param elements elements to upload. No special order required
@param handler handler that processes the server's diffResult response. Optional.
@throws OsmNotFoundException if the changeset does not exist (yet) or an element in the
does not exist
@throws OsmConflictException i... | [
"Upload",
"changes",
"into",
"an",
"opened",
"changeset",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/map/MapDataDao.java#L112-L124 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/user/UserPreferencesDao.java | UserPreferencesDao.setAll | public void setAll(Map<String, String> preferences)
{
// check it before sending it to the server in order to be able to raise a precise exception
for(Map.Entry<String,String> preference : preferences.entrySet())
{
checkPreferenceKeyLength(preference.getKey());
checkPreferenceValueLength(preference.getValu... | java | public void setAll(Map<String, String> preferences)
{
// check it before sending it to the server in order to be able to raise a precise exception
for(Map.Entry<String,String> preference : preferences.entrySet())
{
checkPreferenceKeyLength(preference.getKey());
checkPreferenceValueLength(preference.getValu... | [
"public",
"void",
"setAll",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"preferences",
")",
"{",
"// check it before sending it to the server in order to be able to raise a precise exception",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"pre... | Sets all the given preference keys to the given preference values.
@param preferences preferences to set. Each key and each value must be less than 256
characters.
@throws OsmAuthorizationException if this application is not authorized to change the
user's preferences. (Permission.CHANGE_PREFERENCES) | [
"Sets",
"all",
"the",
"given",
"preference",
"keys",
"to",
"the",
"given",
"preference",
"values",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/user/UserPreferencesDao.java#L81-L112 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/user/UserPreferencesDao.java | UserPreferencesDao.set | public void set(String key, String value)
{
String urlKey = urlEncode(key);
checkPreferenceKeyLength(urlKey);
checkPreferenceValueLength(value);
osm.makeAuthenticatedRequest(USERPREFS + urlKey, "PUT", new PlainTextWriter(value));
} | java | public void set(String key, String value)
{
String urlKey = urlEncode(key);
checkPreferenceKeyLength(urlKey);
checkPreferenceValueLength(value);
osm.makeAuthenticatedRequest(USERPREFS + urlKey, "PUT", new PlainTextWriter(value));
} | [
"public",
"void",
"set",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"String",
"urlKey",
"=",
"urlEncode",
"(",
"key",
")",
";",
"checkPreferenceKeyLength",
"(",
"urlKey",
")",
";",
"checkPreferenceValueLength",
"(",
"value",
")",
";",
"osm",
"... | Sets the given preference key to the given preference value.
@param key preference to set. Must be less than 256 characters.
@param value preference to set. Must be less than 256 characters.
@throws OsmAuthorizationException if this application is not authorized to change the
user's preferences. (Permission.CHANGE_PR... | [
"Sets",
"the",
"given",
"preference",
"key",
"to",
"the",
"given",
"preference",
"value",
"."
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/user/UserPreferencesDao.java#L123-L130 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/user/UserPreferencesDao.java | UserPreferencesDao.delete | public void delete(String key)
{
String urlKey = urlEncode(key);
checkPreferenceKeyLength(urlKey);
osm.makeAuthenticatedRequest(USERPREFS + urlKey, "DELETE");
} | java | public void delete(String key)
{
String urlKey = urlEncode(key);
checkPreferenceKeyLength(urlKey);
osm.makeAuthenticatedRequest(USERPREFS + urlKey, "DELETE");
} | [
"public",
"void",
"delete",
"(",
"String",
"key",
")",
"{",
"String",
"urlKey",
"=",
"urlEncode",
"(",
"key",
")",
";",
"checkPreferenceKeyLength",
"(",
"urlKey",
")",
";",
"osm",
".",
"makeAuthenticatedRequest",
"(",
"USERPREFS",
"+",
"urlKey",
",",
"\"DELE... | Deletes the given preference key from the user preferences
@param key preference to delete. Must be less than 256 characters.
@throws OsmAuthorizationException if this application is not authorized to change the
user's preferences. (Permission.CHANGE_PREFERENCES) | [
"Deletes",
"the",
"given",
"preference",
"key",
"from",
"the",
"user",
"preferences"
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/user/UserPreferencesDao.java#L139-L145 | train |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/QueryChangesetsFilters.java | QueryChangesetsFilters.byOpenSomeTimeBetween | public QueryChangesetsFilters byOpenSomeTimeBetween(Date createdBefore, Date closedAfter)
{
params.put("time", dateFormat.format(closedAfter) + "," + dateFormat.format(createdBefore));
return this;
} | java | public QueryChangesetsFilters byOpenSomeTimeBetween(Date createdBefore, Date closedAfter)
{
params.put("time", dateFormat.format(closedAfter) + "," + dateFormat.format(createdBefore));
return this;
} | [
"public",
"QueryChangesetsFilters",
"byOpenSomeTimeBetween",
"(",
"Date",
"createdBefore",
",",
"Date",
"closedAfter",
")",
"{",
"params",
".",
"put",
"(",
"\"time\"",
",",
"dateFormat",
".",
"format",
"(",
"closedAfter",
")",
"+",
"\",\"",
"+",
"dateFormat",
".... | Filter by changesets that have at one time been open during the given time range
@param closedAfter limit search to changesets that have been closed after this date
@param createdBefore limit search to changesets that have been created before this date | [
"Filter",
"by",
"changesets",
"that",
"have",
"at",
"one",
"time",
"been",
"open",
"during",
"the",
"given",
"time",
"range"
] | dda6978fd12e117d0cf17812bc22037f61e22c4b | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/QueryChangesetsFilters.java#L125-L129 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/PaginatingTask.java | PaginatingTask.call | public R call() throws BackendException {
while (hasNext) {
pagesProcessed++;
next();
}
delegate.updatePagesHistogram(apiName, tableName, pagesProcessed);
return getMergedPages();
} | java | public R call() throws BackendException {
while (hasNext) {
pagesProcessed++;
next();
}
delegate.updatePagesHistogram(apiName, tableName, pagesProcessed);
return getMergedPages();
} | [
"public",
"R",
"call",
"(",
")",
"throws",
"BackendException",
"{",
"while",
"(",
"hasNext",
")",
"{",
"pagesProcessed",
"++",
";",
"next",
"(",
")",
";",
"}",
"delegate",
".",
"updatePagesHistogram",
"(",
"apiName",
",",
"tableName",
",",
"pagesProcessed",
... | Paginates through pages of an entity.
@return an encapsulation of the pages of an entity
@throws BackendException if there was any trouble paginating | [
"Paginates",
"through",
"pages",
"of",
"an",
"entity",
"."
] | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/PaginatingTask.java#L48-L55 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/iterator/ParallelScanner.java | ParallelScanner.grab | private ScanContext grab() throws ExecutionException, InterruptedException {
final Future<ScanContext> ret = exec.take();
final ScanRequest originalRequest = ret.get().getScanRequest();
final int segment = originalRequest.getSegment();
final ScanSegmentWorker sw = workers[segment];
... | java | private ScanContext grab() throws ExecutionException, InterruptedException {
final Future<ScanContext> ret = exec.take();
final ScanRequest originalRequest = ret.get().getScanRequest();
final int segment = originalRequest.getSegment();
final ScanSegmentWorker sw = workers[segment];
... | [
"private",
"ScanContext",
"grab",
"(",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
"{",
"final",
"Future",
"<",
"ScanContext",
">",
"ret",
"=",
"exec",
".",
"take",
"(",
")",
";",
"final",
"ScanRequest",
"originalRequest",
"=",
"ret",
"."... | This method gets a segmentedScanResult and submits the next scan request for that segment, if there is one.
@return the next available ScanResult
@throws ExecutionException if one of the segment pages threw while executing
@throws InterruptedException if one of the segment pages was interrupted while executing. | [
"This",
"method",
"gets",
"a",
"segmentedScanResult",
"and",
"submits",
"the",
"next",
"scan",
"request",
"for",
"that",
"segment",
"if",
"there",
"is",
"one",
"."
] | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/iterator/ParallelScanner.java#L70-L87 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbStoreTransaction.java | DynamoDbStoreTransaction.contains | public boolean contains(final AbstractDynamoDbStore store, final StaticBuffer key, final StaticBuffer column) {
return expectedValues.containsKey(store)
&& expectedValues.get(store).containsKey(key)
&& expectedValues.get(store).get(key).containsKey(column);
} | java | public boolean contains(final AbstractDynamoDbStore store, final StaticBuffer key, final StaticBuffer column) {
return expectedValues.containsKey(store)
&& expectedValues.get(store).containsKey(key)
&& expectedValues.get(store).get(key).containsKey(column);
} | [
"public",
"boolean",
"contains",
"(",
"final",
"AbstractDynamoDbStore",
"store",
",",
"final",
"StaticBuffer",
"key",
",",
"final",
"StaticBuffer",
"column",
")",
"{",
"return",
"expectedValues",
".",
"containsKey",
"(",
"store",
")",
"&&",
"expectedValues",
".",
... | Determins whether a particular key and column are part of this transaction
@param key key to check for existence
@param column column to check for existence
@return true if both the key and column combination are in this transaction and false otherwise. | [
"Determins",
"whether",
"a",
"particular",
"key",
"and",
"column",
"are",
"part",
"of",
"this",
"transaction"
] | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbStoreTransaction.java#L87-L91 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbStoreTransaction.java | DynamoDbStoreTransaction.get | public StaticBuffer get(final AbstractDynamoDbStore store, final StaticBuffer key, final StaticBuffer column) {
// This method assumes the caller has called contains(..) and received a positive response
return expectedValues.get(store).get(key).get(column);
} | java | public StaticBuffer get(final AbstractDynamoDbStore store, final StaticBuffer key, final StaticBuffer column) {
// This method assumes the caller has called contains(..) and received a positive response
return expectedValues.get(store).get(key).get(column);
} | [
"public",
"StaticBuffer",
"get",
"(",
"final",
"AbstractDynamoDbStore",
"store",
",",
"final",
"StaticBuffer",
"key",
",",
"final",
"StaticBuffer",
"column",
")",
"{",
"// This method assumes the caller has called contains(..) and received a positive response",
"return",
"expec... | Gets the expected value for a particular key and column, if any
@param store the store to put the expected key column value
@param key the key to get the expected value for
@param column the column to get the expected value for
@return the expected value of the given key-column pair, if any. | [
"Gets",
"the",
"expected",
"value",
"for",
"a",
"particular",
"key",
"and",
"column",
"if",
"any"
] | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbStoreTransaction.java#L119-L122 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbStoreTransaction.java | DynamoDbStoreTransaction.putKeyColumnOnlyIfItIsNotYetChangedInTx | public void putKeyColumnOnlyIfItIsNotYetChangedInTx(final AbstractDynamoDbStore store, final StaticBuffer key, final StaticBuffer column,
final StaticBuffer expectedValue) {
expectedValues.computeIfAbsent(store, s -> new HashMap<>());
expectedValues.get(store).computeIfAbsent(key, k -> new HashM... | java | public void putKeyColumnOnlyIfItIsNotYetChangedInTx(final AbstractDynamoDbStore store, final StaticBuffer key, final StaticBuffer column,
final StaticBuffer expectedValue) {
expectedValues.computeIfAbsent(store, s -> new HashMap<>());
expectedValues.get(store).computeIfAbsent(key, k -> new HashM... | [
"public",
"void",
"putKeyColumnOnlyIfItIsNotYetChangedInTx",
"(",
"final",
"AbstractDynamoDbStore",
"store",
",",
"final",
"StaticBuffer",
"key",
",",
"final",
"StaticBuffer",
"column",
",",
"final",
"StaticBuffer",
"expectedValue",
")",
"{",
"expectedValues",
".",
"com... | Puts the expected value for a particular key and column
@param store the store to put the expected key column value
@param key the key to put the expected value for
@param column the column to put the expected value for
@param expectedValue the expected value to put | [
"Puts",
"the",
"expected",
"value",
"for",
"a",
"particular",
"key",
"and",
"column"
] | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbStoreTransaction.java#L131-L137 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/AbstractDynamoDbStore.java | AbstractDynamoDbStore.getTableSchema | public CreateTableRequest getTableSchema() {
return new CreateTableRequest()
.withTableName(tableName)
.withProvisionedThroughput(new ProvisionedThroughput(client.readCapacity(tableName),
client.writeCapacity(tableName)));
} | java | public CreateTableRequest getTableSchema() {
return new CreateTableRequest()
.withTableName(tableName)
.withProvisionedThroughput(new ProvisionedThroughput(client.readCapacity(tableName),
client.writeCapacity(tableName)));
} | [
"public",
"CreateTableRequest",
"getTableSchema",
"(",
")",
"{",
"return",
"new",
"CreateTableRequest",
"(",
")",
".",
"withTableName",
"(",
"tableName",
")",
".",
"withProvisionedThroughput",
"(",
"new",
"ProvisionedThroughput",
"(",
"client",
".",
"readCapacity",
... | Creates the schemata for the DynamoDB table or tables each store requires.
Implementations should override and reuse this logic
@return a create table request appropriate for the schema of the selected implementation. | [
"Creates",
"the",
"schemata",
"for",
"the",
"DynamoDB",
"table",
"or",
"tables",
"each",
"store",
"requires",
".",
"Implementations",
"should",
"override",
"and",
"reuse",
"this",
"logic"
] | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/AbstractDynamoDbStore.java#L137-L142 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbDelegate.java | DynamoDbDelegate.calculateExpressionBasedUpdateSize | private int calculateExpressionBasedUpdateSize(final UpdateItemRequest request) {
if (request == null || request.getUpdateExpression() == null) {
throw new IllegalArgumentException("request did not use update expression");
}
int size = calculateItemSizeInBytes(request.getKey());
... | java | private int calculateExpressionBasedUpdateSize(final UpdateItemRequest request) {
if (request == null || request.getUpdateExpression() == null) {
throw new IllegalArgumentException("request did not use update expression");
}
int size = calculateItemSizeInBytes(request.getKey());
... | [
"private",
"int",
"calculateExpressionBasedUpdateSize",
"(",
"final",
"UpdateItemRequest",
"request",
")",
"{",
"if",
"(",
"request",
"==",
"null",
"||",
"request",
".",
"getUpdateExpression",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcep... | This method calculates a lower bound of the size of a new item created with UpdateItem UpdateExpression. It does not
account for the size of the attribute names of the document paths in the attribute names map and it assumes that the
UpdateExpression only uses the SET action to assign to top-level attributes.
@param re... | [
"This",
"method",
"calculates",
"a",
"lower",
"bound",
"of",
"the",
"size",
"of",
"a",
"new",
"item",
"created",
"with",
"UpdateItem",
"UpdateExpression",
".",
"It",
"does",
"not",
"account",
"for",
"the",
"size",
"of",
"the",
"attribute",
"names",
"of",
"... | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbDelegate.java#L574-L583 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbDelegate.java | DynamoDbDelegate.cloneItem | public static Map<String, AttributeValue> cloneItem(final Map<String, AttributeValue> item) {
if (item == null) {
return null;
}
final Map<String, AttributeValue> clonedItem = Maps.newHashMap();
final IdentityHashMap<AttributeValue, AttributeValue> sourceDestinationMap = new ... | java | public static Map<String, AttributeValue> cloneItem(final Map<String, AttributeValue> item) {
if (item == null) {
return null;
}
final Map<String, AttributeValue> clonedItem = Maps.newHashMap();
final IdentityHashMap<AttributeValue, AttributeValue> sourceDestinationMap = new ... | [
"public",
"static",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"cloneItem",
"(",
"final",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"item",
")",
"{",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Map",
... | Helper method that clones an item
@param item the item to clone
@return a clone of item. | [
"Helper",
"method",
"that",
"clones",
"an",
"item"
] | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbDelegate.java#L943-L957 | train |
awslabs/dynamodb-janusgraph-storage-backend | src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbDelegate.java | DynamoDbDelegate.calculateAttributeSizeInBytes | private static int calculateAttributeSizeInBytes(final AttributeValue value) {
int attrValSize = 0;
if (value == null) {
return attrValSize;
}
if (value.getB() != null) {
final ByteBuffer b = value.getB();
attrValSize += b.remaining();
} else ... | java | private static int calculateAttributeSizeInBytes(final AttributeValue value) {
int attrValSize = 0;
if (value == null) {
return attrValSize;
}
if (value.getB() != null) {
final ByteBuffer b = value.getB();
attrValSize += b.remaining();
} else ... | [
"private",
"static",
"int",
"calculateAttributeSizeInBytes",
"(",
"final",
"AttributeValue",
"value",
")",
"{",
"int",
"attrValSize",
"=",
"0",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"attrValSize",
";",
"}",
"if",
"(",
"value",
".",
"ge... | Calculate attribute value size | [
"Calculate",
"attribute",
"value",
"size"
] | e7ba180d2c40d8ea777e320d9a542725a5229fc0 | https://github.com/awslabs/dynamodb-janusgraph-storage-backend/blob/e7ba180d2c40d8ea777e320d9a542725a5229fc0/src/main/java/com/amazon/janusgraph/diskstorage/dynamodb/DynamoDbDelegate.java#L1020-L1075 | train |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java | PausablePriorityBlockingQueue.readObject | private void readObject(ObjectInputStream ois) {
try {
ois.defaultReadObject();
pauseLock = new ReentrantLock();
pauseLock.newCondition();
} catch (Exception e) {
e.printStackTrace();
}
} | java | private void readObject(ObjectInputStream ois) {
try {
ois.defaultReadObject();
pauseLock = new ReentrantLock();
pauseLock.newCondition();
} catch (Exception e) {
e.printStackTrace();
}
} | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"ois",
")",
"{",
"try",
"{",
"ois",
".",
"defaultReadObject",
"(",
")",
";",
"pauseLock",
"=",
"new",
"ReentrantLock",
"(",
")",
";",
"pauseLock",
".",
"newCondition",
"(",
")",
";",
"}",
"catch",
... | makes findbugs happy, but unused | [
"makes",
"findbugs",
"happy",
"but",
"unused"
] | 8bffde88b3534a961a13cab72a8f07a755f0a0fe | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java#L89-L97 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.