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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/AbstractAuditEventMessageImpl.java | AbstractAuditEventMessageImpl.addActiveParticipant | protected ActiveParticipantType addActiveParticipant(String userID, String altUserID, String userName,
Boolean userIsRequestor, List<CodedValueType> roleIdCodes, String networkAccessPointID) {
// Does lookup to see if using IP Address or hostname in Netwo... | java | protected ActiveParticipantType addActiveParticipant(String userID, String altUserID, String userName,
Boolean userIsRequestor, List<CodedValueType> roleIdCodes, String networkAccessPointID) {
// Does lookup to see if using IP Address or hostname in Netwo... | [
"protected",
"ActiveParticipantType",
"addActiveParticipant",
"(",
"String",
"userID",
",",
"String",
"altUserID",
",",
"String",
"userName",
",",
"Boolean",
"userIsRequestor",
",",
"List",
"<",
"CodedValueType",
">",
"roleIdCodes",
",",
"String",
"networkAccessPointID"... | Create and add an Active Participant block to this audit event message but automatically
determine the Network Access Point ID Type Code
@param userID The Active Participant's UserID
@param altUserID The Active Participant's Alternate UserID
@param userName The Active Participant's UserName
@param userIsRequestor Whet... | [
"Create",
"and",
"add",
"an",
"Active",
"Participant",
"block",
"to",
"this",
"audit",
"event",
"message",
"but",
"automatically",
"determine",
"the",
"Network",
"Access",
"Point",
"ID",
"Type",
"Code"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/AbstractAuditEventMessageImpl.java#L388-L394 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/AbstractAuditEventMessageImpl.java | AbstractAuditEventMessageImpl.getNetworkAccessPointCodeFromAddress | protected RFC3881NetworkAccessPointTypeCodes getNetworkAccessPointCodeFromAddress(String address) {
if (EventUtils.isEmptyOrNull(address)) {
return null;
}
if (address.matches("^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$")) {
return RFC3881NetworkAccessPointTypeC... | java | protected RFC3881NetworkAccessPointTypeCodes getNetworkAccessPointCodeFromAddress(String address) {
if (EventUtils.isEmptyOrNull(address)) {
return null;
}
if (address.matches("^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$")) {
return RFC3881NetworkAccessPointTypeC... | [
"protected",
"RFC3881NetworkAccessPointTypeCodes",
"getNetworkAccessPointCodeFromAddress",
"(",
"String",
"address",
")",
"{",
"if",
"(",
"EventUtils",
".",
"isEmptyOrNull",
"(",
"address",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"address",
".",
"mat... | Attempt to determine the proper Active Participant
Network Access Point Type Code from a given string.
@param address Access point type code to look at
@return An RFC 3881 Network Access Point Type Code | [
"Attempt",
"to",
"determine",
"the",
"proper",
"Active",
"Participant",
"Network",
"Access",
"Point",
"Type",
"Code",
"from",
"a",
"given",
"string",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/AbstractAuditEventMessageImpl.java#L404-L414 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCPDInitiatingGatewayAuditor.java | XCPDInitiatingGatewayAuditor.getAuditor | public static XCPDInitiatingGatewayAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (XCPDInitiatingGatewayAuditor)ctx.getAuditor(XCPDInitiatingGatewayAuditor.class);
} | java | public static XCPDInitiatingGatewayAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (XCPDInitiatingGatewayAuditor)ctx.getAuditor(XCPDInitiatingGatewayAuditor.class);
} | [
"public",
"static",
"XCPDInitiatingGatewayAuditor",
"getAuditor",
"(",
")",
"{",
"AuditorModuleContext",
"ctx",
"=",
"AuditorModuleContext",
".",
"getContext",
"(",
")",
";",
"return",
"(",
"XCPDInitiatingGatewayAuditor",
")",
"ctx",
".",
"getAuditor",
"(",
"XCPDIniti... | Get an instance of the XCPD Initiating Gateway Auditor from the
global context
@return XCPD Initiating Gateway Auditor instance | [
"Get",
"an",
"instance",
"of",
"the",
"XCPD",
"Initiating",
"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/XCPDInitiatingGatewayAuditor.java#L51-L55 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCPDInitiatingGatewayAuditor.java | XCPDInitiatingGatewayAuditor.auditXCPDQueryEvent | public void auditXCPDQueryEvent(RFC3881EventOutcomeCodes eventOutcome, String sourceUserId,
String humanRequestorUserId, CodedValueType humanRequestorRoleIdCode,
String XCPDRGUri, String homeCommunityId, String queryByParameter,
List<CodedValueType> purposesOfUse)
{
if (!isAuditorEnabled()) {
re... | java | public void auditXCPDQueryEvent(RFC3881EventOutcomeCodes eventOutcome, String sourceUserId,
String humanRequestorUserId, CodedValueType humanRequestorRoleIdCode,
String XCPDRGUri, String homeCommunityId, String queryByParameter,
List<CodedValueType> purposesOfUse)
{
if (!isAuditorEnabled()) {
re... | [
"public",
"void",
"auditXCPDQueryEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"sourceUserId",
",",
"String",
"humanRequestorUserId",
",",
"CodedValueType",
"humanRequestorRoleIdCode",
",",
"String",
"XCPDRGUri",
",",
"String",
"homeCommunityId",
"... | Audits an ITI-55 Cross Gateway Patient Discovery event for
XCPD Initiating Gateway actors.
@param eventOutcome The event outcome indicator
@param sourceUserId The user id of the source system calling the XCPD IG
@param humanRequestorUserId Human requestor if known, null is ok here
@param humanRequestorRoleIdCode CVT t... | [
"Audits",
"an",
"ITI",
"-",
"55",
"Cross",
"Gateway",
"Patient",
"Discovery",
"event",
"for",
"XCPD",
"Initiating",
"Gateway",
"actors",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCPDInitiatingGatewayAuditor.java#L70-L112 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/SVSConsumerAuditor.java | SVSConsumerAuditor.getAuditor | public static SVSConsumerAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (SVSConsumerAuditor)ctx.getAuditor(SVSConsumerAuditor.class);
} | java | public static SVSConsumerAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (SVSConsumerAuditor)ctx.getAuditor(SVSConsumerAuditor.class);
} | [
"public",
"static",
"SVSConsumerAuditor",
"getAuditor",
"(",
")",
"{",
"AuditorModuleContext",
"ctx",
"=",
"AuditorModuleContext",
".",
"getContext",
"(",
")",
";",
"return",
"(",
"SVSConsumerAuditor",
")",
"ctx",
".",
"getAuditor",
"(",
"SVSConsumerAuditor",
".",
... | Get an instance of the SVS Consumer Auditor from the
global context
@return SVS Consumer Auditor instance | [
"Get",
"an",
"instance",
"of",
"the",
"SVS",
"Consumer",
"Auditor",
"from",
"the",
"global",
"context"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/SVSConsumerAuditor.java#L42-L46 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/SVSConsumerAuditor.java | SVSConsumerAuditor.auditRetrieveValueSetEvent | public void auditRetrieveValueSetEvent(RFC3881EventOutcomeCodes eventOutcome,
String repositoryEndpointUri,
String valueSetUniqueId, String valueSetName,
String valueSetVersion,
List<CodedValueType> purposesOfUse,
List<CodedValueType> userRoles)
{
if (!isAuditorEnabled()) {
return;
}
... | java | public void auditRetrieveValueSetEvent(RFC3881EventOutcomeCodes eventOutcome,
String repositoryEndpointUri,
String valueSetUniqueId, String valueSetName,
String valueSetVersion,
List<CodedValueType> purposesOfUse,
List<CodedValueType> userRoles)
{
if (!isAuditorEnabled()) {
return;
}
... | [
"public",
"void",
"auditRetrieveValueSetEvent",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"repositoryEndpointUri",
",",
"String",
"valueSetUniqueId",
",",
"String",
"valueSetName",
",",
"String",
"valueSetVersion",
",",
"List",
"<",
"CodedValueType",
... | Audits an ITI-48 Retrieve Value Set event for SVS Consumer actors.
@param eventOutcome The event outcome indicator
@param repositoryEndpointUri The Web service endpoint URI for the SVS repository
@param valueSetUniqueId unique id (OID) of the returned value set
@param valueSetName name associated with the unique id (O... | [
"Audits",
"an",
"ITI",
"-",
"48",
"Retrieve",
"Value",
"Set",
"event",
"for",
"SVS",
"Consumer",
"actors",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/SVSConsumerAuditor.java#L59-L78 | train |
jingwei/krati | krati-main/src/examples/java/krati/examples/KratiDataStore.java | KratiDataStore.main | public static void main(String[] args) {
try {
// Parse arguments: homeDir keyCount
File homeDir = new File(args[0]);
int initialCapacity = Integer.parseInt(args[1]);
// Create an instance of Krati DataStore
KratiDataStore store = new Krat... | java | public static void main(String[] args) {
try {
// Parse arguments: homeDir keyCount
File homeDir = new File(args[0]);
int initialCapacity = Integer.parseInt(args[1]);
// Create an instance of Krati DataStore
KratiDataStore store = new Krat... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"// Parse arguments: homeDir keyCount",
"File",
"homeDir",
"=",
"new",
"File",
"(",
"args",
"[",
"0",
"]",
")",
";",
"int",
"initialCapacity",
"=",
"Integer",
".",
... | java -Xmx4G krati.examples.KratiDataStore homeDir initialCapacity | [
"java",
"-",
"Xmx4G",
"krati",
".",
"examples",
".",
"KratiDataStore",
"homeDir",
"initialCapacity"
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/examples/java/krati/examples/KratiDataStore.java#L142-L162 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/RFC5424SyslogSenderImpl.java | RFC5424SyslogSenderImpl.getTransportPayload | protected byte[] getTransportPayload(AuditEventMessage msg) throws UnsupportedEncodingException
{
if (msg == null) {
return null;
}
byte[] msgBytes = msg.getSerializedMessage(false);
if (EventUtils.isEmptyOrNull(msgBytes)) {
return null;
}
// Format message with transport-specific headers
Str... | java | protected byte[] getTransportPayload(AuditEventMessage msg) throws UnsupportedEncodingException
{
if (msg == null) {
return null;
}
byte[] msgBytes = msg.getSerializedMessage(false);
if (EventUtils.isEmptyOrNull(msgBytes)) {
return null;
}
// Format message with transport-specific headers
Str... | [
"protected",
"byte",
"[",
"]",
"getTransportPayload",
"(",
"AuditEventMessage",
"msg",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"msg",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"byte",
"[",
"]",
"msgBytes",
"=",
"msg",
".",
... | Serialize, format, and prepare the message payload body
for sending by this transport. This includes adding
the syslog message header, which is transport independent.
@param msg Message to prepare
@return Buffer to send | [
"Serialize",
"format",
"and",
"prepare",
"the",
"message",
"payload",
"body",
"for",
"sending",
"by",
"this",
"transport",
".",
"This",
"includes",
"adding",
"the",
"syslog",
"message",
"header",
"which",
"is",
"transport",
"independent",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/RFC5424SyslogSenderImpl.java#L88-L142 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/RFC5424SyslogSenderImpl.java | RFC5424SyslogSenderImpl.getSystemHostName | private String getSystemHostName()
{
if (EventUtils.isEmptyOrNull(systemHostName)) {
try {
systemHostName = InetAddress.getLocalHost().getHostName();
} catch (Throwable t) {
systemHostName = "localhost";
}
}
return systemHostName;
} | java | private String getSystemHostName()
{
if (EventUtils.isEmptyOrNull(systemHostName)) {
try {
systemHostName = InetAddress.getLocalHost().getHostName();
} catch (Throwable t) {
systemHostName = "localhost";
}
}
return systemHostName;
} | [
"private",
"String",
"getSystemHostName",
"(",
")",
"{",
"if",
"(",
"EventUtils",
".",
"isEmptyOrNull",
"(",
"systemHostName",
")",
")",
"{",
"try",
"{",
"systemHostName",
"=",
"InetAddress",
".",
"getLocalHost",
"(",
")",
".",
"getHostName",
"(",
")",
";",
... | Gets the hostname of the system managing this transport
@return The system's hostname | [
"Gets",
"the",
"hostname",
"of",
"the",
"system",
"managing",
"this",
"transport"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/RFC5424SyslogSenderImpl.java#L148-L158 | train |
jingwei/krati | krati-main/src/main/java/krati/util/JenkinsHashFunction.java | JenkinsHashFunction.fourByteToLong | private long fourByteToLong(byte[] bytes, int offset) {
return (byteToLong(bytes[offset + 0])
+ (byteToLong(bytes[offset + 1]) << 8)
+ (byteToLong(bytes[offset + 2]) << 16)
+ (byteToLong(bytes[offset + 3]) << 24));
} | java | private long fourByteToLong(byte[] bytes, int offset) {
return (byteToLong(bytes[offset + 0])
+ (byteToLong(bytes[offset + 1]) << 8)
+ (byteToLong(bytes[offset + 2]) << 16)
+ (byteToLong(bytes[offset + 3]) << 24));
} | [
"private",
"long",
"fourByteToLong",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"return",
"(",
"byteToLong",
"(",
"bytes",
"[",
"offset",
"+",
"0",
"]",
")",
"+",
"(",
"byteToLong",
"(",
"bytes",
"[",
"offset",
"+",
"1",
"]",
"... | Convert 4 bytes from the buffer at offset into a long value. | [
"Convert",
"4",
"bytes",
"from",
"the",
"buffer",
"at",
"offset",
"into",
"a",
"long",
"value",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/JenkinsHashFunction.java#L82-L87 | train |
jingwei/krati | krati-main/src/main/java/krati/util/JenkinsHashFunction.java | JenkinsHashFunction.hashMix | private void hashMix() {
a = subtract(a, b); a = subtract(a, c); a = xor(a, c >> 13);
b = subtract(b, c); b = subtract(b, a); b = xor(b, leftShift(a, 8));
c = subtract(c, a); c = subtract(c, b); c = xor(c, (b >> 13));
a = subtract(a, b); a = subtract(a, c); a = xor(a, (c >> 12));
b = ... | java | private void hashMix() {
a = subtract(a, b); a = subtract(a, c); a = xor(a, c >> 13);
b = subtract(b, c); b = subtract(b, a); b = xor(b, leftShift(a, 8));
c = subtract(c, a); c = subtract(c, b); c = xor(c, (b >> 13));
a = subtract(a, b); a = subtract(a, c); a = xor(a, (c >> 12));
b = ... | [
"private",
"void",
"hashMix",
"(",
")",
"{",
"a",
"=",
"subtract",
"(",
"a",
",",
"b",
")",
";",
"a",
"=",
"subtract",
"(",
"a",
",",
"c",
")",
";",
"a",
"=",
"xor",
"(",
"a",
",",
"c",
">>",
"13",
")",
";",
"b",
"=",
"subtract",
"(",
"b"... | Mix up the values in the hash function. | [
"Mix",
"up",
"the",
"values",
"in",
"the",
"hash",
"function",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/JenkinsHashFunction.java#L92-L102 | train |
jingwei/krati | krati-main/src/main/java/krati/util/JenkinsHashFunction.java | JenkinsHashFunction.hash | public long hash(byte[] buffer, long initialValue) {
int len, pos;
// set up the internal state
// the golden ratio; an arbitrary value
a = 0x09e3779b9L;
// the golden ratio; an arbitrary value
b = 0x09e3779b9L;
// the previous hash value
c = init... | java | public long hash(byte[] buffer, long initialValue) {
int len, pos;
// set up the internal state
// the golden ratio; an arbitrary value
a = 0x09e3779b9L;
// the golden ratio; an arbitrary value
b = 0x09e3779b9L;
// the previous hash value
c = init... | [
"public",
"long",
"hash",
"(",
"byte",
"[",
"]",
"buffer",
",",
"long",
"initialValue",
")",
"{",
"int",
"len",
",",
"pos",
";",
"// set up the internal state",
"// the golden ratio; an arbitrary value",
"a",
"=",
"0x09e3779b9",
"",
"L",
";",
"// the golden ratio;... | Hash a variable-length key into a 32-bit value. Every bit of the
key affects every bit of the return value. Every 1-bit and 2-bit
delta achieves avalanche. The best hash table sizes are powers of 2.
@param buffer Byte array that we are hashing on.
@param initialValue Initial value of the hash if we are continuing f... | [
"Hash",
"a",
"variable",
"-",
"length",
"key",
"into",
"a",
"32",
"-",
"bit",
"value",
".",
"Every",
"bit",
"of",
"the",
"key",
"affects",
"every",
"bit",
"of",
"the",
"return",
"value",
".",
"Every",
"1",
"-",
"bit",
"and",
"2",
"-",
"bit",
"delta... | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/JenkinsHashFunction.java#L114-L167 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createXmlSchemaComplexType | public XmlSchemaComplexType createXmlSchemaComplexType(
final XsdDataItem xsdDataItem) {
// All complex types are root complex types
XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType(
getXsd(), true);
XmlSchemaChoice xmlSchemaChoice = null;
... | java | public XmlSchemaComplexType createXmlSchemaComplexType(
final XsdDataItem xsdDataItem) {
// All complex types are root complex types
XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType(
getXsd(), true);
XmlSchemaChoice xmlSchemaChoice = null;
... | [
"public",
"XmlSchemaComplexType",
"createXmlSchemaComplexType",
"(",
"final",
"XsdDataItem",
"xsdDataItem",
")",
"{",
"// All complex types are root complex types",
"XmlSchemaComplexType",
"xmlSchemaComplexType",
"=",
"new",
"XmlSchemaComplexType",
"(",
"getXsd",
"(",
")",
",",... | Create an XML schema complex type. We want to use Named complex types so
we add them to the XSD directly. We add complex types before their
children because its nicer for the XSD layout to list roots before leafs.
Redefined and redefining elements are grouped into an XML Schema choice.
A choice is created when an eleme... | [
"Create",
"an",
"XML",
"schema",
"complex",
"type",
".",
"We",
"want",
"to",
"use",
"Named",
"complex",
"types",
"so",
"we",
"add",
"them",
"to",
"the",
"XSD",
"directly",
".",
"We",
"add",
"complex",
"types",
"before",
"their",
"children",
"because",
"i... | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L141-L177 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createXmlSchemaElement | public XmlSchemaElement createXmlSchemaElement(final XsdDataItem xsdDataItem) {
// Let call add root elements if he needs to so for now pretend this is
// not a root element
XmlSchemaElement element = new XmlSchemaElement(getXsd(), false);
element.setName(xsdDataItem.getXsdElementName()... | java | public XmlSchemaElement createXmlSchemaElement(final XsdDataItem xsdDataItem) {
// Let call add root elements if he needs to so for now pretend this is
// not a root element
XmlSchemaElement element = new XmlSchemaElement(getXsd(), false);
element.setName(xsdDataItem.getXsdElementName()... | [
"public",
"XmlSchemaElement",
"createXmlSchemaElement",
"(",
"final",
"XsdDataItem",
"xsdDataItem",
")",
"{",
"// Let call add root elements if he needs to so for now pretend this is",
"// not a root element",
"XmlSchemaElement",
"element",
"=",
"new",
"XmlSchemaElement",
"(",
"get... | Create an XML Schema element from a COBOL data item.
@param xsdDataItem COBOL data item decorated with XSD attributes
@return the XML schema element | [
"Create",
"an",
"XML",
"Schema",
"element",
"from",
"a",
"COBOL",
"data",
"item",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L185-L217 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.addEnumerationFacets | protected void addEnumerationFacets(final XsdDataItem xsdDataItem,
final XmlSchemaSimpleTypeRestriction restriction) {
if (getConfig().mapConditionsToFacets()) {
boolean hasValueThru = false;
for (XsdDataItem child : xsdDataItem.getChildren()) {
if (child.getD... | java | protected void addEnumerationFacets(final XsdDataItem xsdDataItem,
final XmlSchemaSimpleTypeRestriction restriction) {
if (getConfig().mapConditionsToFacets()) {
boolean hasValueThru = false;
for (XsdDataItem child : xsdDataItem.getChildren()) {
if (child.getD... | [
"protected",
"void",
"addEnumerationFacets",
"(",
"final",
"XsdDataItem",
"xsdDataItem",
",",
"final",
"XmlSchemaSimpleTypeRestriction",
"restriction",
")",
"{",
"if",
"(",
"getConfig",
"(",
")",
".",
"mapConditionsToFacets",
"(",
")",
")",
"{",
"boolean",
"hasValue... | If simple type has conditions attached to it, emit enumeration facets.
@param xsdDataItem COBOL data item decorated with XSD attributes
@param restriction the current set of constraints | [
"If",
"simple",
"type",
"has",
"conditions",
"attached",
"to",
"it",
"emit",
"enumeration",
"facets",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L313-L354 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createXmlSchemaSimpleType | protected XmlSchemaSimpleType createXmlSchemaSimpleType(
final XmlSchemaSimpleTypeRestriction restriction) {
XmlSchemaSimpleType xmlSchemaSimpleType = new XmlSchemaSimpleType(
getXsd(), false);
xmlSchemaSimpleType.setContent(restriction);
return xmlSchemaSimpleType;
... | java | protected XmlSchemaSimpleType createXmlSchemaSimpleType(
final XmlSchemaSimpleTypeRestriction restriction) {
XmlSchemaSimpleType xmlSchemaSimpleType = new XmlSchemaSimpleType(
getXsd(), false);
xmlSchemaSimpleType.setContent(restriction);
return xmlSchemaSimpleType;
... | [
"protected",
"XmlSchemaSimpleType",
"createXmlSchemaSimpleType",
"(",
"final",
"XmlSchemaSimpleTypeRestriction",
"restriction",
")",
"{",
"XmlSchemaSimpleType",
"xmlSchemaSimpleType",
"=",
"new",
"XmlSchemaSimpleType",
"(",
"getXsd",
"(",
")",
",",
"false",
")",
";",
"xml... | Create an XML schema simple type from a restriction.
@param restriction the XML schema restriction
@return the XML schema simple type | [
"Create",
"an",
"XML",
"schema",
"simple",
"type",
"from",
"a",
"restriction",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L362-L368 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createRestriction | protected XmlSchemaSimpleTypeRestriction createRestriction(
final String xsdTypeName) {
XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
restriction.setBaseTypeName(new QName(
XMLConstants.W3C_XML_SCHEMA_NS_URI, xsdTypeName));
return ... | java | protected XmlSchemaSimpleTypeRestriction createRestriction(
final String xsdTypeName) {
XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
restriction.setBaseTypeName(new QName(
XMLConstants.W3C_XML_SCHEMA_NS_URI, xsdTypeName));
return ... | [
"protected",
"XmlSchemaSimpleTypeRestriction",
"createRestriction",
"(",
"final",
"String",
"xsdTypeName",
")",
"{",
"XmlSchemaSimpleTypeRestriction",
"restriction",
"=",
"new",
"XmlSchemaSimpleTypeRestriction",
"(",
")",
";",
"restriction",
".",
"setBaseTypeName",
"(",
"ne... | Create an XML schema restriction.
@param xsdTypeName the XML schema built-in type name to use as a
restriction
@return an XML schema restriction | [
"Create",
"an",
"XML",
"schema",
"restriction",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L377-L383 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createMaxLengthFacet | protected XmlSchemaMaxLengthFacet createMaxLengthFacet(final int length) {
XmlSchemaMaxLengthFacet xmlSchemaMaxLengthFacet = new XmlSchemaMaxLengthFacet();
xmlSchemaMaxLengthFacet.setValue(length);
return xmlSchemaMaxLengthFacet;
} | java | protected XmlSchemaMaxLengthFacet createMaxLengthFacet(final int length) {
XmlSchemaMaxLengthFacet xmlSchemaMaxLengthFacet = new XmlSchemaMaxLengthFacet();
xmlSchemaMaxLengthFacet.setValue(length);
return xmlSchemaMaxLengthFacet;
} | [
"protected",
"XmlSchemaMaxLengthFacet",
"createMaxLengthFacet",
"(",
"final",
"int",
"length",
")",
"{",
"XmlSchemaMaxLengthFacet",
"xmlSchemaMaxLengthFacet",
"=",
"new",
"XmlSchemaMaxLengthFacet",
"(",
")",
";",
"xmlSchemaMaxLengthFacet",
".",
"setValue",
"(",
"length",
... | Create an XML schema maxLength facet.
@param length the value to set
@return an XML schema length facet | [
"Create",
"an",
"XML",
"schema",
"maxLength",
"facet",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L391-L395 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createPatternFacet | protected XmlSchemaPatternFacet createPatternFacet(final String pattern) {
XmlSchemaPatternFacet xmlSchemaPatternFacet = new XmlSchemaPatternFacet();
xmlSchemaPatternFacet.setValue(pattern);
return xmlSchemaPatternFacet;
} | java | protected XmlSchemaPatternFacet createPatternFacet(final String pattern) {
XmlSchemaPatternFacet xmlSchemaPatternFacet = new XmlSchemaPatternFacet();
xmlSchemaPatternFacet.setValue(pattern);
return xmlSchemaPatternFacet;
} | [
"protected",
"XmlSchemaPatternFacet",
"createPatternFacet",
"(",
"final",
"String",
"pattern",
")",
"{",
"XmlSchemaPatternFacet",
"xmlSchemaPatternFacet",
"=",
"new",
"XmlSchemaPatternFacet",
"(",
")",
";",
"xmlSchemaPatternFacet",
".",
"setValue",
"(",
"pattern",
")",
... | Create an XML schema pattern facet.
@param pattern the value to set
@return an XML schema pattern facet | [
"Create",
"an",
"XML",
"schema",
"pattern",
"facet",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L403-L407 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createEnumerationFacet | protected XmlSchemaEnumerationFacet createEnumerationFacet(
final String conditionValue) {
XmlSchemaEnumerationFacet xmlSchemaEnumerationFacet = new XmlSchemaEnumerationFacet();
xmlSchemaEnumerationFacet.setValue(conditionValue);
return xmlSchemaEnumerationFacet;
} | java | protected XmlSchemaEnumerationFacet createEnumerationFacet(
final String conditionValue) {
XmlSchemaEnumerationFacet xmlSchemaEnumerationFacet = new XmlSchemaEnumerationFacet();
xmlSchemaEnumerationFacet.setValue(conditionValue);
return xmlSchemaEnumerationFacet;
} | [
"protected",
"XmlSchemaEnumerationFacet",
"createEnumerationFacet",
"(",
"final",
"String",
"conditionValue",
")",
"{",
"XmlSchemaEnumerationFacet",
"xmlSchemaEnumerationFacet",
"=",
"new",
"XmlSchemaEnumerationFacet",
"(",
")",
";",
"xmlSchemaEnumerationFacet",
".",
"setValue"... | Create an XML schema enumeration facet.
@param conditionValue the value to set
@return an XML schema enumeration facet | [
"Create",
"an",
"XML",
"schema",
"enumeration",
"facet",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L415-L420 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createTotalDigitsFacet | protected XmlSchemaTotalDigitsFacet createTotalDigitsFacet(
final int totalDigits) {
XmlSchemaTotalDigitsFacet xmlSchemaTotalDigitsFacet = new XmlSchemaTotalDigitsFacet();
xmlSchemaTotalDigitsFacet.setValue(totalDigits);
return xmlSchemaTotalDigitsFacet;
} | java | protected XmlSchemaTotalDigitsFacet createTotalDigitsFacet(
final int totalDigits) {
XmlSchemaTotalDigitsFacet xmlSchemaTotalDigitsFacet = new XmlSchemaTotalDigitsFacet();
xmlSchemaTotalDigitsFacet.setValue(totalDigits);
return xmlSchemaTotalDigitsFacet;
} | [
"protected",
"XmlSchemaTotalDigitsFacet",
"createTotalDigitsFacet",
"(",
"final",
"int",
"totalDigits",
")",
"{",
"XmlSchemaTotalDigitsFacet",
"xmlSchemaTotalDigitsFacet",
"=",
"new",
"XmlSchemaTotalDigitsFacet",
"(",
")",
";",
"xmlSchemaTotalDigitsFacet",
".",
"setValue",
"(... | Create an XML schema totalDigits facet.
@param totalDigits the value to set
@return an XML schema totalDigits facet | [
"Create",
"an",
"XML",
"schema",
"totalDigits",
"facet",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L428-L433 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createFractionDigitsFacet | protected XmlSchemaFractionDigitsFacet createFractionDigitsFacet(
final int fractionDigits) {
XmlSchemaFractionDigitsFacet xmlSchemaFractionDigitsFacet = new XmlSchemaFractionDigitsFacet();
xmlSchemaFractionDigitsFacet.setValue(fractionDigits);
return xmlSchemaFractionDigitsFacet;
... | java | protected XmlSchemaFractionDigitsFacet createFractionDigitsFacet(
final int fractionDigits) {
XmlSchemaFractionDigitsFacet xmlSchemaFractionDigitsFacet = new XmlSchemaFractionDigitsFacet();
xmlSchemaFractionDigitsFacet.setValue(fractionDigits);
return xmlSchemaFractionDigitsFacet;
... | [
"protected",
"XmlSchemaFractionDigitsFacet",
"createFractionDigitsFacet",
"(",
"final",
"int",
"fractionDigits",
")",
"{",
"XmlSchemaFractionDigitsFacet",
"xmlSchemaFractionDigitsFacet",
"=",
"new",
"XmlSchemaFractionDigitsFacet",
"(",
")",
";",
"xmlSchemaFractionDigitsFacet",
".... | Create an XML schema fractionDigits facet.
@param fractionDigits the value to set
@return an XML schema fractionDigits facet | [
"Create",
"an",
"XML",
"schema",
"fractionDigits",
"facet",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L441-L446 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createMinInclusiveFacet | protected XmlSchemaMinInclusiveFacet createMinInclusiveFacet(
final String minInclusive) {
XmlSchemaMinInclusiveFacet xmlSchemaMinInclusiveFacet = new XmlSchemaMinInclusiveFacet();
xmlSchemaMinInclusiveFacet.setValue(minInclusive);
return xmlSchemaMinInclusiveFacet;
} | java | protected XmlSchemaMinInclusiveFacet createMinInclusiveFacet(
final String minInclusive) {
XmlSchemaMinInclusiveFacet xmlSchemaMinInclusiveFacet = new XmlSchemaMinInclusiveFacet();
xmlSchemaMinInclusiveFacet.setValue(minInclusive);
return xmlSchemaMinInclusiveFacet;
} | [
"protected",
"XmlSchemaMinInclusiveFacet",
"createMinInclusiveFacet",
"(",
"final",
"String",
"minInclusive",
")",
"{",
"XmlSchemaMinInclusiveFacet",
"xmlSchemaMinInclusiveFacet",
"=",
"new",
"XmlSchemaMinInclusiveFacet",
"(",
")",
";",
"xmlSchemaMinInclusiveFacet",
".",
"setVa... | Create an XML schema minInclusive facet.
@param minInclusive the value to set
@return an XML schema minInclusive facet | [
"Create",
"an",
"XML",
"schema",
"minInclusive",
"facet",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L454-L459 | train |
legsem/legstar-core2 | legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java | XsdEmitter.createMaxInclusiveFacet | protected XmlSchemaMaxInclusiveFacet createMaxInclusiveFacet(
final String maxInclusive) {
XmlSchemaMaxInclusiveFacet xmlSchemaMaxInclusiveFacet = new XmlSchemaMaxInclusiveFacet();
xmlSchemaMaxInclusiveFacet.setValue(maxInclusive);
return xmlSchemaMaxInclusiveFacet;
} | java | protected XmlSchemaMaxInclusiveFacet createMaxInclusiveFacet(
final String maxInclusive) {
XmlSchemaMaxInclusiveFacet xmlSchemaMaxInclusiveFacet = new XmlSchemaMaxInclusiveFacet();
xmlSchemaMaxInclusiveFacet.setValue(maxInclusive);
return xmlSchemaMaxInclusiveFacet;
} | [
"protected",
"XmlSchemaMaxInclusiveFacet",
"createMaxInclusiveFacet",
"(",
"final",
"String",
"maxInclusive",
")",
"{",
"XmlSchemaMaxInclusiveFacet",
"xmlSchemaMaxInclusiveFacet",
"=",
"new",
"XmlSchemaMaxInclusiveFacet",
"(",
")",
";",
"xmlSchemaMaxInclusiveFacet",
".",
"setVa... | Create an XML schema maxInclusive facet.
@param maxInclusive the value to set
@return an XML schema maxInclusive facet | [
"Create",
"an",
"XML",
"schema",
"maxInclusive",
"facet",
"."
] | f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6 | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-cob2xsd/src/main/java/com/legstar/cob2xsd/XsdEmitter.java#L467-L472 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java | SegmentIndexBufferFileIO.read | @Override
public int read(SegmentIndexBuffer sib, File sibFile) throws IOException {
check(sibFile);
RandomAccessFile raf = new RandomAccessFile(sibFile, "r");
FileChannel channel = raf.getChannel();
readVersion(channel);
int length = sib.read(channel);
... | java | @Override
public int read(SegmentIndexBuffer sib, File sibFile) throws IOException {
check(sibFile);
RandomAccessFile raf = new RandomAccessFile(sibFile, "r");
FileChannel channel = raf.getChannel();
readVersion(channel);
int length = sib.read(channel);
... | [
"@",
"Override",
"public",
"int",
"read",
"(",
"SegmentIndexBuffer",
"sib",
",",
"File",
"sibFile",
")",
"throws",
"IOException",
"{",
"check",
"(",
"sibFile",
")",
";",
"RandomAccessFile",
"raf",
"=",
"new",
"RandomAccessFile",
"(",
"sibFile",
",",
"\"r\"",
... | Reads from the specified segment index buffer file.
@param sib - the segment index buffer
@param sibFile - the segment index buffer file to read from
@throws IOException | [
"Reads",
"from",
"the",
"specified",
"segment",
"index",
"buffer",
"file",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java#L61-L80 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java | SegmentIndexBufferFileIO.write | @Override
public int write(SegmentIndexBuffer sib, File sibFile) throws IOException {
create(sibFile);
RandomAccessFile raf = new RandomAccessFile(sibFile, "rw");
FileChannel channel = raf.getChannel();
writeVersion(channel);
int length = sib.write(channel);... | java | @Override
public int write(SegmentIndexBuffer sib, File sibFile) throws IOException {
create(sibFile);
RandomAccessFile raf = new RandomAccessFile(sibFile, "rw");
FileChannel channel = raf.getChannel();
writeVersion(channel);
int length = sib.write(channel);... | [
"@",
"Override",
"public",
"int",
"write",
"(",
"SegmentIndexBuffer",
"sib",
",",
"File",
"sibFile",
")",
"throws",
"IOException",
"{",
"create",
"(",
"sibFile",
")",
";",
"RandomAccessFile",
"raf",
"=",
"new",
"RandomAccessFile",
"(",
"sibFile",
",",
"\"rw\""... | Writes to the specified segment index buffer file.
@param sib - the segment index buffer
@param sibFile - the segment index buffer file to write to
@throws IOException | [
"Writes",
"to",
"the",
"specified",
"segment",
"index",
"buffer",
"file",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java#L122-L143 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java | SegmentIndexBufferFileIO.readVersion | protected int readVersion(ReadableByteChannel channel) throws IOException {
ByteBuffer version = ByteBuffer.allocate(STORAGE_VERSION_LENGTH);
int len = channel.read(version);
if (len < STORAGE_VERSION_LENGTH) {
throw new IOException("Invalid Version");
}
return versio... | java | protected int readVersion(ReadableByteChannel channel) throws IOException {
ByteBuffer version = ByteBuffer.allocate(STORAGE_VERSION_LENGTH);
int len = channel.read(version);
if (len < STORAGE_VERSION_LENGTH) {
throw new IOException("Invalid Version");
}
return versio... | [
"protected",
"int",
"readVersion",
"(",
"ReadableByteChannel",
"channel",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"version",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"STORAGE_VERSION_LENGTH",
")",
";",
"int",
"len",
"=",
"channel",
".",
"read",
"(",
"ve... | Reads version from readable channel.
@throws IOException | [
"Reads",
"version",
"from",
"readable",
"channel",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java#L150-L157 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java | SegmentIndexBufferFileIO.writeVersion | protected void writeVersion(WritableByteChannel channel) throws IOException {
ByteBuffer version = ByteBuffer.allocate(STORAGE_VERSION_LENGTH);
version.putInt(STORAGE_VERSION);
version.flip();
channel.write(version);
} | java | protected void writeVersion(WritableByteChannel channel) throws IOException {
ByteBuffer version = ByteBuffer.allocate(STORAGE_VERSION_LENGTH);
version.putInt(STORAGE_VERSION);
version.flip();
channel.write(version);
} | [
"protected",
"void",
"writeVersion",
"(",
"WritableByteChannel",
"channel",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"version",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"STORAGE_VERSION_LENGTH",
")",
";",
"version",
".",
"putInt",
"(",
"STORAGE_VERSION",
")"... | Writes the version to writable channel.
@throws IOException | [
"Writes",
"the",
"version",
"to",
"writable",
"channel",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java#L164-L169 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java | SegmentIndexBufferFileIO.create | protected void create(File file) throws IOException {
if(!file.exists()) {
File dir = file.getParentFile();
if(dir.exists()) file.createNewFile();
else if(dir.mkdirs()) file.createNewFile();
else throw new IOException("Failed to create " + file.getAbsolutePath());... | java | protected void create(File file) throws IOException {
if(!file.exists()) {
File dir = file.getParentFile();
if(dir.exists()) file.createNewFile();
else if(dir.mkdirs()) file.createNewFile();
else throw new IOException("Failed to create " + file.getAbsolutePath());... | [
"protected",
"void",
"create",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"{",
"File",
"dir",
"=",
"file",
".",
"getParentFile",
"(",
")",
";",
"if",
"(",
"dir",
".",
"exists",
"(",... | Creates the specified file if needed.
@throws IOException | [
"Creates",
"the",
"specified",
"file",
"if",
"needed",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java#L176-L187 | train |
jingwei/krati | krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java | SegmentIndexBufferFileIO.check | protected void check(File file) throws IOException {
if(!file.exists()) {
throw new FileNotFoundException(file.getAbsolutePath());
}
if(file.isDirectory()) {
throw new IOException("Cannot open directory " + file.getAbsolutePath());
}
} | java | protected void check(File file) throws IOException {
if(!file.exists()) {
throw new FileNotFoundException(file.getAbsolutePath());
}
if(file.isDirectory()) {
throw new IOException("Cannot open directory " + file.getAbsolutePath());
}
} | [
"protected",
"void",
"check",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"(",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"}",
"if"... | Checks the existence of the specified file.
@throws IOException | [
"Checks",
"the",
"existence",
"of",
"the",
"specified",
"file",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/segment/SegmentIndexBufferFileIO.java#L194-L202 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PAMSourceAuditor.java | PAMSourceAuditor.getAuditor | public static PAMSourceAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (PAMSourceAuditor)ctx.getAuditor(PAMSourceAuditor.class);
} | java | public static PAMSourceAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (PAMSourceAuditor)ctx.getAuditor(PAMSourceAuditor.class);
} | [
"public",
"static",
"PAMSourceAuditor",
"getAuditor",
"(",
")",
"{",
"AuditorModuleContext",
"ctx",
"=",
"AuditorModuleContext",
".",
"getContext",
"(",
")",
";",
"return",
"(",
"PAMSourceAuditor",
")",
"ctx",
".",
"getAuditor",
"(",
"PAMSourceAuditor",
".",
"clas... | Get an instance of the PAM Source Auditor from the
global context
@return PAM Source Auditor instance | [
"Get",
"an",
"instance",
"of",
"the",
"PAM",
"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/PAMSourceAuditor.java#L39-L43 | train |
jingwei/krati | krati-main/src/main/java/krati/core/array/entry/PreFillEntryLong.java | PreFillEntryLong.add | public void add(int pos, long val, long scn) {
if (_index < _entryCapacity) {
_valArray.get(_index++).reinit(pos, val, scn);
maintainScn(scn);
} else {
throw new EntryOverflowException();
}
} | java | public void add(int pos, long val, long scn) {
if (_index < _entryCapacity) {
_valArray.get(_index++).reinit(pos, val, scn);
maintainScn(scn);
} else {
throw new EntryOverflowException();
}
} | [
"public",
"void",
"add",
"(",
"int",
"pos",
",",
"long",
"val",
",",
"long",
"scn",
")",
"{",
"if",
"(",
"_index",
"<",
"_entryCapacity",
")",
"{",
"_valArray",
".",
"get",
"(",
"_index",
"++",
")",
".",
"reinit",
"(",
"pos",
",",
"val",
",",
"sc... | Adds data to this Entry.
@param pos
@param val
@param scn | [
"Adds",
"data",
"to",
"this",
"Entry",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/entry/PreFillEntryLong.java#L43-L50 | train |
jingwei/krati | krati-main/src/main/java/krati/core/array/entry/AbstractEntry.java | AbstractEntry.save | public final void save(File file) throws IOException {
_entryFile = file;
Chronos c = new Chronos();
DataWriter out = new FastDataWriter(file);
try {
out.open();
// Save entry head
out.writeLong(STORAGE_VERSION); // write the entry file version
... | java | public final void save(File file) throws IOException {
_entryFile = file;
Chronos c = new Chronos();
DataWriter out = new FastDataWriter(file);
try {
out.open();
// Save entry head
out.writeLong(STORAGE_VERSION); // write the entry file version
... | [
"public",
"final",
"void",
"save",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"_entryFile",
"=",
"file",
";",
"Chronos",
"c",
"=",
"new",
"Chronos",
"(",
")",
";",
"DataWriter",
"out",
"=",
"new",
"FastDataWriter",
"(",
"file",
")",
";",
"... | Saves to a file.
@param file
@throws IOException | [
"Saves",
"to",
"a",
"file",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/entry/AbstractEntry.java#L124-L151 | train |
jingwei/krati | krati-main/src/main/java/krati/core/array/entry/AbstractEntry.java | AbstractEntry.load | public void load(File file) throws IOException {
_entryFile = file;
Chronos c = new Chronos();
ChannelReader in = new ChannelReader(file);
try {
in.open();
// Read entry head
long fileVersion = in.readLong();
if (fileVersion != STORAGE_VE... | java | public void load(File file) throws IOException {
_entryFile = file;
Chronos c = new Chronos();
ChannelReader in = new ChannelReader(file);
try {
in.open();
// Read entry head
long fileVersion = in.readLong();
if (fileVersion != STORAGE_VE... | [
"public",
"void",
"load",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"_entryFile",
"=",
"file",
";",
"Chronos",
"c",
"=",
"new",
"Chronos",
"(",
")",
";",
"ChannelReader",
"in",
"=",
"new",
"ChannelReader",
"(",
"file",
")",
";",
"try",
"{... | Loads an entry from a given file.
@param file
@throws IOException | [
"Loads",
"an",
"entry",
"from",
"a",
"given",
"file",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/entry/AbstractEntry.java#L159-L201 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/models/rfc3881/AuditSourceIdentificationType.java | AuditSourceIdentificationType.getAuditSourceTypeCode | public CodedValueType getAuditSourceTypeCode() {
if (EventUtils.isEmptyOrNull(auditSourceTypeCode)) {
return null;
}
AuditSourceType auditSourceType = auditSourceTypeCode.get(0);
CodedValueType codedValueType = new CodedValueType();
codedValueType.setCode(auditSourceT... | java | public CodedValueType getAuditSourceTypeCode() {
if (EventUtils.isEmptyOrNull(auditSourceTypeCode)) {
return null;
}
AuditSourceType auditSourceType = auditSourceTypeCode.get(0);
CodedValueType codedValueType = new CodedValueType();
codedValueType.setCode(auditSourceT... | [
"public",
"CodedValueType",
"getAuditSourceTypeCode",
"(",
")",
"{",
"if",
"(",
"EventUtils",
".",
"isEmptyOrNull",
"(",
"auditSourceTypeCode",
")",
")",
"{",
"return",
"null",
";",
"}",
"AuditSourceType",
"auditSourceType",
"=",
"auditSourceTypeCode",
".",
"get",
... | Gets the value of the auditSourceTypeCode property.
@deprecated use {@link #getAuditSourceType()} | [
"Gets",
"the",
"value",
"of",
"the",
"auditSourceTypeCode",
"property",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/models/rfc3881/AuditSourceIdentificationType.java#L141-L152 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/models/rfc3881/AuditSourceIdentificationType.java | AuditSourceIdentificationType.setAuditSourceTypeCode | public void setAuditSourceTypeCode(CodedValueType auditSourceTypeCode) {
AuditSourceType auditSourceType = new AuditSourceType();
auditSourceType.setCode(auditSourceTypeCode.getCode());
auditSourceType.setCodeSystem(auditSourceTypeCode.getCodeSystem());
auditSourceType.setCodeSystemName(... | java | public void setAuditSourceTypeCode(CodedValueType auditSourceTypeCode) {
AuditSourceType auditSourceType = new AuditSourceType();
auditSourceType.setCode(auditSourceTypeCode.getCode());
auditSourceType.setCodeSystem(auditSourceTypeCode.getCodeSystem());
auditSourceType.setCodeSystemName(... | [
"public",
"void",
"setAuditSourceTypeCode",
"(",
"CodedValueType",
"auditSourceTypeCode",
")",
"{",
"AuditSourceType",
"auditSourceType",
"=",
"new",
"AuditSourceType",
"(",
")",
";",
"auditSourceType",
".",
"setCode",
"(",
"auditSourceTypeCode",
".",
"getCode",
"(",
... | Sets the value of the auditSourceTypeCode property.
@deprecated use {@link #getAuditSourceType() and add to the list} | [
"Sets",
"the",
"value",
"of",
"the",
"auditSourceTypeCode",
"property",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/models/rfc3881/AuditSourceIdentificationType.java#L165-L171 | train |
apptik/jus | examples-android-volley-migration/src/main/java/io/apptik/comm/jus/examples/volley/LruBitmapCache.java | LruBitmapCache.getCacheSize | public static int getCacheSize(Context ctx) {
final DisplayMetrics displayMetrics = ctx.getResources().
getDisplayMetrics();
final int screenWidth = displayMetrics.widthPixels;
final int screenHeight = displayMetrics.heightPixels;
// 4 bytes per pixel
final int screenBytes = screenWidth * screenHeight * 4... | java | public static int getCacheSize(Context ctx) {
final DisplayMetrics displayMetrics = ctx.getResources().
getDisplayMetrics();
final int screenWidth = displayMetrics.widthPixels;
final int screenHeight = displayMetrics.heightPixels;
// 4 bytes per pixel
final int screenBytes = screenWidth * screenHeight * 4... | [
"public",
"static",
"int",
"getCacheSize",
"(",
"Context",
"ctx",
")",
"{",
"final",
"DisplayMetrics",
"displayMetrics",
"=",
"ctx",
".",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
";",
"final",
"int",
"screenWidth",
"=",
"displayMetrics",
"... | Returns a cache size equal to approximately three screens worth of images. | [
"Returns",
"a",
"cache",
"size",
"equal",
"to",
"approximately",
"three",
"screens",
"worth",
"of",
"images",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/examples-android-volley-migration/src/main/java/io/apptik/comm/jus/examples/volley/LruBitmapCache.java#L49-L58 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditRecordRepositoryAuditor.java | AuditRecordRepositoryAuditor.getAuditor | public static AuditRecordRepositoryAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (AuditRecordRepositoryAuditor)ctx.getAuditor(AuditRecordRepositoryAuditor.class);
} | java | public static AuditRecordRepositoryAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (AuditRecordRepositoryAuditor)ctx.getAuditor(AuditRecordRepositoryAuditor.class);
} | [
"public",
"static",
"AuditRecordRepositoryAuditor",
"getAuditor",
"(",
")",
"{",
"AuditorModuleContext",
"ctx",
"=",
"AuditorModuleContext",
".",
"getContext",
"(",
")",
";",
"return",
"(",
"AuditRecordRepositoryAuditor",
")",
"ctx",
".",
"getAuditor",
"(",
"AuditReco... | Get an instance of the Audit Record Repository auditor from the
global context
@return Audit Record Repository auditor instance | [
"Get",
"an",
"instance",
"of",
"the",
"Audit",
"Record",
"Repository",
"auditor",
"from",
"the",
"global",
"context"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditRecordRepositoryAuditor.java#L33-L37 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditRecordRepositoryAuditor.java | AuditRecordRepositoryAuditor.auditAuditLogUsed | public void auditAuditLogUsed(RFC3881EventOutcomeCodes eventOutcome,
String accessingUser, String accessingProcess,
String auditLogUri)
{
if (!isAuditorEnabled()) {
return;
}
AuditLogUsedEvent auditLogUsedEvent = new AuditLogUsedEvent(eventOutcome);
auditLogUsedEvent.setAuditSourceId(getAuditSourceId(... | java | public void auditAuditLogUsed(RFC3881EventOutcomeCodes eventOutcome,
String accessingUser, String accessingProcess,
String auditLogUri)
{
if (!isAuditorEnabled()) {
return;
}
AuditLogUsedEvent auditLogUsedEvent = new AuditLogUsedEvent(eventOutcome);
auditLogUsedEvent.setAuditSourceId(getAuditSourceId(... | [
"public",
"void",
"auditAuditLogUsed",
"(",
"RFC3881EventOutcomeCodes",
"eventOutcome",
",",
"String",
"accessingUser",
",",
"String",
"accessingProcess",
",",
"String",
"auditLogUri",
")",
"{",
"if",
"(",
"!",
"isAuditorEnabled",
"(",
")",
")",
"{",
"return",
";"... | Audits a DICOM "Audit Log Used" event, for a given User and Process.
@param eventOutcome The event outcome indicator
@param accessingUser Identity of the user accessing the audit log
@param accessingProcess Identity of the process accessing the audit log
@param auditLogUri The URI of the audit log being accessed | [
"Audits",
"a",
"DICOM",
"Audit",
"Log",
"Used",
"event",
"for",
"a",
"given",
"User",
"and",
"Process",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditRecordRepositoryAuditor.java#L47-L64 | train |
jingwei/krati | krati-main/src/main/java/krati/core/array/entry/EntryUtility.java | EntryUtility.sortEntriesById | public static <T extends EntryValue> void sortEntriesById(List<Entry<T>> entryList) {
if (entryList.size() > 0) {
Collections.sort(entryList, new Comparator<Entry<?>>() {
@Override
public int compare(Entry<?> e1, Entry<?> e2) {
long v1 = getEntryId... | java | public static <T extends EntryValue> void sortEntriesById(List<Entry<T>> entryList) {
if (entryList.size() > 0) {
Collections.sort(entryList, new Comparator<Entry<?>>() {
@Override
public int compare(Entry<?> e1, Entry<?> e2) {
long v1 = getEntryId... | [
"public",
"static",
"<",
"T",
"extends",
"EntryValue",
">",
"void",
"sortEntriesById",
"(",
"List",
"<",
"Entry",
"<",
"T",
">",
">",
"entryList",
")",
"{",
"if",
"(",
"entryList",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"Collections",
".",
"sort"... | Sort entries in the ascending order of entry log IDs. | [
"Sort",
"entries",
"in",
"the",
"ascending",
"order",
"of",
"entry",
"log",
"IDs",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/entry/EntryUtility.java#L130-L141 | train |
jingwei/krati | krati-main/src/main/java/krati/core/array/entry/EntryUtility.java | EntryUtility.getEntryId | public static long getEntryId(String entryFileName) {
int ind1 = entryFileName.indexOf("_") + 1;
if (ind1 > 0) {
int ind2 = entryFileName.indexOf("_", ind1);
if (ind2 > ind1) {
String str = entryFileName.substring(ind1, ind2);
try {
... | java | public static long getEntryId(String entryFileName) {
int ind1 = entryFileName.indexOf("_") + 1;
if (ind1 > 0) {
int ind2 = entryFileName.indexOf("_", ind1);
if (ind2 > ind1) {
String str = entryFileName.substring(ind1, ind2);
try {
... | [
"public",
"static",
"long",
"getEntryId",
"(",
"String",
"entryFileName",
")",
"{",
"int",
"ind1",
"=",
"entryFileName",
".",
"indexOf",
"(",
"\"_\"",
")",
"+",
"1",
";",
"if",
"(",
"ind1",
">",
"0",
")",
"{",
"int",
"ind2",
"=",
"entryFileName",
".",
... | Gets the entry ID based on the specified entry file name. | [
"Gets",
"the",
"entry",
"ID",
"based",
"on",
"the",
"specified",
"entry",
"file",
"name",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/entry/EntryUtility.java#L146-L160 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/BSDSyslogSenderImpl.java | BSDSyslogSenderImpl.send | private void send(byte[] msg, DatagramSocket socket, InetAddress destination, int port) throws Exception
{
if (EventUtils.isEmptyOrNull(msg)) {
return;
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Auditing to " + destination.getHostAddress() + ":" + port);
}
if (LO... | java | private void send(byte[] msg, DatagramSocket socket, InetAddress destination, int port) throws Exception
{
if (EventUtils.isEmptyOrNull(msg)) {
return;
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Auditing to " + destination.getHostAddress() + ":" + port);
}
if (LO... | [
"private",
"void",
"send",
"(",
"byte",
"[",
"]",
"msg",
",",
"DatagramSocket",
"socket",
",",
"InetAddress",
"destination",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"if",
"(",
"EventUtils",
".",
"isEmptyOrNull",
"(",
"msg",
")",
")",
"{",
"r... | Send a byte buffer to a designated destination address and port using the
datagram socket specified.
@param msg Message buffer to send
@param socket UDP socket to use
@param destination Destination address to send to
@param port Destination port to send to
@throws Exception | [
"Send",
"a",
"byte",
"buffer",
"to",
"a",
"designated",
"destination",
"address",
"and",
"port",
"using",
"the",
"datagram",
"socket",
"specified",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/BSDSyslogSenderImpl.java#L83-L99 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/BSDSyslogSenderImpl.java | BSDSyslogSenderImpl.send | private void send(AuditEventMessage msg, DatagramSocket socket, InetAddress destination, int port) throws Exception
{
if (EventUtils.isEmptyOrNull(msg)) {
return;
}
// Check to validate port
int portToUse = getTransportPort(port);
// Serialize and format event message for syslog
byte[] msgBytes = get... | java | private void send(AuditEventMessage msg, DatagramSocket socket, InetAddress destination, int port) throws Exception
{
if (EventUtils.isEmptyOrNull(msg)) {
return;
}
// Check to validate port
int portToUse = getTransportPort(port);
// Serialize and format event message for syslog
byte[] msgBytes = get... | [
"private",
"void",
"send",
"(",
"AuditEventMessage",
"msg",
",",
"DatagramSocket",
"socket",
",",
"InetAddress",
"destination",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"if",
"(",
"EventUtils",
".",
"isEmptyOrNull",
"(",
"msg",
")",
")",
"{",
"re... | Send an audit message to a designated destination address and port using the
datagram socket specified.
@param msg Message to send
@param socket UDP socket to use
@param destination Destination address to send to
@param port Destination port to send to
@throws Exception | [
"Send",
"an",
"audit",
"message",
"to",
"a",
"designated",
"destination",
"address",
"and",
"port",
"using",
"the",
"datagram",
"socket",
"specified",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/BSDSyslogSenderImpl.java#L111-L123 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/BSDSyslogSenderImpl.java | BSDSyslogSenderImpl.getTransportPayload | protected byte[] getTransportPayload(AuditEventMessage msg)
{
if (msg == null) {
return null;
}
byte[] msgBytes = msg.getSerializedMessage(false);
if (EventUtils.isEmptyOrNull(msgBytes)) {
return null;
}
// Format message with transport-specific headers
StringBuilder sb = new StringBuilder();... | java | protected byte[] getTransportPayload(AuditEventMessage msg)
{
if (msg == null) {
return null;
}
byte[] msgBytes = msg.getSerializedMessage(false);
if (EventUtils.isEmptyOrNull(msgBytes)) {
return null;
}
// Format message with transport-specific headers
StringBuilder sb = new StringBuilder();... | [
"protected",
"byte",
"[",
"]",
"getTransportPayload",
"(",
"AuditEventMessage",
"msg",
")",
"{",
"if",
"(",
"msg",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"byte",
"[",
"]",
"msgBytes",
"=",
"msg",
".",
"getSerializedMessage",
"(",
"false",
")... | Serialize, format, and prepare the message payload body
for sending by this transport. This includes adding
the syslog message header.
@param msg Message to prepare
@return Buffer to send | [
"Serialize",
"format",
"and",
"prepare",
"the",
"message",
"payload",
"body",
"for",
"sending",
"by",
"this",
"transport",
".",
"This",
"includes",
"adding",
"the",
"syslog",
"message",
"header",
"."
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/BSDSyslogSenderImpl.java#L196-L221 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.loadWaterMarks | protected void loadWaterMarks() throws IOException {
// Load source water marks from file
if (file != null && file.exists()) {
try {
loadWaterMarks(file);
} catch (IOException e) {
if (fileOriginal != null && fileOriginal.exists()) {
... | java | protected void loadWaterMarks() throws IOException {
// Load source water marks from file
if (file != null && file.exists()) {
try {
loadWaterMarks(file);
} catch (IOException e) {
if (fileOriginal != null && fileOriginal.exists()) {
... | [
"protected",
"void",
"loadWaterMarks",
"(",
")",
"throws",
"IOException",
"{",
"// Load source water marks from file",
"if",
"(",
"file",
"!=",
"null",
"&&",
"file",
".",
"exists",
"(",
")",
")",
"{",
"try",
"{",
"loadWaterMarks",
"(",
"file",
")",
";",
"}",... | Load water marks from underlying files.
@throws IOException | [
"Load",
"water",
"marks",
"from",
"underlying",
"files",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L91-L102 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.loadWaterMarks | protected void loadWaterMarks(File waterMarksFile) throws IOException {
Properties p = new Properties();
FileInputStream fis = new FileInputStream(waterMarksFile);
logger.info("Loading " + waterMarksFile);
try {
p.load(fis);
Enumeration<?> enm = p.propertyNames... | java | protected void loadWaterMarks(File waterMarksFile) throws IOException {
Properties p = new Properties();
FileInputStream fis = new FileInputStream(waterMarksFile);
logger.info("Loading " + waterMarksFile);
try {
p.load(fis);
Enumeration<?> enm = p.propertyNames... | [
"protected",
"void",
"loadWaterMarks",
"(",
"File",
"waterMarksFile",
")",
"throws",
"IOException",
"{",
"Properties",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"waterMarksFile",
")",
";",
"logger... | Load water marks from an underlying file.
@param waterMarksFile
@throws IOException | [
"Load",
"water",
"marks",
"from",
"an",
"underlying",
"file",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L110-L152 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.getHWMScn | public long getHWMScn(String source) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
return (e == null) ? 0 : e.getHWMScn();
} | java | public long getHWMScn(String source) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
return (e == null) ? 0 : e.getHWMScn();
} | [
"public",
"long",
"getHWMScn",
"(",
"String",
"source",
")",
"{",
"WaterMarkEntry",
"e",
"=",
"sourceWaterMarkMap",
".",
"get",
"(",
"source",
")",
";",
"return",
"(",
"e",
"==",
"null",
")",
"?",
"0",
":",
"e",
".",
"getHWMScn",
"(",
")",
";",
"}"
] | Gets the high water mark of a source.
@param source - the source | [
"Gets",
"the",
"high",
"water",
"mark",
"of",
"a",
"source",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L176-L179 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.getLWMScn | public long getLWMScn(String source) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
return (e == null) ? 0 : e.getLWMScn();
} | java | public long getLWMScn(String source) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
return (e == null) ? 0 : e.getLWMScn();
} | [
"public",
"long",
"getLWMScn",
"(",
"String",
"source",
")",
"{",
"WaterMarkEntry",
"e",
"=",
"sourceWaterMarkMap",
".",
"get",
"(",
"source",
")",
";",
"return",
"(",
"e",
"==",
"null",
")",
"?",
"0",
":",
"e",
".",
"getLWMScn",
"(",
")",
";",
"}"
] | Gets the low water mark of a source.
@param source - the source | [
"Gets",
"the",
"low",
"water",
"mark",
"of",
"a",
"source",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L202-L205 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.setLWMScn | public void setLWMScn(String source, long scn) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
if (e == null) {
e = new WaterMarkEntry(source);
sourceWaterMarkMap.put(source, e);
}
e.setLWMScn(scn);
} | java | public void setLWMScn(String source, long scn) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
if (e == null) {
e = new WaterMarkEntry(source);
sourceWaterMarkMap.put(source, e);
}
e.setLWMScn(scn);
} | [
"public",
"void",
"setLWMScn",
"(",
"String",
"source",
",",
"long",
"scn",
")",
"{",
"WaterMarkEntry",
"e",
"=",
"sourceWaterMarkMap",
".",
"get",
"(",
"source",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"e",
"=",
"new",
"WaterMarkEntry",
"(",... | Sets the low water mark of a source
@param source - the source
@param scn - the water mark value | [
"Sets",
"the",
"low",
"water",
"mark",
"of",
"a",
"source"
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L213-L220 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.setWaterMarks | public void setWaterMarks(String source, long lwmScn, long hwmScn) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
if (e == null) {
e = new WaterMarkEntry(source);
sourceWaterMarkMap.put(source, e);
}
e.setLWMScn(lwmScn);
e.setHWMScn(hwmScn);
} | java | public void setWaterMarks(String source, long lwmScn, long hwmScn) {
WaterMarkEntry e = sourceWaterMarkMap.get(source);
if (e == null) {
e = new WaterMarkEntry(source);
sourceWaterMarkMap.put(source, e);
}
e.setLWMScn(lwmScn);
e.setHWMScn(hwmScn);
} | [
"public",
"void",
"setWaterMarks",
"(",
"String",
"source",
",",
"long",
"lwmScn",
",",
"long",
"hwmScn",
")",
"{",
"WaterMarkEntry",
"e",
"=",
"sourceWaterMarkMap",
".",
"get",
"(",
"source",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"e",
"=",... | Sets the water marks of a source.
@param source - the source
@param lwmScn - the low water mark SCN
@param hwmScn - the high water mark SCN | [
"Sets",
"the",
"water",
"marks",
"of",
"a",
"source",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L248-L256 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.syncWaterMarks | public boolean syncWaterMarks(String source, long lwmScn, long hwmScn) {
setWaterMarks(source, lwmScn, hwmScn);
return flush();
} | java | public boolean syncWaterMarks(String source, long lwmScn, long hwmScn) {
setWaterMarks(source, lwmScn, hwmScn);
return flush();
} | [
"public",
"boolean",
"syncWaterMarks",
"(",
"String",
"source",
",",
"long",
"lwmScn",
",",
"long",
"hwmScn",
")",
"{",
"setWaterMarks",
"(",
"source",
",",
"lwmScn",
",",
"hwmScn",
")",
";",
"return",
"flush",
"(",
")",
";",
"}"
] | Sets and flushes the water marks of a source.
@param source - the source
@param lwmScn - the low water mark SCN
@param hwmScn - the high water mark SCN
@return <tt>true</tt> if flush is successful. | [
"Sets",
"and",
"flushes",
"the",
"water",
"marks",
"of",
"a",
"source",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L266-L269 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.syncWaterMarks | public boolean syncWaterMarks() {
// Sync up low water marks
for (String source : sourceWaterMarkMap.keySet()) {
WaterMarkEntry wmEntry = sourceWaterMarkMap.get(source);
wmEntry.setLWMScn(wmEntry.getHWMScn());
}
return flush();
} | java | public boolean syncWaterMarks() {
// Sync up low water marks
for (String source : sourceWaterMarkMap.keySet()) {
WaterMarkEntry wmEntry = sourceWaterMarkMap.get(source);
wmEntry.setLWMScn(wmEntry.getHWMScn());
}
return flush();
} | [
"public",
"boolean",
"syncWaterMarks",
"(",
")",
"{",
"// Sync up low water marks",
"for",
"(",
"String",
"source",
":",
"sourceWaterMarkMap",
".",
"keySet",
"(",
")",
")",
"{",
"WaterMarkEntry",
"wmEntry",
"=",
"sourceWaterMarkMap",
".",
"get",
"(",
"source",
"... | Sync up low water marks to high water marks for all the sources.
@return <tt>true</tt> if flush is successful. | [
"Sync",
"up",
"low",
"water",
"marks",
"to",
"high",
"water",
"marks",
"for",
"all",
"the",
"sources",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L287-L295 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.flush | public boolean flush() {
boolean ret = true;
PrintWriter out = null;
// Save source water marks
try {
// Backup the original file
if (file.exists()) {
if (fileOriginal.exists()) {
fileOriginal.delete();
... | java | public boolean flush() {
boolean ret = true;
PrintWriter out = null;
// Save source water marks
try {
// Backup the original file
if (file.exists()) {
if (fileOriginal.exists()) {
fileOriginal.delete();
... | [
"public",
"boolean",
"flush",
"(",
")",
"{",
"boolean",
"ret",
"=",
"true",
";",
"PrintWriter",
"out",
"=",
"null",
";",
"// Save source water marks",
"try",
"{",
"// Backup the original file",
"if",
"(",
"file",
".",
"exists",
"(",
")",
")",
"{",
"if",
"(... | Flushes low water marks and high water marks for all the sources.
@return <tt>true</tt> if flush is successful. | [
"Flushes",
"low",
"water",
"marks",
"and",
"high",
"water",
"marks",
"for",
"all",
"the",
"sources",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L302-L335 | train |
jingwei/krati | krati-main/src/main/java/krati/util/SourceWaterMarks.java | SourceWaterMarks.clear | public void clear() {
sourceWaterMarkMap.clear();
flush();
if (fileOriginal != null && fileOriginal.exists()) {
fileOriginal.delete();
}
} | java | public void clear() {
sourceWaterMarkMap.clear();
flush();
if (fileOriginal != null && fileOriginal.exists()) {
fileOriginal.delete();
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"sourceWaterMarkMap",
".",
"clear",
"(",
")",
";",
"flush",
"(",
")",
";",
"if",
"(",
"fileOriginal",
"!=",
"null",
"&&",
"fileOriginal",
".",
"exists",
"(",
")",
")",
"{",
"fileOriginal",
".",
"delete",
"(",
... | Clears SourceWaterMark. | [
"Clears",
"SourceWaterMark",
"."
] | 1ca0f994a7b0c8215b827eac9aaf95789ec08d21 | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/util/SourceWaterMarks.java#L340-L346 | train |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/ui/NetworkImageView.java | NetworkImageView.loadImageIfNecessary | synchronized void loadImageIfNecessary(final boolean isInLayoutPass) {
int width = getWidth();
int height = getHeight();
boolean wrapWidth = false, wrapHeight = false;
if (getLayoutParams() != null) {
wrapWidth = getLayoutParams().width == LayoutParams.WRAP_CONTENT;
... | java | synchronized void loadImageIfNecessary(final boolean isInLayoutPass) {
int width = getWidth();
int height = getHeight();
boolean wrapWidth = false, wrapHeight = false;
if (getLayoutParams() != null) {
wrapWidth = getLayoutParams().width == LayoutParams.WRAP_CONTENT;
... | [
"synchronized",
"void",
"loadImageIfNecessary",
"(",
"final",
"boolean",
"isInLayoutPass",
")",
"{",
"int",
"width",
"=",
"getWidth",
"(",
")",
";",
"int",
"height",
"=",
"getHeight",
"(",
")",
";",
"boolean",
"wrapWidth",
"=",
"false",
",",
"wrapHeight",
"=... | Loads the image for the view if it isn't already loaded.
@param isInLayoutPass True if this was invoked from a layout pass, false otherwise. | [
"Loads",
"the",
"image",
"for",
"the",
"view",
"if",
"it",
"isn",
"t",
"already",
"loaded",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/ui/NetworkImageView.java#L162-L255 | train |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PIXManagerAuditor.java | PIXManagerAuditor.getAuditor | public static PIXManagerAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (PIXManagerAuditor)ctx.getAuditor(PIXManagerAuditor.class);
} | java | public static PIXManagerAuditor getAuditor()
{
AuditorModuleContext ctx = AuditorModuleContext.getContext();
return (PIXManagerAuditor)ctx.getAuditor(PIXManagerAuditor.class);
} | [
"public",
"static",
"PIXManagerAuditor",
"getAuditor",
"(",
")",
"{",
"AuditorModuleContext",
"ctx",
"=",
"AuditorModuleContext",
".",
"getContext",
"(",
")",
";",
"return",
"(",
"PIXManagerAuditor",
")",
"ctx",
".",
"getAuditor",
"(",
"PIXManagerAuditor",
".",
"c... | Get an instance of the PIX Manager Auditor from the
global context
@return PIX Manager Auditor instance | [
"Get",
"an",
"instance",
"of",
"the",
"PIX",
"Manager",
"Auditor",
"from",
"the",
"global",
"context"
] | 25ed1e926825169c94923a2c89a4618f60478ae8 | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/PIXManagerAuditor.java#L43-L47 | train |
ixa-ehu/ixa-pipe-tok | src/main/java/eus/ixa/ixa/pipe/tok/RuleBasedTokenizerServer.java | RuleBasedTokenizerServer.getAnnotations | private String getAnnotations(final Properties properties,
final String stringFromClient) throws IOException, JDOMException {
BufferedReader breader;
KAFDocument kaf;
String kafString = null;
String lang = properties.getProperty("language");
String outputFormat = properties.getProperty("outpu... | java | private String getAnnotations(final Properties properties,
final String stringFromClient) throws IOException, JDOMException {
BufferedReader breader;
KAFDocument kaf;
String kafString = null;
String lang = properties.getProperty("language");
String outputFormat = properties.getProperty("outpu... | [
"private",
"String",
"getAnnotations",
"(",
"final",
"Properties",
"properties",
",",
"final",
"String",
"stringFromClient",
")",
"throws",
"IOException",
",",
"JDOMException",
"{",
"BufferedReader",
"breader",
";",
"KAFDocument",
"kaf",
";",
"String",
"kafString",
... | Get tokens.
@param properties
the options
@param stringFromClient
the original string
@return the tokenized string
@throws IOException
if io problems
@throws JDOMException
if NAF problems | [
"Get",
"tokens",
"."
] | be38651a1267be37764b08acce9ee12a87fb61e7 | https://github.com/ixa-ehu/ixa-pipe-tok/blob/be38651a1267be37764b08acce9ee12a87fb61e7/src/main/java/eus/ixa/ixa/pipe/tok/RuleBasedTokenizerServer.java#L175-L231 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java | BusinessUtils.resolveGenerics | public static <T> Class<?>[] resolveGenerics(Class<T> superType, Class<? extends T> subType) {
checkNotNull(superType, "superType should not be null");
checkNotNull(subType, "subType should not be null");
Class<?> subTypeWithoutProxy = ProxyUtils.cleanProxy(subType);
return TypeResolver.... | java | public static <T> Class<?>[] resolveGenerics(Class<T> superType, Class<? extends T> subType) {
checkNotNull(superType, "superType should not be null");
checkNotNull(subType, "subType should not be null");
Class<?> subTypeWithoutProxy = ProxyUtils.cleanProxy(subType);
return TypeResolver.... | [
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"?",
">",
"[",
"]",
"resolveGenerics",
"(",
"Class",
"<",
"T",
">",
"superType",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"subType",
")",
"{",
"checkNotNull",
"(",
"superType",
",",
"\"superType shou... | Resolve generics of a class relatively to a superclass.
@param superType the superclass.
@param subType the subclass.
@param <T> the type of the superclass.
@return the resolved types. | [
"Resolve",
"generics",
"of",
"a",
"class",
"relatively",
"to",
"a",
"superclass",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java#L50-L56 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java | BusinessUtils.resolveAggregateIdClass | @SuppressWarnings("unchecked")
public static <A extends AggregateRoot<I>, I> Class<I> resolveAggregateIdClass(Class<A> aggregateRootClass) {
checkNotNull(aggregateRootClass, "aggregateRootClass should not be null");
return (Class<I>) resolveGenerics(AggregateRoot.class, aggregateRootClass)[0];
} | java | @SuppressWarnings("unchecked")
public static <A extends AggregateRoot<I>, I> Class<I> resolveAggregateIdClass(Class<A> aggregateRootClass) {
checkNotNull(aggregateRootClass, "aggregateRootClass should not be null");
return (Class<I>) resolveGenerics(AggregateRoot.class, aggregateRootClass)[0];
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"A",
"extends",
"AggregateRoot",
"<",
"I",
">",
",",
"I",
">",
"Class",
"<",
"I",
">",
"resolveAggregateIdClass",
"(",
"Class",
"<",
"A",
">",
"aggregateRootClass",
")",
"{",
"che... | Returns the identifier class for an aggregate root class. | [
"Returns",
"the",
"identifier",
"class",
"for",
"an",
"aggregate",
"root",
"class",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java#L61-L65 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java | BusinessUtils.getAggregateIdClasses | public static Class<?>[] getAggregateIdClasses(Class<? extends AggregateRoot<?>>[] aggregateRootClasses) {
checkNotNull(aggregateRootClasses, "aggregateRootClasses should not be null");
Class<?>[] result = new Class<?>[aggregateRootClasses.length];
for (int i = 0; i < aggregateRootClasses.length... | java | public static Class<?>[] getAggregateIdClasses(Class<? extends AggregateRoot<?>>[] aggregateRootClasses) {
checkNotNull(aggregateRootClasses, "aggregateRootClasses should not be null");
Class<?>[] result = new Class<?>[aggregateRootClasses.length];
for (int i = 0; i < aggregateRootClasses.length... | [
"public",
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"getAggregateIdClasses",
"(",
"Class",
"<",
"?",
"extends",
"AggregateRoot",
"<",
"?",
">",
">",
"[",
"]",
"aggregateRootClasses",
")",
"{",
"checkNotNull",
"(",
"aggregateRootClasses",
",",
"\"aggregateRoo... | Returns an arrays of all identifier class corresponding the the given array of aggregate root
classes. | [
"Returns",
"an",
"arrays",
"of",
"all",
"identifier",
"class",
"corresponding",
"the",
"the",
"given",
"array",
"of",
"aggregate",
"root",
"classes",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java#L71-L78 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java | BusinessUtils.streamClasses | @SuppressWarnings("unchecked")
public static <T> Stream<Class<? extends T>> streamClasses(Collection<Class<?>> classes,
Class<? extends T> baseClass) {
return classes
.stream()
.filter(ClassPredicates.classIsDescendantOf(baseClass))
.map(c -> (Clas... | java | @SuppressWarnings("unchecked")
public static <T> Stream<Class<? extends T>> streamClasses(Collection<Class<?>> classes,
Class<? extends T> baseClass) {
return classes
.stream()
.filter(ClassPredicates.classIsDescendantOf(baseClass))
.map(c -> (Clas... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"Class",
"<",
"?",
"extends",
"T",
">",
">",
"streamClasses",
"(",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
",",
"Class",
"<",
"?",
... | Checks that classes satisfying a specification are assignable to a base class and return a
typed stream of it. | [
"Checks",
"that",
"classes",
"satisfying",
"a",
"specification",
"are",
"assignable",
"to",
"a",
"base",
"class",
"and",
"return",
"a",
"typed",
"stream",
"of",
"it",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java#L84-L91 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java | BusinessUtils.getQualifier | public static Optional<Annotation> getQualifier(AnnotatedElement annotatedElement) {
AnnotatedElement cleanedAnnotatedElement;
if (annotatedElement instanceof Class<?>) {
cleanedAnnotatedElement = ProxyUtils.cleanProxy((Class<?>) annotatedElement);
} else {
cleanedAnnotat... | java | public static Optional<Annotation> getQualifier(AnnotatedElement annotatedElement) {
AnnotatedElement cleanedAnnotatedElement;
if (annotatedElement instanceof Class<?>) {
cleanedAnnotatedElement = ProxyUtils.cleanProxy((Class<?>) annotatedElement);
} else {
cleanedAnnotat... | [
"public",
"static",
"Optional",
"<",
"Annotation",
">",
"getQualifier",
"(",
"AnnotatedElement",
"annotatedElement",
")",
"{",
"AnnotatedElement",
"cleanedAnnotatedElement",
";",
"if",
"(",
"annotatedElement",
"instanceof",
"Class",
"<",
"?",
">",
")",
"{",
"cleaned... | Optionally returns the qualifier annotation of a class. | [
"Optionally",
"returns",
"the",
"qualifier",
"annotation",
"of",
"a",
"class",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java#L96-L107 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java | BusinessUtils.resolveDefaultQualifier | @SuppressWarnings("unchecked")
public static <T> Optional<Key<T>> resolveDefaultQualifier(Map<Key<?>, Class<?>> bindings,
ClassConfiguration<?> classConfiguration, String property, Class<?> qualifiedClass,
TypeLiteral<T> genericInterface) {
Key<T> key = null;
if (classConfig... | java | @SuppressWarnings("unchecked")
public static <T> Optional<Key<T>> resolveDefaultQualifier(Map<Key<?>, Class<?>> bindings,
ClassConfiguration<?> classConfiguration, String property, Class<?> qualifiedClass,
TypeLiteral<T> genericInterface) {
Key<T> key = null;
if (classConfig... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"Key",
"<",
"T",
">",
">",
"resolveDefaultQualifier",
"(",
"Map",
"<",
"Key",
"<",
"?",
">",
",",
"Class",
"<",
"?",
">",
">",
"bindings",
",",
"C... | Returns the Guice key qualified with the default qualifier configured for the specified class. | [
"Returns",
"the",
"Guice",
"key",
"qualified",
"with",
"the",
"default",
"qualifier",
"configured",
"for",
"the",
"specified",
"class",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java#L112-L142 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java | BusinessUtils.includeSuperClasses | @SuppressWarnings("unchecked")
public static Set<Class<? extends AggregateRoot<?>>> includeSuperClasses(
Collection<Class<? extends AggregateRoot>> aggregateClasses) {
Set<Class<? extends AggregateRoot<?>>> results = new HashSet<>();
for (Class<?> aggregateClass : aggregateClasses) {
... | java | @SuppressWarnings("unchecked")
public static Set<Class<? extends AggregateRoot<?>>> includeSuperClasses(
Collection<Class<? extends AggregateRoot>> aggregateClasses) {
Set<Class<? extends AggregateRoot<?>>> results = new HashSet<>();
for (Class<?> aggregateClass : aggregateClasses) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Set",
"<",
"Class",
"<",
"?",
"extends",
"AggregateRoot",
"<",
"?",
">",
">",
">",
"includeSuperClasses",
"(",
"Collection",
"<",
"Class",
"<",
"?",
"extends",
"AggregateRoot",
">",
">"... | Walks the class hierarchy of each class in the given collection and adds its superclasses to
the mix. | [
"Walks",
"the",
"class",
"hierarchy",
"of",
"each",
"class",
"in",
"the",
"given",
"collection",
"and",
"adds",
"its",
"superclasses",
"to",
"the",
"mix",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/BusinessUtils.java#L148-L165 | train |
ixa-ehu/ixa-pipe-tok | src/main/java/eus/ixa/ixa/pipe/tok/Annotate.java | Annotate.tokenizeToKAF | public void tokenizeToKAF(final KAFDocument kaf) throws IOException {
int noSents = 0;
int noParas = 1;
List<List<Token>> tokens;
if (isNoSeg) {
String[] sentences = text.toArray(new String[text.size()]);
tokens = tokenizer.tokenize(sentences);
} else {
final String[] senten... | java | public void tokenizeToKAF(final KAFDocument kaf) throws IOException {
int noSents = 0;
int noParas = 1;
List<List<Token>> tokens;
if (isNoSeg) {
String[] sentences = text.toArray(new String[text.size()]);
tokens = tokenizer.tokenize(sentences);
} else {
final String[] senten... | [
"public",
"void",
"tokenizeToKAF",
"(",
"final",
"KAFDocument",
"kaf",
")",
"throws",
"IOException",
"{",
"int",
"noSents",
"=",
"0",
";",
"int",
"noParas",
"=",
"1",
";",
"List",
"<",
"List",
"<",
"Token",
">",
">",
"tokens",
";",
"if",
"(",
"isNoSeg"... | Tokenize document to NAF.
@param kaf
the incoming naf document
@throws IOException
if io problems | [
"Tokenize",
"document",
"to",
"NAF",
"."
] | be38651a1267be37764b08acce9ee12a87fb61e7 | https://github.com/ixa-ehu/ixa-pipe-tok/blob/be38651a1267be37764b08acce9ee12a87fb61e7/src/main/java/eus/ixa/ixa/pipe/tok/Annotate.java#L118-L149 | train |
ixa-ehu/ixa-pipe-tok | src/main/java/eus/ixa/ixa/pipe/tok/Annotate.java | Annotate.tokenizeToText | public String tokenizeToText() {
final StringBuilder sb = new StringBuilder();
if (isNoSeg) {
String[] sentences = text.toArray(new String[text.size()]);
final List<List<Token>> tokens = tokenizer.tokenize(sentences);
for (final List<Token> tokSentence : tokens) {
for (final Token tok... | java | public String tokenizeToText() {
final StringBuilder sb = new StringBuilder();
if (isNoSeg) {
String[] sentences = text.toArray(new String[text.size()]);
final List<List<Token>> tokens = tokenizer.tokenize(sentences);
for (final List<Token> tokSentence : tokens) {
for (final Token tok... | [
"public",
"String",
"tokenizeToText",
"(",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"isNoSeg",
")",
"{",
"String",
"[",
"]",
"sentences",
"=",
"text",
".",
"toArray",
"(",
"new",
"String",
"[",
"t... | Tokenize and Segment input text. Outputs tokens in running text format one
sentence per line.
@return String tokenized text | [
"Tokenize",
"and",
"Segment",
"input",
"text",
".",
"Outputs",
"tokens",
"in",
"running",
"text",
"format",
"one",
"sentence",
"per",
"line",
"."
] | be38651a1267be37764b08acce9ee12a87fb61e7 | https://github.com/ixa-ehu/ixa-pipe-tok/blob/be38651a1267be37764b08acce9ee12a87fb61e7/src/main/java/eus/ixa/ixa/pipe/tok/Annotate.java#L207-L236 | train |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePackageManager.java | XCodePackageManager.packageArtifacts | void packageArtifacts(final File compileDir, final MavenProject project, final Set<String> bundles)
throws IOException, XCodeException
{
File mainArtifact = createMainArtifactFile(project);
attachBundle(compileDir, project, bundles, mainArtifact);
final File mainArtifactFile = archiveMainArtifa... | java | void packageArtifacts(final File compileDir, final MavenProject project, final Set<String> bundles)
throws IOException, XCodeException
{
File mainArtifact = createMainArtifactFile(project);
attachBundle(compileDir, project, bundles, mainArtifact);
final File mainArtifactFile = archiveMainArtifa... | [
"void",
"packageArtifacts",
"(",
"final",
"File",
"compileDir",
",",
"final",
"MavenProject",
"project",
",",
"final",
"Set",
"<",
"String",
">",
"bundles",
")",
"throws",
"IOException",
",",
"XCodeException",
"{",
"File",
"mainArtifact",
"=",
"createMainArtifactF... | Packages all the artifacts. The main artifact is set and all side artifacts are attached for
deployment.
@param bundles
@param buildDir | [
"Packages",
"all",
"the",
"artifacts",
".",
"The",
"main",
"artifact",
"is",
"set",
"and",
"all",
"side",
"artifacts",
"are",
"attached",
"for",
"deployment",
"."
] | 3f8aa380f501a1d7602f33fef2f6348354e7eb7c | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePackageManager.java#L65-L76 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/domain/DefaultRepositoryCollector.java | DefaultRepositoryCollector.collectFromAggregates | Collection<BindingStrategy> collectFromAggregates(Collection<Class<? extends AggregateRoot>> aggregateClasses) {
Collection<BindingStrategy> bindingStrategies = new ArrayList<>();
Map<Type[], Key<?>> allGenerics = new HashMap<>();
for (Class<? extends AggregateRoot<?>> aggregateClass : Business... | java | Collection<BindingStrategy> collectFromAggregates(Collection<Class<? extends AggregateRoot>> aggregateClasses) {
Collection<BindingStrategy> bindingStrategies = new ArrayList<>();
Map<Type[], Key<?>> allGenerics = new HashMap<>();
for (Class<? extends AggregateRoot<?>> aggregateClass : Business... | [
"Collection",
"<",
"BindingStrategy",
">",
"collectFromAggregates",
"(",
"Collection",
"<",
"Class",
"<",
"?",
"extends",
"AggregateRoot",
">",
">",
"aggregateClasses",
")",
"{",
"Collection",
"<",
"BindingStrategy",
">",
"bindingStrategies",
"=",
"new",
"ArrayList"... | Prepares the binding strategies which bind default repositories. The specificity here is that
it could have multiple implementations of default repository, i.e. one per persistence.
@param aggregateClasses the aggregates classes to collect repositories from.
@return a binding strategy | [
"Prepares",
"the",
"binding",
"strategies",
"which",
"bind",
"default",
"repositories",
".",
"The",
"specificity",
"here",
"is",
"that",
"it",
"could",
"have",
"multiple",
"implementations",
"of",
"default",
"repository",
"i",
".",
"e",
".",
"one",
"per",
"per... | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/domain/DefaultRepositoryCollector.java#L52-L79 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/PluginUtils.java | PluginUtils.classpathRequestForDescendantTypesOf | @SuppressWarnings("unchecked")
public static <T extends Class<?>> Map<T, Specification<? extends T>> classpathRequestForDescendantTypesOf(
ClasspathScanRequestBuilder classpathScanRequestBuilder, Collection<T> interfaces) {
Map<T, Specification<? extends T>> specsByInterface = new HashMap<>();
... | java | @SuppressWarnings("unchecked")
public static <T extends Class<?>> Map<T, Specification<? extends T>> classpathRequestForDescendantTypesOf(
ClasspathScanRequestBuilder classpathScanRequestBuilder, Collection<T> interfaces) {
Map<T, Specification<? extends T>> specsByInterface = new HashMap<>();
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Class",
"<",
"?",
">",
">",
"Map",
"<",
"T",
",",
"Specification",
"<",
"?",
"extends",
"T",
">",
">",
"classpathRequestForDescendantTypesOf",
"(",
"ClasspathScanRequ... | Builds a ClasspathScanRequest to find all the descendant of the given interfaces.
@param <T> the class of the interface.
@param classpathScanRequestBuilder the Nuun classpath scan request builder.
@param interfaces the interfaces.
@return a map where the key is an interface and... | [
"Builds",
"a",
"ClasspathScanRequest",
"to",
"find",
"all",
"the",
"descendant",
"of",
"the",
"given",
"interfaces",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/PluginUtils.java#L48-L61 | train |
ixa-ehu/ixa-pipe-tok | src/main/java/eus/ixa/ixa/pipe/tok/CLI.java | CLI.run | public final void run(final String[] args) throws IOException, JDOMException {
try {
Parameters parameters = cliArgumentsParser.parse(args);
if (parameters.getStrategy() == Strategy.TOKENIZE) {
annotate(parameters);
} else if (parameters.getStrategy() == Strategy.SERVER) {
server(p... | java | public final void run(final String[] args) throws IOException, JDOMException {
try {
Parameters parameters = cliArgumentsParser.parse(args);
if (parameters.getStrategy() == Strategy.TOKENIZE) {
annotate(parameters);
} else if (parameters.getStrategy() == Strategy.SERVER) {
server(p... | [
"public",
"final",
"void",
"run",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
",",
"JDOMException",
"{",
"try",
"{",
"Parameters",
"parameters",
"=",
"cliArgumentsParser",
".",
"parse",
"(",
"args",
")",
";",
"if",
"(",
"paramet... | Run the appropriate command based on the command line parameters.
@param args
the arguments passed through the CLI
@throws IOException
exception if problems with the incoming data
@throws JDOMException
a xml exception | [
"Run",
"the",
"appropriate",
"command",
"based",
"on",
"the",
"command",
"line",
"parameters",
"."
] | be38651a1267be37764b08acce9ee12a87fb61e7 | https://github.com/ixa-ehu/ixa-pipe-tok/blob/be38651a1267be37764b08acce9ee12a87fb61e7/src/main/java/eus/ixa/ixa/pipe/tok/CLI.java#L96-L116 | train |
seedstack/business | core/src/main/java/org/seedstack/business/domain/SortOption.java | SortOption.add | public SortOption add(String attribute, Direction direction) {
sortedAttributes.add(new SortedAttribute(attribute, direction));
return this;
} | java | public SortOption add(String attribute, Direction direction) {
sortedAttributes.add(new SortedAttribute(attribute, direction));
return this;
} | [
"public",
"SortOption",
"add",
"(",
"String",
"attribute",
",",
"Direction",
"direction",
")",
"{",
"sortedAttributes",
".",
"add",
"(",
"new",
"SortedAttribute",
"(",
"attribute",
",",
"direction",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds the specified attribute to the list of sorted attributes with the specified direction.
@param attribute the attribute to sort.
@param direction the direction this attribute will be sorted with.
@return the sort option itself. | [
"Adds",
"the",
"specified",
"attribute",
"to",
"the",
"list",
"of",
"sorted",
"attributes",
"with",
"the",
"specified",
"direction",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/domain/SortOption.java#L63-L66 | train |
seedstack/business | core/src/main/java/org/seedstack/business/domain/SortOption.java | SortOption.buildComparator | public <T> Comparator<T> buildComparator() {
if (sortedAttributes.isEmpty()) {
return (o1, o2) -> 0;
} else {
Comparator<T> comparator = null;
for (SortedAttribute sortedAttribute : sortedAttributes) {
if (comparator == null) {
comp... | java | public <T> Comparator<T> buildComparator() {
if (sortedAttributes.isEmpty()) {
return (o1, o2) -> 0;
} else {
Comparator<T> comparator = null;
for (SortedAttribute sortedAttribute : sortedAttributes) {
if (comparator == null) {
comp... | [
"public",
"<",
"T",
">",
"Comparator",
"<",
"T",
">",
"buildComparator",
"(",
")",
"{",
"if",
"(",
"sortedAttributes",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"(",
"o1",
",",
"o2",
")",
"->",
"0",
";",
"}",
"else",
"{",
"Comparator",
"<",
"... | Builds a comparator allowing the sorting of objects according to the sort criteria.
@param <T> the type of the object to compare.
@return the comparator. | [
"Builds",
"a",
"comparator",
"allowing",
"the",
"sorting",
"of",
"objects",
"according",
"to",
"the",
"sort",
"criteria",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/domain/SortOption.java#L83-L97 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/NodeBuilder.java | NodeBuilder.findPartnerNodeId | private int findPartnerNodeId( Tree<Row> current, Type type ){
switch( type ) {
case JOIN_FIRST:
case JOIN_ALL:
case WHILE_DO_END:
// The partner is the previous sibling which is the SPLIT or WHILE_DO_BEGIN
return current.getPrevious().getConte... | java | private int findPartnerNodeId( Tree<Row> current, Type type ){
switch( type ) {
case JOIN_FIRST:
case JOIN_ALL:
case WHILE_DO_END:
// The partner is the previous sibling which is the SPLIT or WHILE_DO_BEGIN
return current.getPrevious().getConte... | [
"private",
"int",
"findPartnerNodeId",
"(",
"Tree",
"<",
"Row",
">",
"current",
",",
"Type",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"JOIN_FIRST",
":",
"case",
"JOIN_ALL",
":",
"case",
"WHILE_DO_END",
":",
"// The partner is the previous sib... | Some node producing elements do not define an id themselves but deduce their id based
on their block-opening or block-closing partner. E.g. a WHILE_DO_END deduces its id
based on its WHILE_DO_BEGIN partner. | [
"Some",
"node",
"producing",
"elements",
"do",
"not",
"define",
"an",
"id",
"themselves",
"but",
"deduce",
"their",
"id",
"based",
"on",
"their",
"block",
"-",
"opening",
"or",
"block",
"-",
"closing",
"partner",
".",
"E",
".",
"g",
".",
"a",
"WHILE_DO_E... | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/NodeBuilder.java#L176-L196 | train |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/AbstractXCodeMojo.java | AbstractXCodeMojo.zipSubfolder | protected File zipSubfolder(File rootDir, String zipSubFolder, String zipFileName, String archiveFolder)
throws MojoExecutionException
{
int resultCode = 0;
try {
File scriptDirectory = new File(project.getBuild().getDirectory(), "scripts").getCanonicalFile();
scriptDirectory.deleteOnExi... | java | protected File zipSubfolder(File rootDir, String zipSubFolder, String zipFileName, String archiveFolder)
throws MojoExecutionException
{
int resultCode = 0;
try {
File scriptDirectory = new File(project.getBuild().getDirectory(), "scripts").getCanonicalFile();
scriptDirectory.deleteOnExi... | [
"protected",
"File",
"zipSubfolder",
"(",
"File",
"rootDir",
",",
"String",
"zipSubFolder",
",",
"String",
"zipFileName",
",",
"String",
"archiveFolder",
")",
"throws",
"MojoExecutionException",
"{",
"int",
"resultCode",
"=",
"0",
";",
"try",
"{",
"File",
"scrip... | Calls a shell script in order to zip a folder. We have to call a shell script as Java cannot
zip symbolic links.
@param rootDir
the directory where the zip command shall be executed
@param zipSubFolder
the subfolder to be zipped
@param zipFileName
the name of the zipFile (will be located in the rootDir)
@param archive... | [
"Calls",
"a",
"shell",
"script",
"in",
"order",
"to",
"zip",
"a",
"folder",
".",
"We",
"have",
"to",
"call",
"a",
"shell",
"script",
"as",
"Java",
"cannot",
"zip",
"symbolic",
"links",
"."
] | 3f8aa380f501a1d7602f33fef2f6348354e7eb7c | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/AbstractXCodeMojo.java#L274-L303 | train |
zutnop/telekom-workflow-engine | telekom-workflow-web/src/main/java/ee/telekom/workflow/web/rest/RestController.java | RestController.findInstances | @RequestMapping(method = RequestMethod.GET, value = "/workflowInstance/search",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_XML_VALUE})
public ResponseEntity<List<WorkflowInstanceRestModel>> findInstances( @RequestParam(required = false) String label1,
... | java | @RequestMapping(method = RequestMethod.GET, value = "/workflowInstance/search",
produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_XML_VALUE})
public ResponseEntity<List<WorkflowInstanceRestModel>> findInstances( @RequestParam(required = false) String label1,
... | [
"@",
"RequestMapping",
"(",
"method",
"=",
"RequestMethod",
".",
"GET",
",",
"value",
"=",
"\"/workflowInstance/search\"",
",",
"produces",
"=",
"{",
"MediaType",
".",
"APPLICATION_JSON_VALUE",
",",
"MediaType",
".",
"TEXT_XML_VALUE",
"}",
")",
"public",
"Response... | Searches workflow instance's that match the given criteria.
<pre>
Request: GET /workflowInstance/search?label1=aClientId
Response: OK, [{refNum: 1, workflowName: "credit.step1", workflowVersion: null, label1: "aClientId", label2: null, status: NEW}, {refNum: 2, workflowName: "credit.client.step1", workflowVersion: nu... | [
"Searches",
"workflow",
"instance",
"s",
"that",
"match",
"the",
"given",
"criteria",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-web/src/main/java/ee/telekom/workflow/web/rest/RestController.java#L236-L248 | train |
dverstap/jsmiparser | jsmiparser-api/src/main/java/org/jsmiparser/smi/SmiModule.java | SmiModule.resolveReference | public SmiSymbol resolveReference(IdToken idToken, XRefProblemReporter reporter) {
// doesn't work anymore with hardcoded missing symbols
// if (!idToken.getLocation().getSource().equals(getIdToken().getLocation().getSource())) {
// // note this check is not entirely fool-proof in case multiple module... | java | public SmiSymbol resolveReference(IdToken idToken, XRefProblemReporter reporter) {
// doesn't work anymore with hardcoded missing symbols
// if (!idToken.getLocation().getSource().equals(getIdToken().getLocation().getSource())) {
// // note this check is not entirely fool-proof in case multiple module... | [
"public",
"SmiSymbol",
"resolveReference",
"(",
"IdToken",
"idToken",
",",
"XRefProblemReporter",
"reporter",
")",
"{",
"// doesn't work anymore with hardcoded missing symbols",
"// if (!idToken.getLocation().getSource().equals(getIdToken().getLocation().getSource())) {",
"// ... | Resolves a reference from within this module to a symbol in the same module, an imported module
or in the whole mib
@param idToken Token of the identifier that has to be resolved.
@param reporter If not null, the reporter will be used to reporter the not found error message.
@return The symbol that was found, or null... | [
"Resolves",
"a",
"reference",
"from",
"within",
"this",
"module",
"to",
"a",
"symbol",
"in",
"the",
"same",
"module",
"an",
"imported",
"module",
"or",
"in",
"the",
"whole",
"mib"
] | 1ba26599e573682d17e34363a85cf3a42cc06383 | https://github.com/dverstap/jsmiparser/blob/1ba26599e573682d17e34363a85cf3a42cc06383/jsmiparser-api/src/main/java/org/jsmiparser/smi/SmiModule.java#L340-L364 | train |
dverstap/jsmiparser | jsmiparser-api/src/main/java/org/jsmiparser/smi/SmiMib.java | SmiMib.findByOidPrefix | public SmiOidNode findByOidPrefix(int... oid) {
SmiOidNode parent = getRootNode();
for (int subId : oid) {
SmiOidNode result = parent.findChild(subId);
if (result == null) {
return parent;
}
parent = result;
}
return null;
... | java | public SmiOidNode findByOidPrefix(int... oid) {
SmiOidNode parent = getRootNode();
for (int subId : oid) {
SmiOidNode result = parent.findChild(subId);
if (result == null) {
return parent;
}
parent = result;
}
return null;
... | [
"public",
"SmiOidNode",
"findByOidPrefix",
"(",
"int",
"...",
"oid",
")",
"{",
"SmiOidNode",
"parent",
"=",
"getRootNode",
"(",
")",
";",
"for",
"(",
"int",
"subId",
":",
"oid",
")",
"{",
"SmiOidNode",
"result",
"=",
"parent",
".",
"findChild",
"(",
"sub... | This method can be used to find the best match for an OID.
By comparing the length of the OID of the result and the input OID you can
determine how many and which subIds where not matched.
@param oid For which the best match is searched.
@return Best matching SmiOidValue, or null if none is found. | [
"This",
"method",
"can",
"be",
"used",
"to",
"find",
"the",
"best",
"match",
"for",
"an",
"OID",
".",
"By",
"comparing",
"the",
"length",
"of",
"the",
"OID",
"of",
"the",
"result",
"and",
"the",
"input",
"OID",
"you",
"can",
"determine",
"how",
"many",... | 1ba26599e573682d17e34363a85cf3a42cc06383 | https://github.com/dverstap/jsmiparser/blob/1ba26599e573682d17e34363a85cf3a42cc06383/jsmiparser-api/src/main/java/org/jsmiparser/smi/SmiMib.java#L239-L249 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/core/GraphValidatorImpl.java | GraphValidatorImpl.validateReservedVariableNames | private static void validateReservedVariableNames( Graph graph, List<String> errors ){
for( Node node : graph.getNodes() ){
if( node instanceof BeanAsyncCallActivity ){
validateReservedVariablesFromMapping( ((BeanAsyncCallActivity)node).getResultMapping(), graph, node, errors );
... | java | private static void validateReservedVariableNames( Graph graph, List<String> errors ){
for( Node node : graph.getNodes() ){
if( node instanceof BeanAsyncCallActivity ){
validateReservedVariablesFromMapping( ((BeanAsyncCallActivity)node).getResultMapping(), graph, node, errors );
... | [
"private",
"static",
"void",
"validateReservedVariableNames",
"(",
"Graph",
"graph",
",",
"List",
"<",
"String",
">",
"errors",
")",
"{",
"for",
"(",
"Node",
"node",
":",
"graph",
".",
"getNodes",
"(",
")",
")",
"{",
"if",
"(",
"node",
"instanceof",
"Bea... | check through all the node types which use mappings which set Environment attributes | [
"check",
"through",
"all",
"the",
"node",
"types",
"which",
"use",
"mappings",
"which",
"set",
"Environment",
"attributes"
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/core/GraphValidatorImpl.java#L108-L137 | train |
dverstap/jsmiparser | jsmiparser-api/src/main/java/org/jsmiparser/phase/file/ModuleParser.java | ModuleParser.createIntegerType | public SmiType createIntegerType(IdToken idToken, IntKeywordToken intToken, Token applicationTagToken, List<SmiNamedNumber> namedNumbers, List<SmiRange> rangeConstraints) {
if (idToken == null && intToken.getPrimitiveType() == INTEGER && namedNumbers == null && rangeConstraints == null) {
return Smi... | java | public SmiType createIntegerType(IdToken idToken, IntKeywordToken intToken, Token applicationTagToken, List<SmiNamedNumber> namedNumbers, List<SmiRange> rangeConstraints) {
if (idToken == null && intToken.getPrimitiveType() == INTEGER && namedNumbers == null && rangeConstraints == null) {
return Smi... | [
"public",
"SmiType",
"createIntegerType",
"(",
"IdToken",
"idToken",
",",
"IntKeywordToken",
"intToken",
",",
"Token",
"applicationTagToken",
",",
"List",
"<",
"SmiNamedNumber",
">",
"namedNumbers",
",",
"List",
"<",
"SmiRange",
">",
"rangeConstraints",
")",
"{",
... | and resolve references to INTEGER, BITS, ... during the XRef phase | [
"and",
"resolve",
"references",
"to",
"INTEGER",
"BITS",
"...",
"during",
"the",
"XRef",
"phase"
] | 1ba26599e573682d17e34363a85cf3a42cc06383 | https://github.com/dverstap/jsmiparser/blob/1ba26599e573682d17e34363a85cf3a42cc06383/jsmiparser-api/src/main/java/org/jsmiparser/phase/file/ModuleParser.java#L246-L261 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/util/YesNoUtil.java | YesNoUtil.asString | public static String asString(Boolean flag) {
return flag == null ? null : (flag ? YES_AS_STRING : NO_AS_STRING);
} | java | public static String asString(Boolean flag) {
return flag == null ? null : (flag ? YES_AS_STRING : NO_AS_STRING);
} | [
"public",
"static",
"String",
"asString",
"(",
"Boolean",
"flag",
")",
"{",
"return",
"flag",
"==",
"null",
"?",
"null",
":",
"(",
"flag",
"?",
"YES_AS_STRING",
":",
"NO_AS_STRING",
")",
";",
"}"
] | Converts the given flag into a string of either "Y", "N" or null. | [
"Converts",
"the",
"given",
"flag",
"into",
"a",
"string",
"of",
"either",
"Y",
"N",
"or",
"null",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/util/YesNoUtil.java#L14-L16 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/util/YesNoUtil.java | YesNoUtil.asBoolean | public static Boolean asBoolean(String flag) {
return flag == null ? null : flag.equals(YES_AS_STRING);
} | java | public static Boolean asBoolean(String flag) {
return flag == null ? null : flag.equals(YES_AS_STRING);
} | [
"public",
"static",
"Boolean",
"asBoolean",
"(",
"String",
"flag",
")",
"{",
"return",
"flag",
"==",
"null",
"?",
"null",
":",
"flag",
".",
"equals",
"(",
"YES_AS_STRING",
")",
";",
"}"
] | Converts the given string into a Boolean flag of either true, false or
null. | [
"Converts",
"the",
"given",
"string",
"into",
"a",
"Boolean",
"flag",
"of",
"either",
"true",
"false",
"or",
"null",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/util/YesNoUtil.java#L22-L24 | train |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/BuildContextAwareMojo.java | BuildContextAwareMojo.getInfoPListAccessor | protected PListAccessor getInfoPListAccessor(XCodeContext.SourceCodeLocation location, String configuration,
String sdk)
throws MojoExecutionException, XCodeException
{
File plistFile = getPListFile(location, configuration, sdk);
if (!plistFile.isFile()) {
throw new MojoExecutionExceptio... | java | protected PListAccessor getInfoPListAccessor(XCodeContext.SourceCodeLocation location, String configuration,
String sdk)
throws MojoExecutionException, XCodeException
{
File plistFile = getPListFile(location, configuration, sdk);
if (!plistFile.isFile()) {
throw new MojoExecutionExceptio... | [
"protected",
"PListAccessor",
"getInfoPListAccessor",
"(",
"XCodeContext",
".",
"SourceCodeLocation",
"location",
",",
"String",
"configuration",
",",
"String",
"sdk",
")",
"throws",
"MojoExecutionException",
",",
"XCodeException",
"{",
"File",
"plistFile",
"=",
"getPLi... | Retrieves the Info Plist out of the effective Xcode project settings and returns the accessor
to it. | [
"Retrieves",
"the",
"Info",
"Plist",
"out",
"of",
"the",
"effective",
"Xcode",
"project",
"settings",
"and",
"returns",
"the",
"accessor",
"to",
"it",
"."
] | 3f8aa380f501a1d7602f33fef2f6348354e7eb7c | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/BuildContextAwareMojo.java#L376-L386 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/core/workunit/WorkUnitDao.java | WorkUnitDao.findNewWorkUnits | public List<WorkUnit> findNewWorkUnits( Date now, String clusterName ){
if( sqlCache == null || !ObjectUtils.equals( cachedSqlClusterName, clusterName ) ){
sqlCache = getSql( clusterName );
cachedSqlClusterName = clusterName;
}
Object[] args = {now};
return getJdb... | java | public List<WorkUnit> findNewWorkUnits( Date now, String clusterName ){
if( sqlCache == null || !ObjectUtils.equals( cachedSqlClusterName, clusterName ) ){
sqlCache = getSql( clusterName );
cachedSqlClusterName = clusterName;
}
Object[] args = {now};
return getJdb... | [
"public",
"List",
"<",
"WorkUnit",
">",
"findNewWorkUnits",
"(",
"Date",
"now",
",",
"String",
"clusterName",
")",
"{",
"if",
"(",
"sqlCache",
"==",
"null",
"||",
"!",
"ObjectUtils",
".",
"equals",
"(",
"cachedSqlClusterName",
",",
"clusterName",
")",
")",
... | Retrieves the list of work units that can be performed at the given date. | [
"Retrieves",
"the",
"list",
"of",
"work",
"units",
"that",
"can",
"be",
"performed",
"at",
"the",
"given",
"date",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/core/workunit/WorkUnitDao.java#L29-L36 | train |
seedstack/business | core/src/main/java/org/seedstack/business/util/Tuples.java | Tuples.create | @SuppressWarnings("unchecked")
public static <T extends Tuple> T create(Object... objects) {
Class<? extends Tuple> tupleClass = classOfTuple(objects.length);
try {
return (T) tupleClass.getMethod("fromArray", Object[].class)
.invoke(null, new Object[]{objects});
... | java | @SuppressWarnings("unchecked")
public static <T extends Tuple> T create(Object... objects) {
Class<? extends Tuple> tupleClass = classOfTuple(objects.length);
try {
return (T) tupleClass.getMethod("fromArray", Object[].class)
.invoke(null, new Object[]{objects});
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Tuple",
">",
"T",
"create",
"(",
"Object",
"...",
"objects",
")",
"{",
"Class",
"<",
"?",
"extends",
"Tuple",
">",
"tupleClass",
"=",
"classOfTuple",
"(",
"object... | Builds a tuple from an array of objects.
@param objects the collection of objects (size must be less or equal than 10).
@param <T> the tuple type.
@return the constructed tuple. | [
"Builds",
"a",
"tuple",
"from",
"an",
"array",
"of",
"objects",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/util/Tuples.java#L64-L73 | train |
seedstack/business | core/src/main/java/org/seedstack/business/util/Tuples.java | Tuples.classOfTuple | public static Class<? extends Tuple> classOfTuple(int cardinality) {
switch (cardinality) {
case 1:
return Unit.class;
case 2:
return Pair.class;
case 3:
return Triplet.class;
case 4:
return Quartet.c... | java | public static Class<? extends Tuple> classOfTuple(int cardinality) {
switch (cardinality) {
case 1:
return Unit.class;
case 2:
return Pair.class;
case 3:
return Triplet.class;
case 4:
return Quartet.c... | [
"public",
"static",
"Class",
"<",
"?",
"extends",
"Tuple",
">",
"classOfTuple",
"(",
"int",
"cardinality",
")",
"{",
"switch",
"(",
"cardinality",
")",
"{",
"case",
"1",
":",
"return",
"Unit",
".",
"class",
";",
"case",
"2",
":",
"return",
"Pair",
".",... | Returns the tuple class corresponding to the specified cardinality.
@param cardinality the cardinality (must be less or equal than 10).
@return the corresponding tuple class. | [
"Returns",
"the",
"tuple",
"class",
"corresponding",
"to",
"the",
"specified",
"cardinality",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/util/Tuples.java#L133-L158 | train |
seedstack/business | core/src/main/java/org/seedstack/business/util/Tuples.java | Tuples.itemClasses | @SuppressWarnings("unchecked")
public static <T> Class<T>[] itemClasses(Tuple tuple) {
Class<?>[] itemClasses = new Class[tuple.getSize()];
int index = 0;
for (Object o : tuple) {
itemClasses[index++] = o.getClass();
}
return (Class<T>[]) itemClasses;
} | java | @SuppressWarnings("unchecked")
public static <T> Class<T>[] itemClasses(Tuple tuple) {
Class<?>[] itemClasses = new Class[tuple.getSize()];
int index = 0;
for (Object o : tuple) {
itemClasses[index++] = o.getClass();
}
return (Class<T>[]) itemClasses;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"[",
"]",
"itemClasses",
"(",
"Tuple",
"tuple",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"itemClasses",
"=",
"new",
"Class",
"[",
"tuple... | Returns a list containing the classes of the elements of the tuple.
@param <T> the common of the classes contained by the tuple.
@param tuple the tuple to convert.
@return the list of classes. | [
"Returns",
"a",
"list",
"containing",
"the",
"classes",
"of",
"the",
"elements",
"of",
"the",
"tuple",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/util/Tuples.java#L179-L187 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/liquibase/ext/logging/Slf4jLogger.java | Slf4jLogger.buildMessage | private String buildMessage( String rawMessage ){
StringBuilder msg = new StringBuilder();
if( changeLogName != null ){
msg.append( changeLogName ).append( ": " );
}
if( changeSetName != null ){
msg.append( changeSetName.replace( changeLogName + "::", "" ) ).appen... | java | private String buildMessage( String rawMessage ){
StringBuilder msg = new StringBuilder();
if( changeLogName != null ){
msg.append( changeLogName ).append( ": " );
}
if( changeSetName != null ){
msg.append( changeSetName.replace( changeLogName + "::", "" ) ).appen... | [
"private",
"String",
"buildMessage",
"(",
"String",
"rawMessage",
")",
"{",
"StringBuilder",
"msg",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"changeLogName",
"!=",
"null",
")",
"{",
"msg",
".",
"append",
"(",
"changeLogName",
")",
".",
"appen... | Build a log message with optional data if it exists. | [
"Build",
"a",
"log",
"message",
"with",
"optional",
"data",
"if",
"it",
"exists",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/liquibase/ext/logging/Slf4jLogger.java#L108-L118 | train |
tobykurien/Xtendroid | Xtendroid/src/asia/sonix/android/orm/AbatisService.java | AbatisService.toSqlString | public String toSqlString(Object value) {
if (value == null) {
return "null";
}
String val = String.valueOf(value);
if (value instanceof Integer ||
value instanceof Float ||
value instanceof Double ||
value instanceof Long) {
return val;
} else ... | java | public String toSqlString(Object value) {
if (value == null) {
return "null";
}
String val = String.valueOf(value);
if (value instanceof Integer ||
value instanceof Float ||
value instanceof Double ||
value instanceof Long) {
return val;
} else ... | [
"public",
"String",
"toSqlString",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"\"null\"",
";",
"}",
"String",
"val",
"=",
"String",
".",
"valueOf",
"(",
"value",
")",
";",
"if",
"(",
"value",
"instanceof",
... | Convert value object to sanitized SQL string
@param value - the value object
@return a string for use in an SQL statement
@author Toby Kurien | [
"Convert",
"value",
"object",
"to",
"sanitized",
"SQL",
"string"
] | 758bf1d06f4cf3b64f9c10632fe9c6fb30bcebd4 | https://github.com/tobykurien/Xtendroid/blob/758bf1d06f4cf3b64f9c10632fe9c6fb30bcebd4/Xtendroid/src/asia/sonix/android/orm/AbatisService.java#L713-L732 | train |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePrepareBuildManager.java | XCodePrepareBuildManager.createDirectory | private static void createDirectory(final File directory) throws MojoExecutionException
{
try {
com.sap.prd.mobile.ios.mios.FileUtils.deleteDirectory(directory);
}
catch (IOException ex) {
throw new MojoExecutionException("", ex);
}
if (!directory.mkdirs())
throw new MojoExecut... | java | private static void createDirectory(final File directory) throws MojoExecutionException
{
try {
com.sap.prd.mobile.ios.mios.FileUtils.deleteDirectory(directory);
}
catch (IOException ex) {
throw new MojoExecutionException("", ex);
}
if (!directory.mkdirs())
throw new MojoExecut... | [
"private",
"static",
"void",
"createDirectory",
"(",
"final",
"File",
"directory",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"com",
".",
"sap",
".",
"prd",
".",
"mobile",
".",
"ios",
".",
"mios",
".",
"FileUtils",
".",
"deleteDirectory",
"(",... | Creates a directory. If the directory already exists the directory is deleted beforehand.
@param directory
@throws MojoExecutionException | [
"Creates",
"a",
"directory",
".",
"If",
"the",
"directory",
"already",
"exists",
"the",
"directory",
"is",
"deleted",
"beforehand",
"."
] | 3f8aa380f501a1d7602f33fef2f6348354e7eb7c | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePrepareBuildManager.java#L446-L458 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java | WorkflowFactoryImpl.downRight | private Tree<Row> downRight( Element token ){
return current = current.addChild( Tree.of( new Row( token ) ) );
} | java | private Tree<Row> downRight( Element token ){
return current = current.addChild( Tree.of( new Row( token ) ) );
} | [
"private",
"Tree",
"<",
"Row",
">",
"downRight",
"(",
"Element",
"token",
")",
"{",
"return",
"current",
"=",
"current",
".",
"addChild",
"(",
"Tree",
".",
"of",
"(",
"new",
"Row",
"(",
"token",
")",
")",
")",
";",
"}"
] | Starts a new row one indentation level to the right. | [
"Starts",
"a",
"new",
"row",
"one",
"indentation",
"level",
"to",
"the",
"right",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java#L361-L363 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java | WorkflowFactoryImpl.downLeft | private Tree<Row> downLeft( Element token ){
return current = current.getParent().addSibling( Tree.of( new Row( token ) ) );
} | java | private Tree<Row> downLeft( Element token ){
return current = current.getParent().addSibling( Tree.of( new Row( token ) ) );
} | [
"private",
"Tree",
"<",
"Row",
">",
"downLeft",
"(",
"Element",
"token",
")",
"{",
"return",
"current",
"=",
"current",
".",
"getParent",
"(",
")",
".",
"addSibling",
"(",
"Tree",
".",
"of",
"(",
"new",
"Row",
"(",
"token",
")",
")",
")",
";",
"}"
... | Starts a new row one indentation level to the left. | [
"Starts",
"a",
"new",
"row",
"one",
"indentation",
"level",
"to",
"the",
"left",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java#L369-L371 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java | WorkflowFactoryImpl.down | private Tree<Row> down( Element token ){
return current = current.addSibling( Tree.of( new Row( token ) ) );
} | java | private Tree<Row> down( Element token ){
return current = current.addSibling( Tree.of( new Row( token ) ) );
} | [
"private",
"Tree",
"<",
"Row",
">",
"down",
"(",
"Element",
"token",
")",
"{",
"return",
"current",
"=",
"current",
".",
"addSibling",
"(",
"Tree",
".",
"of",
"(",
"new",
"Row",
"(",
"token",
")",
")",
")",
";",
"}"
] | Starts a new row at the same level of indentation. | [
"Starts",
"a",
"new",
"row",
"at",
"the",
"same",
"level",
"of",
"indentation",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java#L383-L385 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java | WorkflowFactoryImpl.here | private Tree<Row> here( Element token ){
current.getContent().addToken( token );
return current;
} | java | private Tree<Row> here( Element token ){
current.getContent().addToken( token );
return current;
} | [
"private",
"Tree",
"<",
"Row",
">",
"here",
"(",
"Element",
"token",
")",
"{",
"current",
".",
"getContent",
"(",
")",
".",
"addToken",
"(",
"token",
")",
";",
"return",
"current",
";",
"}"
] | Adds element to the same row. | [
"Adds",
"element",
"to",
"the",
"same",
"row",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java#L390-L393 | train |
seedstack/business | migrate/src/main/java/org/seedstack/business/finder/Result.java | Result.rangeResult | public static <I> Result<I> rangeResult(List<I> result, long offset, long fullRequestSize) {
return new Result<>(result, offset, fullRequestSize);
} | java | public static <I> Result<I> rangeResult(List<I> result, long offset, long fullRequestSize) {
return new Result<>(result, offset, fullRequestSize);
} | [
"public",
"static",
"<",
"I",
">",
"Result",
"<",
"I",
">",
"rangeResult",
"(",
"List",
"<",
"I",
">",
"result",
",",
"long",
"offset",
",",
"long",
"fullRequestSize",
")",
"{",
"return",
"new",
"Result",
"<>",
"(",
"result",
",",
"offset",
",",
"ful... | Creates a new Result.
@param result the list of item
@param offset the offset
@param fullRequestSize the number of item available
@param <I> the item type
@return the result range | [
"Creates",
"a",
"new",
"Result",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/finder/Result.java#L50-L52 | train |
seedstack/business | migrate/src/main/java/org/seedstack/business/view/VirtualList.java | VirtualList.get | T get(long index) {
checkRange(index);
if (checkSubRange(index)) {
// cannot exceed Integer.MAX_VALUE (checked by checkSubRange)
return subList.get((int) (index - subListOffset));
}
return null;
} | java | T get(long index) {
checkRange(index);
if (checkSubRange(index)) {
// cannot exceed Integer.MAX_VALUE (checked by checkSubRange)
return subList.get((int) (index - subListOffset));
}
return null;
} | [
"T",
"get",
"(",
"long",
"index",
")",
"{",
"checkRange",
"(",
"index",
")",
";",
"if",
"(",
"checkSubRange",
"(",
"index",
")",
")",
"{",
"// cannot exceed Integer.MAX_VALUE (checked by checkSubRange)",
"return",
"subList",
".",
"get",
"(",
"(",
"int",
")",
... | Gets the item at the index.
@param index the request index
@return the item | [
"Gets",
"the",
"item",
"at",
"the",
"index",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/view/VirtualList.java#L44-L52 | train |
seedstack/business | migrate/src/main/java/org/seedstack/business/view/VirtualList.java | VirtualList.subList | List<T> subList(long from, long to) {
if (fullListSize > 0 && to - from > 0) {
checkRange(from);
// subList takes a [from;to[ range
checkRange(to - 1);
// check if the data of the required sub list are available
assertSubRange(from, to - 1);
... | java | List<T> subList(long from, long to) {
if (fullListSize > 0 && to - from > 0) {
checkRange(from);
// subList takes a [from;to[ range
checkRange(to - 1);
// check if the data of the required sub list are available
assertSubRange(from, to - 1);
... | [
"List",
"<",
"T",
">",
"subList",
"(",
"long",
"from",
",",
"long",
"to",
")",
"{",
"if",
"(",
"fullListSize",
">",
"0",
"&&",
"to",
"-",
"from",
">",
"0",
")",
"{",
"checkRange",
"(",
"from",
")",
";",
"// subList takes a [from;to[ range",
"checkRange... | Returns a portion of this list between the specified from, inclusive, and to, exclusive.
@param from low endpoint (inclusive) of the subList
@param to high endpoint (exclusive) of the subList
@return the sub list of item | [
"Returns",
"a",
"portion",
"of",
"this",
"list",
"between",
"the",
"specified",
"from",
"inclusive",
"and",
"to",
"exclusive",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/view/VirtualList.java#L61-L75 | train |
seedstack/business | migrate/src/main/java/org/seedstack/business/view/VirtualList.java | VirtualList.assertSubRange | private void assertSubRange(long from, long to) {
if (!checkSubRange(from) || !checkSubRange(to)) {
throw new IndexOutOfBoundsException("Required data for the sub list [" + from + "," + (to + 1) + "[ have "
+ "not been loaded in the virtual list.");
}
} | java | private void assertSubRange(long from, long to) {
if (!checkSubRange(from) || !checkSubRange(to)) {
throw new IndexOutOfBoundsException("Required data for the sub list [" + from + "," + (to + 1) + "[ have "
+ "not been loaded in the virtual list.");
}
} | [
"private",
"void",
"assertSubRange",
"(",
"long",
"from",
",",
"long",
"to",
")",
"{",
"if",
"(",
"!",
"checkSubRange",
"(",
"from",
")",
"||",
"!",
"checkSubRange",
"(",
"to",
")",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Required da... | Asserts that the requested sub list is available in the virtual list. Otherwise it throws
an IndexOutOfBoundsException.
@param from the from index (inclusive)
@param to the to index (inclusive) | [
"Asserts",
"that",
"the",
"requested",
"sub",
"list",
"is",
"available",
"in",
"the",
"virtual",
"list",
".",
"Otherwise",
"it",
"throws",
"an",
"IndexOutOfBoundsException",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/view/VirtualList.java#L116-L121 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/FieldUtils.java | FieldUtils.getFieldValue | public static Object getFieldValue(Object candidate, Field field) {
try {
return ReflectUtils.getValue(ReflectUtils.makeAccessible(field), candidate);
} catch (Exception e) {
throw BusinessException.wrap(e, BusinessErrorCode.ERROR_ACCESSING_FIELD)
.put("classN... | java | public static Object getFieldValue(Object candidate, Field field) {
try {
return ReflectUtils.getValue(ReflectUtils.makeAccessible(field), candidate);
} catch (Exception e) {
throw BusinessException.wrap(e, BusinessErrorCode.ERROR_ACCESSING_FIELD)
.put("classN... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"candidate",
",",
"Field",
"field",
")",
"{",
"try",
"{",
"return",
"ReflectUtils",
".",
"getValue",
"(",
"ReflectUtils",
".",
"makeAccessible",
"(",
"field",
")",
",",
"candidate",
")",
";",
"}",... | Return the value contained in the specified field of the candidate object.
@param candidate the object to retrieve the value of.
@param field the field.
@return the value contained in the field of the candidate. | [
"Return",
"the",
"value",
"contained",
"in",
"the",
"specified",
"field",
"of",
"the",
"candidate",
"object",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/FieldUtils.java#L43-L51 | train |
seedstack/business | core/src/main/java/org/seedstack/business/internal/utils/FieldUtils.java | FieldUtils.resolveField | public static Optional<Field> resolveField(Class<?> someClass, String fieldName) {
return fieldCache.get(new FieldReference(someClass, fieldName));
} | java | public static Optional<Field> resolveField(Class<?> someClass, String fieldName) {
return fieldCache.get(new FieldReference(someClass, fieldName));
} | [
"public",
"static",
"Optional",
"<",
"Field",
">",
"resolveField",
"(",
"Class",
"<",
"?",
">",
"someClass",
",",
"String",
"fieldName",
")",
"{",
"return",
"fieldCache",
".",
"get",
"(",
"new",
"FieldReference",
"(",
"someClass",
",",
"fieldName",
")",
")... | Returns the specified field found on the specified class and its ancestors.
@param someClass the class to search the field on.
@param fieldName the field name.
@return the corresponding field object wrapped in an optional. | [
"Returns",
"the",
"specified",
"field",
"found",
"on",
"the",
"specified",
"class",
"and",
"its",
"ancestors",
"."
] | 55b3e861fe152e9b125ebc69daa91a682deeae8a | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/FieldUtils.java#L60-L62 | train |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/el/ElUtil.java | ElUtil.removeBrackets | public static String removeBrackets( String condition ){
String value = StringUtils.strip( condition );
if( value != null && value.length() >= 3 ){
return value.substring( 2, value.length() - 1 );
}
return value;
} | java | public static String removeBrackets( String condition ){
String value = StringUtils.strip( condition );
if( value != null && value.length() >= 3 ){
return value.substring( 2, value.length() - 1 );
}
return value;
} | [
"public",
"static",
"String",
"removeBrackets",
"(",
"String",
"condition",
")",
"{",
"String",
"value",
"=",
"StringUtils",
".",
"strip",
"(",
"condition",
")",
";",
"if",
"(",
"value",
"!=",
"null",
"&&",
"value",
".",
"length",
"(",
")",
">=",
"3",
... | After trimming the input, removes two characters from the start and one from the end and returns the result. | [
"After",
"trimming",
"the",
"input",
"removes",
"two",
"characters",
"from",
"the",
"start",
"and",
"one",
"from",
"the",
"end",
"and",
"returns",
"the",
"result",
"."
] | f471f1f94013b3e2d56b4c9380e86e3a92c2ee29 | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/el/ElUtil.java#L29-L35 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.