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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
scireum/server-sass | src/main/java/org/serversass/ast/FunctionCall.java | FunctionCall.appendNameAndParameters | protected static void appendNameAndParameters(StringBuilder sb, String name, List<Expression> parameters) {
sb.append(name);
sb.append("(");
boolean first = true;
for (Expression expr : parameters) {
if (!first) {
sb.append(", ");
}
fir... | java | protected static void appendNameAndParameters(StringBuilder sb, String name, List<Expression> parameters) {
sb.append(name);
sb.append("(");
boolean first = true;
for (Expression expr : parameters) {
if (!first) {
sb.append(", ");
}
fir... | [
"protected",
"static",
"void",
"appendNameAndParameters",
"(",
"StringBuilder",
"sb",
",",
"String",
"name",
",",
"List",
"<",
"Expression",
">",
"parameters",
")",
"{",
"sb",
".",
"append",
"(",
"name",
")",
";",
"sb",
".",
"append",
"(",
"\"(\"",
")",
... | Appends the name and parameters to the given string builder.
@param sb the target to write the output to
@param name the name of the function
@param parameters the list of parameters | [
"Appends",
"the",
"name",
"and",
"parameters",
"to",
"the",
"given",
"string",
"builder",
"."
] | e74af983567f10c43420d70cd31165dd080ba8fc | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/ast/FunctionCall.java#L48-L60 | train |
scireum/server-sass | src/main/java/org/serversass/ast/FunctionCall.java | FunctionCall.getExpectedParam | public Expression getExpectedParam(int index) {
if (parameters.size() <= index) {
throw new IllegalArgumentException("Parameter index out of bounds: " + index + ". Function call: " + this);
}
return parameters.get(index);
} | java | public Expression getExpectedParam(int index) {
if (parameters.size() <= index) {
throw new IllegalArgumentException("Parameter index out of bounds: " + index + ". Function call: " + this);
}
return parameters.get(index);
} | [
"public",
"Expression",
"getExpectedParam",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"parameters",
".",
"size",
"(",
")",
"<=",
"index",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter index out of bounds: \"",
"+",
"index",
"+",
"\". Fu... | Returns the parameter at the expected index.
@param index the number of the parameter to access
@return the expression representing at the given index
@throws IllegalArgumentException if the index is out of bounds | [
"Returns",
"the",
"parameter",
"at",
"the",
"expected",
"index",
"."
] | e74af983567f10c43420d70cd31165dd080ba8fc | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/ast/FunctionCall.java#L96-L102 | train |
scireum/server-sass | src/main/java/org/serversass/Scope.java | Scope.get | public Expression get(String name) {
if (variables.containsKey(name)) {
return variables.get(name);
}
if (parent == null) {
return new Value("");
}
return parent.get(name);
} | java | public Expression get(String name) {
if (variables.containsKey(name)) {
return variables.get(name);
}
if (parent == null) {
return new Value("");
}
return parent.get(name);
} | [
"public",
"Expression",
"get",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"variables",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"variables",
".",
"get",
"(",
"name",
")",
";",
"}",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"ret... | Returns the value previously set for the given variable.
@param name the variable to lookup
@return the value associated with the given name. Uses the parent scope if no variable with the given
name exists. Returns a {@link Value} with "" as content, in case the value is completely unknown. | [
"Returns",
"the",
"value",
"previously",
"set",
"for",
"the",
"given",
"variable",
"."
] | e74af983567f10c43420d70cd31165dd080ba8fc | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Scope.java#L61-L69 | train |
duracloud/management-console | account-management-monitor/src/main/java/org/duracloud/account/monitor/duplication/DuplicationMonitor.java | DuplicationMonitor.monitorDuplication | public DuplicationReport monitorDuplication() {
log.info("starting duplication monitor");
DuplicationReport report = new DuplicationReport();
for (String host : dupHosts.keySet()) {
DuplicationInfo info = new DuplicationInfo(host);
try {
// Connect to sto... | java | public DuplicationReport monitorDuplication() {
log.info("starting duplication monitor");
DuplicationReport report = new DuplicationReport();
for (String host : dupHosts.keySet()) {
DuplicationInfo info = new DuplicationInfo(host);
try {
// Connect to sto... | [
"public",
"DuplicationReport",
"monitorDuplication",
"(",
")",
"{",
"log",
".",
"info",
"(",
"\"starting duplication monitor\"",
")",
";",
"DuplicationReport",
"report",
"=",
"new",
"DuplicationReport",
"(",
")",
";",
"for",
"(",
"String",
"host",
":",
"dupHosts",... | This method performs the duplication checks. These checks compare
the number of content items in identically named spaces.
@return DuplicationReport report | [
"This",
"method",
"performs",
"the",
"duplication",
"checks",
".",
"These",
"checks",
"compare",
"the",
"number",
"of",
"content",
"items",
"in",
"identically",
"named",
"spaces",
"."
] | 7331015c01f9ac5cc5c0aa8ae9a2a1a77e9f4ac6 | https://github.com/duracloud/management-console/blob/7331015c01f9ac5cc5c0aa8ae9a2a1a77e9f4ac6/account-management-monitor/src/main/java/org/duracloud/account/monitor/duplication/DuplicationMonitor.java#L57-L102 | train |
opentable/otj-jaxrs | client/src/main/java/com/opentable/jaxrs/CalculateThreads.java | CalculateThreads.calculateThreads | public static int calculateThreads(final int executorThreads, final String name) {
// For current standard 8 core machines this is 10 regardless.
// On Java 10, you might get less than 8 core reported, but it will still size as if it's 8
// Beyond 8 core you MIGHT undersize if running on Docker,... | java | public static int calculateThreads(final int executorThreads, final String name) {
// For current standard 8 core machines this is 10 regardless.
// On Java 10, you might get less than 8 core reported, but it will still size as if it's 8
// Beyond 8 core you MIGHT undersize if running on Docker,... | [
"public",
"static",
"int",
"calculateThreads",
"(",
"final",
"int",
"executorThreads",
",",
"final",
"String",
"name",
")",
"{",
"// For current standard 8 core machines this is 10 regardless.",
"// On Java 10, you might get less than 8 core reported, but it will still size as if it's ... | Calculate optimal threads. If they exceed the specified executorThreads, use optimal threads
instead. Emit appropriate logging
@param executorThreads executor threads - what the caller wishes to use for size
@param name client pool name. Used for logging.
@return int actual threads to use | [
"Calculate",
"optimal",
"threads",
".",
"If",
"they",
"exceed",
"the",
"specified",
"executorThreads",
"use",
"optimal",
"threads",
"instead",
".",
"Emit",
"appropriate",
"logging"
] | 384e7094fe5a56d41b2a9970bfd783fa85cbbcb8 | https://github.com/opentable/otj-jaxrs/blob/384e7094fe5a56d41b2a9970bfd783fa85cbbcb8/client/src/main/java/com/opentable/jaxrs/CalculateThreads.java#L29-L48 | train |
opentable/otj-jaxrs | client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java | JaxRsClientFactory.addFeatureToAllClients | @SafeVarargs
public final synchronized JaxRsClientFactory addFeatureToAllClients(Class<? extends Feature>... features) {
return addFeatureToGroup(PrivateFeatureGroup.WILDCARD, features);
} | java | @SafeVarargs
public final synchronized JaxRsClientFactory addFeatureToAllClients(Class<? extends Feature>... features) {
return addFeatureToGroup(PrivateFeatureGroup.WILDCARD, features);
} | [
"@",
"SafeVarargs",
"public",
"final",
"synchronized",
"JaxRsClientFactory",
"addFeatureToAllClients",
"(",
"Class",
"<",
"?",
"extends",
"Feature",
">",
"...",
"features",
")",
"{",
"return",
"addFeatureToGroup",
"(",
"PrivateFeatureGroup",
".",
"WILDCARD",
",",
"f... | Register a list of features for all created clients. | [
"Register",
"a",
"list",
"of",
"features",
"for",
"all",
"created",
"clients",
"."
] | 384e7094fe5a56d41b2a9970bfd783fa85cbbcb8 | https://github.com/opentable/otj-jaxrs/blob/384e7094fe5a56d41b2a9970bfd783fa85cbbcb8/client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java#L151-L154 | train |
opentable/otj-jaxrs | client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java | JaxRsClientFactory.createClientProxy | public <T> T createClientProxy(Class<T> proxyClass, WebTarget baseTarget) {
return factory(ctx).createClientProxy(proxyClass, baseTarget);
} | java | public <T> T createClientProxy(Class<T> proxyClass, WebTarget baseTarget) {
return factory(ctx).createClientProxy(proxyClass, baseTarget);
} | [
"public",
"<",
"T",
">",
"T",
"createClientProxy",
"(",
"Class",
"<",
"T",
">",
"proxyClass",
",",
"WebTarget",
"baseTarget",
")",
"{",
"return",
"factory",
"(",
"ctx",
")",
".",
"createClientProxy",
"(",
"proxyClass",
",",
"baseTarget",
")",
";",
"}"
] | Create a Client proxy for the given interface type.
Note that different JAX-RS providers behave slightly
differently for this feature.
@param proxyClass the class to implement
@param baseTarget the API root
@return a proxy implementation that executes requests | [
"Create",
"a",
"Client",
"proxy",
"for",
"the",
"given",
"interface",
"type",
".",
"Note",
"that",
"different",
"JAX",
"-",
"RS",
"providers",
"behave",
"slightly",
"differently",
"for",
"this",
"feature",
"."
] | 384e7094fe5a56d41b2a9970bfd783fa85cbbcb8 | https://github.com/opentable/otj-jaxrs/blob/384e7094fe5a56d41b2a9970bfd783fa85cbbcb8/client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java#L276-L278 | train |
Nanopublication/nanopub-java | src/main/java/org/nanopub/extra/security/SignatureUtils.java | SignatureUtils.seemsToHaveSignature | public static boolean seemsToHaveSignature(Nanopub nanopub) {
for (Statement st : nanopub.getPubinfo()) {
if (st.getPredicate().equals(NanopubSignatureElement.HAS_SIGNATURE_ELEMENT)) return true;
if (st.getPredicate().equals(NanopubSignatureElement.HAS_SIGNATURE_TARGET)) return true;
if (st.getPredicate().eq... | java | public static boolean seemsToHaveSignature(Nanopub nanopub) {
for (Statement st : nanopub.getPubinfo()) {
if (st.getPredicate().equals(NanopubSignatureElement.HAS_SIGNATURE_ELEMENT)) return true;
if (st.getPredicate().equals(NanopubSignatureElement.HAS_SIGNATURE_TARGET)) return true;
if (st.getPredicate().eq... | [
"public",
"static",
"boolean",
"seemsToHaveSignature",
"(",
"Nanopub",
"nanopub",
")",
"{",
"for",
"(",
"Statement",
"st",
":",
"nanopub",
".",
"getPubinfo",
"(",
")",
")",
"{",
"if",
"(",
"st",
".",
"getPredicate",
"(",
")",
".",
"equals",
"(",
"Nanopub... | This includes legacy signatures. Might include false positives. | [
"This",
"includes",
"legacy",
"signatures",
".",
"Might",
"include",
"false",
"positives",
"."
] | 8bae9e87a8e9c2709e6afdcc5e02519607f6032b | https://github.com/Nanopublication/nanopub-java/blob/8bae9e87a8e9c2709e6afdcc5e02519607f6032b/src/main/java/org/nanopub/extra/security/SignatureUtils.java#L192-L200 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.workflowCuration | private void workflowCuration(JsonSimple response, JsonSimple message) {
String oid = message.getString(null, "oid");
if (!workflowCompleted(oid)) {
return;
}
// Resolve relationships before we continue
try {
JSONArray relations = mapRelations(oid);
// Unless there was an error, we should be good to... | java | private void workflowCuration(JsonSimple response, JsonSimple message) {
String oid = message.getString(null, "oid");
if (!workflowCompleted(oid)) {
return;
}
// Resolve relationships before we continue
try {
JSONArray relations = mapRelations(oid);
// Unless there was an error, we should be good to... | [
"private",
"void",
"workflowCuration",
"(",
"JsonSimple",
"response",
",",
"JsonSimple",
"message",
")",
"{",
"String",
"oid",
"=",
"message",
".",
"getString",
"(",
"null",
",",
"\"oid\"",
")",
";",
"if",
"(",
"!",
"workflowCompleted",
"(",
"oid",
")",
")... | Assess a workflow event to see how it effects curation
@param response
The response object
@param message
The incoming message | [
"Assess",
"a",
"workflow",
"event",
"to",
"see",
"how",
"it",
"effects",
"curation"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L236-L258 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.mapRelations | private JSONArray mapRelations(String oid) {
// We want our parsed data for reading
JsonSimple formData = parsedFormData(oid);
if (formData == null) {
log.error("Error parsing form data");
return null;
}
// And raw data to see existing relations and write new ones
JsonSimple rawData = getDataFromStor... | java | private JSONArray mapRelations(String oid) {
// We want our parsed data for reading
JsonSimple formData = parsedFormData(oid);
if (formData == null) {
log.error("Error parsing form data");
return null;
}
// And raw data to see existing relations and write new ones
JsonSimple rawData = getDataFromStor... | [
"private",
"JSONArray",
"mapRelations",
"(",
"String",
"oid",
")",
"{",
"// We want our parsed data for reading",
"JsonSimple",
"formData",
"=",
"parsedFormData",
"(",
"oid",
")",
";",
"if",
"(",
"formData",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\... | Map all the relationships buried in this record's data
@param oid
The object ID being curated
@returns True is ready to proceed, otherwise False | [
"Map",
"all",
"the",
"relationships",
"buried",
"in",
"this",
"record",
"s",
"data"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L283-L358 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.isKnownRelation | private boolean isKnownRelation(JSONArray relations, JsonObject newRelation) {
// Does it have an OID? Highest priority. Avoids infinite loops
// between ReDBox collections pointing at each other, so strict
if (newRelation.containsKey("oid")) {
for (Object relation : relations) {
JsonObject json = (JsonObj... | java | private boolean isKnownRelation(JSONArray relations, JsonObject newRelation) {
// Does it have an OID? Highest priority. Avoids infinite loops
// between ReDBox collections pointing at each other, so strict
if (newRelation.containsKey("oid")) {
for (Object relation : relations) {
JsonObject json = (JsonObj... | [
"private",
"boolean",
"isKnownRelation",
"(",
"JSONArray",
"relations",
",",
"JsonObject",
"newRelation",
")",
"{",
"// Does it have an OID? Highest priority. Avoids infinite loops",
"// between ReDBox collections pointing at each other, so strict",
"if",
"(",
"newRelation",
".",
"... | Test whether the field provided is already a known relationship
@param relations
The list of current relationships
@param field
The cleaned field to provide some context
@param id
The ID of the related object
@returns True is it is a known relationship | [
"Test",
"whether",
"the",
"field",
"provided",
"is",
"already",
"a",
"known",
"relationship"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L498-L533 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.publish | private JsonSimple publish(JsonSimple message, String oid)
throws TransactionException {
log.debug("Publishing '{}'", oid);
JsonSimple response = new JsonSimple();
try {
DigitalObject object = storage.getObject(oid);
Properties metadata = object.getMetadata();
// Already published?
if (!metadata.co... | java | private JsonSimple publish(JsonSimple message, String oid)
throws TransactionException {
log.debug("Publishing '{}'", oid);
JsonSimple response = new JsonSimple();
try {
DigitalObject object = storage.getObject(oid);
Properties metadata = object.getMetadata();
// Already published?
if (!metadata.co... | [
"private",
"JsonSimple",
"publish",
"(",
"JsonSimple",
"message",
",",
"String",
"oid",
")",
"throws",
"TransactionException",
"{",
"log",
".",
"debug",
"(",
"\"Publishing '{}'\"",
",",
"oid",
")",
";",
"JsonSimple",
"response",
"=",
"new",
"JsonSimple",
"(",
... | Get the requested object ready for publication. This would typically just
involve setting a flag
@param message
The incoming message
@param oid
The object identifier to publish
@return JsonSimple The response object
@throws TransactionException
If an error occurred | [
"Get",
"the",
"requested",
"object",
"ready",
"for",
"publication",
".",
"This",
"would",
"typically",
"just",
"involve",
"setting",
"a",
"flag"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1233-L1279 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.publishRelations | private void publishRelations(JsonSimple response, String oid) throws TransactionException {
log.debug("Publishing Children of '{}'", oid);
JsonSimple data = getDataFromStorage(oid);
if (data == null) {
log.error("Error accessing item data! '{}'", oid);
emailObjectLink(response, oid,
"An error occured... | java | private void publishRelations(JsonSimple response, String oid) throws TransactionException {
log.debug("Publishing Children of '{}'", oid);
JsonSimple data = getDataFromStorage(oid);
if (data == null) {
log.error("Error accessing item data! '{}'", oid);
emailObjectLink(response, oid,
"An error occured... | [
"private",
"void",
"publishRelations",
"(",
"JsonSimple",
"response",
",",
"String",
"oid",
")",
"throws",
"TransactionException",
"{",
"log",
".",
"debug",
"(",
"\"Publishing Children of '{}'\"",
",",
"oid",
")",
";",
"JsonSimple",
"data",
"=",
"getDataFromStorage"... | Send out requests to all relations to publish
@param oid
The object identifier to publish
@throws TransactionException | [
"Send",
"out",
"requests",
"to",
"all",
"relations",
"to",
"publish"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1288-L1349 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.reharvest | private void reharvest(JsonSimple response, JsonSimple message) {
String oid = message.getString(null, "oid");
try {
if (oid != null) {
setRenderFlag(oid);
// Transformer config
JsonSimple itemConfig = getConfigFromStorage(oid);
if (itemConfig == null) {
log.error("Error accessing item con... | java | private void reharvest(JsonSimple response, JsonSimple message) {
String oid = message.getString(null, "oid");
try {
if (oid != null) {
setRenderFlag(oid);
// Transformer config
JsonSimple itemConfig = getConfigFromStorage(oid);
if (itemConfig == null) {
log.error("Error accessing item con... | [
"private",
"void",
"reharvest",
"(",
"JsonSimple",
"response",
",",
"JsonSimple",
"message",
")",
"{",
"String",
"oid",
"=",
"message",
".",
"getString",
"(",
"null",
",",
"\"oid\"",
")",
";",
"try",
"{",
"if",
"(",
"oid",
"!=",
"null",
")",
"{",
"setR... | Generate a fairly common list of orders to transform and index an object.
This mirrors the traditional tool chain.
@param message
The response to modify
@param message
The message we received | [
"Generate",
"a",
"fairly",
"common",
"list",
"of",
"orders",
"to",
"transform",
"and",
"index",
"an",
"object",
".",
"This",
"mirrors",
"the",
"traditional",
"tool",
"chain",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1526-L1552 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.emailObjectLink | private void emailObjectLink(JsonSimple response, String oid, String message) {
String link = urlBase + "default/detail/" + oid;
String text = "This is an automated message from the ";
text += "ReDBox Curation Manager.\n\n" + message;
text += "\n\nYou can find this object here:\n" + link;
email(response, oid,... | java | private void emailObjectLink(JsonSimple response, String oid, String message) {
String link = urlBase + "default/detail/" + oid;
String text = "This is an automated message from the ";
text += "ReDBox Curation Manager.\n\n" + message;
text += "\n\nYou can find this object here:\n" + link;
email(response, oid,... | [
"private",
"void",
"emailObjectLink",
"(",
"JsonSimple",
"response",
",",
"String",
"oid",
",",
"String",
"message",
")",
"{",
"String",
"link",
"=",
"urlBase",
"+",
"\"default/detail/\"",
"+",
"oid",
";",
"String",
"text",
"=",
"\"This is an automated message fro... | Generate an order to send an email to the intended recipient with a link
to an object
@param response
The response to add an order to
@param message
The message we want to send | [
"Generate",
"an",
"order",
"to",
"send",
"an",
"email",
"to",
"the",
"intended",
"recipient",
"with",
"a",
"link",
"to",
"an",
"object"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1563-L1569 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.email | private void email(JsonSimple response, String oid, String text) {
JsonObject object = newMessage(response,
EmailNotificationConsumer.LISTENER_ID);
JsonObject message = (JsonObject) object.get("message");
message.put("to", emailAddress);
message.put("body", text);
message.put("oid", oid);
} | java | private void email(JsonSimple response, String oid, String text) {
JsonObject object = newMessage(response,
EmailNotificationConsumer.LISTENER_ID);
JsonObject message = (JsonObject) object.get("message");
message.put("to", emailAddress);
message.put("body", text);
message.put("oid", oid);
} | [
"private",
"void",
"email",
"(",
"JsonSimple",
"response",
",",
"String",
"oid",
",",
"String",
"text",
")",
"{",
"JsonObject",
"object",
"=",
"newMessage",
"(",
"response",
",",
"EmailNotificationConsumer",
".",
"LISTENER_ID",
")",
";",
"JsonObject",
"message",... | Generate an order to send an email to the intended recipient
@param response
The response to add an order to
@param message
The message we want to send | [
"Generate",
"an",
"order",
"to",
"send",
"an",
"email",
"to",
"the",
"intended",
"recipient"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1579-L1586 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.audit | private void audit(JsonSimple response, String oid, String message) {
JsonObject order = newSubscription(response, oid);
JsonObject messageObject = (JsonObject) order.get("message");
messageObject.put("eventType", message);
} | java | private void audit(JsonSimple response, String oid, String message) {
JsonObject order = newSubscription(response, oid);
JsonObject messageObject = (JsonObject) order.get("message");
messageObject.put("eventType", message);
} | [
"private",
"void",
"audit",
"(",
"JsonSimple",
"response",
",",
"String",
"oid",
",",
"String",
"message",
")",
"{",
"JsonObject",
"order",
"=",
"newSubscription",
"(",
"response",
",",
"oid",
")",
";",
"JsonObject",
"messageObject",
"=",
"(",
"JsonObject",
... | Generate an order to add a message to the System's audit log
@param response
The response to add an order to
@param oid
The object ID we are logging
@param message
The message we want to log | [
"Generate",
"an",
"order",
"to",
"add",
"a",
"message",
"to",
"the",
"System",
"s",
"audit",
"log"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1598-L1602 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.scheduleTransformers | private void scheduleTransformers(JsonSimple message, JsonSimple response) {
String oid = message.getString(null, "oid");
List<String> list = message.getStringList("transformer", "metadata");
if (list != null && !list.isEmpty()) {
for (String id : list) {
JsonObject order = newTransform(response, id, oid);... | java | private void scheduleTransformers(JsonSimple message, JsonSimple response) {
String oid = message.getString(null, "oid");
List<String> list = message.getStringList("transformer", "metadata");
if (list != null && !list.isEmpty()) {
for (String id : list) {
JsonObject order = newTransform(response, id, oid);... | [
"private",
"void",
"scheduleTransformers",
"(",
"JsonSimple",
"message",
",",
"JsonSimple",
"response",
")",
"{",
"String",
"oid",
"=",
"message",
".",
"getString",
"(",
"null",
",",
"\"oid\"",
")",
";",
"List",
"<",
"String",
">",
"list",
"=",
"message",
... | Generate orders for the list of normal transformers scheduled to execute
on the tool chain
@param message
The incoming message, which contains the tool chain config for
this object
@param response
The response to edit
@param oid
The object to schedule for clearing | [
"Generate",
"orders",
"for",
"the",
"list",
"of",
"normal",
"transformers",
"scheduled",
"to",
"execute",
"on",
"the",
"tool",
"chain"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1616-L1631 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.setRenderFlag | private void setRenderFlag(String oid) {
try {
DigitalObject object = storage.getObject(oid);
Properties props = object.getMetadata();
props.setProperty("render-pending", "true");
storeProperties(object, props);
} catch (StorageException ex) {
log.error("Error accessing storage for '{}'", oid, ex);
... | java | private void setRenderFlag(String oid) {
try {
DigitalObject object = storage.getObject(oid);
Properties props = object.getMetadata();
props.setProperty("render-pending", "true");
storeProperties(object, props);
} catch (StorageException ex) {
log.error("Error accessing storage for '{}'", oid, ex);
... | [
"private",
"void",
"setRenderFlag",
"(",
"String",
"oid",
")",
"{",
"try",
"{",
"DigitalObject",
"object",
"=",
"storage",
".",
"getObject",
"(",
"oid",
")",
";",
"Properties",
"props",
"=",
"object",
".",
"getMetadata",
"(",
")",
";",
"props",
".",
"set... | Set the render flag for objects that are starting in the tool chain
@param oid
The object to set | [
"Set",
"the",
"render",
"flag",
"for",
"objects",
"that",
"are",
"starting",
"in",
"the",
"tool",
"chain"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1670-L1679 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.createTask | private JsonObject createTask(JsonSimple response, String oid, String task) {
return createTask(response, null, oid, task);
} | java | private JsonObject createTask(JsonSimple response, String oid, String task) {
return createTask(response, null, oid, task);
} | [
"private",
"JsonObject",
"createTask",
"(",
"JsonSimple",
"response",
",",
"String",
"oid",
",",
"String",
"task",
")",
"{",
"return",
"createTask",
"(",
"response",
",",
"null",
",",
"oid",
",",
"task",
")",
";",
"}"
] | Create a task. Tasks are basically just trivial messages that will come
back to this manager for later action.
@param response
The response to edit
@param oid
The object to schedule for clearing
@param task
The task String to use on receipt
@return JsonObject Access to the 'message' node of this task to provide
furthe... | [
"Create",
"a",
"task",
".",
"Tasks",
"are",
"basically",
"just",
"trivial",
"messages",
"that",
"will",
"come",
"back",
"to",
"this",
"manager",
"for",
"later",
"action",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1695-L1697 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.createTask | private JsonObject createTask(JsonSimple response, String broker,
String oid, String task) {
JsonObject object = newMessage(response,
TransactionManagerQueueConsumer.LISTENER_ID);
if (broker != null) {
object.put("broker", broker);
}
JsonObject message = (JsonObject) object.get("message");
message.p... | java | private JsonObject createTask(JsonSimple response, String broker,
String oid, String task) {
JsonObject object = newMessage(response,
TransactionManagerQueueConsumer.LISTENER_ID);
if (broker != null) {
object.put("broker", broker);
}
JsonObject message = (JsonObject) object.get("message");
message.p... | [
"private",
"JsonObject",
"createTask",
"(",
"JsonSimple",
"response",
",",
"String",
"broker",
",",
"String",
"oid",
",",
"String",
"task",
")",
"{",
"JsonObject",
"object",
"=",
"newMessage",
"(",
"response",
",",
"TransactionManagerQueueConsumer",
".",
"LISTENER... | Create a task. This is a more detailed option allowing for tasks being
sent to remote brokers.
@param response
The response to edit
@param broker
The broker URL to use
@param oid
The object to schedule for clearing
@param task
The task String to use on receipt
@return JsonObject Access to the 'message' node of this ta... | [
"Create",
"a",
"task",
".",
"This",
"is",
"a",
"more",
"detailed",
"option",
"allowing",
"for",
"tasks",
"being",
"sent",
"to",
"remote",
"brokers",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1714-L1725 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.newIndex | private JsonObject newIndex(JsonSimple response, String oid) {
JsonObject order = createNewOrder(response,
TransactionManagerQueueConsumer.OrderType.INDEXER.toString());
order.put("oid", oid);
return order;
} | java | private JsonObject newIndex(JsonSimple response, String oid) {
JsonObject order = createNewOrder(response,
TransactionManagerQueueConsumer.OrderType.INDEXER.toString());
order.put("oid", oid);
return order;
} | [
"private",
"JsonObject",
"newIndex",
"(",
"JsonSimple",
"response",
",",
"String",
"oid",
")",
"{",
"JsonObject",
"order",
"=",
"createNewOrder",
"(",
"response",
",",
"TransactionManagerQueueConsumer",
".",
"OrderType",
".",
"INDEXER",
".",
"toString",
"(",
")",
... | Creation of new Orders with appropriate default nodes | [
"Creation",
"of",
"new",
"Orders",
"with",
"appropriate",
"default",
"nodes"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1731-L1736 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.getConfigFromStorage | private JsonSimple getConfigFromStorage(String oid) {
String configOid = null;
String configPid = null;
// Get our object and look for its config info
try {
DigitalObject object = storage.getObject(oid);
Properties metadata = object.getMetadata();
configOid = metadata.getProperty("jsonConfigOid");
... | java | private JsonSimple getConfigFromStorage(String oid) {
String configOid = null;
String configPid = null;
// Get our object and look for its config info
try {
DigitalObject object = storage.getObject(oid);
Properties metadata = object.getMetadata();
configOid = metadata.getProperty("jsonConfigOid");
... | [
"private",
"JsonSimple",
"getConfigFromStorage",
"(",
"String",
"oid",
")",
"{",
"String",
"configOid",
"=",
"null",
";",
"String",
"configPid",
"=",
"null",
";",
"// Get our object and look for its config info",
"try",
"{",
"DigitalObject",
"object",
"=",
"storage",
... | Get the stored harvest configuration from storage for the indicated
object.
@param oid
The object we want config for | [
"Get",
"the",
"stored",
"harvest",
"configuration",
"from",
"storage",
"for",
"the",
"indicated",
"object",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1790-L1829 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.parsedFormData | private JsonSimple parsedFormData(String oid) {
// Get our data from Storage
Payload payload = null;
try {
DigitalObject object = storage.getObject(oid);
payload = getDataPayload(object);
} catch (StorageException ex) {
log.error("Error accessing object '{}' in storage: ", oid, ex);
return null;
}... | java | private JsonSimple parsedFormData(String oid) {
// Get our data from Storage
Payload payload = null;
try {
DigitalObject object = storage.getObject(oid);
payload = getDataPayload(object);
} catch (StorageException ex) {
log.error("Error accessing object '{}' in storage: ", oid, ex);
return null;
}... | [
"private",
"JsonSimple",
"parsedFormData",
"(",
"String",
"oid",
")",
"{",
"// Get our data from Storage",
"Payload",
"payload",
"=",
"null",
";",
"try",
"{",
"DigitalObject",
"object",
"=",
"storage",
".",
"getObject",
"(",
"oid",
")",
";",
"payload",
"=",
"g... | Get the form data from storage for the indicated object and parse it into
a JSON structure.
@param oid
The object we want | [
"Get",
"the",
"form",
"data",
"from",
"storage",
"for",
"the",
"indicated",
"object",
"and",
"parse",
"it",
"into",
"a",
"JSON",
"structure",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1838-L1863 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.getObjectMetadata | private Properties getObjectMetadata(String oid) {
try {
DigitalObject object = storage.getObject(oid);
return object.getMetadata();
} catch (StorageException ex) {
log.error("Error accessing object '{}' in storage: ", oid, ex);
return null;
}
} | java | private Properties getObjectMetadata(String oid) {
try {
DigitalObject object = storage.getObject(oid);
return object.getMetadata();
} catch (StorageException ex) {
log.error("Error accessing object '{}' in storage: ", oid, ex);
return null;
}
} | [
"private",
"Properties",
"getObjectMetadata",
"(",
"String",
"oid",
")",
"{",
"try",
"{",
"DigitalObject",
"object",
"=",
"storage",
".",
"getObject",
"(",
"oid",
")",
";",
"return",
"object",
".",
"getMetadata",
"(",
")",
";",
"}",
"catch",
"(",
"StorageE... | Get the metadata properties for the indicated object.
@param oid
The object we want config for | [
"Get",
"the",
"metadata",
"properties",
"for",
"the",
"indicated",
"object",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1904-L1912 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.saveObjectData | private void saveObjectData(JsonSimple data, String oid)
throws TransactionException {
// Get from storage
DigitalObject object = null;
try {
object = storage.getObject(oid);
getDataPayload(object);
} catch (StorageException ex) {
log.error("Error accessing object '{}' in storage: ", oid, ex);
th... | java | private void saveObjectData(JsonSimple data, String oid)
throws TransactionException {
// Get from storage
DigitalObject object = null;
try {
object = storage.getObject(oid);
getDataPayload(object);
} catch (StorageException ex) {
log.error("Error accessing object '{}' in storage: ", oid, ex);
th... | [
"private",
"void",
"saveObjectData",
"(",
"JsonSimple",
"data",
",",
"String",
"oid",
")",
"throws",
"TransactionException",
"{",
"// Get from storage",
"DigitalObject",
"object",
"=",
"null",
";",
"try",
"{",
"object",
"=",
"storage",
".",
"getObject",
"(",
"oi... | Save the provided object data back into storage
@param data
The data to save
@param oid
The object we want it saved in | [
"Save",
"the",
"provided",
"object",
"data",
"back",
"into",
"storage"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1922-L1942 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java | FormDataParser.parse | public static JsonSimple parse(String input) throws IOException {
ByteArrayInputStream bytes = new ByteArrayInputStream(
input.getBytes("UTF-8"));
return parse(bytes);
} | java | public static JsonSimple parse(String input) throws IOException {
ByteArrayInputStream bytes = new ByteArrayInputStream(
input.getBytes("UTF-8"));
return parse(bytes);
} | [
"public",
"static",
"JsonSimple",
"parse",
"(",
"String",
"input",
")",
"throws",
"IOException",
"{",
"ByteArrayInputStream",
"bytes",
"=",
"new",
"ByteArrayInputStream",
"(",
"input",
".",
"getBytes",
"(",
"\"UTF-8\"",
")",
")",
";",
"return",
"parse",
"(",
"... | A wrapper for Stream based parsing. This method accepts a String and
will internally create a Stream for it.
@param input The form data to parse from a String
@return JsonSimple The parsed form data in JSON
@throws IOException if there are errors reading/parsing the form data | [
"A",
"wrapper",
"for",
"Stream",
"based",
"parsing",
".",
"This",
"method",
"accepts",
"a",
"String",
"and",
"will",
"internally",
"create",
"a",
"Stream",
"for",
"it",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L58-L62 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java | FormDataParser.parse | public static JsonSimple parse(InputStream input) throws IOException {
JsonSimple inputData = new JsonSimple(input);
JsonSimple responseData = new JsonSimple();
// Go through every top level node
JsonObject object = inputData.getJsonObject();
for (Object key : object.keySet()) {... | java | public static JsonSimple parse(InputStream input) throws IOException {
JsonSimple inputData = new JsonSimple(input);
JsonSimple responseData = new JsonSimple();
// Go through every top level node
JsonObject object = inputData.getJsonObject();
for (Object key : object.keySet()) {... | [
"public",
"static",
"JsonSimple",
"parse",
"(",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"JsonSimple",
"inputData",
"=",
"new",
"JsonSimple",
"(",
"input",
")",
";",
"JsonSimple",
"responseData",
"=",
"new",
"JsonSimple",
"(",
")",
";",
"// G... | Accept and parse raw JSON data from an InputStream. Field name String
literals will be broken down into meaningful JSON data structures.
@param input The form data to parse from an InputStream
@return JsonSimple The parsed form data in JSON
@throws IOException if there are errors reading/parsing the form data | [
"Accept",
"and",
"parse",
"raw",
"JSON",
"data",
"from",
"an",
"InputStream",
".",
"Field",
"name",
"String",
"literals",
"will",
"be",
"broken",
"down",
"into",
"meaningful",
"JSON",
"data",
"structures",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L72-L88 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java | FormDataParser.validString | private static String validString(Object data) throws IOException {
// Null is ok
if (data == null) {
return "";
}
if (!(data instanceof String)) {
throw new IOException("Invalid non-String value found!");
}
return (String) data;
} | java | private static String validString(Object data) throws IOException {
// Null is ok
if (data == null) {
return "";
}
if (!(data instanceof String)) {
throw new IOException("Invalid non-String value found!");
}
return (String) data;
} | [
"private",
"static",
"String",
"validString",
"(",
"Object",
"data",
")",
"throws",
"IOException",
"{",
"// Null is ok",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"!",
"(",
"data",
"instanceof",
"String",
")",
")",... | Ensures one of the generic objects coming from the JSON library
is in fact a String.
@param data The generic object
@return String The String instance of the object
@throws IOException if the object is not a String | [
"Ensures",
"one",
"of",
"the",
"generic",
"objects",
"coming",
"from",
"the",
"JSON",
"library",
"is",
"in",
"fact",
"a",
"String",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L98-L107 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java | FormDataParser.parseField | private static void parseField(JsonSimple response, String field,
String data) throws IOException {
// Break it into pieces
String [] fieldParts = field.split("\\.");
// These are used as replacable pointers
// to the last object used on the path
JsonObject lastObjec... | java | private static void parseField(JsonSimple response, String field,
String data) throws IOException {
// Break it into pieces
String [] fieldParts = field.split("\\.");
// These are used as replacable pointers
// to the last object used on the path
JsonObject lastObjec... | [
"private",
"static",
"void",
"parseField",
"(",
"JsonSimple",
"response",
",",
"String",
"field",
",",
"String",
"data",
")",
"throws",
"IOException",
"{",
"// Break it into pieces",
"String",
"[",
"]",
"fieldParts",
"=",
"field",
".",
"split",
"(",
"\"\\\\.\"",... | Parse an individual field into the response object.
@param response The response JSON data structure being built.
@param field The current field name to parse
@param data The data contained in this current field
@throws IOException if errors occur during the parse | [
"Parse",
"an",
"individual",
"field",
"into",
"the",
"response",
"object",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L117-L216 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java | FormDataParser.getArray | private static JSONArray getArray(JsonObject object, String key)
throws IOException {
// Get the existing one
if (object.containsKey(key)) {
Object existing = object.get(key);
if (!(existing instanceof JSONArray)) {
throw new IOException("Invalid field... | java | private static JSONArray getArray(JsonObject object, String key)
throws IOException {
// Get the existing one
if (object.containsKey(key)) {
Object existing = object.get(key);
if (!(existing instanceof JSONArray)) {
throw new IOException("Invalid field... | [
"private",
"static",
"JSONArray",
"getArray",
"(",
"JsonObject",
"object",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"// Get the existing one",
"if",
"(",
"object",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"Object",
"existing",
"=",
"objec... | Get a child JSON Array from an incoming JSON object. If the child does
not exist it will be created.
@param object The incoming object we are to look inside
@param key The child node we are looking for
@return JSONArray The child we found or created
@throws IOException if there is a type mismatch on existing data | [
"Get",
"a",
"child",
"JSON",
"Array",
"from",
"an",
"incoming",
"JSON",
"object",
".",
"If",
"the",
"child",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L271-L289 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java | FormDataParser.getObject | private static JsonObject getObject(JsonObject object, String key)
throws IOException {
// Get the existing one
if (object.containsKey(key)) {
Object existing = object.get(key);
if (!(existing instanceof JsonObject)) {
throw new IOException("Invalid fi... | java | private static JsonObject getObject(JsonObject object, String key)
throws IOException {
// Get the existing one
if (object.containsKey(key)) {
Object existing = object.get(key);
if (!(existing instanceof JsonObject)) {
throw new IOException("Invalid fi... | [
"private",
"static",
"JsonObject",
"getObject",
"(",
"JsonObject",
"object",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"// Get the existing one",
"if",
"(",
"object",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"Object",
"existing",
"=",
"obj... | Get a child JSON Object from an incoming JSON object. If the child does
not exist it will be created.
@param object The incoming object we are to look inside
@param key The child node we are looking for
@return JsonObject The child we found or created
@throws IOException if there is a type mismatch on existing data | [
"Get",
"a",
"child",
"JSON",
"Object",
"from",
"an",
"incoming",
"JSON",
"object",
".",
"If",
"the",
"child",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L300-L318 | train |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java | FormDataParser.parseInt | private static int parseInt(String integer) throws IOException {
try {
int value = Integer.parseInt(integer);
if (value < 0) {
throw new IOException("Invalid number in field name: '"
+ integer + "'");
}
return value;
... | java | private static int parseInt(String integer) throws IOException {
try {
int value = Integer.parseInt(integer);
if (value < 0) {
throw new IOException("Invalid number in field name: '"
+ integer + "'");
}
return value;
... | [
"private",
"static",
"int",
"parseInt",
"(",
"String",
"integer",
")",
"throws",
"IOException",
"{",
"try",
"{",
"int",
"value",
"=",
"Integer",
".",
"parseInt",
"(",
"integer",
")",
";",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"throw",
"new",
"IOExcep... | Parse a String to an integer. This wrapper is simply to avoid the try
catch statement repeatedly. Tests for -1 are sufficient, since it is
illegal in form data. Valid integers below 1 throw exceptions because
of this illegality.
@param integer The incoming integer to parse
@return int The parsed integer, or -1 if it i... | [
"Parse",
"a",
"String",
"to",
"an",
"integer",
".",
"This",
"wrapper",
"is",
"simply",
"to",
"avoid",
"the",
"try",
"catch",
"statement",
"repeatedly",
".",
"Tests",
"for",
"-",
"1",
"are",
"sufficient",
"since",
"it",
"is",
"illegal",
"in",
"form",
"dat... | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L330-L342 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.init | @Override
public void init(String jsonString) throws TransformerException {
try {
setConfig(new JsonSimpleConfig(jsonString));
} catch (IOException e) {
throw new TransformerException(e);
}
} | java | @Override
public void init(String jsonString) throws TransformerException {
try {
setConfig(new JsonSimpleConfig(jsonString));
} catch (IOException e) {
throw new TransformerException(e);
}
} | [
"@",
"Override",
"public",
"void",
"init",
"(",
"String",
"jsonString",
")",
"throws",
"TransformerException",
"{",
"try",
"{",
"setConfig",
"(",
"new",
"JsonSimpleConfig",
"(",
"jsonString",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
... | Initializes the plugin using the specified JSON String
@param jsonString JSON configuration string
@throws TransformerException if there was an error in initialization | [
"Initializes",
"the",
"plugin",
"using",
"the",
"specified",
"JSON",
"String"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L161-L168 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.process | private DigitalObject process(DigitalObject in, String jsonConfig)
throws TransformerException {
String oid = in.getId();
// Workflow payload
JsonSimple workflow = null;
try {
Payload workflowPayload = in.getPayload("workflow.metadata");
workflow = ne... | java | private DigitalObject process(DigitalObject in, String jsonConfig)
throws TransformerException {
String oid = in.getId();
// Workflow payload
JsonSimple workflow = null;
try {
Payload workflowPayload = in.getPayload("workflow.metadata");
workflow = ne... | [
"private",
"DigitalObject",
"process",
"(",
"DigitalObject",
"in",
",",
"String",
"jsonConfig",
")",
"throws",
"TransformerException",
"{",
"String",
"oid",
"=",
"in",
".",
"getId",
"(",
")",
";",
"// Workflow payload",
"JsonSimple",
"workflow",
"=",
"null",
";"... | Top level wrapping method for a processing an object.
This method first performs all the basic checks whether this Object is
technically ready to go to VITAL (no matter what the workflow says).
@param param Map of key/value pairs to add to the index | [
"Top",
"level",
"wrapping",
"method",
"for",
"a",
"processing",
"an",
"object",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L521-L562 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.processObject | private DigitalObject processObject(DigitalObject object,
JsonSimple workflow, Properties metadata)
throws TransformerException {
String oid = object.getId();
String title = workflow.getString(null, Strings.NODE_FORMDATA, "title");
FedoraClient fedora = null;
try... | java | private DigitalObject processObject(DigitalObject object,
JsonSimple workflow, Properties metadata)
throws TransformerException {
String oid = object.getId();
String title = workflow.getString(null, Strings.NODE_FORMDATA, "title");
FedoraClient fedora = null;
try... | [
"private",
"DigitalObject",
"processObject",
"(",
"DigitalObject",
"object",
",",
"JsonSimple",
"workflow",
",",
"Properties",
"metadata",
")",
"throws",
"TransformerException",
"{",
"String",
"oid",
"=",
"object",
".",
"getId",
"(",
")",
";",
"String",
"title",
... | Middle level wrapping method for processing objects. Now we are looking
at what actually needs to be done. Has the object already been put in
VITAL, or is it new.
@param object The Object in question
@param workflow The workflow data for the object
@param metadata The Object's metadata | [
"Middle",
"level",
"wrapping",
"method",
"for",
"processing",
"objects",
".",
"Now",
"we",
"are",
"looking",
"at",
"what",
"actually",
"needs",
"to",
"be",
"done",
".",
"Has",
"the",
"object",
"already",
"been",
"put",
"in",
"VITAL",
"or",
"is",
"it",
"n... | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L573-L658 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.createNewObject | private String createNewObject(FedoraClient fedora, String oid)
throws Exception {
InputStream in = null;
byte[] template = null;
// Start by reading our FOXML template into memory
try {
if (foxmlTemplate != null) {
// We have a user provided templ... | java | private String createNewObject(FedoraClient fedora, String oid)
throws Exception {
InputStream in = null;
byte[] template = null;
// Start by reading our FOXML template into memory
try {
if (foxmlTemplate != null) {
// We have a user provided templ... | [
"private",
"String",
"createNewObject",
"(",
"FedoraClient",
"fedora",
",",
"String",
"oid",
")",
"throws",
"Exception",
"{",
"InputStream",
"in",
"=",
"null",
";",
"byte",
"[",
"]",
"template",
"=",
"null",
";",
"// Start by reading our FOXML template into memory",... | Create a new VITAL object and return the PID.
@param fedora An instantiated fedora client
@param oid The ID of the ReDBox object we will store here. For logging
@return String The new VITAL PID that was just created | [
"Create",
"a",
"new",
"VITAL",
"object",
"and",
"return",
"the",
"PID",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L667-L696 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.processDatastreams | private void processDatastreams(FedoraClient fedora, DigitalObject object,
String vitalPid) throws Exception {
int sent = 0;
// Each payload we care about needs to be sent
for (String ourPid : pids.keySet()) {
// Fascinator packages have unpredictable names,
... | java | private void processDatastreams(FedoraClient fedora, DigitalObject object,
String vitalPid) throws Exception {
int sent = 0;
// Each payload we care about needs to be sent
for (String ourPid : pids.keySet()) {
// Fascinator packages have unpredictable names,
... | [
"private",
"void",
"processDatastreams",
"(",
"FedoraClient",
"fedora",
",",
"DigitalObject",
"object",
",",
"String",
"vitalPid",
")",
"throws",
"Exception",
"{",
"int",
"sent",
"=",
"0",
";",
"// Each payload we care about needs to be sent",
"for",
"(",
"String",
... | Method responsible for arranging submissions to VITAL to store our
datastreams.
@param fedora An instantiated fedora client
@param object The Object to submit
@param vitalPid The VITAL PID to use
@throws Exception on any errors | [
"Method",
"responsible",
"for",
"arranging",
"submissions",
"to",
"VITAL",
"to",
"store",
"our",
"datastreams",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L707-L779 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.getPackagePid | private String getPackagePid(DigitalObject object) throws Exception {
for (String pid : object.getPayloadIdList()) {
if (pid.endsWith(".tfpackage")) {
return pid;
}
}
return null;
} | java | private String getPackagePid(DigitalObject object) throws Exception {
for (String pid : object.getPayloadIdList()) {
if (pid.endsWith(".tfpackage")) {
return pid;
}
}
return null;
} | [
"private",
"String",
"getPackagePid",
"(",
"DigitalObject",
"object",
")",
"throws",
"Exception",
"{",
"for",
"(",
"String",
"pid",
":",
"object",
".",
"getPayloadIdList",
"(",
")",
")",
"{",
"if",
"(",
"pid",
".",
"endsWith",
"(",
"\".tfpackage\"",
")",
"... | For the given digital object, find the Fascinator package inside.
@param object The object with a package
@return String The payload ID of the package, NULL if not found
@throws Exception if any errors occur | [
"For",
"the",
"given",
"digital",
"object",
"find",
"the",
"Fascinator",
"package",
"inside",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L955-L962 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.resolveAltIds | private String[] resolveAltIds(String[] oldArray, String mimeType,
int count) {
// First, find the valid list we want
String key = null;
for (String mimeTest : attachAltIds.keySet()) {
// Ignore 'default'
if (mimeTest.equals(Strings.LITERAL_DEFAULT)) {
... | java | private String[] resolveAltIds(String[] oldArray, String mimeType,
int count) {
// First, find the valid list we want
String key = null;
for (String mimeTest : attachAltIds.keySet()) {
// Ignore 'default'
if (mimeTest.equals(Strings.LITERAL_DEFAULT)) {
... | [
"private",
"String",
"[",
"]",
"resolveAltIds",
"(",
"String",
"[",
"]",
"oldArray",
",",
"String",
"mimeType",
",",
"int",
"count",
")",
"{",
"// First, find the valid list we want",
"String",
"key",
"=",
"null",
";",
"for",
"(",
"String",
"mimeTest",
":",
... | For the given mime type, ensure that the array of alternate identifiers
is correct. If identifiers are missing they will be added to the array.
@param oldArray The old array of identifiers
@param mimeType The mime type of the datastream
@param count The attachment count, to use in the format call
@return String[] An a... | [
"For",
"the",
"given",
"mime",
"type",
"ensure",
"that",
"the",
"array",
"of",
"alternate",
"identifiers",
"is",
"correct",
".",
"If",
"identifiers",
"are",
"missing",
"they",
"will",
"be",
"added",
"to",
"the",
"array",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L974-L1007 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.growArray | private String[] growArray(String[] oldArray, String newElement) {
// Look for the element first
for (String element : oldArray) {
if (element.equals(newElement)) {
// If it's already there, we're done
return oldArray;
}
}
log.debug... | java | private String[] growArray(String[] oldArray, String newElement) {
// Look for the element first
for (String element : oldArray) {
if (element.equals(newElement)) {
// If it's already there, we're done
return oldArray;
}
}
log.debug... | [
"private",
"String",
"[",
"]",
"growArray",
"(",
"String",
"[",
"]",
"oldArray",
",",
"String",
"newElement",
")",
"{",
"// Look for the element first",
"for",
"(",
"String",
"element",
":",
"oldArray",
")",
"{",
"if",
"(",
"element",
".",
"equals",
"(",
"... | Check the array for the new element, and if not found, generate a new
array containing all of the old elements plus the new.
@param oldArray The old array of data
@param newElement The new element we want
@return String[] An array containing all of the old data | [
"Check",
"the",
"array",
"for",
"the",
"new",
"element",
"and",
"if",
"not",
"found",
"generate",
"a",
"new",
"array",
"containing",
"all",
"of",
"the",
"old",
"elements",
"plus",
"the",
"new",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L1017-L1035 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.datastreamExists | private boolean datastreamExists(FedoraClient fedora, String vitalPid,
String dsPid) {
try {
// Some options:
// * getAPIA().listDatastreams... seems best
// * getAPIM().getDatastream... causes Exceptions against new IDs
// * getAPIM().getDatastreams..... | java | private boolean datastreamExists(FedoraClient fedora, String vitalPid,
String dsPid) {
try {
// Some options:
// * getAPIA().listDatastreams... seems best
// * getAPIM().getDatastream... causes Exceptions against new IDs
// * getAPIM().getDatastreams..... | [
"private",
"boolean",
"datastreamExists",
"(",
"FedoraClient",
"fedora",
",",
"String",
"vitalPid",
",",
"String",
"dsPid",
")",
"{",
"try",
"{",
"// Some options:",
"// * getAPIA().listDatastreams... seems best",
"// * getAPIM().getDatastream... causes Exceptions against new IDs... | Test for the existence of a given datastream in VITAL.
@param fedora An instantiated fedora client
@param vitalPid The VITAL PID to use
@param dsPid The datastream ID on the object
@returns boolean True is found, False if not found or there are errors | [
"Test",
"for",
"the",
"existence",
"of",
"a",
"given",
"datastream",
"in",
"VITAL",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L1195-L1213 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.getAltIds | private String[] getAltIds(FedoraClient fedora, String vitalPid,
String dsPid) {
Datastream ds = getDatastream(fedora, vitalPid, dsPid);
if (ds != null) {
return ds.getAltIDs();
}
return new String[]{};
} | java | private String[] getAltIds(FedoraClient fedora, String vitalPid,
String dsPid) {
Datastream ds = getDatastream(fedora, vitalPid, dsPid);
if (ds != null) {
return ds.getAltIDs();
}
return new String[]{};
} | [
"private",
"String",
"[",
"]",
"getAltIds",
"(",
"FedoraClient",
"fedora",
",",
"String",
"vitalPid",
",",
"String",
"dsPid",
")",
"{",
"Datastream",
"ds",
"=",
"getDatastream",
"(",
"fedora",
",",
"vitalPid",
",",
"dsPid",
")",
";",
"if",
"(",
"ds",
"!=... | Find and return any alternate identifiers already in use in fedora for
the given datastream.
@param fedora An instantiated fedora client
@param vitalPid The VITAL PID to use
@param dsPid The datastream ID on the object
@returns String[] An array or String identifiers, will be empty if
datastream does not exist. | [
"Find",
"and",
"return",
"any",
"alternate",
"identifiers",
"already",
"in",
"use",
"in",
"fedora",
"for",
"the",
"given",
"datastream",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L1225-L1232 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.fedoraLogEntry | private String fedoraLogEntry(DigitalObject object, String pid) {
String message = fedoraMessageTemplate.replace("[[PID]]", pid);
return message.replace("[[OID]]", object.getId());
} | java | private String fedoraLogEntry(DigitalObject object, String pid) {
String message = fedoraMessageTemplate.replace("[[PID]]", pid);
return message.replace("[[OID]]", object.getId());
} | [
"private",
"String",
"fedoraLogEntry",
"(",
"DigitalObject",
"object",
",",
"String",
"pid",
")",
"{",
"String",
"message",
"=",
"fedoraMessageTemplate",
".",
"replace",
"(",
"\"[[PID]]\"",
",",
"pid",
")",
";",
"return",
"message",
".",
"replace",
"(",
"\"[[O... | Build a Log entry to use in Fedora. Replace all the template placeholders
@param object The Object being submitted
@param pid The PID in our system | [
"Build",
"a",
"Log",
"entry",
"to",
"use",
"in",
"Fedora",
".",
"Replace",
"all",
"the",
"template",
"placeholders"
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L1260-L1263 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.getTempFile | private File getTempFile(DigitalObject object, String pid)
throws Exception {
// Create file in temp space, use OID in path for uniqueness
File directory = new File(tmpDir, object.getId());
File target = new File(directory, pid);
if (!target.exists()) {
target.get... | java | private File getTempFile(DigitalObject object, String pid)
throws Exception {
// Create file in temp space, use OID in path for uniqueness
File directory = new File(tmpDir, object.getId());
File target = new File(directory, pid);
if (!target.exists()) {
target.get... | [
"private",
"File",
"getTempFile",
"(",
"DigitalObject",
"object",
",",
"String",
"pid",
")",
"throws",
"Exception",
"{",
"// Create file in temp space, use OID in path for uniqueness",
"File",
"directory",
"=",
"new",
"File",
"(",
"tmpDir",
",",
"object",
".",
"getId"... | Stream the data out of storage to our temp directory.
@param object Our digital object.
@param pid The payload ID to retrieve.
@return File The file creating in the temp directory
@throws Exception on any errors | [
"Stream",
"the",
"data",
"out",
"of",
"storage",
"to",
"our",
"temp",
"directory",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L1291-L1325 | train |
redbox-mint/redbox | plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java | VitalTransformer.getBytes | private byte[] getBytes(DigitalObject object, String pid) throws Exception {
// These can happily throw exceptions higher
Payload payload = object.getPayload(pid);
InputStream in = payload.open();
byte[] result = null;
// But here, the payload must receive
// a close bef... | java | private byte[] getBytes(DigitalObject object, String pid) throws Exception {
// These can happily throw exceptions higher
Payload payload = object.getPayload(pid);
InputStream in = payload.open();
byte[] result = null;
// But here, the payload must receive
// a close bef... | [
"private",
"byte",
"[",
"]",
"getBytes",
"(",
"DigitalObject",
"object",
",",
"String",
"pid",
")",
"throws",
"Exception",
"{",
"// These can happily throw exceptions higher",
"Payload",
"payload",
"=",
"object",
".",
"getPayload",
"(",
"pid",
")",
";",
"InputStre... | Retrieve the payload from storage and return as a byte array.
@param object Our digital object.
@param pid The payload ID to retrieve.
@return byte[] The byte array containing payload data
@throws Exception on any errors | [
"Retrieve",
"the",
"payload",
"from",
"storage",
"and",
"return",
"as",
"a",
"byte",
"array",
"."
] | 1db230f218031b85c48c8603cbb04fce7ac6de0c | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transformer/vital-fedora2/src/main/java/com/googlecode/fascinator/redbox/VitalTransformer.java#L1335-L1352 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/tools/ParameterFinder.java | ParameterFinder.find | public static HashMap<String, String> find(HashMap<String, String> props, String path) {
// Kein Pfad angegeben. Also treffen alle.
if (path == null || path.length() == 0)
return props;
// Die neue Map fuer die naechste Runde
HashMap<String, String> next = new HashMap<>();
... | java | public static HashMap<String, String> find(HashMap<String, String> props, String path) {
// Kein Pfad angegeben. Also treffen alle.
if (path == null || path.length() == 0)
return props;
// Die neue Map fuer die naechste Runde
HashMap<String, String> next = new HashMap<>();
... | [
"public",
"static",
"HashMap",
"<",
"String",
",",
"String",
">",
"find",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"props",
",",
"String",
"path",
")",
"{",
"// Kein Pfad angegeben. Also treffen alle.",
"if",
"(",
"path",
"==",
"null",
"||",
"path"... | Sucht in props nach allen Schluesseln im genannten Pfad und liefert sie zurueck.
@param props die Properties, in denen gesucht werden soll.
@param path der Pfad.
Es koennen Wildcards verwendet werden. Etwa so:
Params_*.TAN2StepPar*.ParTAN2Step*.TAN2StepParams*.*secfunc")
@return Liefert die gefundenen Properties. Als... | [
"Sucht",
"in",
"props",
"nach",
"allen",
"Schluesseln",
"im",
"genannten",
"Pfad",
"und",
"liefert",
"sie",
"zurueck",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/tools/ParameterFinder.java#L32-L74 | train |
Chorus-bdd/Chorus | interpreter/chorus/src/main/java/org/chorusbdd/chorus/Chorus.java | Chorus.run | public boolean run() {
boolean passed;
ExecutionToken t = createExecutionToken();
List<FeatureToken> features = getFeatureList(t);
startTests(t, features);
initializeInterpreter();
processFeatures(t, features);
endTests(t, features);
passed = t.getEndState... | java | public boolean run() {
boolean passed;
ExecutionToken t = createExecutionToken();
List<FeatureToken> features = getFeatureList(t);
startTests(t, features);
initializeInterpreter();
processFeatures(t, features);
endTests(t, features);
passed = t.getEndState... | [
"public",
"boolean",
"run",
"(",
")",
"{",
"boolean",
"passed",
";",
"ExecutionToken",
"t",
"=",
"createExecutionToken",
"(",
")",
";",
"List",
"<",
"FeatureToken",
">",
"features",
"=",
"getFeatureList",
"(",
"t",
")",
";",
"startTests",
"(",
"t",
",",
... | Run interpreter using just the base configuration and the listeners provided
@return true, if all tests passed or were marked pending | [
"Run",
"interpreter",
"using",
"just",
"the",
"base",
"configuration",
"and",
"the",
"listeners",
"provided"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus/src/main/java/org/chorusbdd/chorus/Chorus.java#L134-L145 | train |
Chorus-bdd/Chorus | interpreter/chorus/src/main/java/org/chorusbdd/chorus/Chorus.java | Chorus.getSuiteName | public String getSuiteName() {
return configReader.isSet(ChorusConfigProperty.SUITE_NAME) ?
concatenateName(configReader.getValues(ChorusConfigProperty.SUITE_NAME)) :
"";
} | java | public String getSuiteName() {
return configReader.isSet(ChorusConfigProperty.SUITE_NAME) ?
concatenateName(configReader.getValues(ChorusConfigProperty.SUITE_NAME)) :
"";
} | [
"public",
"String",
"getSuiteName",
"(",
")",
"{",
"return",
"configReader",
".",
"isSet",
"(",
"ChorusConfigProperty",
".",
"SUITE_NAME",
")",
"?",
"concatenateName",
"(",
"configReader",
".",
"getValues",
"(",
"ChorusConfigProperty",
".",
"SUITE_NAME",
")",
")",... | to get the suite name we concatenate all the values provided for suite name switch | [
"to",
"get",
"the",
"suite",
"name",
"we",
"concatenate",
"all",
"the",
"values",
"provided",
"for",
"suite",
"name",
"switch"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus/src/main/java/org/chorusbdd/chorus/Chorus.java#L196-L200 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/parsers/ParseCamt05200103.java | ParseCamt05200103.checkDebit | private BigDecimal checkDebit(BigDecimal d, CreditDebitCode code) {
if (d == null || code == null || code == CreditDebitCode.CRDT)
return d;
return BigDecimal.ZERO.subtract(d);
} | java | private BigDecimal checkDebit(BigDecimal d, CreditDebitCode code) {
if (d == null || code == null || code == CreditDebitCode.CRDT)
return d;
return BigDecimal.ZERO.subtract(d);
} | [
"private",
"BigDecimal",
"checkDebit",
"(",
"BigDecimal",
"d",
",",
"CreditDebitCode",
"code",
")",
"{",
"if",
"(",
"d",
"==",
"null",
"||",
"code",
"==",
"null",
"||",
"code",
"==",
"CreditDebitCode",
".",
"CRDT",
")",
"return",
"d",
";",
"return",
"Big... | Prueft, ob es sich um einen Soll-Betrag handelt und setzt in dem Fall ein negatives Vorzeichen vor den Wert.
@param d die zu pruefende Zahl.
@param code das Soll-/Haben-Kennzeichen.
@return der ggf korrigierte Betrag. | [
"Prueft",
"ob",
"es",
"sich",
"um",
"einen",
"Soll",
"-",
"Betrag",
"handelt",
"und",
"setzt",
"in",
"dem",
"Fall",
"ein",
"negatives",
"Vorzeichen",
"vor",
"den",
"Wert",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/parsers/ParseCamt05200103.java#L299-L304 | train |
Chorus-bdd/Chorus | interpreter/chorus-context/src/main/java/org/chorusbdd/chorus/context/ChorusContext.java | ChorusContext.get | @SuppressWarnings({"unchecked", "unused"})
public <T> T get(String key, Class<T> type) {
try {
return (T) state.get(key);
} catch (ClassCastException cce) {
return null;
}
} | java | @SuppressWarnings({"unchecked", "unused"})
public <T> T get(String key, Class<T> type) {
try {
return (T) state.get(key);
} catch (ClassCastException cce) {
return null;
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"unused\"",
"}",
")",
"public",
"<",
"T",
">",
"T",
"get",
"(",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"try",
"{",
"return",
"(",
"T",
")",
"state",
".",
"get",
"... | This get method will return the value if its type matches the type parameter
@param key to lookup
@param type the expected type of the value
@return null if the key does not exist or the type is incorrect | [
"This",
"get",
"method",
"will",
"return",
"the",
"value",
"if",
"its",
"type",
"matches",
"the",
"type",
"parameter"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-context/src/main/java/org/chorusbdd/chorus/context/ChorusContext.java#L85-L92 | train |
Chorus-bdd/Chorus | services/chorus-webagent/src/main/java/org/chorusbdd/chorus/tools/webagent/jettyhandler/AbstractWebAgentHandler.java | AbstractWebAgentHandler.getResourceSuffix | protected String getResourceSuffix(String target) {
int index = target.lastIndexOf('/');
if ( index > -1 ) {
target = target.substring(index + 1);
}
return target;
} | java | protected String getResourceSuffix(String target) {
int index = target.lastIndexOf('/');
if ( index > -1 ) {
target = target.substring(index + 1);
}
return target;
} | [
"protected",
"String",
"getResourceSuffix",
"(",
"String",
"target",
")",
"{",
"int",
"index",
"=",
"target",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
">",
"-",
"1",
")",
"{",
"target",
"=",
"target",
".",
"substring",
"(",
"i... | just find the stylesheet name, disregarding nested folder names | [
"just",
"find",
"the",
"stylesheet",
"name",
"disregarding",
"nested",
"folder",
"names"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/services/chorus-webagent/src/main/java/org/chorusbdd/chorus/tools/webagent/jettyhandler/AbstractWebAgentHandler.java#L71-L77 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/parsers/AbstractCamtParser.java | AbstractCamtParser.trim | protected String trim(String s) {
if (s == null || s.length() == 0)
return s;
return s.trim();
} | java | protected String trim(String s) {
if (s == null || s.length() == 0)
return s;
return s.trim();
} | [
"protected",
"String",
"trim",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"s",
";",
"return",
"s",
".",
"trim",
"(",
")",
";",
"}"
] | Entfernt die Whitespaces des Textes.
Manche Banken fuellen den Gegenkontoinhaber rechts auf 70 Zeichen mit Leerzeichen auf.
@param s der Text. NPE-Sicher.
@return der getrimmte Text. | [
"Entfernt",
"die",
"Whitespaces",
"des",
"Textes",
".",
"Manche",
"Banken",
"fuellen",
"den",
"Gegenkontoinhaber",
"rechts",
"auf",
"70",
"Zeichen",
"mit",
"Leerzeichen",
"auf",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/parsers/AbstractCamtParser.java#L29-L34 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/parsers/AbstractCamtParser.java | AbstractCamtParser.trim | protected List<String> trim(List<String> list) {
if (list == null || list.size() == 0)
return list;
List<String> result = new ArrayList<String>();
for (String s : list) {
s = trim(s);
if (s == null || s.length() == 0)
continue;
r... | java | protected List<String> trim(List<String> list) {
if (list == null || list.size() == 0)
return list;
List<String> result = new ArrayList<String>();
for (String s : list) {
s = trim(s);
if (s == null || s.length() == 0)
continue;
r... | [
"protected",
"List",
"<",
"String",
">",
"trim",
"(",
"List",
"<",
"String",
">",
"list",
")",
"{",
"if",
"(",
"list",
"==",
"null",
"||",
"list",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"list",
";",
"List",
"<",
"String",
">",
"result",... | Entfernt die Whitespaces in der Liste der Texte.
@param list Liste der Texte. NPE-Sicher. Leere Zeilen werden uebersprungen.
@return die getrimmte Liste. | [
"Entfernt",
"die",
"Whitespaces",
"in",
"der",
"Liste",
"der",
"Texte",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/parsers/AbstractCamtParser.java#L42-L57 | train |
Chorus-bdd/Chorus | interpreter/chorus-processes/src/main/java/org/chorusbdd/chorus/processes/manager/ProcessManagerImpl.java | ProcessManagerImpl.startProcess | public synchronized void startProcess(String configName, String processName, Properties processProperties) throws Exception {
ProcessManagerConfig runtimeConfig = getProcessManagerConfig(configName, processProperties);
if ( runtimeConfig.isEnabled()) { //could be disabled in some profiles
... | java | public synchronized void startProcess(String configName, String processName, Properties processProperties) throws Exception {
ProcessManagerConfig runtimeConfig = getProcessManagerConfig(configName, processProperties);
if ( runtimeConfig.isEnabled()) { //could be disabled in some profiles
... | [
"public",
"synchronized",
"void",
"startProcess",
"(",
"String",
"configName",
",",
"String",
"processName",
",",
"Properties",
"processProperties",
")",
"throws",
"Exception",
"{",
"ProcessManagerConfig",
"runtimeConfig",
"=",
"getProcessManagerConfig",
"(",
"configName"... | Starts a record Java process using properties defined in a properties file alongside the feature file
@throws Exception | [
"Starts",
"a",
"record",
"Java",
"process",
"using",
"properties",
"defined",
"in",
"a",
"properties",
"file",
"alongside",
"the",
"feature",
"file"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-processes/src/main/java/org/chorusbdd/chorus/processes/manager/ProcessManagerImpl.java#L88-L97 | train |
Chorus-bdd/Chorus | interpreter/chorus-processes/src/main/java/org/chorusbdd/chorus/processes/manager/ProcessManagerImpl.java | ProcessManagerImpl.incrementPortsIfDuplicateName | private void incrementPortsIfDuplicateName(String configName, ProcessConfigBean config) {
int startedCount = getNumberOfInstancesStarted(configName);
int debugPort = config.getDebugPort();
if ( debugPort != -1) {
config.setDebugPort(debugPort + startedCount);
}
int ... | java | private void incrementPortsIfDuplicateName(String configName, ProcessConfigBean config) {
int startedCount = getNumberOfInstancesStarted(configName);
int debugPort = config.getDebugPort();
if ( debugPort != -1) {
config.setDebugPort(debugPort + startedCount);
}
int ... | [
"private",
"void",
"incrementPortsIfDuplicateName",
"(",
"String",
"configName",
",",
"ProcessConfigBean",
"config",
")",
"{",
"int",
"startedCount",
"=",
"getNumberOfInstancesStarted",
"(",
"configName",
")",
";",
"int",
"debugPort",
"=",
"config",
".",
"getDebugPort... | If we already have an instance of a process with this name, auto increment ports to avoid a conflict | [
"If",
"we",
"already",
"have",
"an",
"instance",
"of",
"a",
"process",
"with",
"this",
"name",
"auto",
"increment",
"ports",
"to",
"avoid",
"a",
"conflict"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-processes/src/main/java/org/chorusbdd/chorus/processes/manager/ProcessManagerImpl.java#L120-L132 | train |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/StepProcessor.java | StepProcessor.runSteps | public StepEndState runSteps(ExecutionToken executionToken, StepInvokerProvider stepInvokerProvider, List<StepToken> stepList, StepCatalogue stepCatalogue, boolean skip) {
for (StepToken step : stepList) {
StepEndState endState = processStep(executionToken, stepInvokerProvider, step, stepCatalogue,... | java | public StepEndState runSteps(ExecutionToken executionToken, StepInvokerProvider stepInvokerProvider, List<StepToken> stepList, StepCatalogue stepCatalogue, boolean skip) {
for (StepToken step : stepList) {
StepEndState endState = processStep(executionToken, stepInvokerProvider, step, stepCatalogue,... | [
"public",
"StepEndState",
"runSteps",
"(",
"ExecutionToken",
"executionToken",
",",
"StepInvokerProvider",
"stepInvokerProvider",
",",
"List",
"<",
"StepToken",
">",
"stepList",
",",
"StepCatalogue",
"stepCatalogue",
",",
"boolean",
"skip",
")",
"{",
"for",
"(",
"St... | Process all steps in stepList
@param skip, do not actually execute (but mark as skipped if not unimplemented)
@return a StepEndState is the StepMacro step's end state, if these steps are executed as part of a StepMacro rather than scenario | [
"Process",
"all",
"steps",
"in",
"stepList"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/StepProcessor.java#L84-L114 | train |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/StepProcessor.java | StepProcessor.sortInvokersByPattern | private void sortInvokersByPattern(List<StepInvoker> stepInvokers) {
Collections.sort(stepInvokers, new Comparator<StepInvoker>() {
public int compare(StepInvoker o1, StepInvoker o2) {
return o1.getStepPattern().toString().compareTo(o2.getStepPattern().toString());
}
... | java | private void sortInvokersByPattern(List<StepInvoker> stepInvokers) {
Collections.sort(stepInvokers, new Comparator<StepInvoker>() {
public int compare(StepInvoker o1, StepInvoker o2) {
return o1.getStepPattern().toString().compareTo(o2.getStepPattern().toString());
}
... | [
"private",
"void",
"sortInvokersByPattern",
"(",
"List",
"<",
"StepInvoker",
">",
"stepInvokers",
")",
"{",
"Collections",
".",
"sort",
"(",
"stepInvokers",
",",
"new",
"Comparator",
"<",
"StepInvoker",
">",
"(",
")",
"{",
"public",
"int",
"compare",
"(",
"S... | prefer fully determinate behaviour. The only sensible solution is to sort by pattern | [
"prefer",
"fully",
"determinate",
"behaviour",
".",
"The",
"only",
"sensible",
"solution",
"is",
"to",
"sort",
"by",
"pattern"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/StepProcessor.java#L190-L196 | train |
IBM-Cloud/gp-java-client | src/main/java/com/ibm/g11n/pipeline/client/DocumentTranslationRequestData.java | DocumentTranslationRequestData.getTargetLanguagesMap | public Map<String, Map<String, Set<String>>> getTargetLanguagesMap() {
if (targetLanguagesMap == null) {
assert false;
return Collections.emptyMap();
}
return Collections.unmodifiableMap(targetLanguagesMap);
} | java | public Map<String, Map<String, Set<String>>> getTargetLanguagesMap() {
if (targetLanguagesMap == null) {
assert false;
return Collections.emptyMap();
}
return Collections.unmodifiableMap(targetLanguagesMap);
} | [
"public",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
">",
"getTargetLanguagesMap",
"(",
")",
"{",
"if",
"(",
"targetLanguagesMap",
"==",
"null",
")",
"{",
"assert",
"false",
";",
"return",
"Collections",
".",
... | Returns the map containing target languages indexed by document type and ids.
This method always returns non-null map.
@return The map containing target languages indexed by document type and ids. | [
"Returns",
"the",
"map",
"containing",
"target",
"languages",
"indexed",
"by",
"document",
"type",
"and",
"ids",
".",
"This",
"method",
"always",
"returns",
"non",
"-",
"null",
"map",
"."
] | b015a081d7a7313bc48c448087fbc07bce860427 | https://github.com/IBM-Cloud/gp-java-client/blob/b015a081d7a7313bc48c448087fbc07bce860427/src/main/java/com/ibm/g11n/pipeline/client/DocumentTranslationRequestData.java#L88-L94 | train |
imsweb/seerapi-client-java | src/main/java/com/imsweb/seerapi/client/staging/cs/CsStagingData.java | CsStagingData.getSsf | public String getSsf(Integer id) {
if (id < 1 || id > 25)
throw new IllegalStateException("Site specific factor must be between 1 and 25.");
return getInput(INPUT_SSF_PREFIX + id);
} | java | public String getSsf(Integer id) {
if (id < 1 || id > 25)
throw new IllegalStateException("Site specific factor must be between 1 and 25.");
return getInput(INPUT_SSF_PREFIX + id);
} | [
"public",
"String",
"getSsf",
"(",
"Integer",
"id",
")",
"{",
"if",
"(",
"id",
"<",
"1",
"||",
"id",
">",
"25",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Site specific factor must be between 1 and 25.\"",
")",
";",
"return",
"getInput",
"(",
"INPUT... | Get the specified input site-specific factor
@param id site-specific factor number
@return ssf value | [
"Get",
"the",
"specified",
"input",
"site",
"-",
"specific",
"factor"
] | 04f509961c3a5ece7b232ecb8d8cb8f89d810a85 | https://github.com/imsweb/seerapi-client-java/blob/04f509961c3a5ece7b232ecb8d8cb8f89d810a85/src/main/java/com/imsweb/seerapi/client/staging/cs/CsStagingData.java#L191-L196 | train |
imsweb/seerapi-client-java | src/main/java/com/imsweb/seerapi/client/staging/cs/CsStagingData.java | CsStagingData.setSsf | public void setSsf(Integer id, String ssf) {
if (id < 1 || id > 25)
throw new IllegalStateException("Site specific factor must be between 1 and 25.");
setInput(INPUT_SSF_PREFIX + id, ssf);
} | java | public void setSsf(Integer id, String ssf) {
if (id < 1 || id > 25)
throw new IllegalStateException("Site specific factor must be between 1 and 25.");
setInput(INPUT_SSF_PREFIX + id, ssf);
} | [
"public",
"void",
"setSsf",
"(",
"Integer",
"id",
",",
"String",
"ssf",
")",
"{",
"if",
"(",
"id",
"<",
"1",
"||",
"id",
">",
"25",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Site specific factor must be between 1 and 25.\"",
")",
";",
"setInput",
... | Set the specified input site-specific factor
@param id site-specific factor number
@param ssf site-specfic factor value | [
"Set",
"the",
"specified",
"input",
"site",
"-",
"specific",
"factor"
] | 04f509961c3a5ece7b232ecb8d8cb8f89d810a85 | https://github.com/imsweb/seerapi-client-java/blob/04f509961c3a5ece7b232ecb8d8cb8f89d810a85/src/main/java/com/imsweb/seerapi/client/staging/cs/CsStagingData.java#L203-L208 | train |
Chorus-bdd/Chorus | extensions/chorus-websockets/src/main/java/org/chorusbdd/chorus/websockets/client/WebSocketStepPublisher.java | WebSocketStepPublisher.addStepInvoker | private void addStepInvoker(StepInvoker stepInvoker) {
if ( connected.get() ) {
throw new ChorusException("You cannot add more steps once the WebSocketStepPublisher is connected");
}
stepInvokers.put(stepInvoker.getId(), stepInvoker);
} | java | private void addStepInvoker(StepInvoker stepInvoker) {
if ( connected.get() ) {
throw new ChorusException("You cannot add more steps once the WebSocketStepPublisher is connected");
}
stepInvokers.put(stepInvoker.getId(), stepInvoker);
} | [
"private",
"void",
"addStepInvoker",
"(",
"StepInvoker",
"stepInvoker",
")",
"{",
"if",
"(",
"connected",
".",
"get",
"(",
")",
")",
"{",
"throw",
"new",
"ChorusException",
"(",
"\"You cannot add more steps once the WebSocketStepPublisher is connected\"",
")",
";",
"}... | Add a step to be published | [
"Add",
"a",
"step",
"to",
"be",
"published"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/extensions/chorus-websockets/src/main/java/org/chorusbdd/chorus/websockets/client/WebSocketStepPublisher.java#L124-L129 | train |
Chorus-bdd/Chorus | extensions/chorus-websockets/src/main/java/org/chorusbdd/chorus/websockets/client/WebSocketStepPublisher.java | WebSocketStepPublisher.publish | public WebSocketStepPublisher publish() {
if (connected.getAndSet(true) == false) {
try {
log.info("Connecting");
boolean connected = chorusWebSocketClient.connectBlocking();
if ( ! connected) {
throw new StepPublisherException("F... | java | public WebSocketStepPublisher publish() {
if (connected.getAndSet(true) == false) {
try {
log.info("Connecting");
boolean connected = chorusWebSocketClient.connectBlocking();
if ( ! connected) {
throw new StepPublisherException("F... | [
"public",
"WebSocketStepPublisher",
"publish",
"(",
")",
"{",
"if",
"(",
"connected",
".",
"getAndSet",
"(",
"true",
")",
"==",
"false",
")",
"{",
"try",
"{",
"log",
".",
"info",
"(",
"\"Connecting\"",
")",
";",
"boolean",
"connected",
"=",
"chorusWebSocke... | Connect to the server and publish all steps | [
"Connect",
"to",
"the",
"server",
"and",
"publish",
"all",
"steps"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/extensions/chorus-websockets/src/main/java/org/chorusbdd/chorus/websockets/client/WebSocketStepPublisher.java#L135-L165 | train |
Chorus-bdd/Chorus | interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java | ChorusAssert.assertEquals | static public void assertEquals(String message, float expected, float actual, float delta) {
if (Float.compare(expected, actual) == 0)
return;
if (!(Math.abs(expected - actual) <= delta))
failNotEquals(message, new Float(expected), new Float(actual));
} | java | static public void assertEquals(String message, float expected, float actual, float delta) {
if (Float.compare(expected, actual) == 0)
return;
if (!(Math.abs(expected - actual) <= delta))
failNotEquals(message, new Float(expected), new Float(actual));
} | [
"static",
"public",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"float",
"expected",
",",
"float",
"actual",
",",
"float",
"delta",
")",
"{",
"if",
"(",
"Float",
".",
"compare",
"(",
"expected",
",",
"actual",
")",
"==",
"0",
")",
"return",
... | Asserts that two floats are equal concerning a positive delta. If they
are not an AssertionFailedError is thrown with the given message. If the
expected value is infinity then the delta value is ignored. | [
"Asserts",
"that",
"two",
"floats",
"are",
"equal",
"concerning",
"a",
"positive",
"delta",
".",
"If",
"they",
"are",
"not",
"an",
"AssertionFailedError",
"is",
"thrown",
"with",
"the",
"given",
"message",
".",
"If",
"the",
"expected",
"value",
"is",
"infini... | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java#L146-L151 | train |
Chorus-bdd/Chorus | interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java | ChorusAssert.assertEquals | static public void assertEquals(String message, char expected, char actual) {
assertEquals(message, new Character(expected), new Character(actual));
} | java | static public void assertEquals(String message, char expected, char actual) {
assertEquals(message, new Character(expected), new Character(actual));
} | [
"static",
"public",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"char",
"expected",
",",
"char",
"actual",
")",
"{",
"assertEquals",
"(",
"message",
",",
"new",
"Character",
"(",
"expected",
")",
",",
"new",
"Character",
"(",
"actual",
")",
")",... | Asserts that two chars are equal. If they are not
an AssertionFailedError is thrown with the given message. | [
"Asserts",
"that",
"two",
"chars",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"an",
"AssertionFailedError",
"is",
"thrown",
"with",
"the",
"given",
"message",
"."
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java#L202-L204 | train |
Chorus-bdd/Chorus | interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java | ChorusAssert.assertEquals | static public void assertEquals(String message, short expected, short actual) {
assertEquals(message, new Short(expected), new Short(actual));
} | java | static public void assertEquals(String message, short expected, short actual) {
assertEquals(message, new Short(expected), new Short(actual));
} | [
"static",
"public",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"short",
"expected",
",",
"short",
"actual",
")",
"{",
"assertEquals",
"(",
"message",
",",
"new",
"Short",
"(",
"expected",
")",
",",
"new",
"Short",
"(",
"actual",
")",
")",
";"... | Asserts that two shorts are equal. If they are not
an AssertionFailedError is thrown with the given message. | [
"Asserts",
"that",
"two",
"shorts",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"an",
"AssertionFailedError",
"is",
"thrown",
"with",
"the",
"given",
"message",
"."
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java#L215-L217 | train |
Chorus-bdd/Chorus | interpreter/chorus-handlerconfig/src/main/java/org/chorusbdd/chorus/handlerconfig/configproperty/ConfigPropertyParser.java | ConfigPropertyParser.getDefaultValidationPattern | private Optional<Pattern> getDefaultValidationPattern(Class javaType) {
return javaType.isEnum() ?
Optional.of(createValidationPatternFromEnumType(javaType)) :
getDefaultPatternIfPrimitive(javaType);
} | java | private Optional<Pattern> getDefaultValidationPattern(Class javaType) {
return javaType.isEnum() ?
Optional.of(createValidationPatternFromEnumType(javaType)) :
getDefaultPatternIfPrimitive(javaType);
} | [
"private",
"Optional",
"<",
"Pattern",
">",
"getDefaultValidationPattern",
"(",
"Class",
"javaType",
")",
"{",
"return",
"javaType",
".",
"isEnum",
"(",
")",
"?",
"Optional",
".",
"of",
"(",
"createValidationPatternFromEnumType",
"(",
"javaType",
")",
")",
":",
... | Try to create a sensible default for validation pattern, in the case where the java type
of the parameter is an enum type or a primitive or primitive wrapper type
@param javaType
@return | [
"Try",
"to",
"create",
"a",
"sensible",
"default",
"for",
"validation",
"pattern",
"in",
"the",
"case",
"where",
"the",
"java",
"type",
"of",
"the",
"parameter",
"is",
"an",
"enum",
"type",
"or",
"a",
"primitive",
"or",
"primitive",
"wrapper",
"type"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-handlerconfig/src/main/java/org/chorusbdd/chorus/handlerconfig/configproperty/ConfigPropertyParser.java#L158-L162 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/protocol/MultipleSyntaxElements.java | MultipleSyntaxElements.containsOnly | private boolean containsOnly(String s, char c) {
for (char c2 : s.toCharArray()) {
if (c != c2)
return false;
}
return true;
} | java | private boolean containsOnly(String s, char c) {
for (char c2 : s.toCharArray()) {
if (c != c2)
return false;
}
return true;
} | [
"private",
"boolean",
"containsOnly",
"(",
"String",
"s",
",",
"char",
"c",
")",
"{",
"for",
"(",
"char",
"c2",
":",
"s",
".",
"toCharArray",
"(",
")",
")",
"{",
"if",
"(",
"c",
"!=",
"c2",
")",
"return",
"false",
";",
"}",
"return",
"true",
";",... | Prueft, ob der Text s nur aus dem Zeichen c besteht.
@param s der Text.
@param c das Zeichen.
@return true, wenn der Text nur dieses Zeichen enthaelt. | [
"Prueft",
"ob",
"der",
"Text",
"s",
"nur",
"aus",
"dem",
"Zeichen",
"c",
"besteht",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/protocol/MultipleSyntaxElements.java#L533-L540 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/AbstractSEPAGV.java | AbstractSEPAGV.getPainGenerator | protected final PainGeneratorIf getPainGenerator() {
if (this.generator == null) {
try {
this.generator = PainGeneratorFactory.get(this, this.getPainVersion());
} catch (Exception e) {
String msg = HBCIUtils.getLocMsg("EXCMSG_JOB_CREATE_ERR", this.getPainJ... | java | protected final PainGeneratorIf getPainGenerator() {
if (this.generator == null) {
try {
this.generator = PainGeneratorFactory.get(this, this.getPainVersion());
} catch (Exception e) {
String msg = HBCIUtils.getLocMsg("EXCMSG_JOB_CREATE_ERR", this.getPainJ... | [
"protected",
"final",
"PainGeneratorIf",
"getPainGenerator",
"(",
")",
"{",
"if",
"(",
"this",
".",
"generator",
"==",
"null",
")",
"{",
"try",
"{",
"this",
".",
"generator",
"=",
"PainGeneratorFactory",
".",
"get",
"(",
"this",
",",
"this",
".",
"getPainV... | Liefert den passenden SEPA-Generator.
@return der SEPA-Generator. | [
"Liefert",
"den",
"passenden",
"SEPA",
"-",
"Generator",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/AbstractSEPAGV.java#L218-L229 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/protocol/SyntaxElement.java | SyntaxElement.enumerateSegs | public int enumerateSegs(int startValue, boolean allowOverwrite) {
int idx = startValue;
for (MultipleSyntaxElements s : getChildContainers()) {
if (s != null)
idx = s.enumerateSegs(idx, allowOverwrite);
}
return idx;
} | java | public int enumerateSegs(int startValue, boolean allowOverwrite) {
int idx = startValue;
for (MultipleSyntaxElements s : getChildContainers()) {
if (s != null)
idx = s.enumerateSegs(idx, allowOverwrite);
}
return idx;
} | [
"public",
"int",
"enumerateSegs",
"(",
"int",
"startValue",
",",
"boolean",
"allowOverwrite",
")",
"{",
"int",
"idx",
"=",
"startValue",
";",
"for",
"(",
"MultipleSyntaxElements",
"s",
":",
"getChildContainers",
"(",
")",
")",
"{",
"if",
"(",
"s",
"!=",
"n... | loop through all child-elements; the segments found there
will be sequentially enumerated starting with num startValue;
if startValue is zero, the segments will not be enumerated,
but all given the number 0
@param startValue value to be used for the first segment found
@return next sequence number usable for enumerati... | [
"loop",
"through",
"all",
"child",
"-",
"elements",
";",
"the",
"segments",
"found",
"there",
"will",
"be",
"sequentially",
"enumerated",
"starting",
"with",
"num",
"startValue",
";",
"if",
"startValue",
"is",
"zero",
"the",
"segments",
"will",
"not",
"be",
... | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/protocol/SyntaxElement.java#L315-L324 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/protocol/SyntaxElement.java | SyntaxElement.extractValues | public void extractValues(HashMap<String, String> values) {
for (MultipleSyntaxElements l : childContainers) {
l.extractValues(values);
}
} | java | public void extractValues(HashMap<String, String> values) {
for (MultipleSyntaxElements l : childContainers) {
l.extractValues(values);
}
} | [
"public",
"void",
"extractValues",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"values",
")",
"{",
"for",
"(",
"MultipleSyntaxElements",
"l",
":",
"childContainers",
")",
"{",
"l",
".",
"extractValues",
"(",
"values",
")",
";",
"}",
"}"
] | fuellt die hashtable 'values' mit den werten der de-syntaxelemente; dazu
wird in allen anderen typen von syntaxelementen die liste der
child-elemente durchlaufen und deren 'fillValues' methode aufgerufen | [
"fuellt",
"die",
"hashtable",
"values",
"mit",
"den",
"werten",
"der",
"de",
"-",
"syntaxelemente",
";",
"dazu",
"wird",
"in",
"allen",
"anderen",
"typen",
"von",
"syntaxelementen",
"die",
"liste",
"der",
"child",
"-",
"elemente",
"durchlaufen",
"und",
"deren"... | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/protocol/SyntaxElement.java#L443-L447 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/protocol/SyntaxElement.java | SyntaxElement.validate | public void validate() {
if (!needsRequestTag || haveRequestTag) {
for (MultipleSyntaxElements l : childContainers) {
l.validate();
}
/* wenn keine exception geworfen wurde, dann ist das aktuelle element
offensichtlich valid */
setV... | java | public void validate() {
if (!needsRequestTag || haveRequestTag) {
for (MultipleSyntaxElements l : childContainers) {
l.validate();
}
/* wenn keine exception geworfen wurde, dann ist das aktuelle element
offensichtlich valid */
setV... | [
"public",
"void",
"validate",
"(",
")",
"{",
"if",
"(",
"!",
"needsRequestTag",
"||",
"haveRequestTag",
")",
"{",
"for",
"(",
"MultipleSyntaxElements",
"l",
":",
"childContainers",
")",
"{",
"l",
".",
"validate",
"(",
")",
";",
"}",
"/* wenn keine exception ... | ueberpreuft, ob das syntaxelement alle restriktionen einhaelt; ist das
nicht der fall, so wird eine Exception ausgeloest. die meisten
syntaxelemente koennen sich nicht selbst ueberpruefen, sondern rufen statt
dessen die validate-funktion der child-elemente auf | [
"ueberpreuft",
"ob",
"das",
"syntaxelement",
"alle",
"restriktionen",
"einhaelt",
";",
"ist",
"das",
"nicht",
"der",
"fall",
"so",
"wird",
"eine",
"Exception",
"ausgeloest",
".",
"die",
"meisten",
"syntaxelemente",
"koennen",
"sich",
"nicht",
"selbst",
"ueberpruef... | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/protocol/SyntaxElement.java#L705-L715 | train |
Chorus-bdd/Chorus | interpreter/chorus-remoting/src/main/java/org/chorusbdd/chorus/remoting/jmx/remotingmanager/ChorusHandlerJmxProxy.java | ChorusHandlerJmxProxy.invokeStep | public Object invokeStep(String remoteStepInvokerId, String stepTokenId, List<String> params) throws Exception {
try {
//call the remote method
Object[] args = {remoteStepInvokerId, stepTokenId, ChorusContext.getContext().getSnapshot(), params};
String[] signature = {"java.la... | java | public Object invokeStep(String remoteStepInvokerId, String stepTokenId, List<String> params) throws Exception {
try {
//call the remote method
Object[] args = {remoteStepInvokerId, stepTokenId, ChorusContext.getContext().getSnapshot(), params};
String[] signature = {"java.la... | [
"public",
"Object",
"invokeStep",
"(",
"String",
"remoteStepInvokerId",
",",
"String",
"stepTokenId",
",",
"List",
"<",
"String",
">",
"params",
")",
"throws",
"Exception",
"{",
"try",
"{",
"//call the remote method",
"Object",
"[",
"]",
"args",
"=",
"{",
"rem... | Calls the invoke Step method on the remote MBean. The current ChorusContext will be
serialized as part of this and marshalled to the remote bean.
@param remoteStepInvokerId the id of the step to call
@param params params to pass in the call | [
"Calls",
"the",
"invoke",
"Step",
"method",
"on",
"the",
"remote",
"MBean",
".",
"The",
"current",
"ChorusContext",
"will",
"be",
"serialized",
"as",
"part",
"of",
"this",
"and",
"marshalled",
"to",
"the",
"remote",
"bean",
"."
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-remoting/src/main/java/org/chorusbdd/chorus/remoting/jmx/remotingmanager/ChorusHandlerJmxProxy.java#L89-L106 | train |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java | HandlerManager.processStartOfScope | public void processStartOfScope(Scope scopeStarting, Iterable<Object> handlerInstances) throws Exception {
for (Object handler : handlerInstances) {
Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
Scope handlerScope = handlerAnnotation.scope();
i... | java | public void processStartOfScope(Scope scopeStarting, Iterable<Object> handlerInstances) throws Exception {
for (Object handler : handlerInstances) {
Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
Scope handlerScope = handlerAnnotation.scope();
i... | [
"public",
"void",
"processStartOfScope",
"(",
"Scope",
"scopeStarting",
",",
"Iterable",
"<",
"Object",
">",
"handlerInstances",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Object",
"handler",
":",
"handlerInstances",
")",
"{",
"Handler",
"handlerAnnotation",
"=... | Scope is starting, perform the required processing on the supplied handlers. | [
"Scope",
"is",
"starting",
"perform",
"the",
"required",
"processing",
"on",
"the",
"supplied",
"handlers",
"."
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java#L117-L125 | train |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java | HandlerManager.processEndOfScope | public void processEndOfScope(Scope scopeEnding, Iterable<Object> handlerInstances) throws Exception {
for (Object handler : handlerInstances) {
Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
Scope scope = handlerAnnotation.scope();
runLifecycle... | java | public void processEndOfScope(Scope scopeEnding, Iterable<Object> handlerInstances) throws Exception {
for (Object handler : handlerInstances) {
Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
Scope scope = handlerAnnotation.scope();
runLifecycle... | [
"public",
"void",
"processEndOfScope",
"(",
"Scope",
"scopeEnding",
",",
"Iterable",
"<",
"Object",
">",
"handlerInstances",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Object",
"handler",
":",
"handlerInstances",
")",
"{",
"Handler",
"handlerAnnotation",
"=",
... | Scope is ending, perform the required processing on the supplied handlers. | [
"Scope",
"is",
"ending",
"perform",
"the",
"required",
"processing",
"on",
"the",
"supplied",
"handlers",
"."
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java#L149-L161 | train |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java | HandlerManager.getMethodScope | private Scope getMethodScope(boolean isDestroy, Method method) {
Scope methodScope;
if ( isDestroy ) {
Destroy annotation = method.getAnnotation(Destroy.class);
methodScope = annotation != null ? annotation.scope() : null;
} else {
Initialize annotation = meth... | java | private Scope getMethodScope(boolean isDestroy, Method method) {
Scope methodScope;
if ( isDestroy ) {
Destroy annotation = method.getAnnotation(Destroy.class);
methodScope = annotation != null ? annotation.scope() : null;
} else {
Initialize annotation = meth... | [
"private",
"Scope",
"getMethodScope",
"(",
"boolean",
"isDestroy",
",",
"Method",
"method",
")",
"{",
"Scope",
"methodScope",
";",
"if",
"(",
"isDestroy",
")",
"{",
"Destroy",
"annotation",
"=",
"method",
".",
"getAnnotation",
"(",
"Destroy",
".",
"class",
"... | return the scope of a lifecycle method, or null if the method is not a lifecycle method | [
"return",
"the",
"scope",
"of",
"a",
"lifecycle",
"method",
"or",
"null",
"if",
"the",
"method",
"is",
"not",
"a",
"lifecycle",
"method"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java#L190-L200 | train |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java | HandlerManager.injectResourceFields | private void injectResourceFields(Object handler, Iterable<Object> handlerInstances, Scope... scopes) {
Class<?> featureClass = handler.getClass();
List<Field> allFields = new ArrayList<>();
addAllPublicFields(featureClass, allFields);
log.trace("Now examining handler fields for ChorusR... | java | private void injectResourceFields(Object handler, Iterable<Object> handlerInstances, Scope... scopes) {
Class<?> featureClass = handler.getClass();
List<Field> allFields = new ArrayList<>();
addAllPublicFields(featureClass, allFields);
log.trace("Now examining handler fields for ChorusR... | [
"private",
"void",
"injectResourceFields",
"(",
"Object",
"handler",
",",
"Iterable",
"<",
"Object",
">",
"handlerInstances",
",",
"Scope",
"...",
"scopes",
")",
"{",
"Class",
"<",
"?",
">",
"featureClass",
"=",
"handler",
".",
"getClass",
"(",
")",
";",
"... | Here we set the values of any handler fields annotated with @ChorusResource | [
"Here",
"we",
"set",
"the",
"values",
"of",
"any",
"handler",
"fields",
"annotated",
"with"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/interpreter/HandlerManager.java#L217-L228 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/sepa/SepaVersion.java | SepaVersion.byURN | public static SepaVersion byURN(String urn) {
SepaVersion test = new SepaVersion(null, 0, urn, null, false);
if (urn == null || urn.length() == 0)
return test;
for (List<SepaVersion> types : knownVersions.values()) {
for (SepaVersion v : types) {
if (v.e... | java | public static SepaVersion byURN(String urn) {
SepaVersion test = new SepaVersion(null, 0, urn, null, false);
if (urn == null || urn.length() == 0)
return test;
for (List<SepaVersion> types : knownVersions.values()) {
for (SepaVersion v : types) {
if (v.e... | [
"public",
"static",
"SepaVersion",
"byURN",
"(",
"String",
"urn",
")",
"{",
"SepaVersion",
"test",
"=",
"new",
"SepaVersion",
"(",
"null",
",",
"0",
",",
"urn",
",",
"null",
",",
"false",
")",
";",
"if",
"(",
"urn",
"==",
"null",
"||",
"urn",
".",
... | Liefert die SEPA-Version aus dem URN.
@param urn URN.
In der Form "urn:iso:std:iso:20022:tech:xsd:pain.001.002.03" oder in
der alten Form "sepade.pain.001.001.02.xsd".
@return die SEPA-Version. | [
"Liefert",
"die",
"SEPA",
"-",
"Version",
"aus",
"dem",
"URN",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/sepa/SepaVersion.java#L157-L172 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/sepa/SepaVersion.java | SepaVersion.findType | private static Type findType(String type, String value) throws IllegalArgumentException {
if (type == null || type.length() == 0)
throw new IllegalArgumentException("no SEPA type type given");
if (value == null || value.length() == 0)
throw new IllegalArgumentException("no SEPA ... | java | private static Type findType(String type, String value) throws IllegalArgumentException {
if (type == null || type.length() == 0)
throw new IllegalArgumentException("no SEPA type type given");
if (value == null || value.length() == 0)
throw new IllegalArgumentException("no SEPA ... | [
"private",
"static",
"Type",
"findType",
"(",
"String",
"type",
",",
"String",
"value",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"type",
"==",
"null",
"||",
"type",
".",
"length",
"(",
")",
"==",
"0",
")",
"throw",
"new",
"IllegalArgument... | Liefert den enum-Type fuer den angegebenen Wert.
@param type der Type. "pain", "camt".
@param value der Wert. 001, 002, 008, ....
@return der zugehoerige Enum-Wert.
@throws IllegalArgumentException wenn der Typ unbekannt ist. | [
"Liefert",
"den",
"enum",
"-",
"Type",
"fuer",
"den",
"angegebenen",
"Wert",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/sepa/SepaVersion.java#L182-L194 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/sepa/SepaVersion.java | SepaVersion.autodetect | public static SepaVersion autodetect(InputStream xml) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringComments(true);
factory.setValidating(false);
factory.setNamespaceAware(true);
DocumentBuilder buil... | java | public static SepaVersion autodetect(InputStream xml) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringComments(true);
factory.setValidating(false);
factory.setNamespaceAware(true);
DocumentBuilder buil... | [
"public",
"static",
"SepaVersion",
"autodetect",
"(",
"InputStream",
"xml",
")",
"{",
"try",
"{",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setIgnoringComments",
"(",
"true",
")",
";",
... | Ermittelt die SEPA-Version aus dem uebergebenen XML-Stream.
@param xml der XML-Stream.
Achtung: Da der Stream hierbei gelesen werden muss, sollte eine Kopie des Streams uebergeben werden.
Denn nach dem Lesen des Streams, kann er nicht erneut gelesen werden.
Der Stream wird von dieser Methode nicht geschlossen. Das ist... | [
"Ermittelt",
"die",
"SEPA",
"-",
"Version",
"aus",
"dem",
"uebergebenen",
"XML",
"-",
"Stream",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/sepa/SepaVersion.java#L236-L260 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/sepa/SepaVersion.java | SepaVersion.getGeneratorClass | public String getGeneratorClass(String jobName) {
StringBuilder sb = new StringBuilder();
sb.append(PainGeneratorIf.class.getPackage().getName());
sb.append(".Gen");
sb.append(jobName);
sb.append(this.type.getValue());
sb.append(new DecimalFormat(DF_MAJOR).format(this.maj... | java | public String getGeneratorClass(String jobName) {
StringBuilder sb = new StringBuilder();
sb.append(PainGeneratorIf.class.getPackage().getName());
sb.append(".Gen");
sb.append(jobName);
sb.append(this.type.getValue());
sb.append(new DecimalFormat(DF_MAJOR).format(this.maj... | [
"public",
"String",
"getGeneratorClass",
"(",
"String",
"jobName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"PainGeneratorIf",
".",
"class",
".",
"getPackage",
"(",
")",
".",
"getName",
"(",
")"... | Erzeugt den Namen der Java-Klasse des zugehoerigen SEPA-Generators.
@param jobName der Job-Name. Z.Bsp. "UebSEPA".
@return der Name der Java-Klasse des zugehoerigen SEPA-Generators. | [
"Erzeugt",
"den",
"Namen",
"der",
"Java",
"-",
"Klasse",
"des",
"zugehoerigen",
"SEPA",
"-",
"Generators",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/sepa/SepaVersion.java#L332-L342 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/sepa/SepaVersion.java | SepaVersion.getParserClass | public String getParserClass() {
StringBuilder sb = new StringBuilder();
sb.append(ISEPAParser.class.getPackage().getName());
sb.append(".Parse");
sb.append(this.type.getType());
sb.append(this.type.getValue());
sb.append(new DecimalFormat(DF_MAJOR).format(this.major));
... | java | public String getParserClass() {
StringBuilder sb = new StringBuilder();
sb.append(ISEPAParser.class.getPackage().getName());
sb.append(".Parse");
sb.append(this.type.getType());
sb.append(this.type.getValue());
sb.append(new DecimalFormat(DF_MAJOR).format(this.major));
... | [
"public",
"String",
"getParserClass",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"ISEPAParser",
".",
"class",
".",
"getPackage",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"sb",
".",
... | Erzeugt den Namen der Java-Klasse des zugehoerigen SEPA-Parsers.
@return der Name der Java-Klasse des zugehoerigen SEPA-Parsers. | [
"Erzeugt",
"den",
"Namen",
"der",
"Java",
"-",
"Klasse",
"des",
"zugehoerigen",
"SEPA",
"-",
"Parsers",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/sepa/SepaVersion.java#L349-L360 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/sepa/SepaVersion.java | SepaVersion.canGenerate | public boolean canGenerate(String jobName) {
try {
Class.forName(this.getGeneratorClass(jobName));
return true;
} catch (ClassNotFoundException e) {
return false;
}
} | java | public boolean canGenerate(String jobName) {
try {
Class.forName(this.getGeneratorClass(jobName));
return true;
} catch (ClassNotFoundException e) {
return false;
}
} | [
"public",
"boolean",
"canGenerate",
"(",
"String",
"jobName",
")",
"{",
"try",
"{",
"Class",
".",
"forName",
"(",
"this",
".",
"getGeneratorClass",
"(",
"jobName",
")",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",... | Prueft, ob fuer die SEPA-Version ein Generator vorhanden ist, der
fuer den angegebenen HBCI4Java-Job die SEPA-XML-Dateien erzeugen kann.
@param jobName der Job-Name. Z.Bsp. "UebSEPA".
@return true, wenn ein Generator vorhanden ist. | [
"Prueft",
"ob",
"fuer",
"die",
"SEPA",
"-",
"Version",
"ein",
"Generator",
"vorhanden",
"ist",
"der",
"fuer",
"den",
"angegebenen",
"HBCI4Java",
"-",
"Job",
"die",
"SEPA",
"-",
"XML",
"-",
"Dateien",
"erzeugen",
"kann",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/sepa/SepaVersion.java#L369-L376 | train |
Chorus-bdd/Chorus | extensions/chorus-websockets/src/main/java/org/chorusbdd/chorus/websockets/client/TimeoutStepExecutor.java | TimeoutStepExecutor.runWithinPeriod | void runWithinPeriod(Runnable runnable, ExecuteStepMessage executeStepMessage, int timeout, TimeUnit unit) {
if ( ! isRunningAStep.getAndSet(true)) {
this.currentlyExecutingStep = executeStepMessage;
Future<String> future = null;
try {
future = scheduledExecut... | java | void runWithinPeriod(Runnable runnable, ExecuteStepMessage executeStepMessage, int timeout, TimeUnit unit) {
if ( ! isRunningAStep.getAndSet(true)) {
this.currentlyExecutingStep = executeStepMessage;
Future<String> future = null;
try {
future = scheduledExecut... | [
"void",
"runWithinPeriod",
"(",
"Runnable",
"runnable",
",",
"ExecuteStepMessage",
"executeStepMessage",
",",
"int",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"!",
"isRunningAStep",
".",
"getAndSet",
"(",
"true",
")",
")",
"{",
"this",
".",
"c... | Run a task on the scheduled executor so that we can try to interrupt it and time out if it fails | [
"Run",
"a",
"task",
"on",
"the",
"scheduled",
"executor",
"so",
"that",
"we",
"can",
"try",
"to",
"interrupt",
"it",
"and",
"time",
"out",
"if",
"it",
"fails"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/extensions/chorus-websockets/src/main/java/org/chorusbdd/chorus/websockets/client/TimeoutStepExecutor.java#L65-L90 | train |
Chorus-bdd/Chorus | extensions/chorus-websockets/src/main/java/org/chorusbdd/chorus/websockets/client/TimeoutStepExecutor.java | TimeoutStepExecutor.runStepAndResetIsRunning | private Runnable runStepAndResetIsRunning(Runnable runnable) {
return () -> {
try {
runnable.run();
} catch (Throwable t) {
//we're in control of the runnable and it should catch it's own execeptions, but just in case it doesn't
log.error("... | java | private Runnable runStepAndResetIsRunning(Runnable runnable) {
return () -> {
try {
runnable.run();
} catch (Throwable t) {
//we're in control of the runnable and it should catch it's own execeptions, but just in case it doesn't
log.error("... | [
"private",
"Runnable",
"runStepAndResetIsRunning",
"(",
"Runnable",
"runnable",
")",
"{",
"return",
"(",
")",
"->",
"{",
"try",
"{",
"runnable",
".",
"run",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"//we're in control of the runnable and i... | Wrap the runnable which executed the step, and only unset currentlyExecutingStep when it has completed
If the step blocks and can't be interrupted, then we don't want to start any other steps | [
"Wrap",
"the",
"runnable",
"which",
"executed",
"the",
"step",
"and",
"only",
"unset",
"currentlyExecutingStep",
"when",
"it",
"has",
"completed",
"If",
"the",
"step",
"blocks",
"and",
"can",
"t",
"be",
"interrupted",
"then",
"we",
"don",
"t",
"want",
"to",
... | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/extensions/chorus-websockets/src/main/java/org/chorusbdd/chorus/websockets/client/TimeoutStepExecutor.java#L96-L107 | train |
Chorus-bdd/Chorus | interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/ExceptionHandling.java | ExceptionHandling.findStackTraceElement | private static StackTraceElement findStackTraceElement(Throwable t) {
StackTraceElement element = t.getStackTrace().length > 0 ? t.getStackTrace()[0] : null;
int index = 0;
String chorusAssertClassName = ChorusAssert.class.getName();
String junitAssertClassName = "org.junit.Assert"; //jun... | java | private static StackTraceElement findStackTraceElement(Throwable t) {
StackTraceElement element = t.getStackTrace().length > 0 ? t.getStackTrace()[0] : null;
int index = 0;
String chorusAssertClassName = ChorusAssert.class.getName();
String junitAssertClassName = "org.junit.Assert"; //jun... | [
"private",
"static",
"StackTraceElement",
"findStackTraceElement",
"(",
"Throwable",
"t",
")",
"{",
"StackTraceElement",
"element",
"=",
"t",
".",
"getStackTrace",
"(",
")",
".",
"length",
">",
"0",
"?",
"t",
".",
"getStackTrace",
"(",
")",
"[",
"0",
"]",
... | we want to skip frames with the JUnit or ChorusAssert | [
"we",
"want",
"to",
"skip",
"frames",
"with",
"the",
"JUnit",
"or",
"ChorusAssert"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/ExceptionHandling.java#L57-L72 | train |
Chorus-bdd/Chorus | interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/startup/InterpreterBuilder.java | InterpreterBuilder.buildAndConfigure | public ChorusInterpreter buildAndConfigure(ConfigProperties config, SubsystemManager subsystemManager) {
ChorusInterpreter chorusInterpreter = new ChorusInterpreter(listenerSupport);
chorusInterpreter.setHandlerClassBasePackages(config.getValues(ChorusConfigProperty.HANDLER_PACKAGES));
chorusInt... | java | public ChorusInterpreter buildAndConfigure(ConfigProperties config, SubsystemManager subsystemManager) {
ChorusInterpreter chorusInterpreter = new ChorusInterpreter(listenerSupport);
chorusInterpreter.setHandlerClassBasePackages(config.getValues(ChorusConfigProperty.HANDLER_PACKAGES));
chorusInt... | [
"public",
"ChorusInterpreter",
"buildAndConfigure",
"(",
"ConfigProperties",
"config",
",",
"SubsystemManager",
"subsystemManager",
")",
"{",
"ChorusInterpreter",
"chorusInterpreter",
"=",
"new",
"ChorusInterpreter",
"(",
"listenerSupport",
")",
";",
"chorusInterpreter",
".... | Run the interpreter, collating results into the executionToken | [
"Run",
"the",
"interpreter",
"collating",
"results",
"into",
"the",
"executionToken"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-interpreter/src/main/java/org/chorusbdd/chorus/interpreter/startup/InterpreterBuilder.java#L56-L66 | train |
Chorus-bdd/Chorus | interpreter/chorus-stepinvoker/src/main/java/org/chorusbdd/chorus/stepinvoker/TypeCoercion.java | TypeCoercion.coerceType | public static <T> T coerceType(ChorusLog log, String value, Class<T> requiredType) {
T result = null;
try {
if ( "null".equals(value)) {
result = null;
} else if (isStringType(requiredType)) {
result = (T) value;
} else if (isStringBuf... | java | public static <T> T coerceType(ChorusLog log, String value, Class<T> requiredType) {
T result = null;
try {
if ( "null".equals(value)) {
result = null;
} else if (isStringType(requiredType)) {
result = (T) value;
} else if (isStringBuf... | [
"public",
"static",
"<",
"T",
">",
"T",
"coerceType",
"(",
"ChorusLog",
"log",
",",
"String",
"value",
",",
"Class",
"<",
"T",
">",
"requiredType",
")",
"{",
"T",
"result",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"\"null\"",
".",
"equals",
"(",
"v... | Will attempt to convert the String to the required type
@return the coerced value, or null if the value cannot be converted to the required type | [
"Will",
"attempt",
"to",
"convert",
"the",
"String",
"to",
"the",
"required",
"type"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-stepinvoker/src/main/java/org/chorusbdd/chorus/stepinvoker/TypeCoercion.java#L53-L99 | train |
Chorus-bdd/Chorus | interpreter/chorus-stepinvoker/src/main/java/org/chorusbdd/chorus/stepinvoker/TypeCoercion.java | TypeCoercion.coerceObject | private static <T> T coerceObject(String value) {
T result;
//try boolean first
if ("true".equals(value) || "false".equals(value)) {
result = (T) (Boolean) Boolean.parseBoolean(value);
}
//then float numbers
else if (floatPattern.matcher(value).matches()) {
... | java | private static <T> T coerceObject(String value) {
T result;
//try boolean first
if ("true".equals(value) || "false".equals(value)) {
result = (T) (Boolean) Boolean.parseBoolean(value);
}
//then float numbers
else if (floatPattern.matcher(value).matches()) {
... | [
"private",
"static",
"<",
"T",
">",
"T",
"coerceObject",
"(",
"String",
"value",
")",
"{",
"T",
"result",
";",
"//try boolean first",
"if",
"(",
"\"true\"",
".",
"equals",
"(",
"value",
")",
"||",
"\"false\"",
".",
"equals",
"(",
"value",
")",
")",
"{"... | Rules for object coercion are probably most important for the ChorusContext
Here when we set the value of a variable, these rules are used to determine how the
String value supplied is represented - since float pattern comes first
I set the variable x with value 1.2 will become a float within the ChorusContext
- this w... | [
"Rules",
"for",
"object",
"coercion",
"are",
"probably",
"most",
"important",
"for",
"the",
"ChorusContext",
"Here",
"when",
"we",
"set",
"the",
"value",
"of",
"a",
"variable",
"these",
"rules",
"are",
"used",
"to",
"determine",
"how",
"the",
"String",
"valu... | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-stepinvoker/src/main/java/org/chorusbdd/chorus/stepinvoker/TypeCoercion.java#L108-L132 | train |
Chorus-bdd/Chorus | interpreter/chorus-handlerconfig/src/main/java/org/chorusbdd/chorus/handlerconfig/ChorusProperties.java | ChorusProperties.mergeConfigurationAndProfileProperties | private PropertyOperations mergeConfigurationAndProfileProperties(PropertyOperations props) {
PropertyOperations result;
result = mergeConfigurationProperties(props);
result = mergeProfileProperties(result);
return result;
} | java | private PropertyOperations mergeConfigurationAndProfileProperties(PropertyOperations props) {
PropertyOperations result;
result = mergeConfigurationProperties(props);
result = mergeProfileProperties(result);
return result;
} | [
"private",
"PropertyOperations",
"mergeConfigurationAndProfileProperties",
"(",
"PropertyOperations",
"props",
")",
"{",
"PropertyOperations",
"result",
";",
"result",
"=",
"mergeConfigurationProperties",
"(",
"props",
")",
";",
"result",
"=",
"mergeProfileProperties",
"(",... | Some property keys may be prefixed with the name of a configuration or the name of a profile
If this matches the current configration/profile we strip this prefix and merge the new property over the top of any default ones
This enables us to declare properties which are only active in a certain profile or configuratio... | [
"Some",
"property",
"keys",
"may",
"be",
"prefixed",
"with",
"the",
"name",
"of",
"a",
"configuration",
"or",
"the",
"name",
"of",
"a",
"profile"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-handlerconfig/src/main/java/org/chorusbdd/chorus/handlerconfig/ChorusProperties.java#L102-L107 | train |
Chorus-bdd/Chorus | interpreter/chorus-handlerconfig/src/main/java/org/chorusbdd/chorus/handlerconfig/ChorusProperties.java | ChorusProperties.addPropertiesFromDatabase | private PropertyOperations addPropertiesFromDatabase(PropertyOperations sourceProperties) {
PropertyOperations dbPropsOnly = sourceProperties.filterByKeyPrefix(ChorusConstants.DATABASE_CONFIGS_PROPERTY_GROUP + ".")
.removeKeyPrefix(ChorusConstants.DATABAS... | java | private PropertyOperations addPropertiesFromDatabase(PropertyOperations sourceProperties) {
PropertyOperations dbPropsOnly = sourceProperties.filterByKeyPrefix(ChorusConstants.DATABASE_CONFIGS_PROPERTY_GROUP + ".")
.removeKeyPrefix(ChorusConstants.DATABAS... | [
"private",
"PropertyOperations",
"addPropertiesFromDatabase",
"(",
"PropertyOperations",
"sourceProperties",
")",
"{",
"PropertyOperations",
"dbPropsOnly",
"=",
"sourceProperties",
".",
"filterByKeyPrefix",
"(",
"ChorusConstants",
".",
"DATABASE_CONFIGS_PROPERTY_GROUP",
"+",
"\... | If there are any database properties defined in sourceProperties then use them to merge extra properties from the databsase
@param sourceProperties
@return | [
"If",
"there",
"are",
"any",
"database",
"properties",
"defined",
"in",
"sourceProperties",
"then",
"use",
"them",
"to",
"merge",
"extra",
"properties",
"from",
"the",
"databsase"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-handlerconfig/src/main/java/org/chorusbdd/chorus/handlerconfig/ChorusProperties.java#L160-L173 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/exceptions/HBCI_Exception.java | HBCI_Exception.isFatal | public boolean isFatal() {
if (this.fatal) // dann brauchen wir den Cause nicht mehr checken
return true;
Throwable t = this.getCause();
if (t == this)
return false; // sind wir selbst
if (t instanceof HBCI_Exception)
return ((HBCI_Exception) t).isFat... | java | public boolean isFatal() {
if (this.fatal) // dann brauchen wir den Cause nicht mehr checken
return true;
Throwable t = this.getCause();
if (t == this)
return false; // sind wir selbst
if (t instanceof HBCI_Exception)
return ((HBCI_Exception) t).isFat... | [
"public",
"boolean",
"isFatal",
"(",
")",
"{",
"if",
"(",
"this",
".",
"fatal",
")",
"// dann brauchen wir den Cause nicht mehr checken",
"return",
"true",
";",
"Throwable",
"t",
"=",
"this",
".",
"getCause",
"(",
")",
";",
"if",
"(",
"t",
"==",
"this",
")... | Liefert true, wenn die Exception oder ihr Cause als fatal eingestuft wurde.
@return true, wenn die Exception oder ihr Cause als fatal eingestuft wurde. | [
"Liefert",
"true",
"wenn",
"die",
"Exception",
"oder",
"ihr",
"Cause",
"als",
"fatal",
"eingestuft",
"wurde",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/exceptions/HBCI_Exception.java#L88-L99 | train |
imsweb/seerapi-client-java | src/main/java/com/imsweb/seerapi/client/staging/SchemaLookup.java | SchemaLookup.setInput | public void setInput(String key, String value) {
if (getAllowedKeys() != null && !getAllowedKeys().contains(key))
throw new IllegalStateException("The input key " + key + " is not allowed for lookups");
_inputs.put(key, value);
} | java | public void setInput(String key, String value) {
if (getAllowedKeys() != null && !getAllowedKeys().contains(key))
throw new IllegalStateException("The input key " + key + " is not allowed for lookups");
_inputs.put(key, value);
} | [
"public",
"void",
"setInput",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"getAllowedKeys",
"(",
")",
"!=",
"null",
"&&",
"!",
"getAllowedKeys",
"(",
")",
".",
"contains",
"(",
"key",
")",
")",
"throw",
"new",
"IllegalStateExceptio... | Set the value of a single input.
@param key key of input
@param value value of input | [
"Set",
"the",
"value",
"of",
"a",
"single",
"input",
"."
] | 04f509961c3a5ece7b232ecb8d8cb8f89d810a85 | https://github.com/imsweb/seerapi-client-java/blob/04f509961c3a5ece7b232ecb8d8cb8f89d810a85/src/main/java/com/imsweb/seerapi/client/staging/SchemaLookup.java#L69-L74 | train |
Chorus-bdd/Chorus | extensions/chorus-sql/src/main/java/org/chorusbdd/chorus/sql/manager/DefaultSqlManager.java | DefaultSqlManager.executeJdbcStatements | private void executeJdbcStatements(Connection connection, String configName, String statements, String description) {
Statement stmt = createStatement(configName, connection);
try {
log.debug("Executing statement [" + description + "]");
List<String> stmtsToExecute =... | java | private void executeJdbcStatements(Connection connection, String configName, String statements, String description) {
Statement stmt = createStatement(configName, connection);
try {
log.debug("Executing statement [" + description + "]");
List<String> stmtsToExecute =... | [
"private",
"void",
"executeJdbcStatements",
"(",
"Connection",
"connection",
",",
"String",
"configName",
",",
"String",
"statements",
",",
"String",
"description",
")",
"{",
"Statement",
"stmt",
"=",
"createStatement",
"(",
"configName",
",",
"connection",
")",
"... | Execute one or more SQL statements
@param statements, a String which may contain one or more semi-colon-delimited SQL statements | [
"Execute",
"one",
"or",
"more",
"SQL",
"statements"
] | 1eea7ca858876bce821bb49b43fd5b6ba1737997 | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/extensions/chorus-sql/src/main/java/org/chorusbdd/chorus/sql/manager/DefaultSqlManager.java#L148-L173 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/FlickerRenderer.java | FlickerRenderer.stop | public final void stop() {
if (this.thread != null) {
try {
if (this.thread != null) {
this.thread.interrupt();
synchronized (this.thread) {
this.thread.notifyAll();
}
}
} ... | java | public final void stop() {
if (this.thread != null) {
try {
if (this.thread != null) {
this.thread.interrupt();
synchronized (this.thread) {
this.thread.notifyAll();
}
}
} ... | [
"public",
"final",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"this",
".",
"thread",
"!=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"thread",
"!=",
"null",
")",
"{",
"this",
".",
"thread",
".",
"interrupt",
"(",
")",
";",
"synchronize... | Stoppt das Rendern. | [
"Stoppt",
"das",
"Rendern",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/FlickerRenderer.java#L204-L217 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/HBCIUtils.java | HBCIUtils.getNameForBLZ | public static String getNameForBLZ(String blz) {
BankInfo info = getBankInfo(blz);
if (info == null)
return "";
return info.getName() != null ? info.getName() : "";
} | java | public static String getNameForBLZ(String blz) {
BankInfo info = getBankInfo(blz);
if (info == null)
return "";
return info.getName() != null ? info.getName() : "";
} | [
"public",
"static",
"String",
"getNameForBLZ",
"(",
"String",
"blz",
")",
"{",
"BankInfo",
"info",
"=",
"getBankInfo",
"(",
"blz",
")",
";",
"if",
"(",
"info",
"==",
"null",
")",
"return",
"\"\"",
";",
"return",
"info",
".",
"getName",
"(",
")",
"!=",
... | Ermittelt zu einer gegebenen Bankleitzahl den Namen des Institutes.
@param blz die Bankleitzahl
@return den Namen des dazugehörigen Kreditinstitutes. Falls die Bankleitzahl unbekannt ist,
so wird ein leerer String zurückgegeben | [
"Ermittelt",
"zu",
"einer",
"gegebenen",
"Bankleitzahl",
"den",
"Namen",
"des",
"Institutes",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIUtils.java#L50-L55 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/HBCIUtils.java | HBCIUtils.searchBankInfo | public static List<BankInfo> searchBankInfo(String query) {
if (query != null)
query = query.trim();
List<BankInfo> list = new LinkedList<BankInfo>();
if (query == null || query.length() < 3)
return list;
query = query.toLowerCase();
for (BankInfo info ... | java | public static List<BankInfo> searchBankInfo(String query) {
if (query != null)
query = query.trim();
List<BankInfo> list = new LinkedList<BankInfo>();
if (query == null || query.length() < 3)
return list;
query = query.toLowerCase();
for (BankInfo info ... | [
"public",
"static",
"List",
"<",
"BankInfo",
">",
"searchBankInfo",
"(",
"String",
"query",
")",
"{",
"if",
"(",
"query",
"!=",
"null",
")",
"query",
"=",
"query",
".",
"trim",
"(",
")",
";",
"List",
"<",
"BankInfo",
">",
"list",
"=",
"new",
"LinkedL... | Liefert eine Liste von Bank-Informationen, die zum angegebenen Suchbegriff passen.
@param query der Suchbegriff.
Der Suchbegriff muss mindestens 3 Zeichen enthalten und ist nicht case-sensitive.
Der Suchbegriff kann im Ort der Bank oder in deren Namen enthalten sein.
Oder die BLZ oder BIC beginnt mit diesem Text.
@ret... | [
"Liefert",
"eine",
"Liste",
"von",
"Bank",
"-",
"Informationen",
"die",
"zum",
"angegebenen",
"Suchbegriff",
"passen",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIUtils.java#L78-L134 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/HBCIUtils.java | HBCIUtils.getIBANForKonto | public static String getIBANForKonto(Konto k) {
String konto = k.number;
// Die Unterkonto-Nummer muss mit eingerechnet werden.
// Aber nur, wenn sie numerisch ist. Bei irgendeiner Bank wurde
// "EUR" als Unterkontonummer verwendet. Das geht natuerlich nicht,
// weil damit nicht... | java | public static String getIBANForKonto(Konto k) {
String konto = k.number;
// Die Unterkonto-Nummer muss mit eingerechnet werden.
// Aber nur, wenn sie numerisch ist. Bei irgendeiner Bank wurde
// "EUR" als Unterkontonummer verwendet. Das geht natuerlich nicht,
// weil damit nicht... | [
"public",
"static",
"String",
"getIBANForKonto",
"(",
"Konto",
"k",
")",
"{",
"String",
"konto",
"=",
"k",
".",
"number",
";",
"// Die Unterkonto-Nummer muss mit eingerechnet werden.",
"// Aber nur, wenn sie numerisch ist. Bei irgendeiner Bank wurde",
"// \"EUR\" als Unterkontonu... | Berechnet die IBAN fuer ein angegebenes deutsches Konto.
@param k das Konto.
@return die berechnete IBAN. | [
"Berechnet",
"die",
"IBAN",
"fuer",
"ein",
"angegebenes",
"deutsches",
"Konto",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIUtils.java#L157-L198 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/HBCIUtils.java | HBCIUtils.exception2StringShort | public static String exception2StringShort(Exception e) {
StringBuffer st = new StringBuffer();
Throwable e2 = e;
while (e2 != null) {
String exClass = e2.getClass().getName();
String msg = e2.getMessage();
if (msg != null) {
st.setLength(0);... | java | public static String exception2StringShort(Exception e) {
StringBuffer st = new StringBuffer();
Throwable e2 = e;
while (e2 != null) {
String exClass = e2.getClass().getName();
String msg = e2.getMessage();
if (msg != null) {
st.setLength(0);... | [
"public",
"static",
"String",
"exception2StringShort",
"(",
"Exception",
"e",
")",
"{",
"StringBuffer",
"st",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"Throwable",
"e2",
"=",
"e",
";",
"while",
"(",
"e2",
"!=",
"null",
")",
"{",
"String",
"exClass",
"=... | Extrahieren der root-Exception aus einer Exception-Chain.
@param e Exception
@return String mit Infos zur root-Exception | [
"Extrahieren",
"der",
"root",
"-",
"Exception",
"aus",
"einer",
"Exception",
"-",
"Chain",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIUtils.java#L280-L298 | train |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/HBCIUtils.java | HBCIUtils.data2hex | public static String data2hex(byte[] data) {
StringBuffer ret = new StringBuffer();
for (int i = 0; i < data.length; i++) {
String st = Integer.toHexString(data[i]);
if (st.length() == 1) {
st = '0' + st;
}
st = st.substring(st.length() - ... | java | public static String data2hex(byte[] data) {
StringBuffer ret = new StringBuffer();
for (int i = 0; i < data.length; i++) {
String st = Integer.toHexString(data[i]);
if (st.length() == 1) {
st = '0' + st;
}
st = st.substring(st.length() - ... | [
"public",
"static",
"String",
"data2hex",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"StringBuffer",
"ret",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"data",
".",
"length",
";",
"i",
"++",
")",
"{",... | Wandelt ein Byte-Array in eine entsprechende hex-Darstellung um.
@param data das Byte-Array, für das eine Hex-Darstellung erzeugt werden soll
@return einen String, der für jedes Byte aus <code>data</code>
zwei Zeichen (0-9,A-F) enthält. | [
"Wandelt",
"ein",
"Byte",
"-",
"Array",
"in",
"eine",
"entsprechende",
"hex",
"-",
"Darstellung",
"um",
"."
] | 5e24f7e429d6b555e1d993196b4cf1adda6433cf | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIUtils.java#L307-L320 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.