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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ManfredTremmel/gwt-bean-validators | gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/resourceloader/CssResources.java | CssResources.addToHeader | public static void addToHeader(final String scriptname) {
if (!CssResources.isInHeader(scriptname)) {
final LinkElement styleLinkElement = Browser.getDocument().createLinkElement();
styleLinkElement.setRel(CssResources.REL_TYPE);
styleLinkElement.setType(CssResources.SCRIPT_TYPE);
styleLinkE... | java | public static void addToHeader(final String scriptname) {
if (!CssResources.isInHeader(scriptname)) {
final LinkElement styleLinkElement = Browser.getDocument().createLinkElement();
styleLinkElement.setRel(CssResources.REL_TYPE);
styleLinkElement.setType(CssResources.SCRIPT_TYPE);
styleLinkE... | [
"public",
"static",
"void",
"addToHeader",
"(",
"final",
"String",
"scriptname",
")",
"{",
"if",
"(",
"!",
"CssResources",
".",
"isInHeader",
"(",
"scriptname",
")",
")",
"{",
"final",
"LinkElement",
"styleLinkElement",
"=",
"Browser",
".",
"getDocument",
"(",... | add css script to header.
@param scriptname style sheet file to add to header | [
"add",
"css",
"script",
"to",
"header",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/resourceloader/CssResources.java#L20-L28 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/constraintvalidators/hv/ModCheckBase.java | ModCheckBase.isValid | public boolean isValid(final CharSequence value, final ConstraintValidatorContext context) {
if (value == null) {
return true;
}
final String valueAsString = value.toString();
String digitsAsString;
char checkDigit;
try {
digitsAsString = this.extractVerificationString(valueAsString... | java | public boolean isValid(final CharSequence value, final ConstraintValidatorContext context) {
if (value == null) {
return true;
}
final String valueAsString = value.toString();
String digitsAsString;
char checkDigit;
try {
digitsAsString = this.extractVerificationString(valueAsString... | [
"public",
"boolean",
"isValid",
"(",
"final",
"CharSequence",
"value",
",",
"final",
"ConstraintValidatorContext",
"context",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"String",
"valueAsString",
"=",
"value",
... | valid check.
@param value value to check.
@param context constraint validator context
@return true if valid | [
"valid",
"check",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/constraintvalidators/hv/ModCheckBase.java#L63-L87 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/decorators/AbstractDecorator.java | AbstractDecorator.clearErrors | public void clearErrors() {
errorLabel.setText(StringUtils.EMPTY);
errorLabel.getElement().getStyle().setDisplay(Display.NONE);
if (contents.getWidget() != null) {
contents.getWidget().removeStyleName(decoratorStyle.errorInputStyle());
contents.getWidget().removeStyleName(decoratorStyle.validInp... | java | public void clearErrors() {
errorLabel.setText(StringUtils.EMPTY);
errorLabel.getElement().getStyle().setDisplay(Display.NONE);
if (contents.getWidget() != null) {
contents.getWidget().removeStyleName(decoratorStyle.errorInputStyle());
contents.getWidget().removeStyleName(decoratorStyle.validInp... | [
"public",
"void",
"clearErrors",
"(",
")",
"{",
"errorLabel",
".",
"setText",
"(",
"StringUtils",
".",
"EMPTY",
")",
";",
"errorLabel",
".",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setDisplay",
"(",
"Display",
".",
"NONE",
")",
";",
"i... | clear errors. | [
"clear",
"errors",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/decorators/AbstractDecorator.java#L264-L271 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/AbstractValidationMessageResolver.java | AbstractValidationMessageResolver.get | public final String get(final String pkey) {
try {
// Replace "." with "_" in the key to match what ConstantsImplCreator does.
return pkey == null ? null : messages.getString(pkey.replace(".", "_"));
} catch (final MissingResourceException e) {
return null;
}
} | java | public final String get(final String pkey) {
try {
// Replace "." with "_" in the key to match what ConstantsImplCreator does.
return pkey == null ? null : messages.getString(pkey.replace(".", "_"));
} catch (final MissingResourceException e) {
return null;
}
} | [
"public",
"final",
"String",
"get",
"(",
"final",
"String",
"pkey",
")",
"{",
"try",
"{",
"// Replace \".\" with \"_\" in the key to match what ConstantsImplCreator does.",
"return",
"pkey",
"==",
"null",
"?",
"null",
":",
"messages",
".",
"getString",
"(",
"pkey",
... | get localized message for key.
@param pkey key of message
@return localized text for the key | [
"get",
"localized",
"message",
"for",
"key",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/AbstractValidationMessageResolver.java#L37-L44 | train |
neoremind/navi | navi/src/main/java/com/baidu/beidou/navi/util/ExtensionLocator.java | ExtensionLocator.getInstanceList | @SuppressWarnings("unchecked")
public static <T> List<T> getInstanceList(Class<T> type) {
if (type == null) {
throw new IllegalArgumentException("Type should not be empty");
}
List<T> loader = (List<T>) EXTENSION_LOCATOR.get(type);
if (loader == null) {
try {
lock.lock();
List<T> insta... | java | @SuppressWarnings("unchecked")
public static <T> List<T> getInstanceList(Class<T> type) {
if (type == null) {
throw new IllegalArgumentException("Type should not be empty");
}
List<T> loader = (List<T>) EXTENSION_LOCATOR.get(type);
if (loader == null) {
try {
lock.lock();
List<T> insta... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getInstanceList",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | Get instances dynamically for a class type
@param type
@return | [
"Get",
"instances",
"dynamically",
"for",
"a",
"class",
"type"
] | d37e4b46ef07d124be2740ad3d85d87e939acc84 | https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi/src/main/java/com/baidu/beidou/navi/util/ExtensionLocator.java#L35-L61 | train |
ddf-project/DDF | core/src/main/java/io/ddf/DDF.java | DDF.initialize | protected void initialize(DDFManager manager, Object data, Class<?>[] typeSpecs, String name, Schema schema)
throws DDFException {
this.validateSchema(schema);
this.setManager(manager); // this must be done first in case later stuff needs a manager
if (typeSpecs != null) {
this.getRepresentatio... | java | protected void initialize(DDFManager manager, Object data, Class<?>[] typeSpecs, String name, Schema schema)
throws DDFException {
this.validateSchema(schema);
this.setManager(manager); // this must be done first in case later stuff needs a manager
if (typeSpecs != null) {
this.getRepresentatio... | [
"protected",
"void",
"initialize",
"(",
"DDFManager",
"manager",
",",
"Object",
"data",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"typeSpecs",
",",
"String",
"name",
",",
"Schema",
"schema",
")",
"throws",
"DDFException",
"{",
"this",
".",
"validateSchema",
"... | Initialization to be done after constructor assignments, such as setting of the all-important DDFManager. | [
"Initialization",
"to",
"be",
"done",
"after",
"constructor",
"assignments",
"such",
"as",
"setting",
"of",
"the",
"all",
"-",
"important",
"DDFManager",
"."
] | e4e68315dcec1ed8b287bf1ee73baa88e7e41eba | https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/DDF.java#L161-L185 | train |
ddf-project/DDF | core/src/main/java/io/ddf/DDF.java | DDF.validateName | private void validateName(String name) throws DDFException {
Boolean isNameExisted;
try {
this.getManager().getDDFByName(name);
isNameExisted = true;
} catch (DDFException e) {
isNameExisted = false;
}
if(isNameExisted) {
throw new DDFException(String.format("DDF with name %s... | java | private void validateName(String name) throws DDFException {
Boolean isNameExisted;
try {
this.getManager().getDDFByName(name);
isNameExisted = true;
} catch (DDFException e) {
isNameExisted = false;
}
if(isNameExisted) {
throw new DDFException(String.format("DDF with name %s... | [
"private",
"void",
"validateName",
"(",
"String",
"name",
")",
"throws",
"DDFException",
"{",
"Boolean",
"isNameExisted",
";",
"try",
"{",
"this",
".",
"getManager",
"(",
")",
".",
"getDDFByName",
"(",
"name",
")",
";",
"isNameExisted",
"=",
"true",
";",
"... | Also only allow alphanumberic and dash "-" and underscore "_" | [
"Also",
"only",
"allow",
"alphanumberic",
"and",
"dash",
"-",
"and",
"underscore",
"_"
] | e4e68315dcec1ed8b287bf1ee73baa88e7e41eba | https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/DDF.java#L241-L259 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/AbstractGwtValidatorFactory.java | AbstractGwtValidatorFactory.init | public final void init(final ConfigurationState configState) {
final ConstraintValidatorFactory configConstraintValidatorFactory =
configState.getConstraintValidatorFactory();
constraintValidatorFactory = configConstraintValidatorFactory == null
? GWT.<ConstraintValidatorFactory>create(Constrain... | java | public final void init(final ConfigurationState configState) {
final ConstraintValidatorFactory configConstraintValidatorFactory =
configState.getConstraintValidatorFactory();
constraintValidatorFactory = configConstraintValidatorFactory == null
? GWT.<ConstraintValidatorFactory>create(Constrain... | [
"public",
"final",
"void",
"init",
"(",
"final",
"ConfigurationState",
"configState",
")",
"{",
"final",
"ConstraintValidatorFactory",
"configConstraintValidatorFactory",
"=",
"configState",
".",
"getConstraintValidatorFactory",
"(",
")",
";",
"constraintValidatorFactory",
... | initialize factory.
@param configState ConfigurationState | [
"initialize",
"factory",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/AbstractGwtValidatorFactory.java#L115-L128 | train |
ManfredTremmel/gwt-bean-validators | gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/helper/ErrorMessageFormater.java | ErrorMessageFormater.messagesToList | public static SafeHtml messagesToList(final Set<String> messages) {
final SafeHtmlBuilder sbList = new SafeHtmlBuilder();
sbList.appendHtmlConstant("<ul>");
for (final String message : messages) {
sbList.appendHtmlConstant("<li>");
sbList.appendEscaped(message);
sbList.appendHtmlConstant("... | java | public static SafeHtml messagesToList(final Set<String> messages) {
final SafeHtmlBuilder sbList = new SafeHtmlBuilder();
sbList.appendHtmlConstant("<ul>");
for (final String message : messages) {
sbList.appendHtmlConstant("<li>");
sbList.appendEscaped(message);
sbList.appendHtmlConstant("... | [
"public",
"static",
"SafeHtml",
"messagesToList",
"(",
"final",
"Set",
"<",
"String",
">",
"messages",
")",
"{",
"final",
"SafeHtmlBuilder",
"sbList",
"=",
"new",
"SafeHtmlBuilder",
"(",
")",
";",
"sbList",
".",
"appendHtmlConstant",
"(",
"\"<ul>\"",
")",
";",... | build a html list out of given message set.
@param messages set of message strings
@return safe html with massages as list | [
"build",
"a",
"html",
"list",
"out",
"of",
"given",
"message",
"set",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/helper/ErrorMessageFormater.java#L41-L52 | train |
ManfredTremmel/gwt-bean-validators | gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/helper/ErrorMessageFormater.java | ErrorMessageFormater.messagesToString | public static String messagesToString(final Set<String> messages) {
final SafeHtmlBuilder sb = new SafeHtmlBuilder();
for (final String message : messages) {
sb.appendEscaped(message);
sb.appendEscaped("\n");
}
return sb.toSafeHtml().asString();
} | java | public static String messagesToString(final Set<String> messages) {
final SafeHtmlBuilder sb = new SafeHtmlBuilder();
for (final String message : messages) {
sb.appendEscaped(message);
sb.appendEscaped("\n");
}
return sb.toSafeHtml().asString();
} | [
"public",
"static",
"String",
"messagesToString",
"(",
"final",
"Set",
"<",
"String",
">",
"messages",
")",
"{",
"final",
"SafeHtmlBuilder",
"sb",
"=",
"new",
"SafeHtmlBuilder",
"(",
")",
";",
"for",
"(",
"final",
"String",
"message",
":",
"messages",
")",
... | build a linefeed separated String with all messages out of given set.
@param messages set of message strings
@return String with messages | [
"build",
"a",
"linefeed",
"separated",
"String",
"with",
"all",
"messages",
"out",
"of",
"given",
"set",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/helper/ErrorMessageFormater.java#L60-L67 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/BeanHelper.java | BeanHelper.getAssociationType | public JClassType getAssociationType(final PropertyDescriptor ppropertyDescriptor,
final boolean puseField) {
final JType type = getElementType(ppropertyDescriptor, puseField);
if (type == null) {
return null;
}
final JArrayType jarray = type.isArray();
if (jarray != null) {
return... | java | public JClassType getAssociationType(final PropertyDescriptor ppropertyDescriptor,
final boolean puseField) {
final JType type = getElementType(ppropertyDescriptor, puseField);
if (type == null) {
return null;
}
final JArrayType jarray = type.isArray();
if (jarray != null) {
return... | [
"public",
"JClassType",
"getAssociationType",
"(",
"final",
"PropertyDescriptor",
"ppropertyDescriptor",
",",
"final",
"boolean",
"puseField",
")",
"{",
"final",
"JType",
"type",
"=",
"getElementType",
"(",
"ppropertyDescriptor",
",",
"puseField",
")",
";",
"if",
"(... | get association type.
@param ppropertyDescriptor property description
@param puseField use field
@return JClassType | [
"get",
"association",
"type",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/BeanHelper.java#L63-L83 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/impl/GroupChain.java | GroupChain.checkDefaultGroupSequenceIsExpandable | public void checkDefaultGroupSequenceIsExpandable(final List<Class<?>> defaultGroupSequence)
throws GroupDefinitionException {
for (final Map.Entry<Class<?>, List<Group>> entry : sequenceMap.entrySet()) {
final Class<?> sequence = entry.getKey();
final List<Group> groups = entry.getValue();
... | java | public void checkDefaultGroupSequenceIsExpandable(final List<Class<?>> defaultGroupSequence)
throws GroupDefinitionException {
for (final Map.Entry<Class<?>, List<Group>> entry : sequenceMap.entrySet()) {
final Class<?> sequence = entry.getKey();
final List<Group> groups = entry.getValue();
... | [
"public",
"void",
"checkDefaultGroupSequenceIsExpandable",
"(",
"final",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"defaultGroupSequence",
")",
"throws",
"GroupDefinitionException",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"Class",
"<",
"?",
">",
",... | check if default group sequence is expandable.
@param defaultGroupSequence list of group classes
@throws GroupDefinitionException if it's no default group | [
"check",
"if",
"default",
"group",
"sequence",
"is",
"expandable",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/impl/GroupChain.java#L53-L64 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/java/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java | ConstraintViolationImpl_CustomFieldSerializer.instantiate | public static ConstraintViolationImpl<Object> instantiate(
final SerializationStreamReader streamReader) throws SerializationException {
final String messageTemplate = null;
final String interpolatedMessage = streamReader.readString();
final Class<Object> rootBeanClass = null;
final Object rootBe... | java | public static ConstraintViolationImpl<Object> instantiate(
final SerializationStreamReader streamReader) throws SerializationException {
final String messageTemplate = null;
final String interpolatedMessage = streamReader.readString();
final Class<Object> rootBeanClass = null;
final Object rootBe... | [
"public",
"static",
"ConstraintViolationImpl",
"<",
"Object",
">",
"instantiate",
"(",
"final",
"SerializationStreamReader",
"streamReader",
")",
"throws",
"SerializationException",
"{",
"final",
"String",
"messageTemplate",
"=",
"null",
";",
"final",
"String",
"interpo... | instantiate a ConstraintViolationImpl.
@param streamReader serialized stream reader to take data from
@return ConstraintViolationImpl
@throws SerializationException if deserialization fails | [
"instantiate",
"a",
"ConstraintViolationImpl",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java#L50-L67 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/io/IOUtils.java | IOUtils.checkOffsetAndCount | public static void checkOffsetAndCount(final byte[] buffer, final int byteOffset,
final int byteCount) {
// Ensure we throw a NullPointerException instead of a JavascriptException in case the
// given buffer is null.
if (buffer == null) {
throw new NullPointerException();
}
checkOffsetAn... | java | public static void checkOffsetAndCount(final byte[] buffer, final int byteOffset,
final int byteCount) {
// Ensure we throw a NullPointerException instead of a JavascriptException in case the
// given buffer is null.
if (buffer == null) {
throw new NullPointerException();
}
checkOffsetAn... | [
"public",
"static",
"void",
"checkOffsetAndCount",
"(",
"final",
"byte",
"[",
"]",
"buffer",
",",
"final",
"int",
"byteOffset",
",",
"final",
"int",
"byteCount",
")",
"{",
"// Ensure we throw a NullPointerException instead of a JavascriptException in case the",
"// given bu... | Validates the offset and the byte count for the given array of bytes.
@param buffer Array of bytes to be checked.
@param byteOffset Starting offset in the array.
@param byteCount Total number of bytes to be accessed.
@throws NullPointerException if the given reference to the buffer is null.
@throws IndexOutOfBoundsExc... | [
"Validates",
"the",
"offset",
"and",
"the",
"byte",
"count",
"for",
"the",
"given",
"array",
"of",
"bytes",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/io/IOUtils.java#L37-L45 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/io/IOUtils.java | IOUtils.checkOffsetAndCount | public static void checkOffsetAndCount(final char[] buffer, final int charOffset,
final int charCount) {
// Ensure we throw a NullPointerException instead of a JavascriptException in case the
// given buffer is null.
if (buffer == null) {
throw new NullPointerException();
}
checkOffsetAn... | java | public static void checkOffsetAndCount(final char[] buffer, final int charOffset,
final int charCount) {
// Ensure we throw a NullPointerException instead of a JavascriptException in case the
// given buffer is null.
if (buffer == null) {
throw new NullPointerException();
}
checkOffsetAn... | [
"public",
"static",
"void",
"checkOffsetAndCount",
"(",
"final",
"char",
"[",
"]",
"buffer",
",",
"final",
"int",
"charOffset",
",",
"final",
"int",
"charCount",
")",
"{",
"// Ensure we throw a NullPointerException instead of a JavascriptException in case the",
"// given bu... | Validates the offset and the byte count for the given array of characters.
@param buffer Array of characters to be checked.
@param charOffset Starting offset in the array.
@param charCount Total number of characters to be accessed.
@throws NullPointerException if the given reference to the buffer is null.
@throws Inde... | [
"Validates",
"the",
"offset",
"and",
"the",
"byte",
"count",
"for",
"the",
"given",
"array",
"of",
"characters",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/io/IOUtils.java#L57-L65 | train |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/io/IOUtils.java | IOUtils.checkOffsetAndCount | private static void checkOffsetAndCount(final int length, final int offset, final int count) {
if (offset < 0 || count < 0 || offset + count > length) {
throw new IndexOutOfBoundsException();
}
} | java | private static void checkOffsetAndCount(final int length, final int offset, final int count) {
if (offset < 0 || count < 0 || offset + count > length) {
throw new IndexOutOfBoundsException();
}
} | [
"private",
"static",
"void",
"checkOffsetAndCount",
"(",
"final",
"int",
"length",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"count",
")",
"{",
"if",
"(",
"offset",
"<",
"0",
"||",
"count",
"<",
"0",
"||",
"offset",
"+",
"count",
">",
"length... | Validates the offset and the byte count for the given array length.
@param length Length of the array to be checked.
@param offset Starting offset in the array.
@param count Total number of elements to be accessed.
@throws IndexOutOfBoundsException if {@code offset} is negative, {@code count} is negative or
their sum ... | [
"Validates",
"the",
"offset",
"and",
"the",
"byte",
"count",
"for",
"the",
"given",
"array",
"length",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/io/IOUtils.java#L76-L80 | train |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java | Assert.doesNotContain | public static void doesNotContain(@Nullable final String textToSearch, final String substring,
final Supplier<String> messageSupplier) {
if (StringUtils.hasLength(textToSearch) && StringUtils.hasLength(substring)
&& textToSearch.contains(substring)) {
throw new IllegalArgumentException(Assert.nu... | java | public static void doesNotContain(@Nullable final String textToSearch, final String substring,
final Supplier<String> messageSupplier) {
if (StringUtils.hasLength(textToSearch) && StringUtils.hasLength(substring)
&& textToSearch.contains(substring)) {
throw new IllegalArgumentException(Assert.nu... | [
"public",
"static",
"void",
"doesNotContain",
"(",
"@",
"Nullable",
"final",
"String",
"textToSearch",
",",
"final",
"String",
"substring",
",",
"final",
"Supplier",
"<",
"String",
">",
"messageSupplier",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasLength",
"... | Assert that the given text does not contain the given substring.
<pre class="code">
Assert.doesNotContain(name, forbidden, () -> "Name must not contain '" + forbidden + "'");
</pre>
@param textToSearch the text to search
@param substring the substring to find within the text
@param messageSupplier a supplier for t... | [
"Assert",
"that",
"the",
"given",
"text",
"does",
"not",
"contain",
"the",
"given",
"substring",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java#L379-L385 | train |
ManfredTremmel/gwt-bean-validators | gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/SelectBoxWithIconInputWidget.java | SelectBoxWithIconInputWidget.getDefaultResources | protected static Resources getDefaultResources() { // NOPMD it's thread save!
if (SelectBoxWithIconInputWidget.defaultResource == null) {
synchronized (Resources.class) {
if (SelectBoxWithIconInputWidget.defaultResource == null) {
SelectBoxWithIconInputWidget.defaultResource = GWT.create(Res... | java | protected static Resources getDefaultResources() { // NOPMD it's thread save!
if (SelectBoxWithIconInputWidget.defaultResource == null) {
synchronized (Resources.class) {
if (SelectBoxWithIconInputWidget.defaultResource == null) {
SelectBoxWithIconInputWidget.defaultResource = GWT.create(Res... | [
"protected",
"static",
"Resources",
"getDefaultResources",
"(",
")",
"{",
"// NOPMD it's thread save!",
"if",
"(",
"SelectBoxWithIconInputWidget",
".",
"defaultResource",
"==",
"null",
")",
"{",
"synchronized",
"(",
"Resources",
".",
"class",
")",
"{",
"if",
"(",
... | get default resource, if not set, create one.
@return default resource. | [
"get",
"default",
"resource",
"if",
"not",
"set",
"create",
"one",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/SelectBoxWithIconInputWidget.java#L149-L158 | train |
ManfredTremmel/gwt-bean-validators | gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/SelectBoxWithIconInputWidget.java | SelectBoxWithIconInputWidget.fillEntries | public void fillEntries(final List<IdAndNamePlusIconBean<T>> pentries) {
this.entries.clear();
this.radioButtons.clear();
this.entries.addAll(pentries);
boolean selected = false;
for (final IdAndNamePlusIconBean<T> entry : this.entries) {
final FlowPanel option = new FlowPanel();
option.... | java | public void fillEntries(final List<IdAndNamePlusIconBean<T>> pentries) {
this.entries.clear();
this.radioButtons.clear();
this.entries.addAll(pentries);
boolean selected = false;
for (final IdAndNamePlusIconBean<T> entry : this.entries) {
final FlowPanel option = new FlowPanel();
option.... | [
"public",
"void",
"fillEntries",
"(",
"final",
"List",
"<",
"IdAndNamePlusIconBean",
"<",
"T",
">",
">",
"pentries",
")",
"{",
"this",
".",
"entries",
".",
"clear",
"(",
")",
";",
"this",
".",
"radioButtons",
".",
"clear",
"(",
")",
";",
"this",
".",
... | fill entries for the select box.
@param pentries list of entries | [
"fill",
"entries",
"for",
"the",
"select",
"box",
"."
] | cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/SelectBoxWithIconInputWidget.java#L175-L204 | train |
ddf-project/DDF | core/src/main/java/io/ddf/ml/RocMetric.java | RocMetric.addIn | public RocMetric addIn(RocMetric other) {
// Sum tpr, fpr for each threshold
int i = 0;
// start from 1, 0-index is for threshold value
int j = 1;
while (i < this.pred.length) {
if (this.pred[i] != null) {
if (other.pred[i] != null) {
j = 1;
// P = P + P
/... | java | public RocMetric addIn(RocMetric other) {
// Sum tpr, fpr for each threshold
int i = 0;
// start from 1, 0-index is for threshold value
int j = 1;
while (i < this.pred.length) {
if (this.pred[i] != null) {
if (other.pred[i] != null) {
j = 1;
// P = P + P
/... | [
"public",
"RocMetric",
"addIn",
"(",
"RocMetric",
"other",
")",
"{",
"// Sum tpr, fpr for each threshold",
"int",
"i",
"=",
"0",
";",
"// start from 1, 0-index is for threshold value",
"int",
"j",
"=",
"1",
";",
"while",
"(",
"i",
"<",
"this",
".",
"pred",
".",
... | Sum in-place to avoid new object alloc | [
"Sum",
"in",
"-",
"place",
"to",
"avoid",
"new",
"object",
"alloc"
] | e4e68315dcec1ed8b287bf1ee73baa88e7e41eba | https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/ml/RocMetric.java#L58-L90 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addSourceActiveParticipant | public void addSourceActiveParticipant(String userId, String altUserId, String userName, String networkId, boolean isRequestor)
{
addActiveParticipant(
userId,
altUserId,
userName,
isRequestor,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Source()),
networkId);
} | java | public void addSourceActiveParticipant(String userId, String altUserId, String userName, String networkId, boolean isRequestor)
{
addActiveParticipant(
userId,
altUserId,
userName,
isRequestor,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Source()),
networkId);
} | [
"public",
"void",
"addSourceActiveParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"String",
"networkId",
",",
"boolean",
"isRequestor",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
"user... | Adds an Active Participant block representing the source participant
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param networkId The Active Participant's Network Access Point ID
@param isRequestor Whether th... | [
"Adds",
"an",
"Active",
"Participant",
"block",
"representing",
"the",
"source",
"participant"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L96-L105 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addDestinationActiveParticipant | public void addDestinationActiveParticipant(String userId, String altUserId, String userName, String networkId, boolean isRequestor)
{
addActiveParticipant(
userId,
altUserId,
userName,
isRequestor,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Destination()),
networkId)... | java | public void addDestinationActiveParticipant(String userId, String altUserId, String userName, String networkId, boolean isRequestor)
{
addActiveParticipant(
userId,
altUserId,
userName,
isRequestor,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Destination()),
networkId)... | [
"public",
"void",
"addDestinationActiveParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"String",
"networkId",
",",
"boolean",
"isRequestor",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
... | Adds an Active Participant block representing the destination participant
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param networkId The Active Participant's Network Access Point ID
@param isRequestor Wheth... | [
"Adds",
"an",
"Active",
"Participant",
"block",
"representing",
"the",
"destination",
"participant"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L115-L124 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addSubmissionSetParticipantObject | public void addSubmissionSetParticipantObject(String submissionSetUniqueId)
{
addParticipantObjectIdentification(
new IHETransactionParticipantObjectIDTypeCodes.SubmissionSet(),
null,
null,
null,
submissionSetUniqueId,
RFC3881ParticipantObjectTypeCodes.SYSTEM,
RFC3881ParticipantObje... | java | public void addSubmissionSetParticipantObject(String submissionSetUniqueId)
{
addParticipantObjectIdentification(
new IHETransactionParticipantObjectIDTypeCodes.SubmissionSet(),
null,
null,
null,
submissionSetUniqueId,
RFC3881ParticipantObjectTypeCodes.SYSTEM,
RFC3881ParticipantObje... | [
"public",
"void",
"addSubmissionSetParticipantObject",
"(",
"String",
"submissionSetUniqueId",
")",
"{",
"addParticipantObjectIdentification",
"(",
"new",
"IHETransactionParticipantObjectIDTypeCodes",
".",
"SubmissionSet",
"(",
")",
",",
"null",
",",
"null",
",",
"null",
... | Adds a Participant Object representing an XDS Submission Set
@param submissionSetUniqueId The Submission Set Unique ID of the Submission Set | [
"Adds",
"a",
"Participant",
"Object",
"representing",
"an",
"XDS",
"Submission",
"Set"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L188-L200 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addDocumentUriParticipantObject | public void addDocumentUriParticipantObject(String documentRetrieveUri, String documentUniqueId)
{
List<TypeValuePairType> tvp = new LinkedList<>();
if (documentUniqueId != null) {
tvp.add(getTypeValuePair("XDSDocumentEntry.uniqueId", documentUniqueId.getBytes()));
}
addParticipantObjectIdentification(
... | java | public void addDocumentUriParticipantObject(String documentRetrieveUri, String documentUniqueId)
{
List<TypeValuePairType> tvp = new LinkedList<>();
if (documentUniqueId != null) {
tvp.add(getTypeValuePair("XDSDocumentEntry.uniqueId", documentUniqueId.getBytes()));
}
addParticipantObjectIdentification(
... | [
"public",
"void",
"addDocumentUriParticipantObject",
"(",
"String",
"documentRetrieveUri",
",",
"String",
"documentUniqueId",
")",
"{",
"List",
"<",
"TypeValuePairType",
">",
"tvp",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"if",
"(",
"documentUniqueId",
"!="... | Adds a Participant Object representing a URI
@param documentRetrieveUri The URI of the Participant Object
@param documentUniqueId The Document Entry Unique ID | [
"Adds",
"a",
"Participant",
"Object",
"representing",
"a",
"URI"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L208-L224 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addDocumentParticipantObject | public void addDocumentParticipantObject(String documentUniqueId, String repositoryUniqueId, String homeCommunityId)
{
List<TypeValuePairType> tvp = new LinkedList<>();
//SEK - 10/19/2011 - added check for empty or null, RE: Issue Tracker artifact artf2295 (was Issue 135)
if (!EventUtils.isEmptyOrNull(rep... | java | public void addDocumentParticipantObject(String documentUniqueId, String repositoryUniqueId, String homeCommunityId)
{
List<TypeValuePairType> tvp = new LinkedList<>();
//SEK - 10/19/2011 - added check for empty or null, RE: Issue Tracker artifact artf2295 (was Issue 135)
if (!EventUtils.isEmptyOrNull(rep... | [
"public",
"void",
"addDocumentParticipantObject",
"(",
"String",
"documentUniqueId",
",",
"String",
"repositoryUniqueId",
",",
"String",
"homeCommunityId",
")",
"{",
"List",
"<",
"TypeValuePairType",
">",
"tvp",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"//SE... | Adds a Participant Object representing a document for XDS Exports
@param documentUniqueId The Document Entry Unique Id
@param repositoryUniqueId The Repository Unique Id of the Repository housing the document
@param homeCommunityId The Home Community Id | [
"Adds",
"a",
"Participant",
"Object",
"representing",
"a",
"document",
"for",
"XDS",
"Exports"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L233-L254 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addValueSetParticipantObject | public void addValueSetParticipantObject(String valueSetUniqueId, String valueSetName, String valueSetVersion)
{
if (valueSetName == null){
valueSetName = "";
}
if (valueSetVersion == null){
valueSetVersion = "";
}
List<TypeValuePairType> tvp = new LinkedList<>();
tvp.add(getTypeValuePair("Value Set ... | java | public void addValueSetParticipantObject(String valueSetUniqueId, String valueSetName, String valueSetVersion)
{
if (valueSetName == null){
valueSetName = "";
}
if (valueSetVersion == null){
valueSetVersion = "";
}
List<TypeValuePairType> tvp = new LinkedList<>();
tvp.add(getTypeValuePair("Value Set ... | [
"public",
"void",
"addValueSetParticipantObject",
"(",
"String",
"valueSetUniqueId",
",",
"String",
"valueSetName",
",",
"String",
"valueSetVersion",
")",
"{",
"if",
"(",
"valueSetName",
"==",
"null",
")",
"{",
"valueSetName",
"=",
"\"\"",
";",
"}",
"if",
"(",
... | Adds a Participant Object representing a value set for SVS Exports
@param valueSetUniqueId unique id (OID) of the returned value set
@param valueSetName name associated with the unique id (OID) of the returned value set
@param valueSetVersion version of the returned value set | [
"Adds",
"a",
"Participant",
"Object",
"representing",
"a",
"value",
"set",
"for",
"SVS",
"Exports"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L262-L282 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java | XCARespondingGatewayAuditor.getAuditor | public static XCARespondingGatewayAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (XCARespondingGatewayAuditor)ctx.getAuditor(XCARespondingGatewayAuditor.class);
} | java | public static XCARespondingGatewayAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (XCARespondingGatewayAuditor)ctx.getAuditor(XCARespondingGatewayAuditor.class);
} | [
"public",
"static",
"XCARespondingGatewayAuditor",
"getAuditor",
"(",
")",
"{",
"AuditorModuleContext",
"ctx",
"=",
"AuditorModuleContext",
".",
"getContext",
"(",
")",
";",
"return",
"(",
"XCARespondingGatewayAuditor",
")",
"ctx",
".",
"getAuditor",
"(",
"XCARespondi... | Get an instance of the XCA Responding Gateway Auditor from the
global context
@return XCA Responding Gateway Auditor instance | [
"Get",
"an",
"instance",
"of",
"the",
"XCA",
"Responding",
"Gateway",
"Auditor",
"from",
"the",
"global",
"context"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java#L45-L49 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java | XCARespondingGatewayAuditor.auditCrossGatewayQueryEvent | public void auditCrossGatewayQueryEvent(
RFC3881EventOutcomeCodes eventOutcome,
String initiatingGatewayUserId, String initiatingGatewayUserName, String initiatingGatewayIpAddress,
String respondingGatewayEndpointUri,
String storedQueryUUID, String adhocQueryRequestPayload, String homeCommunityId,
Strin... | java | public void auditCrossGatewayQueryEvent(
RFC3881EventOutcomeCodes eventOutcome,
String initiatingGatewayUserId, String initiatingGatewayUserName, String initiatingGatewayIpAddress,
String respondingGatewayEndpointUri,
String storedQueryUUID, String adhocQueryRequestPayload, String homeCommunityId,
Strin... | [
"public",
"void",
"auditCrossGatewayQueryEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"initiatingGatewayUserId",
",",
"String",
"initiatingGatewayUserName",
",",
"String",
"initiatingGatewayIpAddress",
",",
"String",
"respondingGatewayEndpointUri",
",",... | Audits an ITI-38 Cross Gateway Query event for XCA Responding Gateway actors.
@param eventOutcome The event outcome indicator
@param initiatingGatewayUserId The Active Participant UserID for the consumer (if using WS-Addressing)
@param initiatingGatewayUserName The Active Participant UserName for the consumer (if usin... | [
"Audits",
"an",
"ITI",
"-",
"38",
"Cross",
"Gateway",
"Query",
"event",
"for",
"XCA",
"Responding",
"Gateway",
"actors",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java#L67-L87 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java | XCARespondingGatewayAuditor.auditCrossGatewayRetrieveEvent | public void auditCrossGatewayRetrieveEvent(
RFC3881EventOutcomeCodes eventOutcome,
String initiatingGatewayUserId, String initiatingGatewayIpAddress,
String respondingGatewayEndpointUri,
String initiatingGatewayUserName,
String[] documentUniqueIds, String[] repositoryUniqueIds, String homeCommun... | java | public void auditCrossGatewayRetrieveEvent(
RFC3881EventOutcomeCodes eventOutcome,
String initiatingGatewayUserId, String initiatingGatewayIpAddress,
String respondingGatewayEndpointUri,
String initiatingGatewayUserName,
String[] documentUniqueIds, String[] repositoryUniqueIds, String homeCommun... | [
"public",
"void",
"auditCrossGatewayRetrieveEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"initiatingGatewayUserId",
",",
"String",
"initiatingGatewayIpAddress",
",",
"String",
"respondingGatewayEndpointUri",
",",
"String",
"initiatingGatewayUserName",
"... | Audits an ITI-39 Cross Gateway Retrieve event for XCA Responding Gateway actors.
@param eventOutcome The event outcome indicator
@param initiatingGatewayUserId The Active Participant UserID for the document consumer (if using WS-Addressing)
@param initiatingGatewayUserName The Active Participant UserName for the docum... | [
"Audits",
"an",
"ITI",
"-",
"39",
"Cross",
"Gateway",
"Retrieve",
"event",
"for",
"XCA",
"Responding",
"Gateway",
"actors",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java#L103-L131 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java | XCARespondingGatewayAuditor.auditRetrieveDocumentSetEvent | public void auditRetrieveDocumentSetEvent(RFC3881EventOutcomeCodes eventOutcome,
String repositoryEndpointUri,
String userName,
String[] documentUniqueIds, String[] repositoryUniqueIds, String homeCommunityIds[],
List<CodedValueType> purposesOfUse, List<CodedValueType> userRoles)
{
if ... | java | public void auditRetrieveDocumentSetEvent(RFC3881EventOutcomeCodes eventOutcome,
String repositoryEndpointUri,
String userName,
String[] documentUniqueIds, String[] repositoryUniqueIds, String homeCommunityIds[],
List<CodedValueType> purposesOfUse, List<CodedValueType> userRoles)
{
if ... | [
"public",
"void",
"auditRetrieveDocumentSetEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"repositoryEndpointUri",
",",
"String",
"userName",
",",
"String",
"[",
"]",
"documentUniqueIds",
",",
"String",
"[",
"]",
"repositoryUniqueIds",
",",
"Str... | Audits an ITI-43 Retrieve Document Set event for XCA Responding Gateway actors.
@param eventOutcome The event outcome indicator
@param repositoryEndpointUri The Web service endpoint URI for the document repository
@param repositoryUniqueIds The XDS.b RepositoryUniqueId value for the repository
@param documentUniqueIds... | [
"Audits",
"an",
"ITI",
"-",
"43",
"Retrieve",
"Document",
"Set",
"event",
"for",
"XCA",
"Responding",
"Gateway",
"actors",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java#L144-L156 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java | XCARespondingGatewayAuditor.auditRegistryStoredQueryEvent | public void auditRegistryStoredQueryEvent(
RFC3881EventOutcomeCodes eventOutcome,
String registryEndpointUri,
String consumerUserName,
String storedQueryUUID, String adhocQueryRequestPayload, String homeCommunityId,
String patientId,
List<CodedValueType> purposesOfUse,
List<CodedV... | java | public void auditRegistryStoredQueryEvent(
RFC3881EventOutcomeCodes eventOutcome,
String registryEndpointUri,
String consumerUserName,
String storedQueryUUID, String adhocQueryRequestPayload, String homeCommunityId,
String patientId,
List<CodedValueType> purposesOfUse,
List<CodedV... | [
"public",
"void",
"auditRegistryStoredQueryEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"registryEndpointUri",
",",
"String",
"consumerUserName",
",",
"String",
"storedQueryUUID",
",",
"String",
"adhocQueryRequestPayload",
",",
"String",
"homeCommun... | Audits an ITI-18 Registry Stored Query event for XCA Responding Gateway actors.
@param eventOutcome The event outcome indicator
@param registryEndpointUri The endpoint of the registry in this transaction
@param storedQueryUUID The UUID of the stored query
@param adhocQueryRequestPayload The payload of the adhoc query ... | [
"Audits",
"an",
"ITI",
"-",
"18",
"Registry",
"Stored",
"Query",
"event",
"for",
"XCA",
"Responding",
"Gateway",
"actors",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java#L170-L185 | train |
jingwei/krati | krati-main/src/main/java/krati/core/array/entry/EntryValueInt.java | EntryValueInt.write | @Override
public void write(DataWriter writer) throws IOException {
writer.writeInt(pos); /* array position */
writer.writeInt(val); /* data value */
writer.writeLong(scn); /* SCN value */
} | java | @Override
public void write(DataWriter writer) throws IOException {
writer.writeInt(pos); /* array position */
writer.writeInt(val); /* data value */
writer.writeLong(scn); /* SCN value */
} | [
"@",
"Override",
"public",
"void",
"write",
"(",
"DataWriter",
"writer",
")",
"throws",
"IOException",
"{",
"writer",
".",
"writeInt",
"(",
"pos",
")",
";",
"/* array position */",
"writer",
".",
"writeInt",
"(",
"val",
")",
";",
"/* data value */",
"writer",
... | Writes this EntryValue to entry log file via a data writer.
@param writer
@throws IOException | [
"Writes",
"this",
"EntryValue",
"to",
"entry",
"log",
"file",
"via",
"a",
"data",
"writer",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/entry/EntryValueInt.java#L80-L85 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/toolbox/ByteArrayPool.java | ByteArrayPool.getBuf | public synchronized byte[] getBuf(int len) {
for (int i = 0; i < mBuffersBySize.size(); i++) {
byte[] buf = mBuffersBySize.get(i);
if (buf.length >= len) {
mCurrentSize -= buf.length;
mBuffersBySize.remove(i);
mBuffersByLastUse.remove(buf);... | java | public synchronized byte[] getBuf(int len) {
for (int i = 0; i < mBuffersBySize.size(); i++) {
byte[] buf = mBuffersBySize.get(i);
if (buf.length >= len) {
mCurrentSize -= buf.length;
mBuffersBySize.remove(i);
mBuffersByLastUse.remove(buf);... | [
"public",
"synchronized",
"byte",
"[",
"]",
"getBuf",
"(",
"int",
"len",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mBuffersBySize",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"byte",
"[",
"]",
"buf",
"=",
"mBuffersBySize",... | Returns a buffer from the pool if one is available in the requested size, or allocates a new
one if a pooled one is not available.
@param len the minimum size, in bytes, of the requested buffer. The returned buffer may be
larger.
@return a byte[] buffer is always returned. | [
"Returns",
"a",
"buffer",
"from",
"the",
"pool",
"if",
"one",
"is",
"available",
"in",
"the",
"requested",
"size",
"or",
"allocates",
"a",
"new",
"one",
"if",
"a",
"pooled",
"one",
"is",
"not",
"available",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/toolbox/ByteArrayPool.java#L91-L102 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/toolbox/ByteArrayPool.java | ByteArrayPool.returnBuf | public synchronized void returnBuf(byte[] buf) {
if (buf == null || buf.length > mSizeLimit) {
return;
}
mBuffersByLastUse.add(buf);
int pos = Collections.binarySearch(mBuffersBySize, buf, BUF_COMPARATOR);
if (pos < 0) {
pos = -pos - 1;
}
m... | java | public synchronized void returnBuf(byte[] buf) {
if (buf == null || buf.length > mSizeLimit) {
return;
}
mBuffersByLastUse.add(buf);
int pos = Collections.binarySearch(mBuffersBySize, buf, BUF_COMPARATOR);
if (pos < 0) {
pos = -pos - 1;
}
m... | [
"public",
"synchronized",
"void",
"returnBuf",
"(",
"byte",
"[",
"]",
"buf",
")",
"{",
"if",
"(",
"buf",
"==",
"null",
"||",
"buf",
".",
"length",
">",
"mSizeLimit",
")",
"{",
"return",
";",
"}",
"mBuffersByLastUse",
".",
"add",
"(",
"buf",
")",
";",... | Returns a buffer to the pool, throwing away old buffers if the pool would exceed its allotted
size.
@param buf the buffer to return to the pool. | [
"Returns",
"a",
"buffer",
"to",
"the",
"pool",
"throwing",
"away",
"old",
"buffers",
"if",
"the",
"pool",
"would",
"exceed",
"its",
"allotted",
"size",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/toolbox/ByteArrayPool.java#L110-L122 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentIndexBuffer.java | SegmentIndexBuffer.ensure128BitMD5 | protected byte[] ensure128BitMD5(byte[] digest) {
if(digest.length == MD5_LENGTH) {
return digest;
} else if(digest.length > MD5_LENGTH) {
byte[] b = new byte[MD5_LENGTH];
System.arraycopy(digest, 0, b, 0, MD5_LENGTH);
return b;
} else {
... | java | protected byte[] ensure128BitMD5(byte[] digest) {
if(digest.length == MD5_LENGTH) {
return digest;
} else if(digest.length > MD5_LENGTH) {
byte[] b = new byte[MD5_LENGTH];
System.arraycopy(digest, 0, b, 0, MD5_LENGTH);
return b;
} else {
... | [
"protected",
"byte",
"[",
"]",
"ensure128BitMD5",
"(",
"byte",
"[",
"]",
"digest",
")",
"{",
"if",
"(",
"digest",
".",
"length",
"==",
"MD5_LENGTH",
")",
"{",
"return",
"digest",
";",
"}",
"else",
"if",
"(",
"digest",
".",
"length",
">",
"MD5_LENGTH",
... | Ensure that the specified MD5 digest has 128 bits. | [
"Ensure",
"that",
"the",
"specified",
"MD5",
"digest",
"has",
"128",
"bits",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentIndexBuffer.java#L350-L363 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentIndexBuffer.java | SegmentIndexBuffer.ensureCapacity | protected void ensureCapacity() {
if(_buffer.remaining() < 8) {
ByteBuffer b = ByteBuffer.allocate(_buffer.capacity() << 1);
_buffer.flip();
b.put(_buffer);
_buffer = b;
}
} | java | protected void ensureCapacity() {
if(_buffer.remaining() < 8) {
ByteBuffer b = ByteBuffer.allocate(_buffer.capacity() << 1);
_buffer.flip();
b.put(_buffer);
_buffer = b;
}
} | [
"protected",
"void",
"ensureCapacity",
"(",
")",
"{",
"if",
"(",
"_buffer",
".",
"remaining",
"(",
")",
"<",
"8",
")",
"{",
"ByteBuffer",
"b",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"_buffer",
".",
"capacity",
"(",
")",
"<<",
"1",
")",
";",
"_buffe... | Ensure that the internal backing buffer has enough capacity for a new pair of index and offset. | [
"Ensure",
"that",
"the",
"internal",
"backing",
"buffer",
"has",
"enough",
"capacity",
"for",
"a",
"new",
"pair",
"of",
"index",
"and",
"offset",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentIndexBuffer.java#L368-L375 | train |
jingwei/krati | krati-main/src/retention/java/krati/retention/SimpleRetention.java | SimpleRetention.get | @Override
public Position get(Position pos, List<Event<T>> list) {
EventBatch<T> b;
// Return null if the position is out of retention or in the indexed form.
if(pos.getOffset() < getOrigin() || pos.isIndexed()) {
return null;
}
// Get events fro... | java | @Override
public Position get(Position pos, List<Event<T>> list) {
EventBatch<T> b;
// Return null if the position is out of retention or in the indexed form.
if(pos.getOffset() < getOrigin() || pos.isIndexed()) {
return null;
}
// Get events fro... | [
"@",
"Override",
"public",
"Position",
"get",
"(",
"Position",
"pos",
",",
"List",
"<",
"Event",
"<",
"T",
">",
">",
"list",
")",
"{",
"EventBatch",
"<",
"T",
">",
"b",
";",
"// Return null if the position is out of retention or in the indexed form.",
"if",
"(",... | Gets a number of events starting from a given position in the Retention.
The number of events is determined internally by the Retention and it is
up to the batch size.
@param pos - the retention position from where events will be read
@param list - the event list to fill in
@return The next position from where new ev... | [
"Gets",
"a",
"number",
"of",
"events",
"starting",
"from",
"a",
"given",
"position",
"in",
"the",
"Retention",
".",
"The",
"number",
"of",
"events",
"is",
"determined",
"internally",
"by",
"the",
"Retention",
"and",
"it",
"is",
"up",
"to",
"the",
"batch",
... | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/retention/java/krati/retention/SimpleRetention.java#L492-L546 | train |
jingwei/krati | krati-main/src/retention/java/krati/retention/SimpleRetention.java | SimpleRetention.mergeEventsToLastBatch | protected boolean mergeEventsToLastBatch() throws IOException {
// Checks if we can merge _batch into _lastBatch
if(_lastBatch != null && _eventBatchSize >= (_lastBatch.getSize() + _batch.getSize())) {
_batch.setCompletionTime(System.currentTimeMillis());
if(_flushLi... | java | protected boolean mergeEventsToLastBatch() throws IOException {
// Checks if we can merge _batch into _lastBatch
if(_lastBatch != null && _eventBatchSize >= (_lastBatch.getSize() + _batch.getSize())) {
_batch.setCompletionTime(System.currentTimeMillis());
if(_flushLi... | [
"protected",
"boolean",
"mergeEventsToLastBatch",
"(",
")",
"throws",
"IOException",
"{",
"// Checks if we can merge _batch into _lastBatch",
"if",
"(",
"_lastBatch",
"!=",
"null",
"&&",
"_eventBatchSize",
">=",
"(",
"_lastBatch",
".",
"getSize",
"(",
")",
"+",
"_batc... | Try to merge events from the current batch to the last persisted batch
in order to reduce the number of smaller batches in the retention.
@return <code>true</code> if the merge operation is performed successfully
@throws IOException | [
"Try",
"to",
"merge",
"events",
"from",
"the",
"current",
"batch",
"to",
"the",
"last",
"persisted",
"batch",
"in",
"order",
"to",
"reduce",
"the",
"number",
"of",
"smaller",
"batches",
"in",
"the",
"retention",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/retention/java/krati/retention/SimpleRetention.java#L700-L751 | train |
jingwei/krati | krati-avro/src/demo/java/krati/store/demo/bus2/AvroStoreBus2HttpServer.java | AvroStoreBus2HttpServer.createPersonSchema | static Schema createPersonSchema() {
List<Field> fields = new ArrayList<Field>();
fields.add(new Field("id", Schema.create(Type.INT), null, null));
fields.add(new Field("age", Schema.create(Type.INT), null, null));
fields.add(new Field("fname", Schema.create(Type.STRING), null, null));
... | java | static Schema createPersonSchema() {
List<Field> fields = new ArrayList<Field>();
fields.add(new Field("id", Schema.create(Type.INT), null, null));
fields.add(new Field("age", Schema.create(Type.INT), null, null));
fields.add(new Field("fname", Schema.create(Type.STRING), null, null));
... | [
"static",
"Schema",
"createPersonSchema",
"(",
")",
"{",
"List",
"<",
"Field",
">",
"fields",
"=",
"new",
"ArrayList",
"<",
"Field",
">",
"(",
")",
";",
"fields",
".",
"add",
"(",
"new",
"Field",
"(",
"\"id\"",
",",
"Schema",
".",
"create",
"(",
"Typ... | Creates the Avro schema for the Person store. | [
"Creates",
"the",
"Avro",
"schema",
"for",
"the",
"Person",
"store",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-avro/src/demo/java/krati/store/demo/bus2/AvroStoreBus2HttpServer.java#L74-L85 | train |
apptik/jus | benchmark/src/perf/java/io/apptik/comm/jus/perf/RoundTripPerf.java | RoundTripPerf.get | @org.openjdk.jmh.annotations.Benchmark
public CountDownLatch get(States.GenericState state) throws Exception {
//JusLog.ResponseLog.on();
//JusLog.MarkerLog.on();
CountDownLatch latch = new CountDownLatch(state.targetBacklog);
if(state.pipeline==Pipeline.JusDef) {
Request... | java | @org.openjdk.jmh.annotations.Benchmark
public CountDownLatch get(States.GenericState state) throws Exception {
//JusLog.ResponseLog.on();
//JusLog.MarkerLog.on();
CountDownLatch latch = new CountDownLatch(state.targetBacklog);
if(state.pipeline==Pipeline.JusDef) {
Request... | [
"@",
"org",
".",
"openjdk",
".",
"jmh",
".",
"annotations",
".",
"Benchmark",
"public",
"CountDownLatch",
"get",
"(",
"States",
".",
"GenericState",
"state",
")",
"throws",
"Exception",
"{",
"//JusLog.ResponseLog.on();",
"//JusLog.MarkerLog.on();",
"CountDownLatch",
... | This is a dummy benchmark showing the time it takes for a complete async request-response
round trip, considering no or negligible network latency
@param state
@return
@throws Exception | [
"This",
"is",
"a",
"dummy",
"benchmark",
"showing",
"the",
"time",
"it",
"takes",
"for",
"a",
"complete",
"async",
"request",
"-",
"response",
"round",
"trip",
"considering",
"no",
"or",
"negligible",
"network",
"latency"
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/io/apptik/comm/jus/perf/RoundTripPerf.java#L32-L54 | train |
jingwei/krati | krati-main/src/main/java/krati/io/MultiMappedReader.java | MultiMappedReader.remap | public void remap() throws IOException {
if (_mmapArray == null) {
open();
return;
}
long length = _raf.length();
long mappedLength = getMappedLength();
if (length != mappedLength) {
// Allocate mapped buffer array
... | java | public void remap() throws IOException {
if (_mmapArray == null) {
open();
return;
}
long length = _raf.length();
long mappedLength = getMappedLength();
if (length != mappedLength) {
// Allocate mapped buffer array
... | [
"public",
"void",
"remap",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_mmapArray",
"==",
"null",
")",
"{",
"open",
"(",
")",
";",
"return",
";",
"}",
"long",
"length",
"=",
"_raf",
".",
"length",
"(",
")",
";",
"long",
"mappedLength",
"=",
... | Performs re-mapping operation to synchronize with the underling file.
@throws IOException | [
"Performs",
"re",
"-",
"mapping",
"operation",
"to",
"synchronize",
"with",
"the",
"underling",
"file",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/io/MultiMappedReader.java#L185-L222 | train |
jingwei/krati | krati-main/src/main/java/krati/io/MultiMappedReader.java | MultiMappedReader.getMappedLength | public final long getMappedLength() {
MappedByteBuffer[] mmapArray = _mmapArray;
long length = 0;
if (mmapArray != null) {
for (MappedByteBuffer mmap : mmapArray) {
length += mmap.capacity();
}
}
return length;
} | java | public final long getMappedLength() {
MappedByteBuffer[] mmapArray = _mmapArray;
long length = 0;
if (mmapArray != null) {
for (MappedByteBuffer mmap : mmapArray) {
length += mmap.capacity();
}
}
return length;
} | [
"public",
"final",
"long",
"getMappedLength",
"(",
")",
"{",
"MappedByteBuffer",
"[",
"]",
"mmapArray",
"=",
"_mmapArray",
";",
"long",
"length",
"=",
"0",
";",
"if",
"(",
"mmapArray",
"!=",
"null",
")",
"{",
"for",
"(",
"MappedByteBuffer",
"mmap",
":",
... | Gets the total number of bytes of all mapped buffers. | [
"Gets",
"the",
"total",
"number",
"of",
"bytes",
"of",
"all",
"mapped",
"buffers",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/io/MultiMappedReader.java#L227-L238 | train |
apptik/jus | benchmark/src/perf/java/com/android/volley/Response.java | Response.success | public static <T> Response<T> success(T result, Cache.Entry cacheEntry) {
return new Response<T>(result, cacheEntry);
} | java | public static <T> Response<T> success(T result, Cache.Entry cacheEntry) {
return new Response<T>(result, cacheEntry);
} | [
"public",
"static",
"<",
"T",
">",
"Response",
"<",
"T",
">",
"success",
"(",
"T",
"result",
",",
"Cache",
".",
"Entry",
"cacheEntry",
")",
"{",
"return",
"new",
"Response",
"<",
"T",
">",
"(",
"result",
",",
"cacheEntry",
")",
";",
"}"
] | Returns a successful response containing the parsed result. | [
"Returns",
"a",
"successful",
"response",
"containing",
"the",
"parsed",
"result",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/Response.java#L42-L44 | train |
oehf/ipf-oht-atna | context/src/main/java/org/openhealthtools/ihe/atna/context/AbstractModuleConfig.java | AbstractModuleConfig.setOption | public synchronized void setOption(String key, String value)
{
if (key == null || value == null) {
return;
}
config.put(key, value);
} | java | public synchronized void setOption(String key, String value)
{
if (key == null || value == null) {
return;
}
config.put(key, value);
} | [
"public",
"synchronized",
"void",
"setOption",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
"||",
"value",
"==",
"null",
")",
"{",
"return",
";",
"}",
"config",
".",
"put",
"(",
"key",
",",
"value",
")",
"... | Set a value to the backed properties in this
module config.
@param key The key of the property to set
@param value The value of the property to set | [
"Set",
"a",
"value",
"to",
"the",
"backed",
"properties",
"in",
"this",
"module",
"config",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/context/src/main/java/org/openhealthtools/ihe/atna/context/AbstractModuleConfig.java#L73-L79 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XDSAuditor.java | XDSAuditor.auditQueryEvent | protected void auditQueryEvent(
boolean systemIsSource, // System Type
IHETransactionEventTypeCodes transaction, RFC3881EventOutcomeCodes eventOutcome, // Event
String auditSourceId, String auditSourceEnterpriseSiteId, // Audit Source
String sourceUserId, String sourceAltUserId, String sourceUserName, Strin... | java | protected void auditQueryEvent(
boolean systemIsSource, // System Type
IHETransactionEventTypeCodes transaction, RFC3881EventOutcomeCodes eventOutcome, // Event
String auditSourceId, String auditSourceEnterpriseSiteId, // Audit Source
String sourceUserId, String sourceAltUserId, String sourceUserName, Strin... | [
"protected",
"void",
"auditQueryEvent",
"(",
"boolean",
"systemIsSource",
",",
"// System Type",
"IHETransactionEventTypeCodes",
"transaction",
",",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"// Event",
"String",
"auditSourceId",
",",
"String",
"auditSourceEnterpriseSite... | Audits a QUERY event for IHE XDS transactions, notably
XDS Registry Query and XDS Registry Stored Query transactions.
@param systemIsSource Whether the system sending the message is the source active participant
@param transaction IHE Transaction sending the message
@param eventOutcome The event outcome indicator
@par... | [
"Audits",
"a",
"QUERY",
"event",
"for",
"IHE",
"XDS",
"transactions",
"notably",
"XDS",
"Registry",
"Query",
"and",
"XDS",
"Registry",
"Stored",
"Query",
"transactions",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XDSAuditor.java#L55-L95 | train |
apptik/jus | retro-jus/src/main/java/io/apptik/comm/jus/retro/RequestFactoryParser.java | RequestFactoryParser.parsePathParameters | static Set<String> parsePathParameters(String path) {
Matcher m = PARAM_URL_REGEX.matcher(path);
Set<String> patterns = new LinkedHashSet<>();
while (m.find()) {
patterns.add(m.group(1));
}
return patterns;
} | java | static Set<String> parsePathParameters(String path) {
Matcher m = PARAM_URL_REGEX.matcher(path);
Set<String> patterns = new LinkedHashSet<>();
while (m.find()) {
patterns.add(m.group(1));
}
return patterns;
} | [
"static",
"Set",
"<",
"String",
">",
"parsePathParameters",
"(",
"String",
"path",
")",
"{",
"Matcher",
"m",
"=",
"PARAM_URL_REGEX",
".",
"matcher",
"(",
"path",
")",
";",
"Set",
"<",
"String",
">",
"patterns",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")"... | Gets the set of unique path parameters used in the given URI. If a parameter is used twice
in the URI, it will only show up once in the set. | [
"Gets",
"the",
"set",
"of",
"unique",
"path",
"parameters",
"used",
"in",
"the",
"given",
"URI",
".",
"If",
"a",
"parameter",
"is",
"used",
"twice",
"in",
"the",
"URI",
"it",
"will",
"only",
"show",
"up",
"once",
"in",
"the",
"set",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/retro-jus/src/main/java/io/apptik/comm/jus/retro/RequestFactoryParser.java#L441-L448 | train |
apptik/jus | benchmark/src/perf/java/com/android/volley/Request.java | Request.getPostBody | @Deprecated
public byte[] getPostBody() throws AuthFailureError {
// Note: For compatibility with legacy clients of volley, this implementation must remain
// here instead of simply calling the getBody() function because this function must
// call getPostParams() and getPostParamsEncoding() ... | java | @Deprecated
public byte[] getPostBody() throws AuthFailureError {
// Note: For compatibility with legacy clients of volley, this implementation must remain
// here instead of simply calling the getBody() function because this function must
// call getPostParams() and getPostParamsEncoding() ... | [
"@",
"Deprecated",
"public",
"byte",
"[",
"]",
"getPostBody",
"(",
")",
"throws",
"AuthFailureError",
"{",
"// Note: For compatibility with legacy clients of volley, this implementation must remain",
"// here instead of simply calling the getBody() function because this function must",
"... | Returns the raw POST body to be sent.
@throws AuthFailureError In the event of auth failure
@deprecated Use {@link #getBody()} instead. | [
"Returns",
"the",
"raw",
"POST",
"body",
"to",
"be",
"sent",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/Request.java#L350-L361 | train |
apptik/jus | benchmark/src/perf/java/com/android/volley/Request.java | Request.getBody | public byte[] getBody() throws AuthFailureError {
Map<String, String> params = getParams();
if (params != null && params.size() > 0) {
return encodeParameters(params, getParamsEncoding());
}
return null;
} | java | public byte[] getBody() throws AuthFailureError {
Map<String, String> params = getParams();
if (params != null && params.size() > 0) {
return encodeParameters(params, getParamsEncoding());
}
return null;
} | [
"public",
"byte",
"[",
"]",
"getBody",
"(",
")",
"throws",
"AuthFailureError",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"getParams",
"(",
")",
";",
"if",
"(",
"params",
"!=",
"null",
"&&",
"params",
".",
"size",
"(",
")",
">",
... | Returns the raw POST or PUT body to be sent.
<p>By default, the body consists of the request parameters in
application/x-www-form-urlencoded format. When overriding this method, consider overriding
{@link #getBodyContentType()} as well to match the new body format.
@throws AuthFailureError in the event of auth failur... | [
"Returns",
"the",
"raw",
"POST",
"or",
"PUT",
"body",
"to",
"be",
"sent",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/Request.java#L407-L413 | train |
jingwei/krati | krati-main/src/examples/java/krati/examples/LargeStore.java | LargeStore.createDataStore | protected DataStore<byte[], byte[]> createDataStore(File homeDir, int initialCapacity) throws Exception {
StoreConfig config = new StoreConfig(homeDir, initialCapacity);
config.setBatchSize(10000);
config.setNumSyncBatches(100);
// Configure store segments
confi... | java | protected DataStore<byte[], byte[]> createDataStore(File homeDir, int initialCapacity) throws Exception {
StoreConfig config = new StoreConfig(homeDir, initialCapacity);
config.setBatchSize(10000);
config.setNumSyncBatches(100);
// Configure store segments
confi... | [
"protected",
"DataStore",
"<",
"byte",
"[",
"]",
",",
"byte",
"[",
"]",
">",
"createDataStore",
"(",
"File",
"homeDir",
",",
"int",
"initialCapacity",
")",
"throws",
"Exception",
"{",
"StoreConfig",
"config",
"=",
"new",
"StoreConfig",
"(",
"homeDir",
",",
... | Creates a DataStore instance. | [
"Creates",
"a",
"DataStore",
"instance",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/examples/java/krati/examples/LargeStore.java#L74-L100 | train |
jingwei/krati | krati-main/src/examples/java/krati/examples/LargeStore.java | LargeStore.populate | public void populate() throws Exception {
for (int i = 0; i < _initialCapacity; i++) {
String str = "key." + i;
byte[] key = str.getBytes();
byte[] value = createDataForKey(str);
_store.put(key, value);
}
_store.sync();
} | java | public void populate() throws Exception {
for (int i = 0; i < _initialCapacity; i++) {
String str = "key." + i;
byte[] key = str.getBytes();
byte[] value = createDataForKey(str);
_store.put(key, value);
}
_store.sync();
} | [
"public",
"void",
"populate",
"(",
")",
"throws",
"Exception",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"_initialCapacity",
";",
"i",
"++",
")",
"{",
"String",
"str",
"=",
"\"key.\"",
"+",
"i",
";",
"byte",
"[",
"]",
"key",
"=",
"str... | Populates the underlying data store.
@throws Exception | [
"Populates",
"the",
"underlying",
"data",
"store",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/examples/java/krati/examples/LargeStore.java#L115-L123 | train |
jingwei/krati | krati-main/src/examples/java/krati/examples/LargeStore.java | LargeStore.doRandomReads | public void doRandomReads(int readCnt) {
Random rand = new Random();
for (int i = 0; i < readCnt; i++) {
int keyId = rand.nextInt(_initialCapacity);
String str = "key." + keyId;
byte[] key = str.getBytes();
byte[] value = _store.get(key);
Syste... | java | public void doRandomReads(int readCnt) {
Random rand = new Random();
for (int i = 0; i < readCnt; i++) {
int keyId = rand.nextInt(_initialCapacity);
String str = "key." + keyId;
byte[] key = str.getBytes();
byte[] value = _store.get(key);
Syste... | [
"public",
"void",
"doRandomReads",
"(",
"int",
"readCnt",
")",
"{",
"Random",
"rand",
"=",
"new",
"Random",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"readCnt",
";",
"i",
"++",
")",
"{",
"int",
"keyId",
"=",
"rand",
".",
"... | Perform a number of random reads from the underlying data store.
@param readCnt the number of reads | [
"Perform",
"a",
"number",
"of",
"random",
"reads",
"from",
"the",
"underlying",
"data",
"store",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/examples/java/krati/examples/LargeStore.java#L130-L139 | train |
rpatil26/webutilities | src/main/java/com/googlecode/webutilities/servlets/JSCSSMergeServlet.java | JSCSSMergeServlet.init | @Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
this.expiresMinutes = readLong(config.getInitParameter(INIT_PARAM_EXPIRES_MINUTES), this.expiresMinutes);
this.cacheControl = config.getInitParameter(INIT_PARAM_CACHE_CONTROL) != null ? config.getI... | java | @Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
this.expiresMinutes = readLong(config.getInitParameter(INIT_PARAM_EXPIRES_MINUTES), this.expiresMinutes);
this.cacheControl = config.getInitParameter(INIT_PARAM_CACHE_CONTROL) != null ? config.getI... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"ServletConfig",
"config",
")",
"throws",
"ServletException",
"{",
"super",
".",
"init",
"(",
"config",
")",
";",
"this",
".",
"expiresMinutes",
"=",
"readLong",
"(",
"config",
".",
"getInitParameter",
"(",
"IN... | default enabled fingerprinting | [
"default",
"enabled",
"fingerprinting"
] | fdd04f59923cd0f2d80540b861aa0268da99f5c7 | https://github.com/rpatil26/webutilities/blob/fdd04f59923cd0f2d80540b861aa0268da99f5c7/src/main/java/com/googlecode/webutilities/servlets/JSCSSMergeServlet.java#L171-L189 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/ApplicationActivityEvent.java | ApplicationActivityEvent.addApplicationParticipant | public void addApplicationParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
false,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Application()),
networkId);
} | java | public void addApplicationParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
false,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.Application()),
networkId);
} | [
"public",
"void",
"addApplicationParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"String",
"networkId",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
"userName",
",",
"false",
",",
"Col... | Add an Application Active Participant to this message
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param networkId The Active Participant's Network Access Point ID | [
"Add",
"an",
"Application",
"Active",
"Participant",
"to",
"this",
"message"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/ApplicationActivityEvent.java#L54-L63 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/ApplicationActivityEvent.java | ApplicationActivityEvent.addApplicationStarterParticipant | public void addApplicationStarterParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
true,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.ApplicationLauncher()),
networkId);
} | java | public void addApplicationStarterParticipant(String userId, String altUserId, String userName, String networkId)
{
addActiveParticipant(
userId,
altUserId,
userName,
true,
Collections.singletonList(new DICOMActiveParticipantRoleIdCodes.ApplicationLauncher()),
networkId);
} | [
"public",
"void",
"addApplicationStarterParticipant",
"(",
"String",
"userId",
",",
"String",
"altUserId",
",",
"String",
"userName",
",",
"String",
"networkId",
")",
"{",
"addActiveParticipant",
"(",
"userId",
",",
"altUserId",
",",
"userName",
",",
"true",
",",
... | Add an Application Starter Active Participant to this message
@param userId The Active Participant's User ID
@param altUserId The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param networkId The Active Participant's Network Access Point ID | [
"Add",
"an",
"Application",
"Starter",
"Active",
"Participant",
"to",
"this",
"message"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/ApplicationActivityEvent.java#L73-L82 | train |
apptik/jus | benchmark/src/perf/java/com/android/volley/toolbox/DiskBasedCache.java | DiskBasedCache.invalidate | @Override
public synchronized void invalidate(String key, boolean fullExpire) {
Entry entry = get(key);
if (entry != null) {
entry.softTtl = 0;
if (fullExpire) {
entry.ttl = 0;
}
put(key, entry);
}
} | java | @Override
public synchronized void invalidate(String key, boolean fullExpire) {
Entry entry = get(key);
if (entry != null) {
entry.softTtl = 0;
if (fullExpire) {
entry.ttl = 0;
}
put(key, entry);
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"invalidate",
"(",
"String",
"key",
",",
"boolean",
"fullExpire",
")",
"{",
"Entry",
"entry",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"entry",
"!=",
"null",
")",
"{",
"entry",
".",
"softTtl",
"=",... | Invalidates an entry in the cache.
@param key Cache key
@param fullExpire True to fully expire the entry, false to soft expire | [
"Invalidates",
"an",
"entry",
"in",
"the",
"cache",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/toolbox/DiskBasedCache.java#L181-L192 | train |
apptik/jus | benchmark/src/perf/java/com/android/volley/toolbox/DiskBasedCache.java | DiskBasedCache.getFilenameForKey | private String getFilenameForKey(String key) {
int firstHalfLength = key.length() / 2;
String localFilename = String.valueOf(key.substring(0, firstHalfLength).hashCode());
localFilename += String.valueOf(key.substring(firstHalfLength).hashCode());
return localFilename;
} | java | private String getFilenameForKey(String key) {
int firstHalfLength = key.length() / 2;
String localFilename = String.valueOf(key.substring(0, firstHalfLength).hashCode());
localFilename += String.valueOf(key.substring(firstHalfLength).hashCode());
return localFilename;
} | [
"private",
"String",
"getFilenameForKey",
"(",
"String",
"key",
")",
"{",
"int",
"firstHalfLength",
"=",
"key",
".",
"length",
"(",
")",
"/",
"2",
";",
"String",
"localFilename",
"=",
"String",
".",
"valueOf",
"(",
"key",
".",
"substring",
"(",
"0",
",",... | Creates a pseudo-unique filename for the specified cache key.
@param key The key to generate a file name for.
@return A pseudo-unique filename. | [
"Creates",
"a",
"pseudo",
"-",
"unique",
"filename",
"for",
"the",
"specified",
"cache",
"key",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/toolbox/DiskBasedCache.java#L240-L245 | train |
apptik/jus | benchmark/src/perf/java/com/android/volley/toolbox/DiskBasedCache.java | DiskBasedCache.removeEntry | private void removeEntry(String key) {
CacheHeader entry = mEntries.get(key);
if (entry != null) {
mTotalSize -= entry.size;
mEntries.remove(key);
}
} | java | private void removeEntry(String key) {
CacheHeader entry = mEntries.get(key);
if (entry != null) {
mTotalSize -= entry.size;
mEntries.remove(key);
}
} | [
"private",
"void",
"removeEntry",
"(",
"String",
"key",
")",
"{",
"CacheHeader",
"entry",
"=",
"mEntries",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"entry",
"!=",
"null",
")",
"{",
"mTotalSize",
"-=",
"entry",
".",
"size",
";",
"mEntries",
".",
"... | Removes the entry identified by 'key' from the cache. | [
"Removes",
"the",
"entry",
"identified",
"by",
"key",
"from",
"the",
"cache",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/benchmark/src/perf/java/com/android/volley/toolbox/DiskBasedCache.java#L313-L319 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentMeta.java | SegmentMeta.wrap | public synchronized void wrap(List<Segment> segments) throws IOException {
int newWorkingGeneration = (_workingGeneration + 1) % Integer.MAX_VALUE;
int newWorkingSectionOffset = (_workingSectionOffset + _bytesPerSection) % _bytesPerSegment;
int cnt = segments.size();
int pos = _segmentDa... | java | public synchronized void wrap(List<Segment> segments) throws IOException {
int newWorkingGeneration = (_workingGeneration + 1) % Integer.MAX_VALUE;
int newWorkingSectionOffset = (_workingSectionOffset + _bytesPerSection) % _bytesPerSegment;
int cnt = segments.size();
int pos = _segmentDa... | [
"public",
"synchronized",
"void",
"wrap",
"(",
"List",
"<",
"Segment",
">",
"segments",
")",
"throws",
"IOException",
"{",
"int",
"newWorkingGeneration",
"=",
"(",
"_workingGeneration",
"+",
"1",
")",
"%",
"Integer",
".",
"MAX_VALUE",
";",
"int",
"newWorkingSe... | Wrap a list of segments and persist meta data into the .meta file.
@param segments - the segments managed by a {@linkplain SegmentManager}
@throws IOException | [
"Wrap",
"a",
"list",
"of",
"segments",
"and",
"persist",
"meta",
"data",
"into",
"the",
".",
"meta",
"file",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentMeta.java#L190-L241 | train |
oehf/ipf-oht-atna | util/src/main/java/org/openhealthtools/ihe/utils/XMLUtils.java | XMLUtils.createDomDocument | public static Document createDomDocument() throws Exception
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.newDocument();
} | java | public static Document createDomDocument() throws Exception
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.newDocument();
} | [
"public",
"static",
"Document",
"createDomDocument",
"(",
")",
"throws",
"Exception",
"{",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setNamespaceAware",
"(",
"true",
")",
";",
"DocumentBui... | Simple method to create an empty well-formed DOM Document
@return Empty, well-formed DOM Document
@throws Exception | [
"Simple",
"method",
"to",
"create",
"an",
"empty",
"well",
"-",
"formed",
"DOM",
"Document"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/util/src/main/java/org/openhealthtools/ihe/utils/XMLUtils.java#L37-L44 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/http/FormEncodingBuilder.java | FormEncodingBuilder.add | public FormEncodingBuilder add(String name, String value) {
if (content.size() > 0) {
content.writeByte('&');
}
HttpUrl.canonicalize(content, name, 0, name.length(),
HttpUrl.FORM_ENCODE_SET, false, false, true, true);
content.writeByte('=');
HttpUrl.ca... | java | public FormEncodingBuilder add(String name, String value) {
if (content.size() > 0) {
content.writeByte('&');
}
HttpUrl.canonicalize(content, name, 0, name.length(),
HttpUrl.FORM_ENCODE_SET, false, false, true, true);
content.writeByte('=');
HttpUrl.ca... | [
"public",
"FormEncodingBuilder",
"add",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"content",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"content",
".",
"writeByte",
"(",
"'",
"'",
")",
";",
"}",
"HttpUrl",
".",
"canonicalize... | Add new key-value pair. | [
"Add",
"new",
"key",
"-",
"value",
"pair",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/http/FormEncodingBuilder.java#L62-L72 | train |
legsem/legstar-core2 | legstar-base/src/main/java/com/legstar/base/utils/NamespaceUtils.java | NamespaceUtils.toPackageName | public static String toPackageName(String nsUri) {
if (nsUri == null || nsUri.length() == 0) {
return null;
}
// remove scheme and :, if present
// spec only requires us to remove 'http' and 'urn'...
int idx = nsUri.indexOf(':');
String scheme = "";
... | java | public static String toPackageName(String nsUri) {
if (nsUri == null || nsUri.length() == 0) {
return null;
}
// remove scheme and :, if present
// spec only requires us to remove 'http' and 'urn'...
int idx = nsUri.indexOf(':');
String scheme = "";
... | [
"public",
"static",
"String",
"toPackageName",
"(",
"String",
"nsUri",
")",
"{",
"if",
"(",
"nsUri",
"==",
"null",
"||",
"nsUri",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"// remove scheme and :, if present",
"// spec only re... | Create a java package name out of an XML namespace.
@param nsUri the namespace URI
@return null if unable to derive a package name | [
"Create",
"a",
"java",
"package",
"name",
"out",
"of",
"an",
"XML",
"namespace",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/utils/NamespaceUtils.java#L45-L114 | train |
legsem/legstar-core2 | legstar-base/src/main/java/com/legstar/base/utils/NamespaceUtils.java | NamespaceUtils.toNamespace | public static String toNamespace(String packageName) {
if (packageName == null || packageName.length() == 0) {
return null;
}
List < String > tokens = reverse(tokenize(packageName, "."));
StringBuilder buf = new StringBuilder("http://");
for (int i = 1; i < ... | java | public static String toNamespace(String packageName) {
if (packageName == null || packageName.length() == 0) {
return null;
}
List < String > tokens = reverse(tokenize(packageName, "."));
StringBuilder buf = new StringBuilder("http://");
for (int i = 1; i < ... | [
"public",
"static",
"String",
"toNamespace",
"(",
"String",
"packageName",
")",
"{",
"if",
"(",
"packageName",
"==",
"null",
"||",
"packageName",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"String",
">",
"tok... | Create an XML namespace out of a java package name.
@param packageName
@return null if unable to derive a namespace | [
"Create",
"an",
"XML",
"namespace",
"out",
"of",
"a",
"java",
"package",
"name",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/utils/NamespaceUtils.java#L122-L141 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCAInitiatingGatewayAuditor.java | XCAInitiatingGatewayAuditor.getAuditor | public static XCAInitiatingGatewayAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (XCAInitiatingGatewayAuditor)ctx.getAuditor(XCAInitiatingGatewayAuditor.class);
} | java | public static XCAInitiatingGatewayAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (XCAInitiatingGatewayAuditor)ctx.getAuditor(XCAInitiatingGatewayAuditor.class);
} | [
"public",
"static",
"XCAInitiatingGatewayAuditor",
"getAuditor",
"(",
")",
"{",
"AuditorModuleContext",
"ctx",
"=",
"AuditorModuleContext",
".",
"getContext",
"(",
")",
";",
"return",
"(",
"XCAInitiatingGatewayAuditor",
")",
"ctx",
".",
"getAuditor",
"(",
"XCAInitiati... | Get an instance of the XCA Initiating Gateway from the
global context
@return XCA Initiating Gateway Auditor instance | [
"Get",
"an",
"instance",
"of",
"the",
"XCA",
"Initiating",
"Gateway",
"from",
"the",
"global",
"context"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCAInitiatingGatewayAuditor.java#L45-L49 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCAInitiatingGatewayAuditor.java | XCAInitiatingGatewayAuditor.auditRetrieveDocumentSetEvent | public void auditRetrieveDocumentSetEvent(
RFC3881EventOutcomeCodes eventOutcome,
String consumerUserId, String consumerUserName, String consumerIpAddress,
String repositoryEndpointUri,
String[] documentUniqueIds, String[] repositoryUniqueIds, String[] homeCommunityIds,
List<CodedValueType> purposesOfUse... | java | public void auditRetrieveDocumentSetEvent(
RFC3881EventOutcomeCodes eventOutcome,
String consumerUserId, String consumerUserName, String consumerIpAddress,
String repositoryEndpointUri,
String[] documentUniqueIds, String[] repositoryUniqueIds, String[] homeCommunityIds,
List<CodedValueType> purposesOfUse... | [
"public",
"void",
"auditRetrieveDocumentSetEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"consumerUserId",
",",
"String",
"consumerUserName",
",",
"String",
"consumerIpAddress",
",",
"String",
"repositoryEndpointUri",
",",
"String",
"[",
"]",
"do... | Audits an ITI-43 Retrieve Document Set-b event for XCA Initiating Gateway actors. Audits as a XDS Document Registry.
@param eventOutcome The event outcome indicator
@param consumerUserId The Active Participant UserID for the document consumer (if using WS-Addressing)
@param consumerUserName The Active Participant User... | [
"Audits",
"an",
"ITI",
"-",
"43",
"Retrieve",
"Document",
"Set",
"-",
"b",
"event",
"for",
"XCA",
"Initiating",
"Gateway",
"actors",
".",
"Audits",
"as",
"a",
"XDS",
"Document",
"Registry",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCAInitiatingGatewayAuditor.java#L135-L148 | train |
jingwei/krati | krati-main/src/retention/java/krati/retention/AbstractRetentionStoreReader.java | AbstractRetentionStoreReader.get | public Position get(Position pos, Map<K, Event<V>> map) {
ArrayList<Event<K>> list = new ArrayList<Event<K>>(1000);
Position nextPos = get(pos, list);
for(Event<K> evt : list) {
K key = evt.getValue();
if(key != null) {
try {
V... | java | public Position get(Position pos, Map<K, Event<V>> map) {
ArrayList<Event<K>> list = new ArrayList<Event<K>>(1000);
Position nextPos = get(pos, list);
for(Event<K> evt : list) {
K key = evt.getValue();
if(key != null) {
try {
V... | [
"public",
"Position",
"get",
"(",
"Position",
"pos",
",",
"Map",
"<",
"K",
",",
"Event",
"<",
"V",
">",
">",
"map",
")",
"{",
"ArrayList",
"<",
"Event",
"<",
"K",
">>",
"list",
"=",
"new",
"ArrayList",
"<",
"Event",
"<",
"K",
">",
">",
"(",
"10... | Gets a number of value events starting from a give position in the Retention.
The number of events is determined internally by the Retention and it is
up to the batch size.
@param pos - the retention position from where events will be read
@param map - the result map (keys to value events) to fill in
@return the next ... | [
"Gets",
"a",
"number",
"of",
"value",
"events",
"starting",
"from",
"a",
"give",
"position",
"in",
"the",
"Retention",
".",
"The",
"number",
"of",
"events",
"is",
"determined",
"internally",
"by",
"the",
"Retention",
"and",
"it",
"is",
"up",
"to",
"the",
... | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/retention/java/krati/retention/AbstractRetentionStoreReader.java#L44-L61 | train |
legsem/legstar-core2 | legstar-base/src/main/java/com/legstar/base/type/primitive/CobolPrimitiveType.java | CobolPrimitiveType.isValid | public boolean isValid(CobolContext cobolContext, byte[] hostData, int start) {
return isValid(javaClass, cobolContext, hostData, start);
} | java | public boolean isValid(CobolContext cobolContext, byte[] hostData, int start) {
return isValid(javaClass, cobolContext, hostData, start);
} | [
"public",
"boolean",
"isValid",
"(",
"CobolContext",
"cobolContext",
",",
"byte",
"[",
"]",
"hostData",
",",
"int",
"start",
")",
"{",
"return",
"isValid",
"(",
"javaClass",
",",
"cobolContext",
",",
"hostData",
",",
"start",
")",
";",
"}"
] | Check if a byte array contains valid mainframe data for this type
characteristics.
@param cobolContext host COBOL configuration parameters
@param hostData the byte array containing mainframe data
@param start the start position for the expected type in the byte array
@return true if the byte array contains a valid typ... | [
"Check",
"if",
"a",
"byte",
"array",
"contains",
"valid",
"mainframe",
"data",
"for",
"this",
"type",
"characteristics",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/type/primitive/CobolPrimitiveType.java#L54-L56 | train |
legsem/legstar-core2 | legstar-base/src/main/java/com/legstar/base/type/primitive/CobolPrimitiveType.java | CobolPrimitiveType.fromHost | public FromHostPrimitiveResult < T > fromHost(CobolContext cobolContext,
byte[] hostData, int start) {
return fromHost(javaClass, cobolContext, hostData, start);
} | java | public FromHostPrimitiveResult < T > fromHost(CobolContext cobolContext,
byte[] hostData, int start) {
return fromHost(javaClass, cobolContext, hostData, start);
} | [
"public",
"FromHostPrimitiveResult",
"<",
"T",
">",
"fromHost",
"(",
"CobolContext",
"cobolContext",
",",
"byte",
"[",
"]",
"hostData",
",",
"int",
"start",
")",
"{",
"return",
"fromHost",
"(",
"javaClass",
",",
"cobolContext",
",",
"hostData",
",",
"start",
... | Convert mainframe data into a Java object.
@param cobolContext host COBOL configuration parameters
@param hostData the byte array containing mainframe data
@param start the start position for the expected type in the byte array
@return the mainframe value as a java object | [
"Convert",
"mainframe",
"data",
"into",
"a",
"Java",
"object",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/type/primitive/CobolPrimitiveType.java#L79-L82 | train |
legsem/legstar-core2 | legstar-base/src/main/java/com/legstar/base/type/primitive/FromHostPrimitiveResult.java | FromHostPrimitiveResult.formatMessage | protected static String formatMessage(String message, byte[] hostData,
int start, int curPos, int bytesLen) {
StringBuilder sb = new StringBuilder();
sb.append(message);
if (hostData != null && hostData.length > 0 && curPos < hostData.length
&& curPos >= start && byt... | java | protected static String formatMessage(String message, byte[] hostData,
int start, int curPos, int bytesLen) {
StringBuilder sb = new StringBuilder();
sb.append(message);
if (hostData != null && hostData.length > 0 && curPos < hostData.length
&& curPos >= start && byt... | [
"protected",
"static",
"String",
"formatMessage",
"(",
"String",
"message",
",",
"byte",
"[",
"]",
"hostData",
",",
"int",
"start",
",",
"int",
"curPos",
",",
"int",
"bytesLen",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
... | Format the data to make it easy to locate the error in the incoming byte
stream.
@param message the text part of the message (explains the error)
@param hostData the incoming host data stream
@param start the starting position of the primitive type value in the
byte stream
@param curPos the position of the error itsel... | [
"Format",
"the",
"data",
"to",
"make",
"it",
"easy",
"to",
"locate",
"the",
"error",
"in",
"the",
"incoming",
"byte",
"stream",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/type/primitive/FromHostPrimitiveResult.java#L66-L99 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java | AuditorFactory.getAuditor | public static IHEAuditor getAuditor(Class<? extends IHEAuditor> clazz, AuditorModuleConfig configToUse, AuditorModuleContext contextToUse)
{
IHEAuditor auditor = AuditorFactory.getAuditorForClass(clazz);
if (auditor != null) {
auditor.setConfig(configToUse);
auditor.setContext(contextToUse);
}
re... | java | public static IHEAuditor getAuditor(Class<? extends IHEAuditor> clazz, AuditorModuleConfig configToUse, AuditorModuleContext contextToUse)
{
IHEAuditor auditor = AuditorFactory.getAuditorForClass(clazz);
if (auditor != null) {
auditor.setConfig(configToUse);
auditor.setContext(contextToUse);
}
re... | [
"public",
"static",
"IHEAuditor",
"getAuditor",
"(",
"Class",
"<",
"?",
"extends",
"IHEAuditor",
">",
"clazz",
",",
"AuditorModuleConfig",
"configToUse",
",",
"AuditorModuleContext",
"contextToUse",
")",
"{",
"IHEAuditor",
"auditor",
"=",
"AuditorFactory",
".",
"get... | Get an auditor instance for the specified auditor class,
auditor configuration, and auditor context.
@param clazz Class to instantiate
@param configToUse Auditor configuration to use
@param contextToUse Auditor context to use
@return Instance of an IHE Auditor | [
"Get",
"an",
"auditor",
"instance",
"for",
"the",
"specified",
"auditor",
"class",
"auditor",
"configuration",
"and",
"auditor",
"context",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L42-L52 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java | AuditorFactory.getAuditor | public static IHEAuditor getAuditor(Class<? extends IHEAuditor> clazz, AuditorModuleConfig config, boolean useGlobalContext)
{
AuditorModuleContext context;
if (!useGlobalContext) {
context = (AuditorModuleContext)ContextInitializer.initialize(config);
} else {
context = AuditorModuleContext.getContext();
... | java | public static IHEAuditor getAuditor(Class<? extends IHEAuditor> clazz, AuditorModuleConfig config, boolean useGlobalContext)
{
AuditorModuleContext context;
if (!useGlobalContext) {
context = (AuditorModuleContext)ContextInitializer.initialize(config);
} else {
context = AuditorModuleContext.getContext();
... | [
"public",
"static",
"IHEAuditor",
"getAuditor",
"(",
"Class",
"<",
"?",
"extends",
"IHEAuditor",
">",
"clazz",
",",
"AuditorModuleConfig",
"config",
",",
"boolean",
"useGlobalContext",
")",
"{",
"AuditorModuleContext",
"context",
";",
"if",
"(",
"!",
"useGlobalCon... | Get an auditor instance for the specified auditor class, module configuration. Auditor
will use a standalone context if a non-global context is requested.
@param clazz Class to instantiate
@param config Auditor configuration to use
@param useGlobalContext Whether to use the global (true) or standalone (false) context... | [
"Get",
"an",
"auditor",
"instance",
"for",
"the",
"specified",
"auditor",
"class",
"module",
"configuration",
".",
"Auditor",
"will",
"use",
"a",
"standalone",
"context",
"if",
"a",
"non",
"-",
"global",
"context",
"is",
"requested",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L63-L73 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java | AuditorFactory.getAuditor | public static IHEAuditor getAuditor(String className, AuditorModuleConfig config, AuditorModuleContext context)
{
Class<? extends IHEAuditor> clazz = AuditorFactory.getAuditorClassForClassName(className);
return getAuditor(clazz, config, context);
} | java | public static IHEAuditor getAuditor(String className, AuditorModuleConfig config, AuditorModuleContext context)
{
Class<? extends IHEAuditor> clazz = AuditorFactory.getAuditorClassForClassName(className);
return getAuditor(clazz, config, context);
} | [
"public",
"static",
"IHEAuditor",
"getAuditor",
"(",
"String",
"className",
",",
"AuditorModuleConfig",
"config",
",",
"AuditorModuleContext",
"context",
")",
"{",
"Class",
"<",
"?",
"extends",
"IHEAuditor",
">",
"clazz",
"=",
"AuditorFactory",
".",
"getAuditorClass... | Get an auditor instance for the specified auditor class name,
auditor configuration, and auditor context.
@param className Class name of the auditor class to instantiate
@param config Auditor configuration to use
@param context Auditor context to use
@return Instance of an IHE Auditor | [
"Get",
"an",
"auditor",
"instance",
"for",
"the",
"specified",
"auditor",
"class",
"name",
"auditor",
"configuration",
"and",
"auditor",
"context",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L106-L110 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java | AuditorFactory.getAuditor | public static IHEAuditor getAuditor(String className, AuditorModuleConfig config, boolean useGlobalContext)
{
Class<? extends IHEAuditor> clazz = AuditorFactory.getAuditorClassForClassName(className);
return getAuditor(clazz, config, useGlobalContext);
} | java | public static IHEAuditor getAuditor(String className, AuditorModuleConfig config, boolean useGlobalContext)
{
Class<? extends IHEAuditor> clazz = AuditorFactory.getAuditorClassForClassName(className);
return getAuditor(clazz, config, useGlobalContext);
} | [
"public",
"static",
"IHEAuditor",
"getAuditor",
"(",
"String",
"className",
",",
"AuditorModuleConfig",
"config",
",",
"boolean",
"useGlobalContext",
")",
"{",
"Class",
"<",
"?",
"extends",
"IHEAuditor",
">",
"clazz",
"=",
"AuditorFactory",
".",
"getAuditorClassForC... | Get an auditor instance for the specified auditor class name, module configuration.
Auditor will use a standalone context if a non-global context is requested
@param className Class name of the auditor class to instantiate
@param config Auditor configuration to use
@param useGlobalContext Whether to use the global (tr... | [
"Get",
"an",
"auditor",
"instance",
"for",
"the",
"specified",
"auditor",
"class",
"name",
"module",
"configuration",
".",
"Auditor",
"will",
"use",
"a",
"standalone",
"context",
"if",
"a",
"non",
"-",
"global",
"context",
"is",
"requested"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L121-L125 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java | AuditorFactory.getAuditorClassForClassName | @SuppressWarnings("unchecked")
public static Class<? extends IHEAuditor> getAuditorClassForClassName(String className)
{
try {
Class<?> clazz = Class.forName(className);
return (Class<? extends IHEAuditor>)clazz;
} catch (ClassCastException e) {
LOGGER.error("The requested class "+ className +" is not a ... | java | @SuppressWarnings("unchecked")
public static Class<? extends IHEAuditor> getAuditorClassForClassName(String className)
{
try {
Class<?> clazz = Class.forName(className);
return (Class<? extends IHEAuditor>)clazz;
} catch (ClassCastException e) {
LOGGER.error("The requested class "+ className +" is not a ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Class",
"<",
"?",
"extends",
"IHEAuditor",
">",
"getAuditorClassForClassName",
"(",
"String",
"className",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"for... | Get a Class instance for the fully-qualified class name specified. The specified
class should have IHEAuditor as a superclass and implement the necessary
methods to be an IHE Auditor.
@param className Fully-qualified class name to get a class instance of
@return The requested class instance | [
"Get",
"a",
"Class",
"instance",
"for",
"the",
"fully",
"-",
"qualified",
"class",
"name",
"specified",
".",
"The",
"specified",
"class",
"should",
"have",
"IHEAuditor",
"as",
"a",
"superclass",
"and",
"implement",
"the",
"necessary",
"methods",
"to",
"be",
... | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L153-L167 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java | AuditorFactory.getAuditorForClass | private static IHEAuditor getAuditorForClass(Class<? extends IHEAuditor> clazz)
{
if (null == clazz) {
LOGGER.error("Error - Cannot specify a null auditor class");
} else {
try {
return clazz.newInstance();
} catch (ClassCastException e) {
LOGGER.error("The requested class "+ clazz.getName() +" is... | java | private static IHEAuditor getAuditorForClass(Class<? extends IHEAuditor> clazz)
{
if (null == clazz) {
LOGGER.error("Error - Cannot specify a null auditor class");
} else {
try {
return clazz.newInstance();
} catch (ClassCastException e) {
LOGGER.error("The requested class "+ clazz.getName() +" is... | [
"private",
"static",
"IHEAuditor",
"getAuditorForClass",
"(",
"Class",
"<",
"?",
"extends",
"IHEAuditor",
">",
"clazz",
")",
"{",
"if",
"(",
"null",
"==",
"clazz",
")",
"{",
"LOGGER",
".",
"error",
"(",
"\"Error - Cannot specify a null auditor class\"",
")",
";"... | Create a new instance of the specified IHE Auditor non-abstract subclass that
implements the auditor API.
@param clazz Class instance to instantiate a new instance for
@return New IHE Auditor instance | [
"Create",
"a",
"new",
"instance",
"of",
"the",
"specified",
"IHE",
"Auditor",
"non",
"-",
"abstract",
"subclass",
"that",
"implements",
"the",
"auditor",
"API",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L176-L190 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/http/HttpUrl.java | HttpUrl.encodedUsername | public String encodedUsername() {
if (username.isEmpty()) return "";
int usernameStart = scheme.length() + 3; // "://".length() == 3.
int usernameEnd = delimiterOffset(url, usernameStart, url.length(), ":@");
return url.substring(usernameStart, usernameEnd);
} | java | public String encodedUsername() {
if (username.isEmpty()) return "";
int usernameStart = scheme.length() + 3; // "://".length() == 3.
int usernameEnd = delimiterOffset(url, usernameStart, url.length(), ":@");
return url.substring(usernameStart, usernameEnd);
} | [
"public",
"String",
"encodedUsername",
"(",
")",
"{",
"if",
"(",
"username",
".",
"isEmpty",
"(",
")",
")",
"return",
"\"\"",
";",
"int",
"usernameStart",
"=",
"scheme",
".",
"length",
"(",
")",
"+",
"3",
";",
"// \"://\".length() == 3.",
"int",
"usernameE... | Returns the username, or an empty string if none is set.
<p><table summary="">
<tr><th>URL</th><th>{@code encodedUsername()}</th></tr>
<tr><td>{@code http://host/}</td><td>{@code ""}</td></tr>
<tr><td>{@code http://username@host/}</td><td>{@code "username"}</td></tr>
<tr><td>{@code http://username:password@host/}</td>... | [
"Returns",
"the",
"username",
"or",
"an",
"empty",
"string",
"if",
"none",
"is",
"set",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/http/HttpUrl.java#L408-L413 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/http/HttpUrl.java | HttpUrl.encodedPassword | public String encodedPassword() {
if (password.isEmpty()) return "";
int passwordStart = url.indexOf(':', scheme.length() + 3) + 1;
int passwordEnd = url.indexOf('@');
return url.substring(passwordStart, passwordEnd);
} | java | public String encodedPassword() {
if (password.isEmpty()) return "";
int passwordStart = url.indexOf(':', scheme.length() + 3) + 1;
int passwordEnd = url.indexOf('@');
return url.substring(passwordStart, passwordEnd);
} | [
"public",
"String",
"encodedPassword",
"(",
")",
"{",
"if",
"(",
"password",
".",
"isEmpty",
"(",
")",
")",
"return",
"\"\"",
";",
"int",
"passwordStart",
"=",
"url",
".",
"indexOf",
"(",
"'",
"'",
",",
"scheme",
".",
"length",
"(",
")",
"+",
"3",
... | Returns the password, or an empty string if none is set.
<p><table summary="">
<tr><th>URL</th><th>{@code encodedPassword()}</th></tr>
<tr><td>{@code http://host/}</td><td>{@code ""}</td></tr>
<tr><td>{@code http://username@host/}</td><td>{@code ""}</td></tr>
<tr><td>{@code http://username:password@host/}</td><td>{@co... | [
"Returns",
"the",
"password",
"or",
"an",
"empty",
"string",
"if",
"none",
"is",
"set",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/http/HttpUrl.java#L441-L446 | train |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/util/BitmapLruPool.java | BitmapLruPool.getBitmap | public synchronized Bitmap getBitmap(BitmapFactory.Options options) {
Bitmap bitmap = null;
synchronized (bitmapsBySize) {
final Iterator<Bitmap> iterator = bitmapsBySize.iterator();
Bitmap item;
while (iterator.hasNext()) {
item = iterator.next();
... | java | public synchronized Bitmap getBitmap(BitmapFactory.Options options) {
Bitmap bitmap = null;
synchronized (bitmapsBySize) {
final Iterator<Bitmap> iterator = bitmapsBySize.iterator();
Bitmap item;
while (iterator.hasNext()) {
item = iterator.next();
... | [
"public",
"synchronized",
"Bitmap",
"getBitmap",
"(",
"BitmapFactory",
".",
"Options",
"options",
")",
"{",
"Bitmap",
"bitmap",
"=",
"null",
";",
"synchronized",
"(",
"bitmapsBySize",
")",
"{",
"final",
"Iterator",
"<",
"Bitmap",
">",
"iterator",
"=",
"bitmaps... | Returns a bitmap from the pool if one is available in the requested size, or allocates a new
one if a pooled one is not available.
@param options the options required to reuse the bitmap. The returned bitmap
may be larger.
@return Bitmap or null if not found. | [
"Returns",
"a",
"bitmap",
"from",
"the",
"pool",
"if",
"one",
"is",
"available",
"in",
"the",
"requested",
"size",
"or",
"allocates",
"a",
"new",
"one",
"if",
"a",
"pooled",
"one",
"is",
"not",
"available",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/util/BitmapLruPool.java#L100-L130 | train |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/util/BitmapLruPool.java | BitmapLruPool.returnBitmap | public synchronized void returnBitmap(Bitmap bitmap) {
if (bitmap == null || bitmapsBySize.contains(bitmap) ) {
return;
} else if(getBitmapSize(bitmap) > sizeLimit || !canBePooled(bitmap)) {
return;
}
bitmapsByLastUse.add(bitmap);
int pos = Collections.bin... | java | public synchronized void returnBitmap(Bitmap bitmap) {
if (bitmap == null || bitmapsBySize.contains(bitmap) ) {
return;
} else if(getBitmapSize(bitmap) > sizeLimit || !canBePooled(bitmap)) {
return;
}
bitmapsByLastUse.add(bitmap);
int pos = Collections.bin... | [
"public",
"synchronized",
"void",
"returnBitmap",
"(",
"Bitmap",
"bitmap",
")",
"{",
"if",
"(",
"bitmap",
"==",
"null",
"||",
"bitmapsBySize",
".",
"contains",
"(",
"bitmap",
")",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"getBitmapSize",
"(",
"bi... | Returns a bitmap to the pool, throwing away old bitmaps if the pool would exceed its allotted
size.
@param bitmap the buffer to return to the pool. | [
"Returns",
"a",
"bitmap",
"to",
"the",
"pool",
"throwing",
"away",
"old",
"bitmaps",
"if",
"the",
"pool",
"would",
"exceed",
"its",
"allotted",
"size",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/util/BitmapLruPool.java#L138-L152 | train |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/util/BitmapLruPool.java | BitmapLruPool.getBytesPerPixel | protected static int getBytesPerPixel(Bitmap.Config config) {
if (config == Bitmap.Config.ARGB_8888) {
return 4;
} else if (config == Bitmap.Config.RGB_565) {
return 2;
} else if (config == Bitmap.Config.ARGB_4444) {
return 2;
} else if (config == Bitm... | java | protected static int getBytesPerPixel(Bitmap.Config config) {
if (config == Bitmap.Config.ARGB_8888) {
return 4;
} else if (config == Bitmap.Config.RGB_565) {
return 2;
} else if (config == Bitmap.Config.ARGB_4444) {
return 2;
} else if (config == Bitm... | [
"protected",
"static",
"int",
"getBytesPerPixel",
"(",
"Bitmap",
".",
"Config",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"Bitmap",
".",
"Config",
".",
"ARGB_8888",
")",
"{",
"return",
"4",
";",
"}",
"else",
"if",
"(",
"config",
"==",
"Bitmap",
".... | Return the byte usage per pixel of a bitmap based on its configuration.
@param config The bitmap configuration.
@return The byte usage per pixel. | [
"Return",
"the",
"byte",
"usage",
"per",
"pixel",
"of",
"a",
"bitmap",
"based",
"on",
"its",
"configuration",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/util/BitmapLruPool.java#L206-L217 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/toolbox/HttpHeaderParser.java | HttpHeaderParser.parseCharset | public static String parseCharset(Map<String, String> headers, String defaultCharset) {
String contentType = headers.get(HTTP.CONTENT_TYPE);
if (contentType != null) {
String[] params = contentType.split(";");
for (int i = 1; i < params.length; i++) {
String[] pai... | java | public static String parseCharset(Map<String, String> headers, String defaultCharset) {
String contentType = headers.get(HTTP.CONTENT_TYPE);
if (contentType != null) {
String[] params = contentType.split(";");
for (int i = 1; i < params.length; i++) {
String[] pai... | [
"public",
"static",
"String",
"parseCharset",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"String",
"defaultCharset",
")",
"{",
"String",
"contentType",
"=",
"headers",
".",
"get",
"(",
"HTTP",
".",
"CONTENT_TYPE",
")",
";",
"if",
"(",
... | Retrieve a charset from headers
@param headers An {@link java.util.Map} of headers
@param defaultCharset Charset to return if none can be found
@return Returns the charset specified in the Content-Type of this header,
or the defaultCharset if none can be found. | [
"Retrieve",
"a",
"charset",
"from",
"headers"
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/toolbox/HttpHeaderParser.java#L152-L167 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/RequestQueue.java | RequestQueue.stopWhenDone | public void stopWhenDone() {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
while (getCurrentRequests() > 0) {
try {
Thread.sleep(33);
} catch (InterruptedException e) {
... | java | public void stopWhenDone() {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
while (getCurrentRequests() > 0) {
try {
Thread.sleep(33);
} catch (InterruptedException e) {
... | [
"public",
"void",
"stopWhenDone",
"(",
")",
"{",
"Thread",
"t",
"=",
"new",
"Thread",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"while",
"(",
"getCurrentRequests",
"(",
")",
">",
"0",
")",
"{",
... | Stops the queue when all requests are finished | [
"Stops",
"the",
"queue",
"when",
"all",
"requests",
"are",
"finished"
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/RequestQueue.java#L251-L272 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/RequestQueue.java | RequestQueue.addQueueMarkerListener | public <R extends RequestQueue> R addQueueMarkerListener(
RequestListener.MarkerListener markerListener) {
if (markerListener != null) {
synchronized (markerListeners) {
this.markerListeners.add(markerListener);
}
}
return (R) this;
} | java | public <R extends RequestQueue> R addQueueMarkerListener(
RequestListener.MarkerListener markerListener) {
if (markerListener != null) {
synchronized (markerListeners) {
this.markerListeners.add(markerListener);
}
}
return (R) this;
} | [
"public",
"<",
"R",
"extends",
"RequestQueue",
">",
"R",
"addQueueMarkerListener",
"(",
"RequestListener",
".",
"MarkerListener",
"markerListener",
")",
"{",
"if",
"(",
"markerListener",
"!=",
"null",
")",
"{",
"synchronized",
"(",
"markerListeners",
")",
"{",
"... | Add marker listener for RequestQueue related events | [
"Add",
"marker",
"listener",
"for",
"RequestQueue",
"related",
"events"
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/RequestQueue.java#L277-L285 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/RequestQueue.java | RequestQueue.removeQueueMarkerListener | public <R extends RequestQueue> R removeQueueMarkerListener(RequestListener.MarkerListener
markerListener) {
synchronized (markerListeners) {
this.markerListeners.remove(markerListener);
}
return (R) this;
} | java | public <R extends RequestQueue> R removeQueueMarkerListener(RequestListener.MarkerListener
markerListener) {
synchronized (markerListeners) {
this.markerListeners.remove(markerListener);
}
return (R) this;
} | [
"public",
"<",
"R",
"extends",
"RequestQueue",
">",
"R",
"removeQueueMarkerListener",
"(",
"RequestListener",
".",
"MarkerListener",
"markerListener",
")",
"{",
"synchronized",
"(",
"markerListeners",
")",
"{",
"this",
".",
"markerListeners",
".",
"remove",
"(",
"... | Remove marker listener for RequestQueue related events | [
"Remove",
"marker",
"listener",
"for",
"RequestQueue",
"related",
"events"
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/RequestQueue.java#L290-L296 | train |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/RequestQueue.java | RequestQueue.cancelAll | public void cancelAll(final Object tag) {
if (tag == null) {
throw new IllegalArgumentException("Cannot cancelAll with a null tag");
}
cancelAll(new RequestFilter() {
@Override
public boolean apply(Request<?> request) {
return request.getTag() ... | java | public void cancelAll(final Object tag) {
if (tag == null) {
throw new IllegalArgumentException("Cannot cancelAll with a null tag");
}
cancelAll(new RequestFilter() {
@Override
public boolean apply(Request<?> request) {
return request.getTag() ... | [
"public",
"void",
"cancelAll",
"(",
"final",
"Object",
"tag",
")",
"{",
"if",
"(",
"tag",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot cancelAll with a null tag\"",
")",
";",
"}",
"cancelAll",
"(",
"new",
"RequestFilter",
... | Cancels all requests in this queue with the given tag. Tag must be non-null
and equality is by identity. | [
"Cancels",
"all",
"requests",
"in",
"this",
"queue",
"with",
"the",
"given",
"tag",
".",
"Tag",
"must",
"be",
"non",
"-",
"null",
"and",
"equality",
"is",
"by",
"identity",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/RequestQueue.java#L367-L377 | train |
jingwei/krati | krati-main/src/retention/java/krati/retention/clock/Clock.java | Clock.parseClock | public static Clock parseClock(String str) {
if(str == null || str.length() == 0) {
return Clock.ZERO;
}
String[] parts = str.split(":");
long[] values = new long[parts.length];
for(int i = 0; i < values.length; i++) {
values[i] = Long.parseLong(p... | java | public static Clock parseClock(String str) {
if(str == null || str.length() == 0) {
return Clock.ZERO;
}
String[] parts = str.split(":");
long[] values = new long[parts.length];
for(int i = 0; i < values.length; i++) {
values[i] = Long.parseLong(p... | [
"public",
"static",
"Clock",
"parseClock",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"Clock",
".",
"ZERO",
";",
"}",
"String",
"[",
"]",
"parts",
"=",
"str... | Parses a Clock value from its string representation.
@param str - the string representation of Clock
@return A Clock object.
<code>Clock.ZERO</code> is returned <code>upon</code> null or zero-length string. | [
"Parses",
"a",
"Clock",
"value",
"from",
"its",
"string",
"representation",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/retention/java/krati/retention/clock/Clock.java#L65-L76 | train |
jingwei/krati | krati-main/src/retention/java/krati/retention/clock/Clock.java | Clock.parseClock | public static Clock parseClock(byte[] raw) {
if(raw == null || raw.length < 8) {
return Clock.ZERO;
}
int cnt = raw.length >> 3;
long[] values = new long[cnt];
ByteBuffer bb = ByteBuffer.wrap(raw);
for(int i = 0; i < values.length; i++) {
... | java | public static Clock parseClock(byte[] raw) {
if(raw == null || raw.length < 8) {
return Clock.ZERO;
}
int cnt = raw.length >> 3;
long[] values = new long[cnt];
ByteBuffer bb = ByteBuffer.wrap(raw);
for(int i = 0; i < values.length; i++) {
... | [
"public",
"static",
"Clock",
"parseClock",
"(",
"byte",
"[",
"]",
"raw",
")",
"{",
"if",
"(",
"raw",
"==",
"null",
"||",
"raw",
".",
"length",
"<",
"8",
")",
"{",
"return",
"Clock",
".",
"ZERO",
";",
"}",
"int",
"cnt",
"=",
"raw",
".",
"length",
... | Parses a Clock value from its raw bytes.
@param raw - the raw bytes of Clock
@return a Clock object.
<code>Clock.ZERO</code> is returned upon <code>null</code> or a byte array with the length less than 8. | [
"Parses",
"a",
"Clock",
"value",
"from",
"its",
"raw",
"bytes",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/retention/java/krati/retention/clock/Clock.java#L85-L97 | train |
jingwei/krati | krati-main/src/retention/java/krati/retention/clock/Clock.java | Clock.compareTo | public Occurred compareTo(Clock c) {
if(this == c) return Occurred.EQUICONCURRENTLY;
if(ZERO == c) return Occurred.AFTER;
if(this == ZERO) return Occurred.BEFORE;
int neg = 0, pos = 0, eq = 0;
try {
final long[] dst = c.values();
final int len = d... | java | public Occurred compareTo(Clock c) {
if(this == c) return Occurred.EQUICONCURRENTLY;
if(ZERO == c) return Occurred.AFTER;
if(this == ZERO) return Occurred.BEFORE;
int neg = 0, pos = 0, eq = 0;
try {
final long[] dst = c.values();
final int len = d... | [
"public",
"Occurred",
"compareTo",
"(",
"Clock",
"c",
")",
"{",
"if",
"(",
"this",
"==",
"c",
")",
"return",
"Occurred",
".",
"EQUICONCURRENTLY",
";",
"if",
"(",
"ZERO",
"==",
"c",
")",
"return",
"Occurred",
".",
"AFTER",
";",
"if",
"(",
"this",
"=="... | Compares this clock with the specified clock for ordering.
@param c - a clock to compare. | [
"Compares",
"this",
"clock",
"with",
"the",
"specified",
"clock",
"for",
"ordering",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/retention/java/krati/retention/clock/Clock.java#L137-L181 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cobol/utils/ValueUtil.java | ValueUtil.resolveFigurative | public static String resolveFigurative(
final String value,
final int length,
final boolean quoteIsQuote) {
if (value == null || value.length() == 0) {
return value;
}
String ucValue = value.toUpperCase(Locale.getDefault());
if (ucValue.m... | java | public static String resolveFigurative(
final String value,
final int length,
final boolean quoteIsQuote) {
if (value == null || value.length() == 0) {
return value;
}
String ucValue = value.toUpperCase(Locale.getDefault());
if (ucValue.m... | [
"public",
"static",
"String",
"resolveFigurative",
"(",
"final",
"String",
"value",
",",
"final",
"int",
"length",
",",
"final",
"boolean",
"quoteIsQuote",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"length",
"(",
")",
"==",
"0",
")"... | Translate individual figurative constants.
@param value a potential figurative constant value
@param length the target data item length
@param quoteIsQuote true if quote is quote, false if quote is apost
@return a translated value or the value stripped from delimiters if it is not a figurative constant | [
"Translate",
"individual",
"figurative",
"constants",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cobol/utils/ValueUtil.java#L35-L98 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cobol/utils/ValueUtil.java | ValueUtil.fill | public static String fill(
final String prefix,
final String charSequence,
final int times) {
if (times < 1) {
return "";
}
StringBuilder sb = new StringBuilder();
if (prefix != null) {
sb.append(prefix);
}
for (... | java | public static String fill(
final String prefix,
final String charSequence,
final int times) {
if (times < 1) {
return "";
}
StringBuilder sb = new StringBuilder();
if (prefix != null) {
sb.append(prefix);
}
for (... | [
"public",
"static",
"String",
"fill",
"(",
"final",
"String",
"prefix",
",",
"final",
"String",
"charSequence",
",",
"final",
"int",
"times",
")",
"{",
"if",
"(",
"times",
"<",
"1",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"sb",
"=",
"new... | Create a string representation repeating a character
sequence the requested number of times.
@param prefix an optional prefix to prepend
@param charSequence the character sequence to repeat
@param times how many times the character sequence should be repeated
@return a string filled with character sequence or empty str... | [
"Create",
"a",
"string",
"representation",
"repeating",
"a",
"character",
"sequence",
"the",
"requested",
"number",
"of",
"times",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cobol/utils/ValueUtil.java#L109-L124 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cobol/utils/ValueUtil.java | ValueUtil.stripDelimiters | public static String stripDelimiters(final String value) {
if (value != null && value.length() > 1) {
if (value.charAt(0) == value.charAt(value.length() - 1)
&& (value.charAt(0) == '\'')) {
return value.substring(1, value.length() - 1);
}
i... | java | public static String stripDelimiters(final String value) {
if (value != null && value.length() > 1) {
if (value.charAt(0) == value.charAt(value.length() - 1)
&& (value.charAt(0) == '\'')) {
return value.substring(1, value.length() - 1);
}
i... | [
"public",
"static",
"String",
"stripDelimiters",
"(",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"value",
".",
"length",
"(",
")",
">",
"1",
")",
"{",
"if",
"(",
"value",
".",
"charAt",
"(",
"0",
")",
"==",
"value... | The parser does not strip delimiters from literal strings so we
do it here if necessary.
@param value a potential literal string
@return the literal without delimiters | [
"The",
"parser",
"does",
"not",
"strip",
"delimiters",
"from",
"literal",
"strings",
"so",
"we",
"do",
"it",
"here",
"if",
"necessary",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cobol/utils/ValueUtil.java#L132-L144 | train |
legsem/legstar-core2 | legstar-base/src/main/java/com/legstar/base/visitor/FromCobolVisitor.java | FromCobolVisitor.isPresent | private boolean isPresent(CobolOptionalType optionalType) {
if (optionalType.getDependingOn() != null) {
return getOdoValue(optionalType.getDependingOn()) > 0;
}
return true;
} | java | private boolean isPresent(CobolOptionalType optionalType) {
if (optionalType.getDependingOn() != null) {
return getOdoValue(optionalType.getDependingOn()) > 0;
}
return true;
} | [
"private",
"boolean",
"isPresent",
"(",
"CobolOptionalType",
"optionalType",
")",
"{",
"if",
"(",
"optionalType",
".",
"getDependingOn",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"getOdoValue",
"(",
"optionalType",
".",
"getDependingOn",
"(",
")",
")",
">",
... | Check if an optional type is present.
@param optionalType the optional type
@return true if the optional type is present | [
"Check",
"if",
"an",
"optional",
"type",
"is",
"present",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/visitor/FromCobolVisitor.java#L477-L482 | train |
legsem/legstar-core2 | legstar-base/src/main/java/com/legstar/base/visitor/FromCobolVisitor.java | FromCobolVisitor.isCustomVariable | public boolean isCustomVariable(CobolPrimitiveType < ? > type, String name) {
if (type.isCustomVariable()) {
return true;
}
if (customVariables != null && customVariables.contains(name)) {
return true;
}
if (customChoiceStrategy != null
&& ... | java | public boolean isCustomVariable(CobolPrimitiveType < ? > type, String name) {
if (type.isCustomVariable()) {
return true;
}
if (customVariables != null && customVariables.contains(name)) {
return true;
}
if (customChoiceStrategy != null
&& ... | [
"public",
"boolean",
"isCustomVariable",
"(",
"CobolPrimitiveType",
"<",
"?",
">",
"type",
",",
"String",
"name",
")",
"{",
"if",
"(",
"type",
".",
"isCustomVariable",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"customVariables",
"!=",
"n... | A primitive type is a custom variable if it has been marked as so via one
of the available mechanisms or is needed to make choice decisions.
@param type the primitive type
@param name the variable name
@return true if this is a custom variable | [
"A",
"primitive",
"type",
"is",
"a",
"custom",
"variable",
"if",
"it",
"has",
"been",
"marked",
"as",
"so",
"via",
"one",
"of",
"the",
"available",
"mechanisms",
"or",
"is",
"needed",
"to",
"make",
"choice",
"decisions",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/visitor/FromCobolVisitor.java#L588-L601 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/context/AuditorModuleConfig.java | AuditorModuleConfig.getAuditRepositoryTransport | public String getAuditRepositoryTransport()
{
String transport = getOption(AUDITOR_AUDIT_REPOSITORY_TRANSPORT_KEY);
return (transport != null) ? transport : AUDITOR_AUDIT_REPOSITORY_DEFAULT_TRANSPORT;
} | java | public String getAuditRepositoryTransport()
{
String transport = getOption(AUDITOR_AUDIT_REPOSITORY_TRANSPORT_KEY);
return (transport != null) ? transport : AUDITOR_AUDIT_REPOSITORY_DEFAULT_TRANSPORT;
} | [
"public",
"String",
"getAuditRepositoryTransport",
"(",
")",
"{",
"String",
"transport",
"=",
"getOption",
"(",
"AUDITOR_AUDIT_REPOSITORY_TRANSPORT_KEY",
")",
";",
"return",
"(",
"transport",
"!=",
"null",
")",
"?",
"transport",
":",
"AUDITOR_AUDIT_REPOSITORY_DEFAULT_TR... | Get the port of the target audit repository
@return The transport to access the target audit repository | [
"Get",
"the",
"port",
"of",
"the",
"target",
"audit",
"repository"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/context/AuditorModuleConfig.java#L206-L210 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/context/AuditorModuleConfig.java | AuditorModuleConfig.setAuditRepositoryUri | public void setAuditRepositoryUri(URI uri)
{
setAuditRepositoryHost(uri.getHost());
setAuditRepositoryPort(uri.getPort());
setAuditRepositoryTransport(uri.getScheme());
} | java | public void setAuditRepositoryUri(URI uri)
{
setAuditRepositoryHost(uri.getHost());
setAuditRepositoryPort(uri.getPort());
setAuditRepositoryTransport(uri.getScheme());
} | [
"public",
"void",
"setAuditRepositoryUri",
"(",
"URI",
"uri",
")",
"{",
"setAuditRepositoryHost",
"(",
"uri",
".",
"getHost",
"(",
")",
")",
";",
"setAuditRepositoryPort",
"(",
"uri",
".",
"getPort",
"(",
")",
")",
";",
"setAuditRepositoryTransport",
"(",
"uri... | Set the hostname and port of the target audit repository from
a well-formed URI
@param uri URI containing the hostname and port to set | [
"Set",
"the",
"hostname",
"and",
"port",
"of",
"the",
"target",
"audit",
"repository",
"from",
"a",
"well",
"-",
"formed",
"URI"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/context/AuditorModuleConfig.java#L229-L234 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PIXSourceAuditor.java | PIXSourceAuditor.getAuditor | public static PIXSourceAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (PIXSourceAuditor)ctx.getAuditor(PIXSourceAuditor.class);
} | java | public static PIXSourceAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (PIXSourceAuditor)ctx.getAuditor(PIXSourceAuditor.class);
} | [
"public",
"static",
"PIXSourceAuditor",
"getAuditor",
"(",
")",
"{",
"AuditorModuleContext",
"ctx",
"=",
"AuditorModuleContext",
".",
"getContext",
"(",
")",
";",
"return",
"(",
"PIXSourceAuditor",
")",
"ctx",
".",
"getAuditor",
"(",
"PIXSourceAuditor",
".",
"clas... | Get an instance of the PIX Source Auditor from the
global context
@return PIX Source Auditor instance | [
"Get",
"an",
"instance",
"of",
"the",
"PIX",
"Source",
"Auditor",
"from",
"the",
"global",
"context"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PIXSourceAuditor.java#L43-L47 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PIXSourceAuditor.java | PIXSourceAuditor.auditCreatePatientRecordV3Event | public void auditCreatePatientRecordV3Event(RFC3881EventOutcomeCodes eventOutcome,
String pixManagerUri, String receivingFacility, String receivingApp,
String sendingFacility, String sendingApp,
String hl7MessageId,
String patientId,
List<CodedValueType> purposesOfUse,
List<CodedValueType>... | java | public void auditCreatePatientRecordV3Event(RFC3881EventOutcomeCodes eventOutcome,
String pixManagerUri, String receivingFacility, String receivingApp,
String sendingFacility, String sendingApp,
String hl7MessageId,
String patientId,
List<CodedValueType> purposesOfUse,
List<CodedValueType>... | [
"public",
"void",
"auditCreatePatientRecordV3Event",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"pixManagerUri",
",",
"String",
"receivingFacility",
",",
"String",
"receivingApp",
",",
"String",
"sendingFacility",
",",
"String",
"sendingApp",
",",
"St... | Audits an ITI-44 Patient Identity Feed CREATE PATIENT RECORD
event for Patient Identity Source actors.
@param eventOutcome The event outcome indicator
@param pixManagerUri The URI of the PIX Manager being accessed
@param receivingFacility The HL7 receiving facility
@param receivingApp The HL7 receiving application
@pa... | [
"Audits",
"an",
"ITI",
"-",
"44",
"Patient",
"Identity",
"Feed",
"CREATE",
"PATIENT",
"RECORD",
"event",
"for",
"Patient",
"Identity",
"Source",
"actors",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PIXSourceAuditor.java#L95-L113 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PIXSourceAuditor.java | PIXSourceAuditor.auditDeletePatientRecordEvent | public void auditDeletePatientRecordEvent(RFC3881EventOutcomeCodes eventOutcome,
String pixManagerUri, String receivingFacility, String receivingApp,
String sendingFacility, String sendingApp,
String hl7MessageControlId,
String patientId)
{
if (!isAuditorEnabled()) {
return;
}
auditPatientReco... | java | public void auditDeletePatientRecordEvent(RFC3881EventOutcomeCodes eventOutcome,
String pixManagerUri, String receivingFacility, String receivingApp,
String sendingFacility, String sendingApp,
String hl7MessageControlId,
String patientId)
{
if (!isAuditorEnabled()) {
return;
}
auditPatientReco... | [
"public",
"void",
"auditDeletePatientRecordEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"pixManagerUri",
",",
"String",
"receivingFacility",
",",
"String",
"receivingApp",
",",
"String",
"sendingFacility",
",",
"String",
"sendingApp",
",",
"Stri... | Audits an ITI-8 Patient Identity Feed DELETE PATIENT RECORD
event for Patient Identity Source actors.
@param eventOutcome The event outcome indicator
@param pixManagerUri The URI of the PIX Manager being accessed
@param receivingFacility The HL7 receiving facility
@param receivingApp The HL7 receiving application
@par... | [
"Audits",
"an",
"ITI",
"-",
"8",
"Patient",
"Identity",
"Feed",
"DELETE",
"PATIENT",
"RECORD",
"event",
"for",
"Patient",
"Identity",
"Source",
"actors",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PIXSourceAuditor.java#L128-L144 | train |
oehf/ipf-oht-atna | nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/context/NodeAuthModuleContext.java | NodeAuthModuleContext.getContext | public static NodeAuthModuleContext getContext()
{
SecurityContext securityContext = SecurityContextFactory.getSecurityContext();
if (!securityContext.isInitialized()) {
securityContext.initialize();
}
AbstractModuleContext moduleContext = securityContext.getModuleContext(CONTEXT_ID);
if (!(moduleCo... | java | public static NodeAuthModuleContext getContext()
{
SecurityContext securityContext = SecurityContextFactory.getSecurityContext();
if (!securityContext.isInitialized()) {
securityContext.initialize();
}
AbstractModuleContext moduleContext = securityContext.getModuleContext(CONTEXT_ID);
if (!(moduleCo... | [
"public",
"static",
"NodeAuthModuleContext",
"getContext",
"(",
")",
"{",
"SecurityContext",
"securityContext",
"=",
"SecurityContextFactory",
".",
"getSecurityContext",
"(",
")",
";",
"if",
"(",
"!",
"securityContext",
".",
"isInitialized",
"(",
")",
")",
"{",
"s... | Returns the current singleton instance of the Node Authentication Module Context from the
ThreadLocal cache. If the ThreadLocal cache has not been initialized or does not contain
this context, then create and initialize module context, register in the ThreadLocal
and return the new instance.
@return Context singleton | [
"Returns",
"the",
"current",
"singleton",
"instance",
"of",
"the",
"Node",
"Authentication",
"Module",
"Context",
"from",
"the",
"ThreadLocal",
"cache",
".",
"If",
"the",
"ThreadLocal",
"cache",
"has",
"not",
"been",
"initialized",
"or",
"does",
"not",
"contain"... | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/context/NodeAuthModuleContext.java#L93-L111 | train |
jingwei/krati | krati-main/src/main/java/krati/store/DynamicDataSet.java | DynamicDataSet.createAddressArray | protected AddressArray createAddressArray(File homeDir,
int batchSize,
int numSyncBatches,
boolean indexesCached) throws Exception {
AddressArrayFactory factory = new Address... | java | protected AddressArray createAddressArray(File homeDir,
int batchSize,
int numSyncBatches,
boolean indexesCached) throws Exception {
AddressArrayFactory factory = new Address... | [
"protected",
"AddressArray",
"createAddressArray",
"(",
"File",
"homeDir",
",",
"int",
"batchSize",
",",
"int",
"numSyncBatches",
",",
"boolean",
"indexesCached",
")",
"throws",
"Exception",
"{",
"AddressArrayFactory",
"factory",
"=",
"new",
"AddressArrayFactory",
"("... | Creates an address array file under the specified home directory.
@param homeDir - the home directory
@param batchSize - the update batch size
@param numSyncBatches - the number of batches need to sync address array file
@param indexesCached - whether the indexes.dat is cached in memory.
@return the creat... | [
"Creates",
"an",
"address",
"array",
"file",
"under",
"the",
"specified",
"home",
"directory",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/store/DynamicDataSet.java#L461-L468 | train |
jingwei/krati | krati-main/src/main/java/krati/store/DynamicDataSet.java | DynamicDataSet.canSplitOnCapacity | protected boolean canSplitOnCapacity() {
if(0 < _split) {
// The splitTo must NOT overflow the current capacity
int splitTo = _levelCapacity + _split;
if (capacity() > splitTo && splitTo >= _levelCapacity) {
return true;
}
}
... | java | protected boolean canSplitOnCapacity() {
if(0 < _split) {
// The splitTo must NOT overflow the current capacity
int splitTo = _levelCapacity + _split;
if (capacity() > splitTo && splitTo >= _levelCapacity) {
return true;
}
}
... | [
"protected",
"boolean",
"canSplitOnCapacity",
"(",
")",
"{",
"if",
"(",
"0",
"<",
"_split",
")",
"{",
"// The splitTo must NOT overflow the current capacity",
"int",
"splitTo",
"=",
"_levelCapacity",
"+",
"_split",
";",
"if",
"(",
"capacity",
"(",
")",
">",
"spl... | Perform split on the current capacity. | [
"Perform",
"split",
"on",
"the",
"current",
"capacity",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/store/DynamicDataSet.java#L732-L742 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.