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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
aseovic/coherence-tools | core/src/main/java/com/seovic/core/Defaults.java | Defaults.createExpression | public static Expression createExpression(String expression) {
try {
return INSTANCE.ctorExpression.newInstance(expression);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static Expression createExpression(String expression) {
try {
return INSTANCE.ctorExpression.newInstance(expression);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"Expression",
"createExpression",
"(",
"String",
"expression",
")",
"{",
"try",
"{",
"return",
"INSTANCE",
".",
"ctorExpression",
".",
"newInstance",
"(",
"expression",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"ne... | Creates a default expression instance.
@param expression string expression
@return expression instance | [
"Creates",
"a",
"default",
"expression",
"instance",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/Defaults.java#L72-L79 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/Defaults.java | Defaults.createExtractor | public static Extractor createExtractor(String expression) {
try {
return INSTANCE.ctorExtractor.newInstance(expression);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static Extractor createExtractor(String expression) {
try {
return INSTANCE.ctorExtractor.newInstance(expression);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"Extractor",
"createExtractor",
"(",
"String",
"expression",
")",
"{",
"try",
"{",
"return",
"INSTANCE",
".",
"ctorExtractor",
".",
"newInstance",
"(",
"expression",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",... | Creates a default extractor instance.
@param expression string expression
@return extractor instance | [
"Creates",
"a",
"default",
"extractor",
"instance",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/Defaults.java#L88-L95 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/Defaults.java | Defaults.createUpdater | public static Updater createUpdater(String expression) {
try {
return INSTANCE.ctorUpdater.newInstance(expression);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static Updater createUpdater(String expression) {
try {
return INSTANCE.ctorUpdater.newInstance(expression);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"Updater",
"createUpdater",
"(",
"String",
"expression",
")",
"{",
"try",
"{",
"return",
"INSTANCE",
".",
"ctorUpdater",
".",
"newInstance",
"(",
"expression",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"Ru... | Creates a default updater instance.
@param expression string expression
@return updater instance | [
"Creates",
"a",
"default",
"updater",
"instance",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/Defaults.java#L104-L111 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/Defaults.java | Defaults.createCondition | public static Condition createCondition(String expression) {
try {
return INSTANCE.ctorCondition.newInstance(expression);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static Condition createCondition(String expression) {
try {
return INSTANCE.ctorCondition.newInstance(expression);
}
catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"Condition",
"createCondition",
"(",
"String",
"expression",
")",
"{",
"try",
"{",
"return",
"INSTANCE",
".",
"ctorCondition",
".",
"newInstance",
"(",
"expression",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",... | Creates a default condition instance.
@param expression conditional expression
@return condition instance | [
"Creates",
"a",
"default",
"condition",
"instance",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/Defaults.java#L120-L127 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/Defaults.java | Defaults.getConstructor | protected Constructor getConstructor(Class type) {
try {
return type.getConstructor(String.class);
}
catch (NoSuchMethodException e) {
throw new RuntimeException(
"Unable to find a constructor that accepts"
+ " a single String argum... | java | protected Constructor getConstructor(Class type) {
try {
return type.getConstructor(String.class);
}
catch (NoSuchMethodException e) {
throw new RuntimeException(
"Unable to find a constructor that accepts"
+ " a single String argum... | [
"protected",
"Constructor",
"getConstructor",
"(",
"Class",
"type",
")",
"{",
"try",
"{",
"return",
"type",
".",
"getConstructor",
"(",
"String",
".",
"class",
")",
";",
"}",
"catch",
"(",
"NoSuchMethodException",
"e",
")",
"{",
"throw",
"new",
"RuntimeExcep... | Gets a constructor for the specified class that accepts a single String
argument.
@param type the class to find the constructor for
@return a constructor for the specified class that accepts a single
String argument | [
"Gets",
"a",
"constructor",
"for",
"the",
"specified",
"class",
"that",
"accepts",
"a",
"single",
"String",
"argument",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/Defaults.java#L141-L151 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EngineeringObjectModelWrapper.java | EngineeringObjectModelWrapper.enhance | public static EngineeringObjectModelWrapper enhance(AdvancedModelWrapper model) {
if (!model.isEngineeringObject()) {
throw new IllegalArgumentException("The model of the AdvancedModelWrapper is no EngineeringObject");
}
return new EngineeringObjectModelWrapper(model.getUnderlyingMod... | java | public static EngineeringObjectModelWrapper enhance(AdvancedModelWrapper model) {
if (!model.isEngineeringObject()) {
throw new IllegalArgumentException("The model of the AdvancedModelWrapper is no EngineeringObject");
}
return new EngineeringObjectModelWrapper(model.getUnderlyingMod... | [
"public",
"static",
"EngineeringObjectModelWrapper",
"enhance",
"(",
"AdvancedModelWrapper",
"model",
")",
"{",
"if",
"(",
"!",
"model",
".",
"isEngineeringObject",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The model of the AdvancedModelWra... | Returns the corresponding engineering object model wrapper to the given advanced model wrapper. | [
"Returns",
"the",
"corresponding",
"engineering",
"object",
"model",
"wrapper",
"to",
"the",
"given",
"advanced",
"model",
"wrapper",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EngineeringObjectModelWrapper.java#L45-L50 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EngineeringObjectModelWrapper.java | EngineeringObjectModelWrapper.getForeignKeyFields | public List<Field> getForeignKeyFields() {
List<Field> fields = new ArrayList<Field>();
for (Field field : model.getClass().getDeclaredFields()) {
if (field.isAnnotationPresent(OpenEngSBForeignKey.class)) {
fields.add(field);
}
}
return fields;
... | java | public List<Field> getForeignKeyFields() {
List<Field> fields = new ArrayList<Field>();
for (Field field : model.getClass().getDeclaredFields()) {
if (field.isAnnotationPresent(OpenEngSBForeignKey.class)) {
fields.add(field);
}
}
return fields;
... | [
"public",
"List",
"<",
"Field",
">",
"getForeignKeyFields",
"(",
")",
"{",
"List",
"<",
"Field",
">",
"fields",
"=",
"new",
"ArrayList",
"<",
"Field",
">",
"(",
")",
";",
"for",
"(",
"Field",
"field",
":",
"model",
".",
"getClass",
"(",
")",
".",
"... | Returns a list of foreign key fields for the Engineering Object model. | [
"Returns",
"a",
"list",
"of",
"foreign",
"key",
"fields",
"for",
"the",
"Engineering",
"Object",
"model",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EngineeringObjectModelWrapper.java#L55-L63 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EngineeringObjectModelWrapper.java | EngineeringObjectModelWrapper.loadReferencedModel | public AdvancedModelWrapper loadReferencedModel(Field field, ModelRegistry modelRegistry,
EngineeringDatabaseService edbService, EDBConverter edbConverter) {
try {
ModelDescription description = getModelDescriptionFromField(field);
String modelKey = (String) FieldUtils.readFi... | java | public AdvancedModelWrapper loadReferencedModel(Field field, ModelRegistry modelRegistry,
EngineeringDatabaseService edbService, EDBConverter edbConverter) {
try {
ModelDescription description = getModelDescriptionFromField(field);
String modelKey = (String) FieldUtils.readFi... | [
"public",
"AdvancedModelWrapper",
"loadReferencedModel",
"(",
"Field",
"field",
",",
"ModelRegistry",
"modelRegistry",
",",
"EngineeringDatabaseService",
"edbService",
",",
"EDBConverter",
"edbConverter",
")",
"{",
"try",
"{",
"ModelDescription",
"description",
"=",
"getM... | Loads the model referenced by the given field for the given model instance. Returns null if the field has no
value set. | [
"Loads",
"the",
"model",
"referenced",
"by",
"the",
"given",
"field",
"for",
"the",
"given",
"model",
"instance",
".",
"Returns",
"null",
"if",
"the",
"field",
"has",
"no",
"value",
"set",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EngineeringObjectModelWrapper.java#L69-L91 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EngineeringObjectModelWrapper.java | EngineeringObjectModelWrapper.getModelDescriptionFromField | private ModelDescription getModelDescriptionFromField(Field field) {
OpenEngSBForeignKey key = field.getAnnotation(OpenEngSBForeignKey.class);
ModelDescription description = new ModelDescription(key.modelType(), key.modelVersion());
return description;
} | java | private ModelDescription getModelDescriptionFromField(Field field) {
OpenEngSBForeignKey key = field.getAnnotation(OpenEngSBForeignKey.class);
ModelDescription description = new ModelDescription(key.modelType(), key.modelVersion());
return description;
} | [
"private",
"ModelDescription",
"getModelDescriptionFromField",
"(",
"Field",
"field",
")",
"{",
"OpenEngSBForeignKey",
"key",
"=",
"field",
".",
"getAnnotation",
"(",
"OpenEngSBForeignKey",
".",
"class",
")",
";",
"ModelDescription",
"description",
"=",
"new",
"ModelD... | Generates the model description of a field which is annotated with the OpenEngSBForeignKey annotation. | [
"Generates",
"the",
"model",
"description",
"of",
"a",
"field",
"which",
"is",
"annotated",
"with",
"the",
"OpenEngSBForeignKey",
"annotation",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EngineeringObjectModelWrapper.java#L103-L107 | train |
aseovic/coherence-tools | identity/src/main/java/com/seovic/identity/SequenceGenerator.java | SequenceGenerator.generateId | public synchronized Long generateId() {
if (sequenceBlock == null || !sequenceBlock.hasNext()) {
sequenceBlock = allocateSequenceBlock();
}
return sequenceBlock.next();
} | java | public synchronized Long generateId() {
if (sequenceBlock == null || !sequenceBlock.hasNext()) {
sequenceBlock = allocateSequenceBlock();
}
return sequenceBlock.next();
} | [
"public",
"synchronized",
"Long",
"generateId",
"(",
")",
"{",
"if",
"(",
"sequenceBlock",
"==",
"null",
"||",
"!",
"sequenceBlock",
".",
"hasNext",
"(",
")",
")",
"{",
"sequenceBlock",
"=",
"allocateSequenceBlock",
"(",
")",
";",
"}",
"return",
"sequenceBlo... | Return the next number in the sequence.
@return the next number in the sequence | [
"Return",
"the",
"next",
"number",
"in",
"the",
"sequence",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/identity/src/main/java/com/seovic/identity/SequenceGenerator.java#L88-L93 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/RemoveLeadingOperation.java | RemoveLeadingOperation.performRemoveLeading | private String performRemoveLeading(String source, Integer length, Matcher matcher) {
if (length != null && length != 0) {
matcher.region(0, length);
}
if (matcher.find()) {
String matched = matcher.group();
return source.substring(matched.length());
}... | java | private String performRemoveLeading(String source, Integer length, Matcher matcher) {
if (length != null && length != 0) {
matcher.region(0, length);
}
if (matcher.find()) {
String matched = matcher.group();
return source.substring(matched.length());
}... | [
"private",
"String",
"performRemoveLeading",
"(",
"String",
"source",
",",
"Integer",
"length",
",",
"Matcher",
"matcher",
")",
"{",
"if",
"(",
"length",
"!=",
"null",
"&&",
"length",
"!=",
"0",
")",
"{",
"matcher",
".",
"region",
"(",
"0",
",",
"length"... | Perform the remove leading operation. Returns the original string if the matcher does not match with the string | [
"Perform",
"the",
"remove",
"leading",
"operation",
".",
"Returns",
"the",
"original",
"string",
"if",
"the",
"matcher",
"does",
"not",
"match",
"with",
"the",
"string"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/RemoveLeadingOperation.java#L75-L84 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/spatial/geometry/Mat2.java | Mat2.set | public void set( float radians )
{
float c = (float)StrictMath.cos( radians );
float s = (float)StrictMath.sin( radians );
m00 = c;
m01 = -s;
m10 = s;
m11 = c;
} | java | public void set( float radians )
{
float c = (float)StrictMath.cos( radians );
float s = (float)StrictMath.sin( radians );
m00 = c;
m01 = -s;
m10 = s;
m11 = c;
} | [
"public",
"void",
"set",
"(",
"float",
"radians",
")",
"{",
"float",
"c",
"=",
"(",
"float",
")",
"StrictMath",
".",
"cos",
"(",
"radians",
")",
";",
"float",
"s",
"=",
"(",
"float",
")",
"StrictMath",
".",
"sin",
"(",
"radians",
")",
";",
"m00",
... | Sets this matrix to a rotation matrix with the given radians.
@param radians Rotation in radians. | [
"Sets",
"this",
"matrix",
"to",
"a",
"rotation",
"matrix",
"with",
"the",
"given",
"radians",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/spatial/geometry/Mat2.java#L41-L50 | train |
openengsb/openengsb | components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/driver/AbstractTypeMap.java | AbstractTypeMap.put | protected DataType put(Class<?> clazz, int type, String name) {
DataType dataType = new DataType(type, name);
map.put(clazz, dataType);
return dataType;
} | java | protected DataType put(Class<?> clazz, int type, String name) {
DataType dataType = new DataType(type, name);
map.put(clazz, dataType);
return dataType;
} | [
"protected",
"DataType",
"put",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"int",
"type",
",",
"String",
"name",
")",
"{",
"DataType",
"dataType",
"=",
"new",
"DataType",
"(",
"type",
",",
"name",
")",
";",
"map",
".",
"put",
"(",
"clazz",
",",
"da... | Create a new DataType instance for the given type and name, and place it in the map with the given Class as key.
@param clazz the key
@param type the type of {@code java.sql.Types}
@param name the name of the type corresponding to the used dbms
@return the DataType created | [
"Create",
"a",
"new",
"DataType",
"instance",
"for",
"the",
"given",
"type",
"and",
"name",
"and",
"place",
"it",
"in",
"the",
"map",
"with",
"the",
"given",
"Class",
"as",
"key",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/driver/AbstractTypeMap.java#L51-L55 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.decrypt | public static byte[] decrypt(byte[] text, Key key) throws DecryptionException {
return decrypt(text, key, key.getAlgorithm());
} | java | public static byte[] decrypt(byte[] text, Key key) throws DecryptionException {
return decrypt(text, key, key.getAlgorithm());
} | [
"public",
"static",
"byte",
"[",
"]",
"decrypt",
"(",
"byte",
"[",
"]",
"text",
",",
"Key",
"key",
")",
"throws",
"DecryptionException",
"{",
"return",
"decrypt",
"(",
"text",
",",
"key",
",",
"key",
".",
"getAlgorithm",
"(",
")",
")",
";",
"}"
] | Decrypts the given data using the given key. The key holds the algorithm used for decryption. If you are
decrypting data that is supposed to be a string, consider that it might be Base64-encoded.
@throws DecryptionException if the string cannot be decrypted with the given key | [
"Decrypts",
"the",
"given",
"data",
"using",
"the",
"given",
"key",
".",
"The",
"key",
"holds",
"the",
"algorithm",
"used",
"for",
"decryption",
".",
"If",
"you",
"are",
"decrypting",
"data",
"that",
"is",
"supposed",
"to",
"be",
"a",
"string",
"consider",... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L59-L61 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.decrypt | public static byte[] decrypt(byte[] text, Key key, String algorithm) throws DecryptionException {
Cipher cipher;
try {
LOGGER.trace("start decrypting text using {} cipher", algorithm);
cipher = Cipher.getInstance(algorithm);
cipher.init(Cipher.DECRYPT_MODE, key);
... | java | public static byte[] decrypt(byte[] text, Key key, String algorithm) throws DecryptionException {
Cipher cipher;
try {
LOGGER.trace("start decrypting text using {} cipher", algorithm);
cipher = Cipher.getInstance(algorithm);
cipher.init(Cipher.DECRYPT_MODE, key);
... | [
"public",
"static",
"byte",
"[",
"]",
"decrypt",
"(",
"byte",
"[",
"]",
"text",
",",
"Key",
"key",
",",
"String",
"algorithm",
")",
"throws",
"DecryptionException",
"{",
"Cipher",
"cipher",
";",
"try",
"{",
"LOGGER",
".",
"trace",
"(",
"\"start decrypting ... | Decrypts the given data using the given key using the given algorithm. If you are decrypting data that is
supposed to be a string, consider that it might be Base64-encoded.
@throws DecryptionException if the string cannot be decrypted with the given key
@throws IllegalArgumentException if the algorithm is not supporte... | [
"Decrypts",
"the",
"given",
"data",
"using",
"the",
"given",
"key",
"using",
"the",
"given",
"algorithm",
".",
"If",
"you",
"are",
"decrypting",
"data",
"that",
"is",
"supposed",
"to",
"be",
"a",
"string",
"consider",
"that",
"it",
"might",
"be",
"Base64",... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L70-L85 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.encrypt | public static byte[] encrypt(byte[] text, Key key) throws EncryptionException {
return encrypt(text, key, key.getAlgorithm());
} | java | public static byte[] encrypt(byte[] text, Key key) throws EncryptionException {
return encrypt(text, key, key.getAlgorithm());
} | [
"public",
"static",
"byte",
"[",
"]",
"encrypt",
"(",
"byte",
"[",
"]",
"text",
",",
"Key",
"key",
")",
"throws",
"EncryptionException",
"{",
"return",
"encrypt",
"(",
"text",
",",
"key",
",",
"key",
".",
"getAlgorithm",
"(",
")",
")",
";",
"}"
] | Encrypts the given data using the given key. The key holds the algorithm used for encryption. If you are
encrypting data that is supposed to be a string, consider that it might be Base64-encoded.
@throws EncryptionException if the string cannot be encrypted with the given key | [
"Encrypts",
"the",
"given",
"data",
"using",
"the",
"given",
"key",
".",
"The",
"key",
"holds",
"the",
"algorithm",
"used",
"for",
"encryption",
".",
"If",
"you",
"are",
"encrypting",
"data",
"that",
"is",
"supposed",
"to",
"be",
"a",
"string",
"consider",... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L93-L95 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.encrypt | public static byte[] encrypt(byte[] text, Key key, String algorithm) throws EncryptionException {
Cipher cipher;
try {
LOGGER.trace("start encrypting text using {} cipher", algorithm);
cipher = Cipher.getInstance(algorithm);
cipher.init(Cipher.ENCRYPT_MODE, key);
... | java | public static byte[] encrypt(byte[] text, Key key, String algorithm) throws EncryptionException {
Cipher cipher;
try {
LOGGER.trace("start encrypting text using {} cipher", algorithm);
cipher = Cipher.getInstance(algorithm);
cipher.init(Cipher.ENCRYPT_MODE, key);
... | [
"public",
"static",
"byte",
"[",
"]",
"encrypt",
"(",
"byte",
"[",
"]",
"text",
",",
"Key",
"key",
",",
"String",
"algorithm",
")",
"throws",
"EncryptionException",
"{",
"Cipher",
"cipher",
";",
"try",
"{",
"LOGGER",
".",
"trace",
"(",
"\"start encrypting ... | Encrypts the given data using the given key using the given algorithm. If you are encrypting data that is
supposed to be a string, consider encoding it in Base64.
@throws EncryptionException if the string cannot be encrypted with the given key
@throws IllegalArgumentException if the algorithm is not supported. | [
"Encrypts",
"the",
"given",
"data",
"using",
"the",
"given",
"key",
"using",
"the",
"given",
"algorithm",
".",
"If",
"you",
"are",
"encrypting",
"data",
"that",
"is",
"supposed",
"to",
"be",
"a",
"string",
"consider",
"encoding",
"it",
"in",
"Base64",
"."
... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L104-L119 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.sign | public static byte[] sign(byte[] text, PrivateKey key, String algorithm) throws SignatureException {
Signature signature;
try {
signature = Signature.getInstance(algorithm);
signature.initSign(key);
} catch (GeneralSecurityException e) {
throw new IllegalArgum... | java | public static byte[] sign(byte[] text, PrivateKey key, String algorithm) throws SignatureException {
Signature signature;
try {
signature = Signature.getInstance(algorithm);
signature.initSign(key);
} catch (GeneralSecurityException e) {
throw new IllegalArgum... | [
"public",
"static",
"byte",
"[",
"]",
"sign",
"(",
"byte",
"[",
"]",
"text",
",",
"PrivateKey",
"key",
",",
"String",
"algorithm",
")",
"throws",
"SignatureException",
"{",
"Signature",
"signature",
";",
"try",
"{",
"signature",
"=",
"Signature",
".",
"get... | create a signature for the given text using the PrivateKey and algorithm
Example: CipherUtils.sign(data, key, CipherUtils.DEFAULT_SIGN_ALGORITHM)
@throws SignatureException if the data cannot not be signed | [
"create",
"a",
"signature",
"for",
"the",
"given",
"text",
"using",
"the",
"PrivateKey",
"and",
"algorithm"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L207-L217 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.verify | public static boolean verify(byte[] text, byte[] signatureValue, PublicKey key, String algorithm)
throws SignatureException {
Signature signature;
try {
signature = Signature.getInstance(algorithm);
signature.initVerify(key);
} catch (GeneralSecurityException e) {... | java | public static boolean verify(byte[] text, byte[] signatureValue, PublicKey key, String algorithm)
throws SignatureException {
Signature signature;
try {
signature = Signature.getInstance(algorithm);
signature.initVerify(key);
} catch (GeneralSecurityException e) {... | [
"public",
"static",
"boolean",
"verify",
"(",
"byte",
"[",
"]",
"text",
",",
"byte",
"[",
"]",
"signatureValue",
",",
"PublicKey",
"key",
",",
"String",
"algorithm",
")",
"throws",
"SignatureException",
"{",
"Signature",
"signature",
";",
"try",
"{",
"signat... | verifies if the given data is valid for the given signature and public key.
@throws SignatureException if the algorithm cannot be initialized | [
"verifies",
"if",
"the",
"given",
"data",
"is",
"valid",
"for",
"the",
"given",
"signature",
"and",
"public",
"key",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L224-L235 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/expression/OgnlExpression.java | OgnlExpression.getCompiledExpression | protected synchronized Object getCompiledExpression() {
if (compiledExpression == null) {
try {
compiledExpression = Ognl.parseExpression(getExpression());
}
catch (OgnlException e) {
throw new IllegalArgumentException("[" + getExpression() + "... | java | protected synchronized Object getCompiledExpression() {
if (compiledExpression == null) {
try {
compiledExpression = Ognl.parseExpression(getExpression());
}
catch (OgnlException e) {
throw new IllegalArgumentException("[" + getExpression() + "... | [
"protected",
"synchronized",
"Object",
"getCompiledExpression",
"(",
")",
"{",
"if",
"(",
"compiledExpression",
"==",
"null",
")",
"{",
"try",
"{",
"compiledExpression",
"=",
"Ognl",
".",
"parseExpression",
"(",
"getExpression",
"(",
")",
")",
";",
"}",
"catch... | Return a compiled OGNL expression.
@return compiled OGNL expression | [
"Return",
"a",
"compiled",
"OGNL",
"expression",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/expression/OgnlExpression.java#L105-L115 | train |
BrunoEberhard/minimal-j | src/main/java/org/minimalj/model/ViewUtil.java | ViewUtil.view | public static <T> T view(Object completeObject, T viewObject) {
if (completeObject == null) return null;
Map<String, PropertyInterface> propertiesOfCompleteObject = FlatProperties.getProperties(completeObject.getClass());
Map<String, PropertyInterface> properties = FlatProperties.getProperties(viewObject.getCl... | java | public static <T> T view(Object completeObject, T viewObject) {
if (completeObject == null) return null;
Map<String, PropertyInterface> propertiesOfCompleteObject = FlatProperties.getProperties(completeObject.getClass());
Map<String, PropertyInterface> properties = FlatProperties.getProperties(viewObject.getCl... | [
"public",
"static",
"<",
"T",
">",
"T",
"view",
"(",
"Object",
"completeObject",
",",
"T",
"viewObject",
")",
"{",
"if",
"(",
"completeObject",
"==",
"null",
")",
"return",
"null",
";",
"Map",
"<",
"String",
",",
"PropertyInterface",
">",
"propertiesOfComp... | Creates a view to a complete object. Meaning all fields existing on view and
the complete object are copied from the complete object to the view.
@param <T> type of the view object
@param completeObject the source
@param viewObject the filled view object
@return the view object (same as input) | [
"Creates",
"a",
"view",
"to",
"a",
"complete",
"object",
".",
"Meaning",
"all",
"fields",
"existing",
"on",
"view",
"and",
"the",
"complete",
"object",
"are",
"copied",
"from",
"the",
"complete",
"object",
"to",
"the",
"view",
"."
] | f7c5461b2b47a10b383aee1e2f1f150f6773703b | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/model/ViewUtil.java#L27-L39 | train |
BrunoEberhard/minimal-j | src/main/java/org/minimalj/model/ViewUtil.java | ViewUtil.viewed | public static <T> T viewed(View<T> viewObject) {
if (viewObject == null) return null;
@SuppressWarnings("unchecked")
Class<T> viewedClass = (Class<T>) getViewedClass(viewObject.getClass());
Object id = IdUtils.getId(viewObject);
if (id == null) {
return null;
}
return Backend.read(viewedClass,... | java | public static <T> T viewed(View<T> viewObject) {
if (viewObject == null) return null;
@SuppressWarnings("unchecked")
Class<T> viewedClass = (Class<T>) getViewedClass(viewObject.getClass());
Object id = IdUtils.getId(viewObject);
if (id == null) {
return null;
}
return Backend.read(viewedClass,... | [
"public",
"static",
"<",
"T",
">",
"T",
"viewed",
"(",
"View",
"<",
"T",
">",
"viewObject",
")",
"{",
"if",
"(",
"viewObject",
"==",
"null",
")",
"return",
"null",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Class",
"<",
"T",
">",
"view... | Resolves a view object to the real object. Of course this is only possible by
asking the Backend to read the complete object. This method expects the view
to have an id.
@param <T> type of the complete object
@param viewObject the view object
@return the complete object (could be newer as the view object as the... | [
"Resolves",
"a",
"view",
"object",
"to",
"the",
"real",
"object",
".",
"Of",
"course",
"this",
"is",
"only",
"possible",
"by",
"asking",
"the",
"Backend",
"to",
"read",
"the",
"complete",
"object",
".",
"This",
"method",
"expects",
"the",
"view",
"to",
"... | f7c5461b2b47a10b383aee1e2f1f150f6773703b | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/model/ViewUtil.java#L62-L74 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java | ModelDiff.createModelDiff | public static ModelDiff createModelDiff(OpenEngSBModel before, OpenEngSBModel after) {
ModelDiff diff = new ModelDiff(before, after);
calculateDifferences(diff);
return diff;
} | java | public static ModelDiff createModelDiff(OpenEngSBModel before, OpenEngSBModel after) {
ModelDiff diff = new ModelDiff(before, after);
calculateDifferences(diff);
return diff;
} | [
"public",
"static",
"ModelDiff",
"createModelDiff",
"(",
"OpenEngSBModel",
"before",
",",
"OpenEngSBModel",
"after",
")",
"{",
"ModelDiff",
"diff",
"=",
"new",
"ModelDiff",
"(",
"before",
",",
"after",
")",
";",
"calculateDifferences",
"(",
"diff",
")",
";",
"... | Creates an instance of the ModelDiff class based on the both models which are passed to the function. It
instantiate the class and calculates the differences of this two models. | [
"Creates",
"an",
"instance",
"of",
"the",
"ModelDiff",
"class",
"based",
"on",
"the",
"both",
"models",
"which",
"are",
"passed",
"to",
"the",
"function",
".",
"It",
"instantiate",
"the",
"class",
"and",
"calculates",
"the",
"differences",
"of",
"this",
"two... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java#L50-L54 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java | ModelDiff.createModelDiff | public static ModelDiff createModelDiff(OpenEngSBModel updated, String completeModelId,
EngineeringDatabaseService edbService, EDBConverter edbConverter) {
EDBObject queryResult = edbService.getObject(completeModelId);
OpenEngSBModel old = edbConverter.convertEDBObjectToModel(updated.getClas... | java | public static ModelDiff createModelDiff(OpenEngSBModel updated, String completeModelId,
EngineeringDatabaseService edbService, EDBConverter edbConverter) {
EDBObject queryResult = edbService.getObject(completeModelId);
OpenEngSBModel old = edbConverter.convertEDBObjectToModel(updated.getClas... | [
"public",
"static",
"ModelDiff",
"createModelDiff",
"(",
"OpenEngSBModel",
"updated",
",",
"String",
"completeModelId",
",",
"EngineeringDatabaseService",
"edbService",
",",
"EDBConverter",
"edbConverter",
")",
"{",
"EDBObject",
"queryResult",
"=",
"edbService",
".",
"g... | Creates an instance of the ModelDiff class based on the given model. It loads the old status of the model and
calculates the differences of this two models. | [
"Creates",
"an",
"instance",
"of",
"the",
"ModelDiff",
"class",
"based",
"on",
"the",
"given",
"model",
".",
"It",
"loads",
"the",
"old",
"status",
"of",
"the",
"model",
"and",
"calculates",
"the",
"differences",
"of",
"this",
"two",
"models",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java#L60-L67 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java | ModelDiff.calculateDifferences | private static void calculateDifferences(ModelDiff diff) {
Class<?> modelClass = diff.getBefore().getClass();
for (Field field : modelClass.getDeclaredFields()) {
if (field.getName().equals(ModelUtils.MODEL_TAIL_FIELD_NAME)) {
continue;
}
try {
... | java | private static void calculateDifferences(ModelDiff diff) {
Class<?> modelClass = diff.getBefore().getClass();
for (Field field : modelClass.getDeclaredFields()) {
if (field.getName().equals(ModelUtils.MODEL_TAIL_FIELD_NAME)) {
continue;
}
try {
... | [
"private",
"static",
"void",
"calculateDifferences",
"(",
"ModelDiff",
"diff",
")",
"{",
"Class",
"<",
"?",
">",
"modelClass",
"=",
"diff",
".",
"getBefore",
"(",
")",
".",
"getClass",
"(",
")",
";",
"for",
"(",
"Field",
"field",
":",
"modelClass",
".",
... | Calculates the real differences between the two models of the given ModelDiff and saves them to the differences
field of the ModelDiff class. | [
"Calculates",
"the",
"real",
"differences",
"between",
"the",
"two",
"models",
"of",
"the",
"given",
"ModelDiff",
"and",
"saves",
"them",
"to",
"the",
"differences",
"field",
"of",
"the",
"ModelDiff",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java#L79-L95 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java | ModelDiff.addDifference | public void addDifference(Field field, Object before, Object after) {
ModelDiffEntry entry = new ModelDiffEntry();
entry.setBefore(before);
entry.setAfter(after);
entry.setField(field);
differences.put(field, entry);
} | java | public void addDifference(Field field, Object before, Object after) {
ModelDiffEntry entry = new ModelDiffEntry();
entry.setBefore(before);
entry.setAfter(after);
entry.setField(field);
differences.put(field, entry);
} | [
"public",
"void",
"addDifference",
"(",
"Field",
"field",
",",
"Object",
"before",
",",
"Object",
"after",
")",
"{",
"ModelDiffEntry",
"entry",
"=",
"new",
"ModelDiffEntry",
"(",
")",
";",
"entry",
".",
"setBefore",
"(",
"before",
")",
";",
"entry",
".",
... | Adds a difference to the list of differences of this ModelDiff instance. | [
"Adds",
"a",
"difference",
"to",
"the",
"list",
"of",
"differences",
"of",
"this",
"ModelDiff",
"instance",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java#L100-L106 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java | ModelDiff.isForeignKeyChanged | public boolean isForeignKeyChanged() {
return CollectionUtils.exists(differences.values(), new Predicate() {
@Override
public boolean evaluate(Object object) {
return ((ModelDiffEntry) object).isForeignKey();
}
});
} | java | public boolean isForeignKeyChanged() {
return CollectionUtils.exists(differences.values(), new Predicate() {
@Override
public boolean evaluate(Object object) {
return ((ModelDiffEntry) object).isForeignKey();
}
});
} | [
"public",
"boolean",
"isForeignKeyChanged",
"(",
")",
"{",
"return",
"CollectionUtils",
".",
"exists",
"(",
"differences",
".",
"values",
"(",
")",
",",
"new",
"Predicate",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"evaluate",
"(",
"Object",
"obje... | Returns true if one of the differences of this ModelDiff instance is an OpenEngSBForeignKey. Returns false
otherwise. | [
"Returns",
"true",
"if",
"one",
"of",
"the",
"differences",
"of",
"this",
"ModelDiff",
"instance",
"is",
"an",
"OpenEngSBForeignKey",
".",
"Returns",
"false",
"otherwise",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/ModelDiff.java#L112-L119 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatial/DE9IM/PolygonalDomain.java | PolygonalDomain.containsPoint | public boolean containsPoint(Coordinate point) {
Point p = new GeometryFactory().createPoint(point);
return this.getGeometry().contains(p);
} | java | public boolean containsPoint(Coordinate point) {
Point p = new GeometryFactory().createPoint(point);
return this.getGeometry().contains(p);
} | [
"public",
"boolean",
"containsPoint",
"(",
"Coordinate",
"point",
")",
"{",
"Point",
"p",
"=",
"new",
"GeometryFactory",
"(",
")",
".",
"createPoint",
"(",
"point",
")",
";",
"return",
"this",
".",
"getGeometry",
"(",
")",
".",
"contains",
"(",
"p",
")",... | Check whether this polygon contains a given point.
@param point The coordinates specifying the point to check.
@return <code>true</code> this {@link PolygonalDomain} contains this point. | [
"Check",
"whether",
"this",
"polygon",
"contains",
"a",
"given",
"point",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatial/DE9IM/PolygonalDomain.java#L46-L49 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/SecurityContext.java | SecurityContext.executeWithSystemPermissions | public static <ReturnType> ReturnType executeWithSystemPermissions(Callable<ReturnType> task)
throws ExecutionException {
ContextAwareCallable<ReturnType> contextAwareCallable = new ContextAwareCallable<ReturnType>(task);
Subject newsubject = new Subject.Builder().buildSubject();
newsubj... | java | public static <ReturnType> ReturnType executeWithSystemPermissions(Callable<ReturnType> task)
throws ExecutionException {
ContextAwareCallable<ReturnType> contextAwareCallable = new ContextAwareCallable<ReturnType>(task);
Subject newsubject = new Subject.Builder().buildSubject();
newsubj... | [
"public",
"static",
"<",
"ReturnType",
">",
"ReturnType",
"executeWithSystemPermissions",
"(",
"Callable",
"<",
"ReturnType",
">",
"task",
")",
"throws",
"ExecutionException",
"{",
"ContextAwareCallable",
"<",
"ReturnType",
">",
"contextAwareCallable",
"=",
"new",
"Co... | Executes the given task with root-permissions. Use with care.
@throws ExecutionException if an exception occurs during the execution of the task | [
"Executes",
"the",
"given",
"task",
"with",
"root",
"-",
"permissions",
".",
"Use",
"with",
"care",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/SecurityContext.java#L39-L49 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/SecurityContext.java | SecurityContext.executeWithSystemPermissions | public static void executeWithSystemPermissions(Runnable task) {
ContextAwareRunnable contextAwaretask = new ContextAwareRunnable(task);
Subject newsubject = new Subject.Builder().buildSubject();
newsubject.login(new RootAuthenticationToken());
try {
newsubject.execute(contex... | java | public static void executeWithSystemPermissions(Runnable task) {
ContextAwareRunnable contextAwaretask = new ContextAwareRunnable(task);
Subject newsubject = new Subject.Builder().buildSubject();
newsubject.login(new RootAuthenticationToken());
try {
newsubject.execute(contex... | [
"public",
"static",
"void",
"executeWithSystemPermissions",
"(",
"Runnable",
"task",
")",
"{",
"ContextAwareRunnable",
"contextAwaretask",
"=",
"new",
"ContextAwareRunnable",
"(",
"task",
")",
";",
"Subject",
"newsubject",
"=",
"new",
"Subject",
".",
"Builder",
"(",... | wraps an existing ExecutorService to handle context- and security-related threadlocal variables | [
"wraps",
"an",
"existing",
"ExecutorService",
"to",
"handle",
"context",
"-",
"and",
"security",
"-",
"related",
"threadlocal",
"variables"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/SecurityContext.java#L54-L63 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/SecurityContext.java | SecurityContext.getSecurityContextAwareExecutor | public static ExecutorService getSecurityContextAwareExecutor(ExecutorService original) {
SubjectAwareExecutorService subjectAwareExecutor = new SubjectAwareExecutorService(original);
return ThreadLocalUtil.contextAwareExecutor(subjectAwareExecutor);
} | java | public static ExecutorService getSecurityContextAwareExecutor(ExecutorService original) {
SubjectAwareExecutorService subjectAwareExecutor = new SubjectAwareExecutorService(original);
return ThreadLocalUtil.contextAwareExecutor(subjectAwareExecutor);
} | [
"public",
"static",
"ExecutorService",
"getSecurityContextAwareExecutor",
"(",
"ExecutorService",
"original",
")",
"{",
"SubjectAwareExecutorService",
"subjectAwareExecutor",
"=",
"new",
"SubjectAwareExecutorService",
"(",
"original",
")",
";",
"return",
"ThreadLocalUtil",
".... | Wrap the given executor so that it takes authentication-information and context are inherited to tasks when they
are submitted. | [
"Wrap",
"the",
"given",
"executor",
"so",
"that",
"it",
"takes",
"authentication",
"-",
"information",
"and",
"context",
"are",
"inherited",
"to",
"tasks",
"when",
"they",
"are",
"submitted",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/SecurityContext.java#L69-L72 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/BeanUtilsExtended.java | BeanUtilsExtended.createBeanFromAttributeMap | public static <BeanType> BeanType createBeanFromAttributeMap(Class<BeanType> beanType,
Map<String, ? extends Object> attributeValues) {
BeanType instance;
try {
instance = beanType.newInstance();
BeanUtils.populate(instance, attributeValues);
} catch (Exceptio... | java | public static <BeanType> BeanType createBeanFromAttributeMap(Class<BeanType> beanType,
Map<String, ? extends Object> attributeValues) {
BeanType instance;
try {
instance = beanType.newInstance();
BeanUtils.populate(instance, attributeValues);
} catch (Exceptio... | [
"public",
"static",
"<",
"BeanType",
">",
"BeanType",
"createBeanFromAttributeMap",
"(",
"Class",
"<",
"BeanType",
">",
"beanType",
",",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"attributeValues",
")",
"{",
"BeanType",
"instance",
";",
"try",
... | Creates a new instance of the beanType and populates it with the property-values from the map
@throws IllegalArgumentException if the bean cannot be populated because of errors in the definition of the
beantype | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"beanType",
"and",
"populates",
"it",
"with",
"the",
"property",
"-",
"values",
"from",
"the",
"map"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/BeanUtilsExtended.java#L83-L94 | train |
openengsb/openengsb | components/workflow/src/main/java/org/openengsb/core/workflow/drools/internal/RulebaseBuilder.java | RulebaseBuilder.reloadRulebase | public synchronized void reloadRulebase() throws RuleBaseException {
long start = System.currentTimeMillis();
reloadDeclarations();
packageStrings.clear();
for (RuleBaseElementId id : manager.listAll(RuleBaseElementType.Function)) {
String packageName = id.getPackageName();
... | java | public synchronized void reloadRulebase() throws RuleBaseException {
long start = System.currentTimeMillis();
reloadDeclarations();
packageStrings.clear();
for (RuleBaseElementId id : manager.listAll(RuleBaseElementType.Function)) {
String packageName = id.getPackageName();
... | [
"public",
"synchronized",
"void",
"reloadRulebase",
"(",
")",
"throws",
"RuleBaseException",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"reloadDeclarations",
"(",
")",
";",
"packageStrings",
".",
"clear",
"(",
")",
";",
"for"... | reloads the rulebase but keeps references intact
@throws RuleBaseException if the rulebase contains errors | [
"reloads",
"the",
"rulebase",
"but",
"keeps",
"references",
"intact"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/workflow/src/main/java/org/openengsb/core/workflow/drools/internal/RulebaseBuilder.java#L73-L112 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.convertEDBObjectToModel | @SuppressWarnings("unchecked")
public <T> T convertEDBObjectToModel(Class<T> model, EDBObject object) {
return (T) convertEDBObjectToUncheckedModel(model, object);
} | java | @SuppressWarnings("unchecked")
public <T> T convertEDBObjectToModel(Class<T> model, EDBObject object) {
return (T) convertEDBObjectToUncheckedModel(model, object);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"convertEDBObjectToModel",
"(",
"Class",
"<",
"T",
">",
"model",
",",
"EDBObject",
"object",
")",
"{",
"return",
"(",
"T",
")",
"convertEDBObjectToUncheckedModel",
"(",
"model",
... | Converts an EDBObject to a model of the given model type. | [
"Converts",
"an",
"EDBObject",
"to",
"a",
"model",
"of",
"the",
"given",
"model",
"type",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L77-L80 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.convertEDBObjectsToModelObjects | public <T> List<T> convertEDBObjectsToModelObjects(Class<T> model, List<EDBObject> objects) {
List<T> models = new ArrayList<>();
for (EDBObject object : objects) {
T instance = convertEDBObjectToModel(model, object);
if (instance != null) {
models.add(instance);
... | java | public <T> List<T> convertEDBObjectsToModelObjects(Class<T> model, List<EDBObject> objects) {
List<T> models = new ArrayList<>();
for (EDBObject object : objects) {
T instance = convertEDBObjectToModel(model, object);
if (instance != null) {
models.add(instance);
... | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"convertEDBObjectsToModelObjects",
"(",
"Class",
"<",
"T",
">",
"model",
",",
"List",
"<",
"EDBObject",
">",
"objects",
")",
"{",
"List",
"<",
"T",
">",
"models",
"=",
"new",
"ArrayList",
"<>",
"(",
")"... | Converts a list of EDBObjects to a list of models of the given model type. | [
"Converts",
"a",
"list",
"of",
"EDBObjects",
"to",
"a",
"list",
"of",
"models",
"of",
"the",
"given",
"model",
"type",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L85-L94 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.checkEDBObjectModelType | private boolean checkEDBObjectModelType(EDBObject object, Class<?> model) {
String modelClass = object.getString(EDBConstants.MODEL_TYPE);
if (modelClass == null) {
LOGGER.warn(String.format("The EDBObject with the oid %s has no model type information."
+ "The resulting m... | java | private boolean checkEDBObjectModelType(EDBObject object, Class<?> model) {
String modelClass = object.getString(EDBConstants.MODEL_TYPE);
if (modelClass == null) {
LOGGER.warn(String.format("The EDBObject with the oid %s has no model type information."
+ "The resulting m... | [
"private",
"boolean",
"checkEDBObjectModelType",
"(",
"EDBObject",
"object",
",",
"Class",
"<",
"?",
">",
"model",
")",
"{",
"String",
"modelClass",
"=",
"object",
".",
"getString",
"(",
"EDBConstants",
".",
"MODEL_TYPE",
")",
";",
"if",
"(",
"modelClass",
"... | Tests if an EDBObject has the correct model class in which it should be converted. Returns false if the model
type is not fitting, returns true if the model type is fitting or model type is unknown. | [
"Tests",
"if",
"an",
"EDBObject",
"has",
"the",
"correct",
"model",
"class",
"in",
"which",
"it",
"should",
"be",
"converted",
".",
"Returns",
"false",
"if",
"the",
"model",
"type",
"is",
"not",
"fitting",
"returns",
"true",
"if",
"the",
"model",
"type",
... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L100-L110 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.convertEDBObjectToUncheckedModel | private Object convertEDBObjectToUncheckedModel(Class<?> model, EDBObject object) {
if (!checkEDBObjectModelType(object, model)) {
return null;
}
filterEngineeringObjectInformation(object, model);
List<OpenEngSBModelEntry> entries = new ArrayList<>();
for (PropertyDes... | java | private Object convertEDBObjectToUncheckedModel(Class<?> model, EDBObject object) {
if (!checkEDBObjectModelType(object, model)) {
return null;
}
filterEngineeringObjectInformation(object, model);
List<OpenEngSBModelEntry> entries = new ArrayList<>();
for (PropertyDes... | [
"private",
"Object",
"convertEDBObjectToUncheckedModel",
"(",
"Class",
"<",
"?",
">",
"model",
",",
"EDBObject",
"object",
")",
"{",
"if",
"(",
"!",
"checkEDBObjectModelType",
"(",
"object",
",",
"model",
")",
")",
"{",
"return",
"null",
";",
"}",
"filterEng... | Converts an EDBObject to a model by analyzing the object and trying to call the corresponding setters of the
model. | [
"Converts",
"an",
"EDBObject",
"to",
"a",
"model",
"by",
"analyzing",
"the",
"object",
"and",
"trying",
"to",
"call",
"the",
"corresponding",
"setters",
"of",
"the",
"model",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L116-L148 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getPropertyDescriptorsForClass | private List<PropertyDescriptor> getPropertyDescriptorsForClass(Class<?> clasz) {
try {
BeanInfo beanInfo = Introspector.getBeanInfo(clasz);
return Arrays.asList(beanInfo.getPropertyDescriptors());
} catch (IntrospectionException e) {
LOGGER.error("instantiation excep... | java | private List<PropertyDescriptor> getPropertyDescriptorsForClass(Class<?> clasz) {
try {
BeanInfo beanInfo = Introspector.getBeanInfo(clasz);
return Arrays.asList(beanInfo.getPropertyDescriptors());
} catch (IntrospectionException e) {
LOGGER.error("instantiation excep... | [
"private",
"List",
"<",
"PropertyDescriptor",
">",
"getPropertyDescriptorsForClass",
"(",
"Class",
"<",
"?",
">",
"clasz",
")",
"{",
"try",
"{",
"BeanInfo",
"beanInfo",
"=",
"Introspector",
".",
"getBeanInfo",
"(",
"clasz",
")",
";",
"return",
"Arrays",
".",
... | Returns all property descriptors for a given class. | [
"Returns",
"all",
"property",
"descriptors",
"for",
"a",
"given",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L153-L161 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getValueForProperty | private Object getValueForProperty(PropertyDescriptor propertyDescriptor, EDBObject object) {
Method setterMethod = propertyDescriptor.getWriteMethod();
String propertyName = propertyDescriptor.getName();
Object value = object.getObject(propertyName);
Class<?> parameterType = setterMetho... | java | private Object getValueForProperty(PropertyDescriptor propertyDescriptor, EDBObject object) {
Method setterMethod = propertyDescriptor.getWriteMethod();
String propertyName = propertyDescriptor.getName();
Object value = object.getObject(propertyName);
Class<?> parameterType = setterMetho... | [
"private",
"Object",
"getValueForProperty",
"(",
"PropertyDescriptor",
"propertyDescriptor",
",",
"EDBObject",
"object",
")",
"{",
"Method",
"setterMethod",
"=",
"propertyDescriptor",
".",
"getWriteMethod",
"(",
")",
";",
"String",
"propertyName",
"=",
"propertyDescript... | Generate the value for a specific property of a model out of an EDBObject. | [
"Generate",
"the",
"value",
"for",
"a",
"specific",
"property",
"of",
"a",
"model",
"out",
"of",
"an",
"EDBObject",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L166-L214 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getListValue | @SuppressWarnings("unchecked")
private <T> List<T> getListValue(Class<T> type, String propertyName, EDBObject object) {
List<T> temp = new ArrayList<>();
for (int i = 0;; i++) {
String property = getEntryNameForList(propertyName, i);
Object obj = object.getObject(property);
... | java | @SuppressWarnings("unchecked")
private <T> List<T> getListValue(Class<T> type, String propertyName, EDBObject object) {
List<T> temp = new ArrayList<>();
for (int i = 0;; i++) {
String property = getEntryNameForList(propertyName, i);
Object obj = object.getObject(property);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getListValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"propertyName",
",",
"EDBObject",
"object",
")",
"{",
"List",
"<",
"T",
">",
"temp"... | Gets a list object out of an EDBObject. | [
"Gets",
"a",
"list",
"object",
"out",
"of",
"an",
"EDBObject",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L246-L262 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getArrayValue | @SuppressWarnings("unchecked")
private <T> T[] getArrayValue(Class<T> type, String propertyName, EDBObject object) {
List<T> elements = getListValue(type, propertyName, object);
T[] ar = (T[]) Array.newInstance(type, elements.size());
return elements.toArray(ar);
} | java | @SuppressWarnings("unchecked")
private <T> T[] getArrayValue(Class<T> type, String propertyName, EDBObject object) {
List<T> elements = getListValue(type, propertyName, object);
T[] ar = (T[]) Array.newInstance(type, elements.size());
return elements.toArray(ar);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"<",
"T",
">",
"T",
"[",
"]",
"getArrayValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"propertyName",
",",
"EDBObject",
"object",
")",
"{",
"List",
"<",
"T",
">",
"elements",
"... | Gets an array object out of an EDBObject. | [
"Gets",
"an",
"array",
"object",
"out",
"of",
"an",
"EDBObject",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L267-L272 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getMapValue | private Object getMapValue(Class<?> keyType, Class<?> valueType, String propertyName, EDBObject object) {
Map<Object, Object> temp = new HashMap<>();
for (int i = 0;; i++) {
String keyProperty = getEntryNameForMapKey(propertyName, i);
String valueProperty = getEntryNameForMapValu... | java | private Object getMapValue(Class<?> keyType, Class<?> valueType, String propertyName, EDBObject object) {
Map<Object, Object> temp = new HashMap<>();
for (int i = 0;; i++) {
String keyProperty = getEntryNameForMapKey(propertyName, i);
String valueProperty = getEntryNameForMapValu... | [
"private",
"Object",
"getMapValue",
"(",
"Class",
"<",
"?",
">",
"keyType",
",",
"Class",
"<",
"?",
">",
"valueType",
",",
"String",
"propertyName",
",",
"EDBObject",
"object",
")",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"temp",
"=",
"new",
"Ha... | Gets a map object out of an EDBObject. | [
"Gets",
"a",
"map",
"object",
"out",
"of",
"an",
"EDBObject",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L277-L298 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getEnumValue | private Object getEnumValue(Class<?> type, Object value) {
Object[] enumValues = type.getEnumConstants();
for (Object enumValue : enumValues) {
if (enumValue.toString().equals(value.toString())) {
value = enumValue;
break;
}
}
retur... | java | private Object getEnumValue(Class<?> type, Object value) {
Object[] enumValues = type.getEnumConstants();
for (Object enumValue : enumValues) {
if (enumValue.toString().equals(value.toString())) {
value = enumValue;
break;
}
}
retur... | [
"private",
"Object",
"getEnumValue",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"value",
")",
"{",
"Object",
"[",
"]",
"enumValues",
"=",
"type",
".",
"getEnumConstants",
"(",
")",
";",
"for",
"(",
"Object",
"enumValue",
":",
"enumValues",
")",
... | Gets an enum value out of an object. | [
"Gets",
"an",
"enum",
"value",
"out",
"of",
"an",
"object",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L303-L312 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.convertEKBCommit | public ConvertedCommit convertEKBCommit(EKBCommit commit) {
ConvertedCommit result = new ConvertedCommit();
ConnectorInformation information = commit.getConnectorInformation();
result.setInserts(convertModelsToEDBObjects(commit.getInserts(), information));
result.setUpdates(convertModels... | java | public ConvertedCommit convertEKBCommit(EKBCommit commit) {
ConvertedCommit result = new ConvertedCommit();
ConnectorInformation information = commit.getConnectorInformation();
result.setInserts(convertModelsToEDBObjects(commit.getInserts(), information));
result.setUpdates(convertModels... | [
"public",
"ConvertedCommit",
"convertEKBCommit",
"(",
"EKBCommit",
"commit",
")",
"{",
"ConvertedCommit",
"result",
"=",
"new",
"ConvertedCommit",
"(",
")",
";",
"ConnectorInformation",
"information",
"=",
"commit",
".",
"getConnectorInformation",
"(",
")",
";",
"re... | Converts the models of an EKBCommit to EDBObjects and return an object which contains the three corresponding
lists | [
"Converts",
"the",
"models",
"of",
"an",
"EKBCommit",
"to",
"EDBObjects",
"and",
"return",
"an",
"object",
"which",
"contains",
"the",
"three",
"corresponding",
"lists"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L318-L325 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.fillEDBObjectWithEngineeringObjectInformation | private void fillEDBObjectWithEngineeringObjectInformation(EDBObject object, OpenEngSBModel model)
throws IllegalAccessException {
if (!new AdvancedModelWrapper(model).isEngineeringObject()) {
return;
}
for (Field field : model.getClass().getDeclaredFields()) {
Op... | java | private void fillEDBObjectWithEngineeringObjectInformation(EDBObject object, OpenEngSBModel model)
throws IllegalAccessException {
if (!new AdvancedModelWrapper(model).isEngineeringObject()) {
return;
}
for (Field field : model.getClass().getDeclaredFields()) {
Op... | [
"private",
"void",
"fillEDBObjectWithEngineeringObjectInformation",
"(",
"EDBObject",
"object",
",",
"OpenEngSBModel",
"model",
")",
"throws",
"IllegalAccessException",
"{",
"if",
"(",
"!",
"new",
"AdvancedModelWrapper",
"(",
"model",
")",
".",
"isEngineeringObject",
"(... | Adds to the EDBObject special entries which mark that a model is referring to other models through
OpenEngSBForeignKey annotations | [
"Adds",
"to",
"the",
"EDBObject",
"special",
"entries",
"which",
"mark",
"that",
"a",
"model",
"is",
"referring",
"to",
"other",
"models",
"through",
"OpenEngSBForeignKey",
"annotations"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L465-L483 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.filterEngineeringObjectInformation | private void filterEngineeringObjectInformation(EDBObject object, Class<?> model) {
if (!AdvancedModelWrapper.isEngineeringObjectClass(model)) {
return;
}
Iterator<String> keys = object.keySet().iterator();
while (keys.hasNext()) {
if (keys.next().startsWith(REFER... | java | private void filterEngineeringObjectInformation(EDBObject object, Class<?> model) {
if (!AdvancedModelWrapper.isEngineeringObjectClass(model)) {
return;
}
Iterator<String> keys = object.keySet().iterator();
while (keys.hasNext()) {
if (keys.next().startsWith(REFER... | [
"private",
"void",
"filterEngineeringObjectInformation",
"(",
"EDBObject",
"object",
",",
"Class",
"<",
"?",
">",
"model",
")",
"{",
"if",
"(",
"!",
"AdvancedModelWrapper",
".",
"isEngineeringObjectClass",
"(",
"model",
")",
")",
"{",
"return",
";",
"}",
"Iter... | Filters the reference prefix values added in the model to EDBObject conversion out of the EDBObject | [
"Filters",
"the",
"reference",
"prefix",
"values",
"added",
"in",
"the",
"model",
"to",
"EDBObject",
"conversion",
"out",
"of",
"the",
"EDBObject"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L488-L498 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getEntryNameForMapKey | public static String getEntryNameForMapKey(String property, Integer index) {
return getEntryNameForMap(property, true, index);
} | java | public static String getEntryNameForMapKey(String property, Integer index) {
return getEntryNameForMap(property, true, index);
} | [
"public",
"static",
"String",
"getEntryNameForMapKey",
"(",
"String",
"property",
",",
"Integer",
"index",
")",
"{",
"return",
"getEntryNameForMap",
"(",
"property",
",",
"true",
",",
"index",
")",
";",
"}"
] | Returns the entry name for a map key in the EDB format. E.g. the map key for the property "map" with the index 0
would be "map.0.key". | [
"Returns",
"the",
"entry",
"name",
"for",
"a",
"map",
"key",
"in",
"the",
"EDB",
"format",
".",
"E",
".",
"g",
".",
"the",
"map",
"key",
"for",
"the",
"property",
"map",
"with",
"the",
"index",
"0",
"would",
"be",
"map",
".",
"0",
".",
"key",
"."... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L504-L506 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getEntryNameForMapValue | public static String getEntryNameForMapValue(String property, Integer index) {
return getEntryNameForMap(property, false, index);
} | java | public static String getEntryNameForMapValue(String property, Integer index) {
return getEntryNameForMap(property, false, index);
} | [
"public",
"static",
"String",
"getEntryNameForMapValue",
"(",
"String",
"property",
",",
"Integer",
"index",
")",
"{",
"return",
"getEntryNameForMap",
"(",
"property",
",",
"false",
",",
"index",
")",
";",
"}"
] | Returns the entry name for a map value in the EDB format. E.g. the map value for the property "map" with the
index 0 would be "map.0.value". | [
"Returns",
"the",
"entry",
"name",
"for",
"a",
"map",
"value",
"in",
"the",
"EDB",
"format",
".",
"E",
".",
"g",
".",
"the",
"map",
"value",
"for",
"the",
"property",
"map",
"with",
"the",
"index",
"0",
"would",
"be",
"map",
".",
"0",
".",
"value",... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L512-L514 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getEntryNameForMap | private static String getEntryNameForMap(String property, Boolean key, Integer index) {
return String.format("%s.%d.%s", property, index, key ? "key" : "value");
} | java | private static String getEntryNameForMap(String property, Boolean key, Integer index) {
return String.format("%s.%d.%s", property, index, key ? "key" : "value");
} | [
"private",
"static",
"String",
"getEntryNameForMap",
"(",
"String",
"property",
",",
"Boolean",
"key",
",",
"Integer",
"index",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s.%d.%s\"",
",",
"property",
",",
"index",
",",
"key",
"?",
"\"key\"",
":",
... | Returns the entry name for a map element in the EDB format. The key parameter defines if the entry name should be
generated for the key or the value of the map. E.g. the map key for the property "map" with the index 0 would be
"map.0.key". | [
"Returns",
"the",
"entry",
"name",
"for",
"a",
"map",
"element",
"in",
"the",
"EDB",
"format",
".",
"The",
"key",
"parameter",
"defines",
"if",
"the",
"entry",
"name",
"should",
"be",
"generated",
"for",
"the",
"key",
"or",
"the",
"value",
"of",
"the",
... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L521-L523 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getEntryNameForList | public static String getEntryNameForList(String property, Integer index) {
return String.format("%s.%d", property, index);
} | java | public static String getEntryNameForList(String property, Integer index) {
return String.format("%s.%d", property, index);
} | [
"public",
"static",
"String",
"getEntryNameForList",
"(",
"String",
"property",
",",
"Integer",
"index",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s.%d\"",
",",
"property",
",",
"index",
")",
";",
"}"
] | Returns the entry name for a list element in the EDB format. E.g. the list element for the property "list" with
the index 0 would be "list.0". | [
"Returns",
"the",
"entry",
"name",
"for",
"a",
"list",
"element",
"in",
"the",
"EDB",
"format",
".",
"E",
".",
"g",
".",
"the",
"list",
"element",
"for",
"the",
"property",
"list",
"with",
"the",
"index",
"0",
"would",
"be",
"list",
".",
"0",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L529-L531 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java | EDBConverter.getEOReferenceStringFromAnnotation | public static String getEOReferenceStringFromAnnotation(OpenEngSBForeignKey key) {
return String.format("%s%s:%s", REFERENCE_PREFIX, key.modelType(), key.modelVersion().toString());
} | java | public static String getEOReferenceStringFromAnnotation(OpenEngSBForeignKey key) {
return String.format("%s%s:%s", REFERENCE_PREFIX, key.modelType(), key.modelVersion().toString());
} | [
"public",
"static",
"String",
"getEOReferenceStringFromAnnotation",
"(",
"OpenEngSBForeignKey",
"key",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s%s:%s\"",
",",
"REFERENCE_PREFIX",
",",
"key",
".",
"modelType",
"(",
")",
",",
"key",
".",
"modelVersion"... | Converts an OpenEngSBForeignKey annotation to the fitting format which will be added to an EDBObject. | [
"Converts",
"an",
"OpenEngSBForeignKey",
"annotation",
"to",
"the",
"fitting",
"format",
"which",
"will",
"be",
"added",
"to",
"an",
"EDBObject",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L536-L538 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.assigneModelsToViews | private static Map<String, ModelDescription> assigneModelsToViews(Map<ModelDescription,
XLinkConnectorView[]> modelsToViews) {
HashMap<String, ModelDescription> viewsToModels = new HashMap<String, ModelDescription>();
for (ModelDescription modelInfo : modelsToViews.keySet()) {
L... | java | private static Map<String, ModelDescription> assigneModelsToViews(Map<ModelDescription,
XLinkConnectorView[]> modelsToViews) {
HashMap<String, ModelDescription> viewsToModels = new HashMap<String, ModelDescription>();
for (ModelDescription modelInfo : modelsToViews.keySet()) {
L... | [
"private",
"static",
"Map",
"<",
"String",
",",
"ModelDescription",
">",
"assigneModelsToViews",
"(",
"Map",
"<",
"ModelDescription",
",",
"XLinkConnectorView",
"[",
"]",
">",
"modelsToViews",
")",
"{",
"HashMap",
"<",
"String",
",",
"ModelDescription",
">",
"vi... | Naive model to view assignment.
The current model is choosen for the first occurence of the view. | [
"Naive",
"model",
"to",
"view",
"assignment",
".",
"The",
"current",
"model",
"is",
"choosen",
"for",
"the",
"first",
"occurence",
"of",
"the",
"view",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L90-L102 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.getExpirationDate | private static String getExpirationDate(int futureDays) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_YEAR, futureDays);
Format formatter = new SimpleDateFormat(XLinkConstants.DATEFORMAT);
return formatter.format(calendar.getTime());
} | java | private static String getExpirationDate(int futureDays) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_YEAR, futureDays);
Format formatter = new SimpleDateFormat(XLinkConstants.DATEFORMAT);
return formatter.format(calendar.getTime());
} | [
"private",
"static",
"String",
"getExpirationDate",
"(",
"int",
"futureDays",
")",
"{",
"Calendar",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"calendar",
".",
"add",
"(",
"Calendar",
".",
"DAY_OF_YEAR",
",",
"futureDays",
")",
";",
"For... | Returns a future Date-String in the format 'yyyyMMddkkmmss'. | [
"Returns",
"a",
"future",
"Date",
"-",
"String",
"in",
"the",
"format",
"yyyyMMddkkmmss",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L107-L112 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.setValueOfModel | public static void setValueOfModel(Object model, OpenEngSBModelEntry entry, Object value) throws
NoSuchFieldException,
IllegalArgumentException,
IllegalAccessException {
Class clazz = model.getClass();
Field field = clazz.getDeclaredField(entry.getKey());
f... | java | public static void setValueOfModel(Object model, OpenEngSBModelEntry entry, Object value) throws
NoSuchFieldException,
IllegalArgumentException,
IllegalAccessException {
Class clazz = model.getClass();
Field field = clazz.getDeclaredField(entry.getKey());
f... | [
"public",
"static",
"void",
"setValueOfModel",
"(",
"Object",
"model",
",",
"OpenEngSBModelEntry",
"entry",
",",
"Object",
"value",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalArgumentException",
",",
"IllegalAccessException",
"{",
"Class",
"clazz",
"=",
"mode... | Sets the value, of the field defined in the OpenEngSBModelEntry, the the given model,
with reflection. | [
"Sets",
"the",
"value",
"of",
"the",
"field",
"defined",
"in",
"the",
"OpenEngSBModelEntry",
"the",
"the",
"given",
"model",
"with",
"reflection",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L120-L128 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.createInstanceOfModelClass | public static Object createInstanceOfModelClass(Class clazzObject,
List<OpenEngSBModelEntry> entries) {
return ModelUtils.createModel(clazzObject, entries);
} | java | public static Object createInstanceOfModelClass(Class clazzObject,
List<OpenEngSBModelEntry> entries) {
return ModelUtils.createModel(clazzObject, entries);
} | [
"public",
"static",
"Object",
"createInstanceOfModelClass",
"(",
"Class",
"clazzObject",
",",
"List",
"<",
"OpenEngSBModelEntry",
">",
"entries",
")",
"{",
"return",
"ModelUtils",
".",
"createModel",
"(",
"clazzObject",
",",
"entries",
")",
";",
"}"
] | Returns an instance to a given Classobject and a List of OpenEngSBModelEntries.
Returns null, if an error happens during the instantiation. | [
"Returns",
"an",
"instance",
"to",
"a",
"given",
"Classobject",
"and",
"a",
"List",
"of",
"OpenEngSBModelEntries",
".",
"Returns",
"null",
"if",
"an",
"error",
"happens",
"during",
"the",
"instantiation",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L143-L146 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.dateStringToCalendar | public static Calendar dateStringToCalendar(String dateString) {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat(XLinkConstants.DATEFORMAT);
try {
calendar.setTime(formatter.parse(dateString));
} catch (Exception ex) {
... | java | public static Calendar dateStringToCalendar(String dateString) {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat(XLinkConstants.DATEFORMAT);
try {
calendar.setTime(formatter.parse(dateString));
} catch (Exception ex) {
... | [
"public",
"static",
"Calendar",
"dateStringToCalendar",
"(",
"String",
"dateString",
")",
"{",
"Calendar",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"SimpleDateFormat",
"formatter",
"=",
"new",
"SimpleDateFormat",
"(",
"XLinkConstants",
".",
... | Returns a Calendarobject to a given dateString in the Format 'DATEFORMAT'.
If the given String is of the wrong format, null is returned.
@see XLinkUtils#DATEFORMAT | [
"Returns",
"a",
"Calendarobject",
"to",
"a",
"given",
"dateString",
"in",
"the",
"Format",
"DATEFORMAT",
".",
"If",
"the",
"given",
"String",
"is",
"of",
"the",
"wrong",
"format",
"null",
"is",
"returned",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L166-L175 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.urlEncodeParameter | private static String urlEncodeParameter(String parameter) {
try {
return URLEncoder.encode(parameter, "UTF-8");
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(XLinkUtils.class.getName()).log(Level.SEVERE, null, ex);
}
return parameter;
} | java | private static String urlEncodeParameter(String parameter) {
try {
return URLEncoder.encode(parameter, "UTF-8");
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(XLinkUtils.class.getName()).log(Level.SEVERE, null, ex);
}
return parameter;
} | [
"private",
"static",
"String",
"urlEncodeParameter",
"(",
"String",
"parameter",
")",
"{",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"parameter",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"ex",
")",
"{",
"Logg... | Encodes a given Parameter in UTF-8. | [
"Encodes",
"a",
"given",
"Parameter",
"in",
"UTF",
"-",
"8",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L180-L187 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.getViewsOfRegistration | public static XLinkConnectorView[] getViewsOfRegistration(XLinkConnectorRegistration registration) {
List<XLinkConnectorView> viewsOfRegistration = new ArrayList<XLinkConnectorView>();
Map<ModelDescription, XLinkConnectorView[]> modelsToViews = registration.getModelsToViews();
for (XLinkConnecto... | java | public static XLinkConnectorView[] getViewsOfRegistration(XLinkConnectorRegistration registration) {
List<XLinkConnectorView> viewsOfRegistration = new ArrayList<XLinkConnectorView>();
Map<ModelDescription, XLinkConnectorView[]> modelsToViews = registration.getModelsToViews();
for (XLinkConnecto... | [
"public",
"static",
"XLinkConnectorView",
"[",
"]",
"getViewsOfRegistration",
"(",
"XLinkConnectorRegistration",
"registration",
")",
"{",
"List",
"<",
"XLinkConnectorView",
">",
"viewsOfRegistration",
"=",
"new",
"ArrayList",
"<",
"XLinkConnectorView",
">",
"(",
")",
... | Returns a distinct List of all RemoteToolViews, contained in a RemoteToolRegistration.
@see RemoteToolView
@see RemoteToolRegistration | [
"Returns",
"a",
"distinct",
"List",
"of",
"all",
"RemoteToolViews",
"contained",
"in",
"a",
"RemoteToolRegistration",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L194-L206 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java | XLinkUtils.getLocalToolFromRegistrations | public static XLinkConnector[] getLocalToolFromRegistrations(List<XLinkConnectorRegistration> registrations) {
List<XLinkConnector> tools = new ArrayList<XLinkConnector>();
for (XLinkConnectorRegistration registration : registrations) {
XLinkConnector newLocalTools
= new XLi... | java | public static XLinkConnector[] getLocalToolFromRegistrations(List<XLinkConnectorRegistration> registrations) {
List<XLinkConnector> tools = new ArrayList<XLinkConnector>();
for (XLinkConnectorRegistration registration : registrations) {
XLinkConnector newLocalTools
= new XLi... | [
"public",
"static",
"XLinkConnector",
"[",
"]",
"getLocalToolFromRegistrations",
"(",
"List",
"<",
"XLinkConnectorRegistration",
">",
"registrations",
")",
"{",
"List",
"<",
"XLinkConnector",
">",
"tools",
"=",
"new",
"ArrayList",
"<",
"XLinkConnector",
">",
"(",
... | Returns a list of RemoteTools to a list of RemoteToolRegistrations.
The list of RemoteTool can be sent to a remote host. A RemoteToolRegistration
is for internal usage only.
@see RemoteToolRegistration
@see RemoteTool | [
"Returns",
"a",
"list",
"of",
"RemoteTools",
"to",
"a",
"list",
"of",
"RemoteToolRegistrations",
".",
"The",
"list",
"of",
"RemoteTool",
"can",
"be",
"sent",
"to",
"a",
"remote",
"host",
".",
"A",
"RemoteToolRegistration",
"is",
"for",
"internal",
"usage",
"... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/xlink/XLinkUtils.java#L215-L226 | train |
aseovic/coherence-tools | loader/src/main/java/com/seovic/loader/target/JpaTarget.java | JpaTarget.mergeInTransaction | private void mergeInTransaction(EntityManager em, Collection objects) {
EntityTransaction tx = null;
try {
tx = em.getTransaction();
tx.begin();
for (Object o : objects) {
em.merge(o);
}
tx.commit();
}
... | java | private void mergeInTransaction(EntityManager em, Collection objects) {
EntityTransaction tx = null;
try {
tx = em.getTransaction();
tx.begin();
for (Object o : objects) {
em.merge(o);
}
tx.commit();
}
... | [
"private",
"void",
"mergeInTransaction",
"(",
"EntityManager",
"em",
",",
"Collection",
"objects",
")",
"{",
"EntityTransaction",
"tx",
"=",
"null",
";",
"try",
"{",
"tx",
"=",
"em",
".",
"getTransaction",
"(",
")",
";",
"tx",
".",
"begin",
"(",
")",
";"... | Persist collection of objects.
@param em entity manager used to persist objects
@param objects objects to persist | [
"Persist",
"collection",
"of",
"objects",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/loader/src/main/java/com/seovic/loader/target/JpaTarget.java#L98-L114 | train |
openengsb/openengsb | components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/driver/h2/SchemaCreateCommand.java | SchemaCreateCommand.execute | public void execute() {
try {
new JdbcTemplate(dataSource).execute(readResourceContent(SCHEMA_FILE)); // TODO: sql independence
} catch (IOException e) {
throw new RuntimeException("Could not create schema for EDBI Index", e);
}
} | java | public void execute() {
try {
new JdbcTemplate(dataSource).execute(readResourceContent(SCHEMA_FILE)); // TODO: sql independence
} catch (IOException e) {
throw new RuntimeException("Could not create schema for EDBI Index", e);
}
} | [
"public",
"void",
"execute",
"(",
")",
"{",
"try",
"{",
"new",
"JdbcTemplate",
"(",
"dataSource",
")",
".",
"execute",
"(",
"readResourceContent",
"(",
"SCHEMA_FILE",
")",
")",
";",
"// TODO: sql independence",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{"... | Creates the necessary relations to save Index and IndexField instances. | [
"Creates",
"the",
"necessary",
"relations",
"to",
"save",
"Index",
"and",
"IndexField",
"instances",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/driver/h2/SchemaCreateCommand.java#L44-L50 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/TimebasedOrderFilter.java | TimebasedOrderFilter.addId | public static void addId(Entry entry, boolean updateRdn) {
String uuid = newUUID().toString();
try {
entry.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, UNIQUE_OBJECT_OC);
entry.add(ID_ATTRIBUTE, uuid);
} catch (LdapException e) {
throw new LdapRuntimeException(... | java | public static void addId(Entry entry, boolean updateRdn) {
String uuid = newUUID().toString();
try {
entry.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, UNIQUE_OBJECT_OC);
entry.add(ID_ATTRIBUTE, uuid);
} catch (LdapException e) {
throw new LdapRuntimeException(... | [
"public",
"static",
"void",
"addId",
"(",
"Entry",
"entry",
",",
"boolean",
"updateRdn",
")",
"{",
"String",
"uuid",
"=",
"newUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"try",
"{",
"entry",
".",
"add",
"(",
"SchemaConstants",
".",
"OBJECT_CLASS_ATT... | Adds a timebased uuid to entry. If updateRdn is true, the uuid becomes the rdn. Use this to handle duplicates. | [
"Adds",
"a",
"timebased",
"uuid",
"to",
"entry",
".",
"If",
"updateRdn",
"is",
"true",
"the",
"uuid",
"becomes",
"the",
"rdn",
".",
"Use",
"this",
"to",
"handle",
"duplicates",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/TimebasedOrderFilter.java#L57-L69 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/TimebasedOrderFilter.java | TimebasedOrderFilter.addIds | public static void addIds(List<Entry> entries, boolean updateRdn) {
for (Entry entry : entries) {
addId(entry, updateRdn);
}
} | java | public static void addIds(List<Entry> entries, boolean updateRdn) {
for (Entry entry : entries) {
addId(entry, updateRdn);
}
} | [
"public",
"static",
"void",
"addIds",
"(",
"List",
"<",
"Entry",
">",
"entries",
",",
"boolean",
"updateRdn",
")",
"{",
"for",
"(",
"Entry",
"entry",
":",
"entries",
")",
"{",
"addId",
"(",
"entry",
",",
"updateRdn",
")",
";",
"}",
"}"
] | Iterates over entries and adds a timebased uuid to each entry. If updateRdn is true, the uuid becomes the rdn.
Use this to handle duplicates. | [
"Iterates",
"over",
"entries",
"and",
"adds",
"a",
"timebased",
"uuid",
"to",
"each",
"entry",
".",
"If",
"updateRdn",
"is",
"true",
"the",
"uuid",
"becomes",
"the",
"rdn",
".",
"Use",
"this",
"to",
"handle",
"duplicates",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/TimebasedOrderFilter.java#L75-L79 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/concurrent/ClusteredExecutorService.java | ClusteredExecutorService.initialize | protected synchronized void initialize() {
String invocationServiceName = this.invocationServiceName;
invocationService = (InvocationService)
CacheFactory.getService(invocationServiceName);
if (invocationService == null) {
throw new IllegalArgumentException("Invocatio... | java | protected synchronized void initialize() {
String invocationServiceName = this.invocationServiceName;
invocationService = (InvocationService)
CacheFactory.getService(invocationServiceName);
if (invocationService == null) {
throw new IllegalArgumentException("Invocatio... | [
"protected",
"synchronized",
"void",
"initialize",
"(",
")",
"{",
"String",
"invocationServiceName",
"=",
"this",
".",
"invocationServiceName",
";",
"invocationService",
"=",
"(",
"InvocationService",
")",
"CacheFactory",
".",
"getService",
"(",
"invocationServiceName",... | Initialize this executor service. | [
"Initialize",
"this",
"executor",
"service",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/concurrent/ClusteredExecutorService.java#L101-L114 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/concurrent/ClusteredExecutorService.java | ClusteredExecutorService.execute | public void execute(Runnable command) {
if (!(command instanceof ClusteredFutureTask)) {
command = new ClusteredFutureTask<Object>(command, null);
}
command.run();
} | java | public void execute(Runnable command) {
if (!(command instanceof ClusteredFutureTask)) {
command = new ClusteredFutureTask<Object>(command, null);
}
command.run();
} | [
"public",
"void",
"execute",
"(",
"Runnable",
"command",
")",
"{",
"if",
"(",
"!",
"(",
"command",
"instanceof",
"ClusteredFutureTask",
")",
")",
"{",
"command",
"=",
"new",
"ClusteredFutureTask",
"<",
"Object",
">",
"(",
"command",
",",
"null",
")",
";",
... | Executes the given command at some time in the future.
@param command the runnable task | [
"Executes",
"the",
"given",
"command",
"at",
"some",
"time",
"in",
"the",
"future",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/concurrent/ClusteredExecutorService.java#L124-L129 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/concurrent/ClusteredExecutorService.java | ClusteredExecutorService.getExecutionMember | protected synchronized Member getExecutionMember() {
Iterator<Member> it = memberIterator;
if (it == null || !it.hasNext()) {
memberIterator = it = serviceMembers.iterator();
}
return it.next();
} | java | protected synchronized Member getExecutionMember() {
Iterator<Member> it = memberIterator;
if (it == null || !it.hasNext()) {
memberIterator = it = serviceMembers.iterator();
}
return it.next();
} | [
"protected",
"synchronized",
"Member",
"getExecutionMember",
"(",
")",
"{",
"Iterator",
"<",
"Member",
">",
"it",
"=",
"memberIterator",
";",
"if",
"(",
"it",
"==",
"null",
"||",
"!",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"memberIterator",
"=",
"it",... | Return the member that should execute submitted command.
@return the member to execute submitted command on | [
"Return",
"the",
"member",
"that",
"should",
"execute",
"submitted",
"command",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/concurrent/ClusteredExecutorService.java#L185-L191 | train |
cloudfoundry-community/cf-java-component | cf-spring/src/main/java/cf/spring/servicebroker/AbstractAnnotationCatalogAccessorProvider.java | AbstractAnnotationCatalogAccessorProvider.getMethodAccessor | protected BrokerServiceAccessor getMethodAccessor(String serviceBrokerName, CatalogService description) {
return new AnnotationBrokerServiceAccessor(description, serviceBrokerName, getBeanClass(serviceBrokerName),
context.getBean(serviceBrokerName));
} | java | protected BrokerServiceAccessor getMethodAccessor(String serviceBrokerName, CatalogService description) {
return new AnnotationBrokerServiceAccessor(description, serviceBrokerName, getBeanClass(serviceBrokerName),
context.getBean(serviceBrokerName));
} | [
"protected",
"BrokerServiceAccessor",
"getMethodAccessor",
"(",
"String",
"serviceBrokerName",
",",
"CatalogService",
"description",
")",
"{",
"return",
"new",
"AnnotationBrokerServiceAccessor",
"(",
"description",
",",
"serviceBrokerName",
",",
"getBeanClass",
"(",
"servic... | Returns the accessor used to access the specified service of the
specified broker.
@param serviceBrokerName the name of the broker offering the specified service
@param description the service description | [
"Returns",
"the",
"accessor",
"used",
"to",
"access",
"the",
"specified",
"service",
"of",
"the",
"specified",
"broker",
"."
] | 9d7d54f2b599f3e4f4706bc0c471e144065671fa | https://github.com/cloudfoundry-community/cf-java-component/blob/9d7d54f2b599f3e4f4706bc0c471e144065671fa/cf-spring/src/main/java/cf/spring/servicebroker/AbstractAnnotationCatalogAccessorProvider.java#L48-L51 | train |
cloudfoundry-community/cf-java-component | cf-spring/src/main/java/cf/spring/servicebroker/AbstractAnnotationCatalogAccessorProvider.java | AbstractAnnotationCatalogAccessorProvider.getBeanClass | protected Class<?> getBeanClass(String beanName) {
Class<?> clazz = context.getType(beanName);
while (Proxy.isProxyClass(clazz) || Enhancer.isEnhanced(clazz)) {
clazz = clazz.getSuperclass();
}
return clazz;
} | java | protected Class<?> getBeanClass(String beanName) {
Class<?> clazz = context.getType(beanName);
while (Proxy.isProxyClass(clazz) || Enhancer.isEnhanced(clazz)) {
clazz = clazz.getSuperclass();
}
return clazz;
} | [
"protected",
"Class",
"<",
"?",
">",
"getBeanClass",
"(",
"String",
"beanName",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"context",
".",
"getType",
"(",
"beanName",
")",
";",
"while",
"(",
"Proxy",
".",
"isProxyClass",
"(",
"clazz",
")",
"||",
... | Returns the class of the specified bean name. | [
"Returns",
"the",
"class",
"of",
"the",
"specified",
"bean",
"name",
"."
] | 9d7d54f2b599f3e4f4706bc0c471e144065671fa | https://github.com/cloudfoundry-community/cf-java-component/blob/9d7d54f2b599f3e4f4706bc0c471e144065671fa/cf-spring/src/main/java/cf/spring/servicebroker/AbstractAnnotationCatalogAccessorProvider.java#L56-L62 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/framework/Constraint.java | Constraint.skipSolver | public void skipSolver(ConstraintSolver ... solvers) {
if (solversToSkip == null) solversToSkip = new HashSet<ConstraintSolver>();
for (ConstraintSolver solver : solvers) solversToSkip.add(solver);
} | java | public void skipSolver(ConstraintSolver ... solvers) {
if (solversToSkip == null) solversToSkip = new HashSet<ConstraintSolver>();
for (ConstraintSolver solver : solvers) solversToSkip.add(solver);
} | [
"public",
"void",
"skipSolver",
"(",
"ConstraintSolver",
"...",
"solvers",
")",
"{",
"if",
"(",
"solversToSkip",
"==",
"null",
")",
"solversToSkip",
"=",
"new",
"HashSet",
"<",
"ConstraintSolver",
">",
"(",
")",
";",
"for",
"(",
"ConstraintSolver",
"solver",
... | Provide a list of solvers that should not process this constraint.
@param solvers Solvers that should not process this constraint. | [
"Provide",
"a",
"list",
"of",
"solvers",
"that",
"should",
"not",
"process",
"this",
"constraint",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/framework/Constraint.java#L72-L75 | train |
aseovic/coherence-tools | loader/src/main/java/com/seovic/loader/target/XmlTarget.java | XmlTarget.initAttributesAndElements | private void initAttributesAndElements(String... propertyNames)
{
for (String propertyName : propertyNames)
{
Property property = new Property(propertyName);
if (property.isAttribute())
{
m_attributes.add(property);
}
... | java | private void initAttributesAndElements(String... propertyNames)
{
for (String propertyName : propertyNames)
{
Property property = new Property(propertyName);
if (property.isAttribute())
{
m_attributes.add(property);
}
... | [
"private",
"void",
"initAttributesAndElements",
"(",
"String",
"...",
"propertyNames",
")",
"{",
"for",
"(",
"String",
"propertyName",
":",
"propertyNames",
")",
"{",
"Property",
"property",
"=",
"new",
"Property",
"(",
"propertyName",
")",
";",
"if",
"(",
"pr... | Parses user-specified property names and determines which properties
should be written out as attributes and which as child elements.
@param propertyNames property names | [
"Parses",
"user",
"-",
"specified",
"property",
"names",
"and",
"determines",
"which",
"properties",
"should",
"be",
"written",
"out",
"as",
"attributes",
"and",
"which",
"as",
"child",
"elements",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/loader/src/main/java/com/seovic/loader/target/XmlTarget.java#L384-L398 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/time/TimePoint.java | TimePoint.setUsed | public void setUsed(boolean newVal){
if(isUsed() && newVal == false) {
Arrays.fill(out, null);
}
used = newVal;
} | java | public void setUsed(boolean newVal){
if(isUsed() && newVal == false) {
Arrays.fill(out, null);
}
used = newVal;
} | [
"public",
"void",
"setUsed",
"(",
"boolean",
"newVal",
")",
"{",
"if",
"(",
"isUsed",
"(",
")",
"&&",
"newVal",
"==",
"false",
")",
"{",
"Arrays",
".",
"fill",
"(",
"out",
",",
"null",
")",
";",
"}",
"used",
"=",
"newVal",
";",
"}"
] | Set whether this time point as used in the underlying temporal network.
@param newVal Set to true iff the time point should be included in the underlying temporal network. | [
"Set",
"whether",
"this",
"time",
"point",
"as",
"used",
"in",
"the",
"underlying",
"temporal",
"network",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/time/TimePoint.java#L182-L189 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/PadOperation.java | PadOperation.getPadCharacter | private Character getPadCharacter(String characterString) {
if (characterString.length() > 0) {
getLogger().debug("The given character string is longer than one element. The first character is used.");
}
return characterString.charAt(0);
} | java | private Character getPadCharacter(String characterString) {
if (characterString.length() > 0) {
getLogger().debug("The given character string is longer than one element. The first character is used.");
}
return characterString.charAt(0);
} | [
"private",
"Character",
"getPadCharacter",
"(",
"String",
"characterString",
")",
"{",
"if",
"(",
"characterString",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"getLogger",
"(",
")",
".",
"debug",
"(",
"\"The given character string is longer than one element. The ... | Returns the character which is used for the padding. If the character string is longer than one char, the first
char will be used. | [
"Returns",
"the",
"character",
"which",
"is",
"used",
"for",
"the",
"padding",
".",
"If",
"the",
"character",
"string",
"is",
"longer",
"than",
"one",
"char",
"the",
"first",
"char",
"will",
"be",
"used",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/PadOperation.java#L80-L85 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/PadOperation.java | PadOperation.getDirectionString | private String getDirectionString(String direction) {
if (direction == null || !(direction.equals("Start") || direction.equals("End"))) {
getLogger().debug("Unrecognized direction string. The standard value 'Start' will be used.");
return "Start";
}
return direction;
... | java | private String getDirectionString(String direction) {
if (direction == null || !(direction.equals("Start") || direction.equals("End"))) {
getLogger().debug("Unrecognized direction string. The standard value 'Start' will be used.");
return "Start";
}
return direction;
... | [
"private",
"String",
"getDirectionString",
"(",
"String",
"direction",
")",
"{",
"if",
"(",
"direction",
"==",
"null",
"||",
"!",
"(",
"direction",
".",
"equals",
"(",
"\"Start\"",
")",
"||",
"direction",
".",
"equals",
"(",
"\"End\"",
")",
")",
")",
"{"... | Returns the direction in which the padding will be done. If the direction string is null or invalid, 'Start' will
be taken instead. | [
"Returns",
"the",
"direction",
"in",
"which",
"the",
"padding",
"will",
"be",
"done",
".",
"If",
"the",
"direction",
"string",
"is",
"null",
"or",
"invalid",
"Start",
"will",
"be",
"taken",
"instead",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/PadOperation.java#L91-L97 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/PadOperation.java | PadOperation.performPadOperation | private String performPadOperation(String source, Integer length, Character padChar, String direction) {
if (direction.equals("Start")) {
return Strings.padStart(source, length, padChar);
} else {
return Strings.padEnd(source, length, padChar);
}
} | java | private String performPadOperation(String source, Integer length, Character padChar, String direction) {
if (direction.equals("Start")) {
return Strings.padStart(source, length, padChar);
} else {
return Strings.padEnd(source, length, padChar);
}
} | [
"private",
"String",
"performPadOperation",
"(",
"String",
"source",
",",
"Integer",
"length",
",",
"Character",
"padChar",
",",
"String",
"direction",
")",
"{",
"if",
"(",
"direction",
".",
"equals",
"(",
"\"Start\"",
")",
")",
"{",
"return",
"Strings",
"."... | Perform the pad operation itself and returns the result | [
"Perform",
"the",
"pad",
"operation",
"itself",
"and",
"returns",
"the",
"result"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/PadOperation.java#L102-L108 | train |
openengsb/openengsb | connector/userprojectsfile/src/main/java/org/openengsb/connector/userprojects/file/internal/file/ProjectFileAccessObject.java | ProjectFileAccessObject.findAllProjects | public List<Project> findAllProjects() {
List<Project> list = new ArrayList<>();
List<String> projectNames;
try {
projectNames = readLines(projectsFile);
} catch (IOException e) {
throw new FileBasedRuntimeException(e);
}
for (String projectName : ... | java | public List<Project> findAllProjects() {
List<Project> list = new ArrayList<>();
List<String> projectNames;
try {
projectNames = readLines(projectsFile);
} catch (IOException e) {
throw new FileBasedRuntimeException(e);
}
for (String projectName : ... | [
"public",
"List",
"<",
"Project",
">",
"findAllProjects",
"(",
")",
"{",
"List",
"<",
"Project",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"String",
">",
"projectNames",
";",
"try",
"{",
"projectNames",
"=",
"readLines",
"... | Finds all the available projects.
@return the list of available projects | [
"Finds",
"all",
"the",
"available",
"projects",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/connector/userprojectsfile/src/main/java/org/openengsb/connector/userprojects/file/internal/file/ProjectFileAccessObject.java#L44-L59 | train |
openengsb/openengsb | components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/util/Introspector.java | Introspector.getPropertyTypeMap | public static Map<String, Class<?>> getPropertyTypeMap(Class<?> clazz, String... exclude) {
PropertyDescriptor[] descriptors;
try {
descriptors = getPropertyDescriptors(clazz);
} catch (IntrospectionException e) {
LOG.error("Failed to introspect " + clazz, e);
... | java | public static Map<String, Class<?>> getPropertyTypeMap(Class<?> clazz, String... exclude) {
PropertyDescriptor[] descriptors;
try {
descriptors = getPropertyDescriptors(clazz);
} catch (IntrospectionException e) {
LOG.error("Failed to introspect " + clazz, e);
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"getPropertyTypeMap",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"...",
"exclude",
")",
"{",
"PropertyDescriptor",
"[",
"]",
"descriptors",
";",
"try",
"{",
"descriptor... | Returns a create of all property names and their respective type. Any property passed via exclude are removed
from the create before hand.
@param clazz the class to introspect
@param exclude the properties to exclude
@return a mapping between property names and their type. | [
"Returns",
"a",
"create",
"of",
"all",
"property",
"names",
"and",
"their",
"respective",
"type",
".",
"Any",
"property",
"passed",
"via",
"exclude",
"are",
"removed",
"from",
"the",
"create",
"before",
"hand",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/util/Introspector.java#L66-L87 | train |
openengsb/openengsb | components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/util/Introspector.java | Introspector.read | public static Map<String, Object> read(Object object) {
PropertyDescriptor[] descriptors;
Class<?> clazz = object.getClass();
try {
descriptors = getPropertyDescriptors(clazz);
} catch (IntrospectionException e) {
LOG.error("Failed to introspect " + clazz, e);
... | java | public static Map<String, Object> read(Object object) {
PropertyDescriptor[] descriptors;
Class<?> clazz = object.getClass();
try {
descriptors = getPropertyDescriptors(clazz);
} catch (IntrospectionException e) {
LOG.error("Failed to introspect " + clazz, e);
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"read",
"(",
"Object",
"object",
")",
"{",
"PropertyDescriptor",
"[",
"]",
"descriptors",
";",
"Class",
"<",
"?",
">",
"clazz",
"=",
"object",
".",
"getClass",
"(",
")",
";",
"try",
"{",
"... | Returns a create of all property names and their values contained in the given object.
@param object the object to visit out of
@return the extracted value create | [
"Returns",
"a",
"create",
"of",
"all",
"property",
"names",
"and",
"their",
"values",
"contained",
"in",
"the",
"given",
"object",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/util/Introspector.java#L95-L120 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/AdvancedModelWrapper.java | AdvancedModelWrapper.wrap | public static AdvancedModelWrapper wrap(Object model) {
if (!(isModel(model.getClass()))) {
throw new IllegalArgumentException("The given object is no model");
}
return new AdvancedModelWrapper((OpenEngSBModel) model);
} | java | public static AdvancedModelWrapper wrap(Object model) {
if (!(isModel(model.getClass()))) {
throw new IllegalArgumentException("The given object is no model");
}
return new AdvancedModelWrapper((OpenEngSBModel) model);
} | [
"public",
"static",
"AdvancedModelWrapper",
"wrap",
"(",
"Object",
"model",
")",
"{",
"if",
"(",
"!",
"(",
"isModel",
"(",
"model",
".",
"getClass",
"(",
")",
")",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The given object is no model\... | Creates an advanced model wrapper object out of the given model object. Throws IllegalArgumentException in case
the given model object is no model. | [
"Creates",
"an",
"advanced",
"model",
"wrapper",
"object",
"out",
"of",
"the",
"given",
"model",
"object",
".",
"Throws",
"IllegalArgumentException",
"in",
"case",
"the",
"given",
"model",
"object",
"is",
"no",
"model",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/AdvancedModelWrapper.java#L45-L50 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/AdvancedModelWrapper.java | AdvancedModelWrapper.getModelsReferringToThisModel | public List<EDBObject> getModelsReferringToThisModel(EngineeringDatabaseService edbService) {
return edbService.query(QueryRequest.query(
EDBConverter.REFERENCE_PREFIX + "%", getCompleteModelOID()));
} | java | public List<EDBObject> getModelsReferringToThisModel(EngineeringDatabaseService edbService) {
return edbService.query(QueryRequest.query(
EDBConverter.REFERENCE_PREFIX + "%", getCompleteModelOID()));
} | [
"public",
"List",
"<",
"EDBObject",
">",
"getModelsReferringToThisModel",
"(",
"EngineeringDatabaseService",
"edbService",
")",
"{",
"return",
"edbService",
".",
"query",
"(",
"QueryRequest",
".",
"query",
"(",
"EDBConverter",
".",
"REFERENCE_PREFIX",
"+",
"\"%\"",
... | Returns a list of EDBObjects which are referring to this model. | [
"Returns",
"a",
"list",
"of",
"EDBObjects",
"which",
"are",
"referring",
"to",
"this",
"model",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/AdvancedModelWrapper.java#L55-L58 | train |
openengsb/openengsb | components/ekb/common/src/main/java/org/openengsb/core/ekb/common/AdvancedModelWrapper.java | AdvancedModelWrapper.isEngineeringObjectClass | public static Boolean isEngineeringObjectClass(Class<?> clazz) {
for (Field field : clazz.getDeclaredFields()) {
if (field.isAnnotationPresent(OpenEngSBForeignKey.class)) {
return true;
}
}
return false;
} | java | public static Boolean isEngineeringObjectClass(Class<?> clazz) {
for (Field field : clazz.getDeclaredFields()) {
if (field.isAnnotationPresent(OpenEngSBForeignKey.class)) {
return true;
}
}
return false;
} | [
"public",
"static",
"Boolean",
"isEngineeringObjectClass",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"clazz",
".",
"getDeclaredFields",
"(",
")",
")",
"{",
"if",
"(",
"field",
".",
"isAnnotationPresent",
"(",
"OpenE... | Returns true if the class is the class of an engineering object, returns false if not. | [
"Returns",
"true",
"if",
"the",
"class",
"is",
"the",
"class",
"of",
"an",
"engineering",
"object",
"returns",
"false",
"if",
"not",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/AdvancedModelWrapper.java#L77-L84 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/JsonUtils.java | JsonUtils.convertObject | public static <T> T convertObject(String json, Class<T> clazz) throws IOException {
try {
if (clazz.isAnnotationPresent(Model.class)) {
return MODEL_MAPPER.readValue(json, clazz);
}
return MAPPER.readValue(json, clazz);
} catch (IOException e) {
... | java | public static <T> T convertObject(String json, Class<T> clazz) throws IOException {
try {
if (clazz.isAnnotationPresent(Model.class)) {
return MODEL_MAPPER.readValue(json, clazz);
}
return MAPPER.readValue(json, clazz);
} catch (IOException e) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"convertObject",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"clazz",
".",
"isAnnotationPresent",
"(",
"Model",
".",
"class",
")",
")",
... | Converts an object in JSON format to the given class. Throws an IOException if the conversion could not be
performed. | [
"Converts",
"an",
"object",
"in",
"JSON",
"format",
"to",
"the",
"given",
"class",
".",
"Throws",
"an",
"IOException",
"if",
"the",
"conversion",
"could",
"not",
"be",
"performed",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/JsonUtils.java#L65-L76 | train |
openengsb/openengsb | components/edbi/hook/src/main/java/org/openengsb/framework/edbi/hook/internal/CommitConverter.java | CommitConverter.convert | public IndexCommit convert(EKBCommit ekbCommit) {
IndexCommit commit = new IndexCommit();
commit.setCommitId(ekbCommit.getRevisionNumber());
commit.setParentCommitId(ekbCommit.getParentRevisionNumber());
commit.setConnectorId(ekbCommit.getConnectorId());
commit.setDomainId(ekbCo... | java | public IndexCommit convert(EKBCommit ekbCommit) {
IndexCommit commit = new IndexCommit();
commit.setCommitId(ekbCommit.getRevisionNumber());
commit.setParentCommitId(ekbCommit.getParentRevisionNumber());
commit.setConnectorId(ekbCommit.getConnectorId());
commit.setDomainId(ekbCo... | [
"public",
"IndexCommit",
"convert",
"(",
"EKBCommit",
"ekbCommit",
")",
"{",
"IndexCommit",
"commit",
"=",
"new",
"IndexCommit",
"(",
")",
";",
"commit",
".",
"setCommitId",
"(",
"ekbCommit",
".",
"getRevisionNumber",
"(",
")",
")",
";",
"commit",
".",
"setP... | Convert the given EKBCommit to an IndexCommit.
@param ekbCommit the commit to convert
@return a new IndexCommit instance representing the given EKBCommit | [
"Convert",
"the",
"given",
"EKBCommit",
"to",
"an",
"IndexCommit",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/hook/src/main/java/org/openengsb/framework/edbi/hook/internal/CommitConverter.java#L60-L86 | train |
openengsb/openengsb | components/edbi/hook/src/main/java/org/openengsb/framework/edbi/hook/internal/CommitConverter.java | CommitConverter.mapByClass | protected Map<Class<?>, List<OpenEngSBModel>> mapByClass(Collection<OpenEngSBModel> models) {
return group(models, new Function<OpenEngSBModel, Class<?>>() {
@Override
public Class<?> apply(OpenEngSBModel input) {
return input.getClass();
}
});
} | java | protected Map<Class<?>, List<OpenEngSBModel>> mapByClass(Collection<OpenEngSBModel> models) {
return group(models, new Function<OpenEngSBModel, Class<?>>() {
@Override
public Class<?> apply(OpenEngSBModel input) {
return input.getClass();
}
});
} | [
"protected",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"List",
"<",
"OpenEngSBModel",
">",
">",
"mapByClass",
"(",
"Collection",
"<",
"OpenEngSBModel",
">",
"models",
")",
"{",
"return",
"group",
"(",
"models",
",",
"new",
"Function",
"<",
"OpenEngSBModel",... | Groups all models in the given collection by their class.
@param models the models
@return a map containing all given models grouped by their type | [
"Groups",
"all",
"models",
"in",
"the",
"given",
"collection",
"by",
"their",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/hook/src/main/java/org/openengsb/framework/edbi/hook/internal/CommitConverter.java#L94-L101 | train |
cloudfoundry-community/cf-java-component | cf-spring/src/main/java/cf/spring/servicebroker/CatalogAccessor.java | CatalogAccessor.createCatalog | public Catalog createCatalog() {
final List<CatalogService> services = new ArrayList<>();
for (BrokerServiceAccessor serviceAccessor : serviceAccessors) {
services.add(serviceAccessor.getServiceDescription());
}
return new Catalog(services);
} | java | public Catalog createCatalog() {
final List<CatalogService> services = new ArrayList<>();
for (BrokerServiceAccessor serviceAccessor : serviceAccessors) {
services.add(serviceAccessor.getServiceDescription());
}
return new Catalog(services);
} | [
"public",
"Catalog",
"createCatalog",
"(",
")",
"{",
"final",
"List",
"<",
"CatalogService",
">",
"services",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"BrokerServiceAccessor",
"serviceAccessor",
":",
"serviceAccessors",
")",
"{",
"services",
"... | Creates the catalog. | [
"Creates",
"the",
"catalog",
"."
] | 9d7d54f2b599f3e4f4706bc0c471e144065671fa | https://github.com/cloudfoundry-community/cf-java-component/blob/9d7d54f2b599f3e4f4706bc0c471e144065671fa/cf-spring/src/main/java/cf/spring/servicebroker/CatalogAccessor.java#L52-L60 | train |
cloudfoundry-community/cf-java-component | cf-spring/src/main/java/cf/spring/servicebroker/CatalogAccessor.java | CatalogAccessor.getServiceAccessor | public BrokerServiceAccessor getServiceAccessor(String serviceId) {
for (BrokerServiceAccessor serviceAccessor : serviceAccessors) {
if (serviceId.equals(serviceAccessor.getServiceDescription().getId())) {
return serviceAccessor;
}
}
throw new NotFoundExc... | java | public BrokerServiceAccessor getServiceAccessor(String serviceId) {
for (BrokerServiceAccessor serviceAccessor : serviceAccessors) {
if (serviceId.equals(serviceAccessor.getServiceDescription().getId())) {
return serviceAccessor;
}
}
throw new NotFoundExc... | [
"public",
"BrokerServiceAccessor",
"getServiceAccessor",
"(",
"String",
"serviceId",
")",
"{",
"for",
"(",
"BrokerServiceAccessor",
"serviceAccessor",
":",
"serviceAccessors",
")",
"{",
"if",
"(",
"serviceId",
".",
"equals",
"(",
"serviceAccessor",
".",
"getServiceDes... | Returns the accessor associated to the specified service id. | [
"Returns",
"the",
"accessor",
"associated",
"to",
"the",
"specified",
"service",
"id",
"."
] | 9d7d54f2b599f3e4f4706bc0c471e144065671fa | https://github.com/cloudfoundry-community/cf-java-component/blob/9d7d54f2b599f3e4f4706bc0c471e144065671fa/cf-spring/src/main/java/cf/spring/servicebroker/CatalogAccessor.java#L65-L73 | train |
openengsb/openengsb | components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java | OrientModelGraphUtils.setIdFieldValue | public static void setIdFieldValue(ODocument document, String value) {
setFieldValue(document, OGraphDatabase.LABEL, value);
} | java | public static void setIdFieldValue(ODocument document, String value) {
setFieldValue(document, OGraphDatabase.LABEL, value);
} | [
"public",
"static",
"void",
"setIdFieldValue",
"(",
"ODocument",
"document",
",",
"String",
"value",
")",
"{",
"setFieldValue",
"(",
"document",
",",
"OGraphDatabase",
".",
"LABEL",
",",
"value",
")",
";",
"}"
] | Sets the value for the id field of a graph object. | [
"Sets",
"the",
"value",
"for",
"the",
"id",
"field",
"of",
"a",
"graph",
"object",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java#L50-L52 | train |
openengsb/openengsb | components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java | OrientModelGraphUtils.setActiveFieldValue | public static void setActiveFieldValue(ODocument document, Boolean active) {
setFieldValue(document, ACTIVE_FIELD, active.toString());
} | java | public static void setActiveFieldValue(ODocument document, Boolean active) {
setFieldValue(document, ACTIVE_FIELD, active.toString());
} | [
"public",
"static",
"void",
"setActiveFieldValue",
"(",
"ODocument",
"document",
",",
"Boolean",
"active",
")",
"{",
"setFieldValue",
"(",
"document",
",",
"ACTIVE_FIELD",
",",
"active",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Sets the value for the active field of a graph object. | [
"Sets",
"the",
"value",
"for",
"the",
"active",
"field",
"of",
"a",
"graph",
"object",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java#L64-L66 | train |
openengsb/openengsb | components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java | OrientModelGraphUtils.getFieldValue | public static String getFieldValue(ODocument document, String fieldname) {
return (String) document.field(fieldname);
} | java | public static String getFieldValue(ODocument document, String fieldname) {
return (String) document.field(fieldname);
} | [
"public",
"static",
"String",
"getFieldValue",
"(",
"ODocument",
"document",
",",
"String",
"fieldname",
")",
"{",
"return",
"(",
"String",
")",
"document",
".",
"field",
"(",
"fieldname",
")",
";",
"}"
] | Gets the value for the given field of a graph object. | [
"Gets",
"the",
"value",
"for",
"the",
"given",
"field",
"of",
"a",
"graph",
"object",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java#L78-L80 | train |
openengsb/openengsb | components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java | OrientModelGraphUtils.setFieldValue | public static void setFieldValue(ODocument document, String fieldname, String value) {
document.field(fieldname, value);
} | java | public static void setFieldValue(ODocument document, String fieldname, String value) {
document.field(fieldname, value);
} | [
"public",
"static",
"void",
"setFieldValue",
"(",
"ODocument",
"document",
",",
"String",
"fieldname",
",",
"String",
"value",
")",
"{",
"document",
".",
"field",
"(",
"fieldname",
",",
"value",
")",
";",
"}"
] | Sets the value for the given field of an graph object. | [
"Sets",
"the",
"value",
"for",
"the",
"given",
"field",
"of",
"an",
"graph",
"object",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java#L85-L87 | train |
openengsb/openengsb | components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java | OrientModelGraphUtils.fillEdgeWithPropertyConnections | public static void fillEdgeWithPropertyConnections(ODocument edge, TransformationDescription description) {
Map<String, String> connections = convertPropertyConnectionsToSimpleForm(description.getPropertyConnections());
for (Map.Entry<String, String> entry : connections.entrySet()) {
edge.fi... | java | public static void fillEdgeWithPropertyConnections(ODocument edge, TransformationDescription description) {
Map<String, String> connections = convertPropertyConnectionsToSimpleForm(description.getPropertyConnections());
for (Map.Entry<String, String> entry : connections.entrySet()) {
edge.fi... | [
"public",
"static",
"void",
"fillEdgeWithPropertyConnections",
"(",
"ODocument",
"edge",
",",
"TransformationDescription",
"description",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"connections",
"=",
"convertPropertyConnectionsToSimpleForm",
"(",
"description",
... | Adds to the given map the property connection information which result from the given transformation description. | [
"Adds",
"to",
"the",
"given",
"map",
"the",
"property",
"connection",
"information",
"which",
"result",
"from",
"the",
"given",
"transformation",
"description",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraphUtils.java#L92-L97 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/PermutationsWithRepetition.java | PermutationsWithRepetition.getVariations | public int[][] getVariations() {
int permutations = (int) Math.pow(n, r);
int[][] table = new int[permutations][r];
for (int x = 0; x < r; x++) {
int t2 = (int) Math.pow(n, x);
for (int p1 = 0; p1 < permutations;) {
for (int al = 0; al < n; al++) {
for (int p2 = 0; p2 < t2; p2++) {
table[p1]... | java | public int[][] getVariations() {
int permutations = (int) Math.pow(n, r);
int[][] table = new int[permutations][r];
for (int x = 0; x < r; x++) {
int t2 = (int) Math.pow(n, x);
for (int p1 = 0; p1 < permutations;) {
for (int al = 0; al < n; al++) {
for (int p2 = 0; p2 < t2; p2++) {
table[p1]... | [
"public",
"int",
"[",
"]",
"[",
"]",
"getVariations",
"(",
")",
"{",
"int",
"permutations",
"=",
"(",
"int",
")",
"Math",
".",
"pow",
"(",
"n",
",",
"r",
")",
";",
"int",
"[",
"]",
"[",
"]",
"table",
"=",
"new",
"int",
"[",
"permutations",
"]",... | Get all r-permutations of n integers.
@return All r-permutations of n integers. | [
"Get",
"all",
"r",
"-",
"permutations",
"of",
"n",
"integers",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/PermutationsWithRepetition.java#L54-L71 | train |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java | CheckPreCommitHook.checkInserts | private List<JPAObject> checkInserts(List<JPAObject> inserts) {
List<JPAObject> failedObjects = new ArrayList<JPAObject>();
for (JPAObject insert : inserts) {
String oid = insert.getOID();
if (checkIfActiveOidExisting(oid)) {
failedObjects.add(insert);
... | java | private List<JPAObject> checkInserts(List<JPAObject> inserts) {
List<JPAObject> failedObjects = new ArrayList<JPAObject>();
for (JPAObject insert : inserts) {
String oid = insert.getOID();
if (checkIfActiveOidExisting(oid)) {
failedObjects.add(insert);
... | [
"private",
"List",
"<",
"JPAObject",
">",
"checkInserts",
"(",
"List",
"<",
"JPAObject",
">",
"inserts",
")",
"{",
"List",
"<",
"JPAObject",
">",
"failedObjects",
"=",
"new",
"ArrayList",
"<",
"JPAObject",
">",
"(",
")",
";",
"for",
"(",
"JPAObject",
"in... | Checks if all oid's of the given JPAObjects are not existing yet. Returns a list of objects where the JPAObject
already exists. | [
"Checks",
"if",
"all",
"oid",
"s",
"of",
"the",
"given",
"JPAObjects",
"are",
"not",
"existing",
"yet",
".",
"Returns",
"a",
"list",
"of",
"objects",
"where",
"the",
"JPAObject",
"already",
"exists",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java#L98-L109 | train |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java | CheckPreCommitHook.checkDeletions | private List<String> checkDeletions(List<String> deletes) {
List<String> failedObjects = new ArrayList<String>();
for (String delete : deletes) {
if (!checkIfActiveOidExisting(delete)) {
failedObjects.add(delete);
}
}
return failedObjects;
} | java | private List<String> checkDeletions(List<String> deletes) {
List<String> failedObjects = new ArrayList<String>();
for (String delete : deletes) {
if (!checkIfActiveOidExisting(delete)) {
failedObjects.add(delete);
}
}
return failedObjects;
} | [
"private",
"List",
"<",
"String",
">",
"checkDeletions",
"(",
"List",
"<",
"String",
">",
"deletes",
")",
"{",
"List",
"<",
"String",
">",
"failedObjects",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"delete",
":",... | Checks if all oid's of the given JPAObjects are existing. Returns a list of objects where the JPAObject doesn't
exist. | [
"Checks",
"if",
"all",
"oid",
"s",
"of",
"the",
"given",
"JPAObjects",
"are",
"existing",
".",
"Returns",
"a",
"list",
"of",
"objects",
"where",
"the",
"JPAObject",
"doesn",
"t",
"exist",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java#L115-L123 | train |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java | CheckPreCommitHook.checkUpdates | private List<JPAObject> checkUpdates(List<JPAObject> updates) throws EDBException {
List<JPAObject> failedObjects = new ArrayList<JPAObject>();
for (JPAObject update : updates) {
try {
Integer modelVersion = investigateVersionAndCheckForConflict(update);
model... | java | private List<JPAObject> checkUpdates(List<JPAObject> updates) throws EDBException {
List<JPAObject> failedObjects = new ArrayList<JPAObject>();
for (JPAObject update : updates) {
try {
Integer modelVersion = investigateVersionAndCheckForConflict(update);
model... | [
"private",
"List",
"<",
"JPAObject",
">",
"checkUpdates",
"(",
"List",
"<",
"JPAObject",
">",
"updates",
")",
"throws",
"EDBException",
"{",
"List",
"<",
"JPAObject",
">",
"failedObjects",
"=",
"new",
"ArrayList",
"<",
"JPAObject",
">",
"(",
")",
";",
"for... | Checks every update for a potential conflict. Returns a list of objects where a conflict has been found. | [
"Checks",
"every",
"update",
"for",
"a",
"potential",
"conflict",
".",
"Returns",
"a",
"list",
"of",
"objects",
"where",
"a",
"conflict",
"has",
"been",
"found",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java#L128-L142 | train |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java | CheckPreCommitHook.investigateVersionAndCheckForConflict | private Integer investigateVersionAndCheckForConflict(JPAObject newObject) throws EDBException {
JPAEntry entry = newObject.getEntry(EDBConstants.MODEL_VERSION);
String oid = newObject.getOID();
Integer modelVersion = 0;
if (entry != null) {
modelVersion = Integer.parseInt(e... | java | private Integer investigateVersionAndCheckForConflict(JPAObject newObject) throws EDBException {
JPAEntry entry = newObject.getEntry(EDBConstants.MODEL_VERSION);
String oid = newObject.getOID();
Integer modelVersion = 0;
if (entry != null) {
modelVersion = Integer.parseInt(e... | [
"private",
"Integer",
"investigateVersionAndCheckForConflict",
"(",
"JPAObject",
"newObject",
")",
"throws",
"EDBException",
"{",
"JPAEntry",
"entry",
"=",
"newObject",
".",
"getEntry",
"(",
"EDBConstants",
".",
"MODEL_VERSION",
")",
";",
"String",
"oid",
"=",
"newO... | Investigates the version of an JPAObject and checks if a conflict can be found. | [
"Investigates",
"the",
"version",
"of",
"an",
"JPAObject",
"and",
"checks",
"if",
"a",
"conflict",
"can",
"be",
"found",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java#L147-L170 | train |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java | CheckPreCommitHook.checkForConflict | private void checkForConflict(JPAObject newObject) throws EDBException {
String oid = newObject.getOID();
JPAObject object = dao.getJPAObject(oid);
for (JPAEntry entry : newObject.getEntries()) {
if (entry.getKey().equals(EDBConstants.MODEL_VERSION)) {
continue;
... | java | private void checkForConflict(JPAObject newObject) throws EDBException {
String oid = newObject.getOID();
JPAObject object = dao.getJPAObject(oid);
for (JPAEntry entry : newObject.getEntries()) {
if (entry.getKey().equals(EDBConstants.MODEL_VERSION)) {
continue;
... | [
"private",
"void",
"checkForConflict",
"(",
"JPAObject",
"newObject",
")",
"throws",
"EDBException",
"{",
"String",
"oid",
"=",
"newObject",
".",
"getOID",
"(",
")",
";",
"JPAObject",
"object",
"=",
"dao",
".",
"getJPAObject",
"(",
"oid",
")",
";",
"for",
... | Simple check mechanism if there is a conflict between a model which should be saved and the existing model, based
on the values which are in the EDB. | [
"Simple",
"check",
"mechanism",
"if",
"there",
"is",
"a",
"conflict",
"between",
"a",
"model",
"which",
"should",
"be",
"saved",
"and",
"the",
"existing",
"model",
"based",
"on",
"the",
"values",
"which",
"are",
"in",
"the",
"EDB",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/CheckPreCommitHook.java#L176-L192 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/WsdlToDll.java | WsdlToDll.execute | @Override
public void execute() throws MojoExecutionException {
checkParameters();
windowsModus = isWindows();
if (windowsModus) {
setWindowsVariables();
} else {
setLinuxVariables();
}
createDllFromWsdl();
} | java | @Override
public void execute() throws MojoExecutionException {
checkParameters();
windowsModus = isWindows();
if (windowsModus) {
setWindowsVariables();
} else {
setLinuxVariables();
}
createDllFromWsdl();
} | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"checkParameters",
"(",
")",
";",
"windowsModus",
"=",
"isWindows",
"(",
")",
";",
"if",
"(",
"windowsModus",
")",
"{",
"setWindowsVariables",
"(",
")",
";",
"}"... | Find and executes the commands wsdl.exe and csc.exe | [
"Find",
"and",
"executes",
"the",
"commands",
"wsdl",
".",
"exe",
"and",
"csc",
".",
"exe"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/WsdlToDll.java#L191-L201 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/WsdlToDll.java | WsdlToDll.createDllFromWsdl | private void createDllFromWsdl() throws MojoExecutionException {
getLog().info("Execute WSDl to cs command");
wsdlCommand();
getLog().info("Execute cs to dll command");
cscCommand();
if (generateNugetPackage) {
if (isLinux()) {
throw new MojoExecutionE... | java | private void createDllFromWsdl() throws MojoExecutionException {
getLog().info("Execute WSDl to cs command");
wsdlCommand();
getLog().info("Execute cs to dll command");
cscCommand();
if (generateNugetPackage) {
if (isLinux()) {
throw new MojoExecutionE... | [
"private",
"void",
"createDllFromWsdl",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Execute WSDl to cs command\"",
")",
";",
"wsdlCommand",
"(",
")",
";",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Execute cs to dll ... | Windows mode for maven execution
@throws MojoExecutionException | [
"Windows",
"mode",
"for",
"maven",
"execution"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/WsdlToDll.java#L237-L258 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/WsdlToDll.java | WsdlToDll.wsdlCommand | private void wsdlCommand() throws MojoExecutionException {
String cmd = findWsdlCommand();
int i = 0;
for (String location : wsdlLocations) {
String outputFilename = new File(outputDirectory, namespace + (i++)
+ ".cs").getAbsolutePath();
String[] comma... | java | private void wsdlCommand() throws MojoExecutionException {
String cmd = findWsdlCommand();
int i = 0;
for (String location : wsdlLocations) {
String outputFilename = new File(outputDirectory, namespace + (i++)
+ ".cs").getAbsolutePath();
String[] comma... | [
"private",
"void",
"wsdlCommand",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"String",
"cmd",
"=",
"findWsdlCommand",
"(",
")",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"String",
"location",
":",
"wsdlLocations",
")",
"{",
"String",
"outputFilenam... | Search for the wsdl command and execute it when it is found | [
"Search",
"for",
"the",
"wsdl",
"command",
"and",
"execute",
"it",
"when",
"it",
"is",
"found"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/WsdlToDll.java#L372-L402 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/WsdlToDll.java | WsdlToDll.cscCommand | private void cscCommand() throws MojoExecutionException {
generateAssemblyInfo();
String cscPath = findCscCommand();
List<String> commandList = new LinkedList<String>(cspath);
commandList.add(0, cscPath);
commandList.add(1, "/target:library");
commandList.add(2, "/out:" +... | java | private void cscCommand() throws MojoExecutionException {
generateAssemblyInfo();
String cscPath = findCscCommand();
List<String> commandList = new LinkedList<String>(cspath);
commandList.add(0, cscPath);
commandList.add(1, "/target:library");
commandList.add(2, "/out:" +... | [
"private",
"void",
"cscCommand",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"generateAssemblyInfo",
"(",
")",
";",
"String",
"cscPath",
"=",
"findCscCommand",
"(",
")",
";",
"List",
"<",
"String",
">",
"commandList",
"=",
"new",
"LinkedList",
"<",
"Str... | Search for the csc command and execute it when it is found | [
"Search",
"for",
"the",
"csc",
"command",
"and",
"execute",
"it",
"when",
"it",
"is",
"found"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/WsdlToDll.java#L407-L428 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.