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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.enhanceUpdates | private List<AdvancedModelWrapper> enhanceUpdates(List<AdvancedModelWrapper> updates,
Map<Object, AdvancedModelWrapper> updated, EKBCommit commit) {
List<AdvancedModelWrapper> additionalUpdates = new ArrayList<AdvancedModelWrapper>();
for (AdvancedModelWrapper model : updates) {
... | java | private List<AdvancedModelWrapper> enhanceUpdates(List<AdvancedModelWrapper> updates,
Map<Object, AdvancedModelWrapper> updated, EKBCommit commit) {
List<AdvancedModelWrapper> additionalUpdates = new ArrayList<AdvancedModelWrapper>();
for (AdvancedModelWrapper model : updates) {
... | [
"private",
"List",
"<",
"AdvancedModelWrapper",
">",
"enhanceUpdates",
"(",
"List",
"<",
"AdvancedModelWrapper",
">",
"updates",
",",
"Map",
"<",
"Object",
",",
"AdvancedModelWrapper",
">",
"updated",
",",
"EKBCommit",
"commit",
")",
"{",
"List",
"<",
"AdvancedM... | Enhances the given list of updates and returns a list of models which need to be additionally updated. | [
"Enhances",
"the",
"given",
"list",
"of",
"updates",
"and",
"returns",
"a",
"list",
"of",
"models",
"which",
"need",
"to",
"be",
"additionally",
"updated",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L144-L157 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.performEOModelUpdate | private List<AdvancedModelWrapper> performEOModelUpdate(EngineeringObjectModelWrapper model, EKBCommit commit) {
ModelDiff diff = createModelDiff(model.getUnderlyingModel(), model.getCompleteModelOID(),
edbService, edbConverter);
boolean referencesChanged = diff.isForeignKeyChanged();
... | java | private List<AdvancedModelWrapper> performEOModelUpdate(EngineeringObjectModelWrapper model, EKBCommit commit) {
ModelDiff diff = createModelDiff(model.getUnderlyingModel(), model.getCompleteModelOID(),
edbService, edbConverter);
boolean referencesChanged = diff.isForeignKeyChanged();
... | [
"private",
"List",
"<",
"AdvancedModelWrapper",
">",
"performEOModelUpdate",
"(",
"EngineeringObjectModelWrapper",
"model",
",",
"EKBCommit",
"commit",
")",
"{",
"ModelDiff",
"diff",
"=",
"createModelDiff",
"(",
"model",
".",
"getUnderlyingModel",
"(",
")",
",",
"mo... | Runs the logic of updating an Engineering Object model. Returns a list of models which need to be updated
additionally. | [
"Runs",
"the",
"logic",
"of",
"updating",
"an",
"Engineering",
"Object",
"model",
".",
"Returns",
"a",
"list",
"of",
"models",
"which",
"need",
"to",
"be",
"updated",
"additionally",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L163-L181 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.updateReferencedModelsByEO | private List<AdvancedModelWrapper> updateReferencedModelsByEO(EngineeringObjectModelWrapper model) {
List<AdvancedModelWrapper> updates = new ArrayList<AdvancedModelWrapper>();
for (Field field : model.getForeignKeyFields()) {
try {
AdvancedModelWrapper result = performMerge(... | java | private List<AdvancedModelWrapper> updateReferencedModelsByEO(EngineeringObjectModelWrapper model) {
List<AdvancedModelWrapper> updates = new ArrayList<AdvancedModelWrapper>();
for (Field field : model.getForeignKeyFields()) {
try {
AdvancedModelWrapper result = performMerge(... | [
"private",
"List",
"<",
"AdvancedModelWrapper",
">",
"updateReferencedModelsByEO",
"(",
"EngineeringObjectModelWrapper",
"model",
")",
"{",
"List",
"<",
"AdvancedModelWrapper",
">",
"updates",
"=",
"new",
"ArrayList",
"<",
"AdvancedModelWrapper",
">",
"(",
")",
";",
... | Updates all models which are referenced by the given engineering object. | [
"Updates",
"all",
"models",
"which",
"are",
"referenced",
"by",
"the",
"given",
"engineering",
"object",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L186-L199 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.reloadReferencesAndUpdateEO | private void reloadReferencesAndUpdateEO(ModelDiff diff, EngineeringObjectModelWrapper model) {
for (ModelDiffEntry entry : diff.getDifferences().values()) {
mergeEngineeringObjectWithReferencedModel(entry.getField(), model);
}
} | java | private void reloadReferencesAndUpdateEO(ModelDiff diff, EngineeringObjectModelWrapper model) {
for (ModelDiffEntry entry : diff.getDifferences().values()) {
mergeEngineeringObjectWithReferencedModel(entry.getField(), model);
}
} | [
"private",
"void",
"reloadReferencesAndUpdateEO",
"(",
"ModelDiff",
"diff",
",",
"EngineeringObjectModelWrapper",
"model",
")",
"{",
"for",
"(",
"ModelDiffEntry",
"entry",
":",
"diff",
".",
"getDifferences",
"(",
")",
".",
"values",
"(",
")",
")",
"{",
"mergeEng... | Reload the references which have changed in the actual update and update the Engineering Object accordingly. | [
"Reload",
"the",
"references",
"which",
"have",
"changed",
"in",
"the",
"actual",
"update",
"and",
"update",
"the",
"Engineering",
"Object",
"accordingly",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L204-L208 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.getReferenceBasedUpdates | private List<AdvancedModelWrapper> getReferenceBasedUpdates(AdvancedModelWrapper model,
Map<Object, AdvancedModelWrapper> updated, EKBCommit commit) throws EKBException {
List<AdvancedModelWrapper> updates = new ArrayList<AdvancedModelWrapper>();
List<EDBObject> references = model.getModelsR... | java | private List<AdvancedModelWrapper> getReferenceBasedUpdates(AdvancedModelWrapper model,
Map<Object, AdvancedModelWrapper> updated, EKBCommit commit) throws EKBException {
List<AdvancedModelWrapper> updates = new ArrayList<AdvancedModelWrapper>();
List<EDBObject> references = model.getModelsR... | [
"private",
"List",
"<",
"AdvancedModelWrapper",
">",
"getReferenceBasedUpdates",
"(",
"AdvancedModelWrapper",
"model",
",",
"Map",
"<",
"Object",
",",
"AdvancedModelWrapper",
">",
"updated",
",",
"EKBCommit",
"commit",
")",
"throws",
"EKBException",
"{",
"List",
"<"... | Returns engineering objects to the commit, which are changed by a model which was committed in the EKBCommit | [
"Returns",
"engineering",
"objects",
"to",
"the",
"commit",
"which",
"are",
"changed",
"by",
"a",
"model",
"which",
"was",
"committed",
"in",
"the",
"EKBCommit"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L213-L225 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.updateEOByUpdatedModel | private AdvancedModelWrapper updateEOByUpdatedModel(EDBModelObject reference, AdvancedModelWrapper model,
Map<Object, AdvancedModelWrapper> updated) {
ModelDescription source = model.getModelDescription();
ModelDescription description = reference.getModelDescription();
AdvancedModelW... | java | private AdvancedModelWrapper updateEOByUpdatedModel(EDBModelObject reference, AdvancedModelWrapper model,
Map<Object, AdvancedModelWrapper> updated) {
ModelDescription source = model.getModelDescription();
ModelDescription description = reference.getModelDescription();
AdvancedModelW... | [
"private",
"AdvancedModelWrapper",
"updateEOByUpdatedModel",
"(",
"EDBModelObject",
"reference",
",",
"AdvancedModelWrapper",
"model",
",",
"Map",
"<",
"Object",
",",
"AdvancedModelWrapper",
">",
"updated",
")",
"{",
"ModelDescription",
"source",
"=",
"model",
".",
"g... | Updates an Engineering Object given as EDBObject based on the update on the given model which is referenced by
the given Engineering Object. | [
"Updates",
"an",
"Engineering",
"Object",
"given",
"as",
"EDBObject",
"based",
"on",
"the",
"update",
"on",
"the",
"given",
"model",
"which",
"is",
"referenced",
"by",
"the",
"given",
"Engineering",
"Object",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L231-L245 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.enhanceCommitInserts | private void enhanceCommitInserts(EKBCommit commit) throws EKBException {
for (OpenEngSBModel model : commit.getInserts()) {
AdvancedModelWrapper simple = AdvancedModelWrapper.wrap(model);
if (simple.isEngineeringObject()) {
performInsertEOLogic(simple.toEngineeringObject... | java | private void enhanceCommitInserts(EKBCommit commit) throws EKBException {
for (OpenEngSBModel model : commit.getInserts()) {
AdvancedModelWrapper simple = AdvancedModelWrapper.wrap(model);
if (simple.isEngineeringObject()) {
performInsertEOLogic(simple.toEngineeringObject... | [
"private",
"void",
"enhanceCommitInserts",
"(",
"EKBCommit",
"commit",
")",
"throws",
"EKBException",
"{",
"for",
"(",
"OpenEngSBModel",
"model",
":",
"commit",
".",
"getInserts",
"(",
")",
")",
"{",
"AdvancedModelWrapper",
"simple",
"=",
"AdvancedModelWrapper",
"... | Enhances the EKBCommit for the insertion of EngineeringObjects. | [
"Enhances",
"the",
"EKBCommit",
"for",
"the",
"insertion",
"of",
"EngineeringObjects",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L250-L257 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.performInsertEOLogic | private void performInsertEOLogic(EngineeringObjectModelWrapper model) {
for (Field field : model.getForeignKeyFields()) {
mergeEngineeringObjectWithReferencedModel(field, model);
}
} | java | private void performInsertEOLogic(EngineeringObjectModelWrapper model) {
for (Field field : model.getForeignKeyFields()) {
mergeEngineeringObjectWithReferencedModel(field, model);
}
} | [
"private",
"void",
"performInsertEOLogic",
"(",
"EngineeringObjectModelWrapper",
"model",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"model",
".",
"getForeignKeyFields",
"(",
")",
")",
"{",
"mergeEngineeringObjectWithReferencedModel",
"(",
"field",
",",
"model",
"... | Performs the logic for the enhancement needed to be performed to insert an Engineering Object into the EDB. | [
"Performs",
"the",
"logic",
"for",
"the",
"enhancement",
"needed",
"to",
"be",
"performed",
"to",
"insert",
"an",
"Engineering",
"Object",
"into",
"the",
"EDB",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L262-L266 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.performMerge | private AdvancedModelWrapper performMerge(AdvancedModelWrapper source, AdvancedModelWrapper target) {
if (source == null || target == null) {
return null;
}
ModelDescription sourceDesc = source.getModelDescription();
ModelDescription targetDesc = target.getModelDescription();... | java | private AdvancedModelWrapper performMerge(AdvancedModelWrapper source, AdvancedModelWrapper target) {
if (source == null || target == null) {
return null;
}
ModelDescription sourceDesc = source.getModelDescription();
ModelDescription targetDesc = target.getModelDescription();... | [
"private",
"AdvancedModelWrapper",
"performMerge",
"(",
"AdvancedModelWrapper",
"source",
",",
"AdvancedModelWrapper",
"target",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"target",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ModelDescription",
... | Performs the merge from the source model to the target model and returns the result. Returns null if either the
source or the target is null. | [
"Performs",
"the",
"merge",
"from",
"the",
"source",
"model",
"to",
"the",
"target",
"model",
"and",
"returns",
"the",
"result",
".",
"Returns",
"null",
"if",
"either",
"the",
"source",
"or",
"the",
"target",
"is",
"null",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L272-L283 | train |
openengsb/openengsb | components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java | EngineeringObjectEnhancer.mergeEngineeringObjectWithReferencedModel | private void mergeEngineeringObjectWithReferencedModel(Field field, EngineeringObjectModelWrapper model) {
AdvancedModelWrapper result = performMerge(loadReferencedModel(model, field), model);
if (result != null) {
model = result.toEngineeringObject();
}
} | java | private void mergeEngineeringObjectWithReferencedModel(Field field, EngineeringObjectModelWrapper model) {
AdvancedModelWrapper result = performMerge(loadReferencedModel(model, field), model);
if (result != null) {
model = result.toEngineeringObject();
}
} | [
"private",
"void",
"mergeEngineeringObjectWithReferencedModel",
"(",
"Field",
"field",
",",
"EngineeringObjectModelWrapper",
"model",
")",
"{",
"AdvancedModelWrapper",
"result",
"=",
"performMerge",
"(",
"loadReferencedModel",
"(",
"model",
",",
"field",
")",
",",
"mode... | Merges the given EngineeringObject with the referenced model which is defined in the given field. | [
"Merges",
"the",
"given",
"EngineeringObject",
"with",
"the",
"referenced",
"model",
"which",
"is",
"defined",
"in",
"the",
"given",
"field",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/persistence-persist-edb/src/main/java/org/openengsb/core/ekb/persistence/persist/edb/internal/EngineeringObjectEnhancer.java#L288-L293 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/ModelUtils.java | ModelUtils.createModel | public static <T> T createModel(Class<T> model, List<OpenEngSBModelEntry> entries) {
if (!ModelWrapper.isModel(model)) {
throw new IllegalArgumentException("The given class is no model");
}
try {
T instance = model.newInstance();
for (OpenEngSBModelEntry entry... | java | public static <T> T createModel(Class<T> model, List<OpenEngSBModelEntry> entries) {
if (!ModelWrapper.isModel(model)) {
throw new IllegalArgumentException("The given class is no model");
}
try {
T instance = model.newInstance();
for (OpenEngSBModelEntry entry... | [
"public",
"static",
"<",
"T",
">",
"T",
"createModel",
"(",
"Class",
"<",
"T",
">",
"model",
",",
"List",
"<",
"OpenEngSBModelEntry",
">",
"entries",
")",
"{",
"if",
"(",
"!",
"ModelWrapper",
".",
"isModel",
"(",
"model",
")",
")",
"{",
"throw",
"new... | Creates a model of the given type and uses the list of OpenEngSBModelEntries as initialization data. | [
"Creates",
"a",
"model",
"of",
"the",
"given",
"type",
"and",
"uses",
"the",
"list",
"of",
"OpenEngSBModelEntries",
"as",
"initialization",
"data",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/ModelUtils.java#L45-L69 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/ModelUtils.java | ModelUtils.tryToSetValueThroughField | private static boolean tryToSetValueThroughField(OpenEngSBModelEntry entry, Object instance)
throws IllegalAccessException {
try {
Field field = instance.getClass().getDeclaredField(entry.getKey());
field.setAccessible(true);
field.set(instance, entry.getValue());
... | java | private static boolean tryToSetValueThroughField(OpenEngSBModelEntry entry, Object instance)
throws IllegalAccessException {
try {
Field field = instance.getClass().getDeclaredField(entry.getKey());
field.setAccessible(true);
field.set(instance, entry.getValue());
... | [
"private",
"static",
"boolean",
"tryToSetValueThroughField",
"(",
"OpenEngSBModelEntry",
"entry",
",",
"Object",
"instance",
")",
"throws",
"IllegalAccessException",
"{",
"try",
"{",
"Field",
"field",
"=",
"instance",
".",
"getClass",
"(",
")",
".",
"getDeclaredFiel... | Tries to set the value of an OpenEngSBModelEntry to its corresponding field of the model. Returns true if the
field can be set, returns false if not. | [
"Tries",
"to",
"set",
"the",
"value",
"of",
"an",
"OpenEngSBModelEntry",
"to",
"its",
"corresponding",
"field",
"of",
"the",
"model",
".",
"Returns",
"true",
"if",
"the",
"field",
"can",
"be",
"set",
"returns",
"false",
"if",
"not",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/ModelUtils.java#L75-L90 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/ModelUtils.java | ModelUtils.tryToSetValueThroughSetter | private static boolean tryToSetValueThroughSetter(OpenEngSBModelEntry entry, Object instance)
throws IllegalAccessException {
try {
String setterName = getSetterName(entry.getKey());
Method method = instance.getClass().getMethod(setterName, entry.getType());
method.in... | java | private static boolean tryToSetValueThroughSetter(OpenEngSBModelEntry entry, Object instance)
throws IllegalAccessException {
try {
String setterName = getSetterName(entry.getKey());
Method method = instance.getClass().getMethod(setterName, entry.getType());
method.in... | [
"private",
"static",
"boolean",
"tryToSetValueThroughSetter",
"(",
"OpenEngSBModelEntry",
"entry",
",",
"Object",
"instance",
")",
"throws",
"IllegalAccessException",
"{",
"try",
"{",
"String",
"setterName",
"=",
"getSetterName",
"(",
"entry",
".",
"getKey",
"(",
")... | Tries to set the value of an OpenEngSBModelEntry to its corresponding setter of the model. Returns true if the
setter can be called, returns false if not. | [
"Tries",
"to",
"set",
"the",
"value",
"of",
"an",
"OpenEngSBModelEntry",
"to",
"its",
"corresponding",
"setter",
"of",
"the",
"model",
".",
"Returns",
"true",
"if",
"the",
"setter",
"can",
"be",
"called",
"returns",
"false",
"if",
"not",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/ModelUtils.java#L96-L111 | train |
openengsb/openengsb | ports/jms/src/main/java/org/openengsb/ports/jms/DestinationUrl.java | DestinationUrl.createDestinationUrl | public static DestinationUrl createDestinationUrl(String destination) {
String[] split = splitDestination(destination);
String host = split[0].trim();
String jmsDestination = split[1].trim();
return new DestinationUrl(host, jmsDestination);
} | java | public static DestinationUrl createDestinationUrl(String destination) {
String[] split = splitDestination(destination);
String host = split[0].trim();
String jmsDestination = split[1].trim();
return new DestinationUrl(host, jmsDestination);
} | [
"public",
"static",
"DestinationUrl",
"createDestinationUrl",
"(",
"String",
"destination",
")",
"{",
"String",
"[",
"]",
"split",
"=",
"splitDestination",
"(",
"destination",
")",
";",
"String",
"host",
"=",
"split",
"[",
"0",
"]",
".",
"trim",
"(",
")",
... | Creates an instance of an connection URL based on an destination string. In case that the destination string does
not match the form HOST?QUEUE||TOPIC an IllegalArgumentException is thrown. | [
"Creates",
"an",
"instance",
"of",
"an",
"connection",
"URL",
"based",
"on",
"an",
"destination",
"string",
".",
"In",
"case",
"that",
"the",
"destination",
"string",
"does",
"not",
"match",
"the",
"form",
"HOST?QUEUE||TOPIC",
"an",
"IllegalArgumentException",
"... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/ports/jms/src/main/java/org/openengsb/ports/jms/DestinationUrl.java#L34-L39 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CollectionUtilsExtended.java | CollectionUtilsExtended.group | public static <K, V> Map<K, List<V>> group(Collection<V> collection, Function<V, K> keyFn) {
Map<K, List<V>> map = new HashMap<>();
for (V value : collection) {
K key = keyFn.apply(value);
if (map.get(key) == null) {
map.put(key, new ArrayList<V>());
... | java | public static <K, V> Map<K, List<V>> group(Collection<V> collection, Function<V, K> keyFn) {
Map<K, List<V>> map = new HashMap<>();
for (V value : collection) {
K key = keyFn.apply(value);
if (map.get(key) == null) {
map.put(key, new ArrayList<V>());
... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"List",
"<",
"V",
">",
">",
"group",
"(",
"Collection",
"<",
"V",
">",
"collection",
",",
"Function",
"<",
"V",
",",
"K",
">",
"keyFn",
")",
"{",
"Map",
"<",
"K",
",",
"List",... | Does a "group by" or map aggregation on a collection based on keys that are emitted by the given function. For
each key emitted by the function, the map will contain a list at that key entry containing at least one element
from the collection.
@param collection the collection to group
@param keyFn the function that em... | [
"Does",
"a",
"group",
"by",
"or",
"map",
"aggregation",
"on",
"a",
"collection",
"based",
"on",
"keys",
"that",
"are",
"emitted",
"by",
"the",
"given",
"function",
".",
"For",
"each",
"key",
"emitted",
"by",
"the",
"function",
"the",
"map",
"will",
"cont... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CollectionUtilsExtended.java#L69-L83 | train |
openengsb/openengsb | components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/IndexBuilder.java | IndexBuilder.buildIndex | public <T> JdbcIndex<T> buildIndex(Class<T> model) {
JdbcIndex<T> index = new JdbcIndex<>();
index.setModelClass(model);
index.setName(indexNameTranslator.translate(model));
index.setFields(buildFields(index));
return index;
} | java | public <T> JdbcIndex<T> buildIndex(Class<T> model) {
JdbcIndex<T> index = new JdbcIndex<>();
index.setModelClass(model);
index.setName(indexNameTranslator.translate(model));
index.setFields(buildFields(index));
return index;
} | [
"public",
"<",
"T",
">",
"JdbcIndex",
"<",
"T",
">",
"buildIndex",
"(",
"Class",
"<",
"T",
">",
"model",
")",
"{",
"JdbcIndex",
"<",
"T",
">",
"index",
"=",
"new",
"JdbcIndex",
"<>",
"(",
")",
";",
"index",
".",
"setModelClass",
"(",
"model",
")",
... | Builds a JdbcIndex instance for the given model Class.
@param model the model class
@param <T> the type of the model class
@return a new Index | [
"Builds",
"a",
"JdbcIndex",
"instance",
"for",
"the",
"given",
"model",
"Class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/IndexBuilder.java#L62-L71 | train |
openengsb/openengsb | connector/userprojectsldap/src/main/java/org/openengsb/connector/userprojects/ldap/internal/ldap/Utils.java | Utils.extractAttributeValueNoEmptyCheck | public static String extractAttributeValueNoEmptyCheck(Entry entry, String attributeType) {
Attribute attribute = entry.get(attributeType);
if (attribute == null) {
return null;
}
try {
return attribute.getString();
} catch (LdapInvalidAttributeValueExcept... | java | public static String extractAttributeValueNoEmptyCheck(Entry entry, String attributeType) {
Attribute attribute = entry.get(attributeType);
if (attribute == null) {
return null;
}
try {
return attribute.getString();
} catch (LdapInvalidAttributeValueExcept... | [
"public",
"static",
"String",
"extractAttributeValueNoEmptyCheck",
"(",
"Entry",
"entry",
",",
"String",
"attributeType",
")",
"{",
"Attribute",
"attribute",
"=",
"entry",
".",
"get",
"(",
"attributeType",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"... | Returns the value of the attribute of attributeType from entry. | [
"Returns",
"the",
"value",
"of",
"the",
"attribute",
"of",
"attributeType",
"from",
"entry",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/connector/userprojectsldap/src/main/java/org/openengsb/connector/userprojects/ldap/internal/ldap/Utils.java#L55-L65 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java | FileComparer.removeSimilarClassesFromFile1 | public void removeSimilarClassesFromFile1() throws IOException {
logging.info("Start reding cs File");
List<String> linescs1 = getFileLinesAsList(csFile1);
logging.info("Start reding cs File");
List<String> linescs2 = getFileLinesAsList(csFile2);
logging.info("Search classes");
... | java | public void removeSimilarClassesFromFile1() throws IOException {
logging.info("Start reding cs File");
List<String> linescs1 = getFileLinesAsList(csFile1);
logging.info("Start reding cs File");
List<String> linescs2 = getFileLinesAsList(csFile2);
logging.info("Search classes");
... | [
"public",
"void",
"removeSimilarClassesFromFile1",
"(",
")",
"throws",
"IOException",
"{",
"logging",
".",
"info",
"(",
"\"Start reding cs File\"",
")",
";",
"List",
"<",
"String",
">",
"linescs1",
"=",
"getFileLinesAsList",
"(",
"csFile1",
")",
";",
"logging",
... | Removes similar classes in the first cs File
@throws IOException | [
"Removes",
"similar",
"classes",
"in",
"the",
"first",
"cs",
"File"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java#L65-L90 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java | FileComparer.replaceAbstractClasses | public List<String> replaceAbstractClasses(List<String> lines) {
List<String> result = new LinkedList<String>();
for (int i = 0; i < lines.size(); i++) {
result.add(removeAbstract(lines.get(i)));
}
return result;
} | java | public List<String> replaceAbstractClasses(List<String> lines) {
List<String> result = new LinkedList<String>();
for (int i = 0; i < lines.size(); i++) {
result.add(removeAbstract(lines.get(i)));
}
return result;
} | [
"public",
"List",
"<",
"String",
">",
"replaceAbstractClasses",
"(",
"List",
"<",
"String",
">",
"lines",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"LinkedList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Searches for abstract classes and replace it by an interface.
@param lines
@return | [
"Searches",
"for",
"abstract",
"classes",
"and",
"replace",
"it",
"by",
"an",
"interface",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java#L98-L104 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java | FileComparer.getClassName | private String getClassName(String line) {
String result = line.substring(line.indexOf(CSHARP_CLASS_NAME)
+ CSHARP_CLASS_NAME.length());
if (result.contains("{")) {
result = result.substring(0, result.indexOf("{"));
}
if (result.contains(":")) {
re... | java | private String getClassName(String line) {
String result = line.substring(line.indexOf(CSHARP_CLASS_NAME)
+ CSHARP_CLASS_NAME.length());
if (result.contains("{")) {
result = result.substring(0, result.indexOf("{"));
}
if (result.contains(":")) {
re... | [
"private",
"String",
"getClassName",
"(",
"String",
"line",
")",
"{",
"String",
"result",
"=",
"line",
".",
"substring",
"(",
"line",
".",
"indexOf",
"(",
"CSHARP_CLASS_NAME",
")",
"+",
"CSHARP_CLASS_NAME",
".",
"length",
"(",
")",
")",
";",
"if",
"(",
"... | Returns the Class name of a line
@param line
@return | [
"Returns",
"the",
"Class",
"name",
"of",
"a",
"line"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java#L255-L265 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java | FileComparer.getFileLinesAsList | public List<String> getFileLinesAsList(File f) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(
new DataInputStream(new FileInputStream(f))));
List<String> result = new LinkedList<String>();
String strLine;
while ((strLine = br.readLine()) !=... | java | public List<String> getFileLinesAsList(File f) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(
new DataInputStream(new FileInputStream(f))));
List<String> result = new LinkedList<String>();
String strLine;
while ((strLine = br.readLine()) !=... | [
"public",
"List",
"<",
"String",
">",
"getFileLinesAsList",
"(",
"File",
"f",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"br",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"new",
"DataInputStream",
"(",
"new",
"FileInputStream",
... | Reads a file and returns the content as List
@param f
@return
@throws IOException | [
"Reads",
"a",
"file",
"and",
"returns",
"the",
"content",
"as",
"List"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java#L284-L295 | train |
openengsb/openengsb | tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java | FileComparer.removeSimilaritiesAndSaveFiles | public static void removeSimilaritiesAndSaveFiles(List<String> filepathes,
Log logging, Boolean isWindows) throws IOException {
List<File> files = new LinkedList<File>();
for (String path : filepathes) {
files.add(new File(path));
}
FileComparer fcomparer;
... | java | public static void removeSimilaritiesAndSaveFiles(List<String> filepathes,
Log logging, Boolean isWindows) throws IOException {
List<File> files = new LinkedList<File>();
for (String path : filepathes) {
files.add(new File(path));
}
FileComparer fcomparer;
... | [
"public",
"static",
"void",
"removeSimilaritiesAndSaveFiles",
"(",
"List",
"<",
"String",
">",
"filepathes",
",",
"Log",
"logging",
",",
"Boolean",
"isWindows",
")",
"throws",
"IOException",
"{",
"List",
"<",
"File",
">",
"files",
"=",
"new",
"LinkedList",
"<"... | Removes all the similar parts from all the files
@param filepathes
@throws IOException | [
"Removes",
"all",
"the",
"similar",
"parts",
"from",
"all",
"the",
"files"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/tooling/wsdl2dll/src/main/java/org/openengsb/loom/csharp/comon/wsdltodll/csfilehandling/FileComparer.java#L303-L317 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/OsgiUtils.java | OsgiUtils.getFilterForLocation | public static Filter getFilterForLocation(Class<?> clazz, String location, String context)
throws IllegalArgumentException {
String filter = makeLocationFilterString(location, context);
return FilterUtils.makeFilter(clazz, filter);
} | java | public static Filter getFilterForLocation(Class<?> clazz, String location, String context)
throws IllegalArgumentException {
String filter = makeLocationFilterString(location, context);
return FilterUtils.makeFilter(clazz, filter);
} | [
"public",
"static",
"Filter",
"getFilterForLocation",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"location",
",",
"String",
"context",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"filter",
"=",
"makeLocationFilterString",
"(",
"location",
"... | returns a filter that matches services with the given class and location in both the given context and the
root-context
@throws IllegalArgumentException if the location contains special characters that prevent the filter from
compiling | [
"returns",
"a",
"filter",
"that",
"matches",
"services",
"with",
"the",
"given",
"class",
"and",
"location",
"in",
"both",
"the",
"given",
"context",
"and",
"the",
"root",
"-",
"context"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/OsgiUtils.java#L40-L44 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/OsgiUtils.java | OsgiUtils.getFilterForLocation | public static Filter getFilterForLocation(Class<?> clazz, String location) throws IllegalArgumentException {
return getFilterForLocation(clazz, location, ContextHolder.get().getCurrentContextId());
} | java | public static Filter getFilterForLocation(Class<?> clazz, String location) throws IllegalArgumentException {
return getFilterForLocation(clazz, location, ContextHolder.get().getCurrentContextId());
} | [
"public",
"static",
"Filter",
"getFilterForLocation",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"location",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"getFilterForLocation",
"(",
"clazz",
",",
"location",
",",
"ContextHolder",
".",
"get"... | returns a filter that matches services with the given class and location in both the current context and the
root-context
@throws IllegalArgumentException if the location contains special characters that prevent the filter from
compiling | [
"returns",
"a",
"filter",
"that",
"matches",
"services",
"with",
"the",
"given",
"class",
"and",
"location",
"in",
"both",
"the",
"current",
"context",
"and",
"the",
"root",
"-",
"context"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/OsgiUtils.java#L53-L55 | train |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/OsgiUtils.java | OsgiUtils.getFilterForLocation | public static Filter getFilterForLocation(String location, String context) throws IllegalArgumentException {
String filter = makeLocationFilterString(location, context);
try {
return FrameworkUtil.createFilter(filter);
} catch (InvalidSyntaxException e) {
throw new Illega... | java | public static Filter getFilterForLocation(String location, String context) throws IllegalArgumentException {
String filter = makeLocationFilterString(location, context);
try {
return FrameworkUtil.createFilter(filter);
} catch (InvalidSyntaxException e) {
throw new Illega... | [
"public",
"static",
"Filter",
"getFilterForLocation",
"(",
"String",
"location",
",",
"String",
"context",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"filter",
"=",
"makeLocationFilterString",
"(",
"location",
",",
"context",
")",
";",
"try",
"{",
"... | returns a filter that matches services with the given location in both the given context and the root-context
@throws IllegalArgumentException if the location contains special characters that prevent the filter from
compiling | [
"returns",
"a",
"filter",
"that",
"matches",
"services",
"with",
"the",
"given",
"location",
"in",
"both",
"the",
"given",
"context",
"and",
"the",
"root",
"-",
"context"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/OsgiUtils.java#L63-L70 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java | AbstractStandardTransformationOperation.checkInputSize | protected void checkInputSize(List<Object> input) throws TransformationOperationException {
int inputCount = getOperationInputCount();
int inputSize = input.size();
if (inputCount == -2) {
return;
} else if (inputCount == -1 && input.size() < 1) {
throw new Transf... | java | protected void checkInputSize(List<Object> input) throws TransformationOperationException {
int inputCount = getOperationInputCount();
int inputSize = input.size();
if (inputCount == -2) {
return;
} else if (inputCount == -1 && input.size() < 1) {
throw new Transf... | [
"protected",
"void",
"checkInputSize",
"(",
"List",
"<",
"Object",
">",
"input",
")",
"throws",
"TransformationOperationException",
"{",
"int",
"inputCount",
"=",
"getOperationInputCount",
"(",
")",
";",
"int",
"inputSize",
"=",
"input",
".",
"size",
"(",
")",
... | Checks if the input size is matching with the operation defined input count. If not, a
TransformationOperationException is thrown. | [
"Checks",
"if",
"the",
"input",
"size",
"is",
"matching",
"with",
"the",
"operation",
"defined",
"input",
"count",
".",
"If",
"not",
"a",
"TransformationOperationException",
"is",
"thrown",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L68-L79 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java | AbstractStandardTransformationOperation.getParameterOrDefault | protected String getParameterOrDefault(Map<String, String> parameters, String paramName, String defaultValue)
throws TransformationOperationException {
return getParameter(parameters, paramName, false, defaultValue);
} | java | protected String getParameterOrDefault(Map<String, String> parameters, String paramName, String defaultValue)
throws TransformationOperationException {
return getParameter(parameters, paramName, false, defaultValue);
} | [
"protected",
"String",
"getParameterOrDefault",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"paramName",
",",
"String",
"defaultValue",
")",
"throws",
"TransformationOperationException",
"{",
"return",
"getParameter",
"(",
"parameters",... | Get the parameter with the given parameter name from the parameter map. If the parameters does not contain such a
parameter, take the default value instead. | [
"Get",
"the",
"parameter",
"with",
"the",
"given",
"parameter",
"name",
"from",
"the",
"parameter",
"map",
".",
"If",
"the",
"parameters",
"does",
"not",
"contain",
"such",
"a",
"parameter",
"take",
"the",
"default",
"value",
"instead",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L85-L88 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java | AbstractStandardTransformationOperation.getParameterOrException | protected String getParameterOrException(Map<String, String> parameters, String paramName)
throws TransformationOperationException {
return getParameter(parameters, paramName, true, null);
} | java | protected String getParameterOrException(Map<String, String> parameters, String paramName)
throws TransformationOperationException {
return getParameter(parameters, paramName, true, null);
} | [
"protected",
"String",
"getParameterOrException",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"paramName",
")",
"throws",
"TransformationOperationException",
"{",
"return",
"getParameter",
"(",
"parameters",
",",
"paramName",
",",
"tr... | Get the parameter with the given parameter name from the parameter map. If the parameters does not contain such a
parameter, the function throws a TransformationOperationException. | [
"Get",
"the",
"parameter",
"with",
"the",
"given",
"parameter",
"name",
"from",
"the",
"parameter",
"map",
".",
"If",
"the",
"parameters",
"does",
"not",
"contain",
"such",
"a",
"parameter",
"the",
"function",
"throws",
"a",
"TransformationOperationException",
"... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L94-L97 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java | AbstractStandardTransformationOperation.getParameter | private String getParameter(Map<String, String> parameters, String paramName, boolean abortOnError,
String defaultValue) throws TransformationOperationException {
String value = parameters.get(paramName);
if (value != null) {
return value;
}
if (abortOnError) {
... | java | private String getParameter(Map<String, String> parameters, String paramName, boolean abortOnError,
String defaultValue) throws TransformationOperationException {
String value = parameters.get(paramName);
if (value != null) {
return value;
}
if (abortOnError) {
... | [
"private",
"String",
"getParameter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"paramName",
",",
"boolean",
"abortOnError",
",",
"String",
"defaultValue",
")",
"throws",
"TransformationOperationException",
"{",
"String",
"value",
... | Get a parameter from the parameter map. If abortOnError is true, then a TransformationOperationException is
thrown in case that the asked parameter does not exists. If this value is false, the default value will be taken
instead of throwing an exception. | [
"Get",
"a",
"parameter",
"from",
"the",
"parameter",
"map",
".",
"If",
"abortOnError",
"is",
"true",
"then",
"a",
"TransformationOperationException",
"is",
"thrown",
"in",
"case",
"that",
"the",
"asked",
"parameter",
"does",
"not",
"exists",
".",
"If",
"this",... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L104-L118 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java | AbstractStandardTransformationOperation.parseIntString | protected Integer parseIntString(String string, boolean abortOnError, int def)
throws TransformationOperationException {
Integer integer = def;
if (string == null) {
logger.debug("Given string is empty so the default value is taken.");
}
try {
integer = In... | java | protected Integer parseIntString(String string, boolean abortOnError, int def)
throws TransformationOperationException {
Integer integer = def;
if (string == null) {
logger.debug("Given string is empty so the default value is taken.");
}
try {
integer = In... | [
"protected",
"Integer",
"parseIntString",
"(",
"String",
"string",
",",
"boolean",
"abortOnError",
",",
"int",
"def",
")",
"throws",
"TransformationOperationException",
"{",
"Integer",
"integer",
"=",
"def",
";",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"l... | Parses a string to an integer object. AbortOnError defines if the function should throw an exception if an error
occurs during the parsing. If it doesn't abort, the given default value is given back as result on error. | [
"Parses",
"a",
"string",
"to",
"an",
"integer",
"object",
".",
"AbortOnError",
"defines",
"if",
"the",
"function",
"should",
"throw",
"an",
"exception",
"if",
"an",
"error",
"occurs",
"during",
"the",
"parsing",
".",
"If",
"it",
"doesn",
"t",
"abort",
"the... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L124-L147 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java | AbstractStandardTransformationOperation.generateMatcher | protected Matcher generateMatcher(String regex, String valueString)
throws TransformationOperationException {
if (regex == null) {
throw new TransformationOperationException("No regex defined. The step will be skipped.");
}
try {
Pattern pattern = Pattern.compile(... | java | protected Matcher generateMatcher(String regex, String valueString)
throws TransformationOperationException {
if (regex == null) {
throw new TransformationOperationException("No regex defined. The step will be skipped.");
}
try {
Pattern pattern = Pattern.compile(... | [
"protected",
"Matcher",
"generateMatcher",
"(",
"String",
"regex",
",",
"String",
"valueString",
")",
"throws",
"TransformationOperationException",
"{",
"if",
"(",
"regex",
"==",
"null",
")",
"{",
"throw",
"new",
"TransformationOperationException",
"(",
"\"No regex de... | Generates a matcher for the given valueString with the given regular expression. | [
"Generates",
"a",
"matcher",
"for",
"the",
"given",
"valueString",
"with",
"the",
"given",
"regular",
"expression",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L152-L166 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/io/JAXBMarshaller.java | JAXBMarshaller.configureJaxbMarshaller | protected void configureJaxbMarshaller(javax.xml.bind.Marshaller marshaller)
throws PropertyException {
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT,
m_formatOutput);
} | java | protected void configureJaxbMarshaller(javax.xml.bind.Marshaller marshaller)
throws PropertyException {
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT,
m_formatOutput);
} | [
"protected",
"void",
"configureJaxbMarshaller",
"(",
"javax",
".",
"xml",
".",
"bind",
".",
"Marshaller",
"marshaller",
")",
"throws",
"PropertyException",
"{",
"marshaller",
".",
"setProperty",
"(",
"javax",
".",
"xml",
".",
"bind",
".",
"Marshaller",
".",
"J... | Configure a JAXB marshaller.
@param marshaller marshaller to configure
@throws PropertyException when there is an error processing a property or
value | [
"Configure",
"a",
"JAXB",
"marshaller",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/io/JAXBMarshaller.java#L125-L129 | train |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/util/DefaultConverterStep.java | DefaultConverterStep.getEntryValue | public Object getEntryValue(JPAEntry entry) {
try {
Class<?> typeClass = loadClass(entry.getType());
if (typeClass == null) {
return entry.getValue();
}
if (typeClass == Character.class) {
if (entry.getValue().length() > 1) {
... | java | public Object getEntryValue(JPAEntry entry) {
try {
Class<?> typeClass = loadClass(entry.getType());
if (typeClass == null) {
return entry.getValue();
}
if (typeClass == Character.class) {
if (entry.getValue().length() > 1) {
... | [
"public",
"Object",
"getEntryValue",
"(",
"JPAEntry",
"entry",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"typeClass",
"=",
"loadClass",
"(",
"entry",
".",
"getType",
"(",
")",
")",
";",
"if",
"(",
"typeClass",
"==",
"null",
")",
"{",
"return",
"e... | Tries to get the object value for a given JPAEntry. To instantiate the type first the static method "valueOf" of
the type will be tried. If that didn't work, then the constructor of the object with a string parameter is used.
If that didn't work either, the simple string will be set in the entry. | [
"Tries",
"to",
"get",
"the",
"object",
"value",
"for",
"a",
"given",
"JPAEntry",
".",
"To",
"instantiate",
"the",
"type",
"first",
"the",
"static",
"method",
"valueOf",
"of",
"the",
"type",
"will",
"be",
"tried",
".",
"If",
"that",
"didn",
"t",
"work",
... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/util/DefaultConverterStep.java#L63-L98 | train |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/util/DefaultConverterStep.java | DefaultConverterStep.loadClass | private Class<?> loadClass(String className) {
try {
return EDBUtils.class.getClassLoader().loadClass(className);
} catch (ClassNotFoundException e) {
LOGGER.debug("Class {} can not be found by the EDB. This object type is not supported by the EDB."
+ " Maybe the ... | java | private Class<?> loadClass(String className) {
try {
return EDBUtils.class.getClassLoader().loadClass(className);
} catch (ClassNotFoundException e) {
LOGGER.debug("Class {} can not be found by the EDB. This object type is not supported by the EDB."
+ " Maybe the ... | [
"private",
"Class",
"<",
"?",
">",
"loadClass",
"(",
"String",
"className",
")",
"{",
"try",
"{",
"return",
"EDBUtils",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
"loadClass",
"(",
"className",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException"... | Tries to load the class with the given name. Returns the class object if the class can be loaded. Returns null if
the class could not be loaded. | [
"Tries",
"to",
"load",
"the",
"class",
"with",
"the",
"given",
"name",
".",
"Returns",
"the",
"class",
"object",
"if",
"the",
"class",
"can",
"be",
"loaded",
".",
"Returns",
"null",
"if",
"the",
"class",
"could",
"not",
"be",
"loaded",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/util/DefaultConverterStep.java#L104-L112 | train |
openengsb/openengsb | components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/util/DefaultConverterStep.java | DefaultConverterStep.invokeValueOf | private Object invokeValueOf(Class<?> clazz, String value) throws IllegalAccessException,
InvocationTargetException {
try {
return MethodUtils.invokeExactStaticMethod(clazz, "valueOf", value);
} catch (NoSuchMethodException e) {
return null;
}
} | java | private Object invokeValueOf(Class<?> clazz, String value) throws IllegalAccessException,
InvocationTargetException {
try {
return MethodUtils.invokeExactStaticMethod(clazz, "valueOf", value);
} catch (NoSuchMethodException e) {
return null;
}
} | [
"private",
"Object",
"invokeValueOf",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"value",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"try",
"{",
"return",
"MethodUtils",
".",
"invokeExactStaticMethod",
"(",
"clazz",
"... | Tries to invoke the method valueOf of the given class object. If this method can be called, the result will be
given back based on the given value which is used as parameter for the method. If this method can't be called
null will be given back. | [
"Tries",
"to",
"invoke",
"the",
"method",
"valueOf",
"of",
"the",
"given",
"class",
"object",
".",
"If",
"this",
"method",
"can",
"be",
"called",
"the",
"result",
"will",
"be",
"given",
"back",
"based",
"on",
"the",
"given",
"value",
"which",
"is",
"used... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edb/src/main/java/org/openengsb/core/edb/jpa/internal/util/DefaultConverterStep.java#L119-L126 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/expression/SpelExpression.java | SpelExpression.getParsedExpression | protected synchronized Expression getParsedExpression() {
if (parsedExpression == null) {
try {
parsedExpression = EXPRESSION_PARSER.parseExpression(getExpression());
}
catch (ParseException e) {
throw new IllegalArgumentException("[" + g... | java | protected synchronized Expression getParsedExpression() {
if (parsedExpression == null) {
try {
parsedExpression = EXPRESSION_PARSER.parseExpression(getExpression());
}
catch (ParseException e) {
throw new IllegalArgumentException("[" + g... | [
"protected",
"synchronized",
"Expression",
"getParsedExpression",
"(",
")",
"{",
"if",
"(",
"parsedExpression",
"==",
"null",
")",
"{",
"try",
"{",
"parsedExpression",
"=",
"EXPRESSION_PARSER",
".",
"parseExpression",
"(",
"getExpression",
"(",
")",
")",
";",
"}... | Return a parsed SpEL expression.
@return parsed SpEL expression | [
"Return",
"a",
"parsed",
"SpEL",
"expression",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/expression/SpelExpression.java#L112-L122 | train |
BrunoEberhard/minimal-j | ext/vaadin/src/main/java/org/minimalj/frontend/impl/vaadin/toolkit/VaadinConfirmDialog.java | VaadinConfirmDialog.show | public static VaadinConfirmDialog show(final UI ui,
final String windowCaption, final String message,
final String okCaption, final String cancelCaption, final Runnable r) {
VaadinConfirmDialog d = getFactory().create(windowCaption, message,
okCaption, cancelCaption, null... | java | public static VaadinConfirmDialog show(final UI ui,
final String windowCaption, final String message,
final String okCaption, final String cancelCaption, final Runnable r) {
VaadinConfirmDialog d = getFactory().create(windowCaption, message,
okCaption, cancelCaption, null... | [
"public",
"static",
"VaadinConfirmDialog",
"show",
"(",
"final",
"UI",
"ui",
",",
"final",
"String",
"windowCaption",
",",
"final",
"String",
"message",
",",
"final",
"String",
"okCaption",
",",
"final",
"String",
"cancelCaption",
",",
"final",
"Runnable",
"r",
... | Shows a modal VaadinConfirmDialog in given window and executes Runnable if OK
is chosen.
@param ui
Main level UI.
@param windowCaption
Caption for the confirmation dialog window.
@param message
Message to display as window content.
@param okCaption
Caption for the ok button.
@param cancelCaption
Caption for cancel but... | [
"Shows",
"a",
"modal",
"VaadinConfirmDialog",
"in",
"given",
"window",
"and",
"executes",
"Runnable",
"if",
"OK",
"is",
"chosen",
"."
] | f7c5461b2b47a10b383aee1e2f1f150f6773703b | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/ext/vaadin/src/main/java/org/minimalj/frontend/impl/vaadin/toolkit/VaadinConfirmDialog.java#L176-L191 | train |
BrunoEberhard/minimal-j | ext/vaadin/src/main/java/org/minimalj/frontend/impl/vaadin/toolkit/VaadinConfirmDialog.java | VaadinConfirmDialog.show | public final void show(final UI ui, final Listener listener,
final boolean modal) {
confirmListener = listener;
center();
setModal(modal);
ui.addWindow(this);
} | java | public final void show(final UI ui, final Listener listener,
final boolean modal) {
confirmListener = listener;
center();
setModal(modal);
ui.addWindow(this);
} | [
"public",
"final",
"void",
"show",
"(",
"final",
"UI",
"ui",
",",
"final",
"Listener",
"listener",
",",
"final",
"boolean",
"modal",
")",
"{",
"confirmListener",
"=",
"listener",
";",
"center",
"(",
")",
";",
"setModal",
"(",
"modal",
")",
";",
"ui",
"... | Show confirm dialog.
@param ui the UI in which the dialog should be shown
@param listener the listener to be notified
@param modal true if the dialog should be modal | [
"Show",
"confirm",
"dialog",
"."
] | f7c5461b2b47a10b383aee1e2f1f150f6773703b | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/ext/vaadin/src/main/java/org/minimalj/frontend/impl/vaadin/toolkit/VaadinConfirmDialog.java#L208-L214 | train |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java | EKBCommit.addInsert | public EKBCommit addInsert(Object insert) {
if (insert != null) {
checkIfModel(insert);
inserts.add((OpenEngSBModel) insert);
}
return this;
} | java | public EKBCommit addInsert(Object insert) {
if (insert != null) {
checkIfModel(insert);
inserts.add((OpenEngSBModel) insert);
}
return this;
} | [
"public",
"EKBCommit",
"addInsert",
"(",
"Object",
"insert",
")",
"{",
"if",
"(",
"insert",
"!=",
"null",
")",
"{",
"checkIfModel",
"(",
"insert",
")",
";",
"inserts",
".",
"add",
"(",
"(",
"OpenEngSBModel",
")",
"insert",
")",
";",
"}",
"return",
"thi... | Adds a model to the list of models which shall be inserted into the EDB. If the given object is not a model, an
IllegalArgumentException is thrown. | [
"Adds",
"a",
"model",
"to",
"the",
"list",
"of",
"models",
"which",
"shall",
"be",
"inserted",
"into",
"the",
"EDB",
".",
"If",
"the",
"given",
"object",
"is",
"not",
"a",
"model",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java#L51-L57 | train |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java | EKBCommit.addInserts | public EKBCommit addInserts(Collection<?> inserts) {
if (inserts != null) {
for (Object insert : inserts) {
checkIfModel(insert);
this.inserts.add((OpenEngSBModel) insert);
}
}
return this;
} | java | public EKBCommit addInserts(Collection<?> inserts) {
if (inserts != null) {
for (Object insert : inserts) {
checkIfModel(insert);
this.inserts.add((OpenEngSBModel) insert);
}
}
return this;
} | [
"public",
"EKBCommit",
"addInserts",
"(",
"Collection",
"<",
"?",
">",
"inserts",
")",
"{",
"if",
"(",
"inserts",
"!=",
"null",
")",
"{",
"for",
"(",
"Object",
"insert",
":",
"inserts",
")",
"{",
"checkIfModel",
"(",
"insert",
")",
";",
"this",
".",
... | Adds a collection of models which shall be inserted into the EDB. If one of the given objects is not a model, an
IllegalArgumentException is thrown. | [
"Adds",
"a",
"collection",
"of",
"models",
"which",
"shall",
"be",
"inserted",
"into",
"the",
"EDB",
".",
"If",
"one",
"of",
"the",
"given",
"objects",
"is",
"not",
"a",
"model",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java#L63-L71 | train |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java | EKBCommit.addUpdate | public EKBCommit addUpdate(Object update) {
if (update != null) {
checkIfModel(update);
updates.add((OpenEngSBModel) update);
}
return this;
} | java | public EKBCommit addUpdate(Object update) {
if (update != null) {
checkIfModel(update);
updates.add((OpenEngSBModel) update);
}
return this;
} | [
"public",
"EKBCommit",
"addUpdate",
"(",
"Object",
"update",
")",
"{",
"if",
"(",
"update",
"!=",
"null",
")",
"{",
"checkIfModel",
"(",
"update",
")",
";",
"updates",
".",
"add",
"(",
"(",
"OpenEngSBModel",
")",
"update",
")",
";",
"}",
"return",
"thi... | Adds a model to the list of models which shall be updated in the EDB. If the given object is not a model, an
IllegalArgumentException is thrown. | [
"Adds",
"a",
"model",
"to",
"the",
"list",
"of",
"models",
"which",
"shall",
"be",
"updated",
"in",
"the",
"EDB",
".",
"If",
"the",
"given",
"object",
"is",
"not",
"a",
"model",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java#L77-L83 | train |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java | EKBCommit.addUpdates | public EKBCommit addUpdates(Collection<?> updates) {
if (updates != null) {
for (Object update : updates) {
checkIfModel(update);
this.updates.add((OpenEngSBModel) update);
}
}
return this;
} | java | public EKBCommit addUpdates(Collection<?> updates) {
if (updates != null) {
for (Object update : updates) {
checkIfModel(update);
this.updates.add((OpenEngSBModel) update);
}
}
return this;
} | [
"public",
"EKBCommit",
"addUpdates",
"(",
"Collection",
"<",
"?",
">",
"updates",
")",
"{",
"if",
"(",
"updates",
"!=",
"null",
")",
"{",
"for",
"(",
"Object",
"update",
":",
"updates",
")",
"{",
"checkIfModel",
"(",
"update",
")",
";",
"this",
".",
... | Adds a collection of models which shall be updated in the EDB. If one of the given objects is not a model, an
IllegalArgumentException is thrown. | [
"Adds",
"a",
"collection",
"of",
"models",
"which",
"shall",
"be",
"updated",
"in",
"the",
"EDB",
".",
"If",
"one",
"of",
"the",
"given",
"objects",
"is",
"not",
"a",
"model",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java#L89-L97 | train |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java | EKBCommit.addDelete | public EKBCommit addDelete(Object delete) {
if (delete != null) {
checkIfModel(delete);
deletes.add((OpenEngSBModel) delete);
}
return this;
} | java | public EKBCommit addDelete(Object delete) {
if (delete != null) {
checkIfModel(delete);
deletes.add((OpenEngSBModel) delete);
}
return this;
} | [
"public",
"EKBCommit",
"addDelete",
"(",
"Object",
"delete",
")",
"{",
"if",
"(",
"delete",
"!=",
"null",
")",
"{",
"checkIfModel",
"(",
"delete",
")",
";",
"deletes",
".",
"add",
"(",
"(",
"OpenEngSBModel",
")",
"delete",
")",
";",
"}",
"return",
"thi... | Adds an model to the list of models which shall be deleted from the EDB. If the given object is not a model, an
IllegalArgumentException is thrown. | [
"Adds",
"an",
"model",
"to",
"the",
"list",
"of",
"models",
"which",
"shall",
"be",
"deleted",
"from",
"the",
"EDB",
".",
"If",
"the",
"given",
"object",
"is",
"not",
"a",
"model",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java#L103-L109 | train |
openengsb/openengsb | api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java | EKBCommit.addDeletes | public EKBCommit addDeletes(Collection<?> deletes) {
if (deletes != null) {
for (Object delete : deletes) {
checkIfModel(delete);
this.deletes.add((OpenEngSBModel) delete);
}
}
return this;
} | java | public EKBCommit addDeletes(Collection<?> deletes) {
if (deletes != null) {
for (Object delete : deletes) {
checkIfModel(delete);
this.deletes.add((OpenEngSBModel) delete);
}
}
return this;
} | [
"public",
"EKBCommit",
"addDeletes",
"(",
"Collection",
"<",
"?",
">",
"deletes",
")",
"{",
"if",
"(",
"deletes",
"!=",
"null",
")",
"{",
"for",
"(",
"Object",
"delete",
":",
"deletes",
")",
"{",
"checkIfModel",
"(",
"delete",
")",
";",
"this",
".",
... | Adds a collection of models which shall be deleted from the EDB. If one of the given objects is not a model, an
IllegalArgumentException is thrown. | [
"Adds",
"a",
"collection",
"of",
"models",
"which",
"shall",
"be",
"deleted",
"from",
"the",
"EDB",
".",
"If",
"one",
"of",
"the",
"given",
"objects",
"is",
"not",
"a",
"model",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/ekb/src/main/java/org/openengsb/core/ekb/api/EKBCommit.java#L115-L123 | train |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/api/Explanation.java | Explanation.getNestedClassExpressions | public Set<OWLClassExpression> getNestedClassExpressions() {
Set<OWLClassExpression> subConcepts = new HashSet<OWLClassExpression>();
for (OWLAxiom ax : justification) {
subConcepts.addAll(ax.getNestedClassExpressions());
}
return subConcepts;
} | java | public Set<OWLClassExpression> getNestedClassExpressions() {
Set<OWLClassExpression> subConcepts = new HashSet<OWLClassExpression>();
for (OWLAxiom ax : justification) {
subConcepts.addAll(ax.getNestedClassExpressions());
}
return subConcepts;
} | [
"public",
"Set",
"<",
"OWLClassExpression",
">",
"getNestedClassExpressions",
"(",
")",
"{",
"Set",
"<",
"OWLClassExpression",
">",
"subConcepts",
"=",
"new",
"HashSet",
"<",
"OWLClassExpression",
">",
"(",
")",
";",
"for",
"(",
"OWLAxiom",
"ax",
":",
"justifi... | Gets the sub-concepts that appear in the axioms in this explanation
@return A set of sub-concepts that appear in the axioms in this explanation | [
"Gets",
"the",
"sub",
"-",
"concepts",
"that",
"appear",
"in",
"the",
"axioms",
"in",
"this",
"explanation"
] | 439c5ca67835f5e421adde725e4e8a3bcd760ac8 | https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/api/Explanation.java#L113-L119 | train |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/api/Explanation.java | Explanation.store | public static void store(Explanation<OWLAxiom> explanation, OutputStream os) throws IOException {
try {
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.createOntology(explanation.getAxioms());
OWLDataFactory df = manager.getO... | java | public static void store(Explanation<OWLAxiom> explanation, OutputStream os) throws IOException {
try {
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.createOntology(explanation.getAxioms());
OWLDataFactory df = manager.getO... | [
"public",
"static",
"void",
"store",
"(",
"Explanation",
"<",
"OWLAxiom",
">",
"explanation",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"try",
"{",
"OWLOntologyManager",
"manager",
"=",
"OWLManager",
".",
"createOWLOntologyManager",
"(",
")",
... | Stores the specified explanation to the specified output stream
@param explanation The explanation to be stored
@param os The output stream to store the explanation to
@throws IOException if there was a problem writing out the explanation | [
"Stores",
"the",
"specified",
"explanation",
"to",
"the",
"specified",
"output",
"stream"
] | 439c5ca67835f5e421adde725e4e8a3bcd760ac8 | https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/api/Explanation.java#L186-L203 | train |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/api/Explanation.java | Explanation.load | public static Explanation<OWLAxiom> load(InputStream is) throws IOException {
try {
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(new BufferedInputStream(is));
OWLDataFactory df = manager.ge... | java | public static Explanation<OWLAxiom> load(InputStream is) throws IOException {
try {
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(new BufferedInputStream(is));
OWLDataFactory df = manager.ge... | [
"public",
"static",
"Explanation",
"<",
"OWLAxiom",
">",
"load",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"try",
"{",
"OWLOntologyManager",
"manager",
"=",
"OWLManager",
".",
"createOWLOntologyManager",
"(",
")",
";",
"OWLOntology",
"ontology",... | Loads a previously stored explanation from the specified input stream
@param is The input stream from where to read the explanation
@return The explanation that was read
@throws IOException if there was a problem reading the explanation
@throws IllegalStateException if the input stream does not appear to contain a seri... | [
"Loads",
"a",
"previously",
"stored",
"explanation",
"from",
"the",
"specified",
"input",
"stream"
] | 439c5ca67835f5e421adde725e4e8a3bcd760ac8 | https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/api/Explanation.java#L212-L237 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/JavassistUtils.java | JavassistUtils.hasAnnotation | public static boolean hasAnnotation(CtClass clazz, String annotationName) {
ClassFile cf = clazz.getClassFile2();
AnnotationsAttribute ainfo = (AnnotationsAttribute)
cf.getAttribute(AnnotationsAttribute.invisibleTag);
AnnotationsAttribute ainfo2 = (AnnotationsAttribute)
c... | java | public static boolean hasAnnotation(CtClass clazz, String annotationName) {
ClassFile cf = clazz.getClassFile2();
AnnotationsAttribute ainfo = (AnnotationsAttribute)
cf.getAttribute(AnnotationsAttribute.invisibleTag);
AnnotationsAttribute ainfo2 = (AnnotationsAttribute)
c... | [
"public",
"static",
"boolean",
"hasAnnotation",
"(",
"CtClass",
"clazz",
",",
"String",
"annotationName",
")",
"{",
"ClassFile",
"cf",
"=",
"clazz",
".",
"getClassFile2",
"(",
")",
";",
"AnnotationsAttribute",
"ainfo",
"=",
"(",
"AnnotationsAttribute",
")",
"cf"... | Returns true if the given class has an annotation set with the given name, returns false otherwise. | [
"Returns",
"true",
"if",
"the",
"given",
"class",
"has",
"an",
"annotation",
"set",
"with",
"the",
"given",
"name",
"returns",
"false",
"otherwise",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/JavassistUtils.java#L37-L44 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/JavassistUtils.java | JavassistUtils.hasAnnotation | public static boolean hasAnnotation(CtField field, String annotationName) {
FieldInfo info = field.getFieldInfo();
AnnotationsAttribute ainfo = (AnnotationsAttribute)
info.getAttribute(AnnotationsAttribute.invisibleTag);
AnnotationsAttribute ainfo2 = (AnnotationsAttribute)
... | java | public static boolean hasAnnotation(CtField field, String annotationName) {
FieldInfo info = field.getFieldInfo();
AnnotationsAttribute ainfo = (AnnotationsAttribute)
info.getAttribute(AnnotationsAttribute.invisibleTag);
AnnotationsAttribute ainfo2 = (AnnotationsAttribute)
... | [
"public",
"static",
"boolean",
"hasAnnotation",
"(",
"CtField",
"field",
",",
"String",
"annotationName",
")",
"{",
"FieldInfo",
"info",
"=",
"field",
".",
"getFieldInfo",
"(",
")",
";",
"AnnotationsAttribute",
"ainfo",
"=",
"(",
"AnnotationsAttribute",
")",
"in... | Returns true if the given field has an annotation set with the given name, returns false otherwise. | [
"Returns",
"true",
"if",
"the",
"given",
"field",
"has",
"an",
"annotation",
"set",
"with",
"the",
"given",
"name",
"returns",
"false",
"otherwise",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/JavassistUtils.java#L49-L56 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/JavassistUtils.java | JavassistUtils.checkAnnotation | private static boolean checkAnnotation(AnnotationsAttribute invisible, AnnotationsAttribute visible,
String annotationName) {
boolean exist1 = false;
boolean exist2 = false;
if (invisible != null) {
exist1 = invisible.getAnnotation(annotationName) != null;
}
... | java | private static boolean checkAnnotation(AnnotationsAttribute invisible, AnnotationsAttribute visible,
String annotationName) {
boolean exist1 = false;
boolean exist2 = false;
if (invisible != null) {
exist1 = invisible.getAnnotation(annotationName) != null;
}
... | [
"private",
"static",
"boolean",
"checkAnnotation",
"(",
"AnnotationsAttribute",
"invisible",
",",
"AnnotationsAttribute",
"visible",
",",
"String",
"annotationName",
")",
"{",
"boolean",
"exist1",
"=",
"false",
";",
"boolean",
"exist2",
"=",
"false",
";",
"if",
"(... | Checks if an annotation with the given name is either in the invisible or in the visible annotation attributes. | [
"Checks",
"if",
"an",
"annotation",
"with",
"the",
"given",
"name",
"is",
"either",
"in",
"the",
"invisible",
"or",
"in",
"the",
"visible",
"annotation",
"attributes",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/JavassistUtils.java#L61-L72 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java | SubStringOperation.checkBounds | private void checkBounds(String source, Integer from, Integer to) throws TransformationOperationException {
Integer length = source.length();
if (from > to) {
throw new TransformationOperationException(
"The from parameter is bigger than the to parameter");
}
... | java | private void checkBounds(String source, Integer from, Integer to) throws TransformationOperationException {
Integer length = source.length();
if (from > to) {
throw new TransformationOperationException(
"The from parameter is bigger than the to parameter");
}
... | [
"private",
"void",
"checkBounds",
"(",
"String",
"source",
",",
"Integer",
"from",
",",
"Integer",
"to",
")",
"throws",
"TransformationOperationException",
"{",
"Integer",
"length",
"=",
"source",
".",
"length",
"(",
")",
";",
"if",
"(",
"from",
">",
"to",
... | Checks if the from and the to parameters are valid for the given source | [
"Checks",
"if",
"the",
"from",
"and",
"the",
"to",
"parameters",
"are",
"valid",
"for",
"the",
"given",
"source"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java#L78-L92 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java | SubStringOperation.getFromParameter | private Integer getFromParameter(Map<String, String> parameters) throws TransformationOperationException {
return getSubStringParameter(parameters, fromParam, 0);
} | java | private Integer getFromParameter(Map<String, String> parameters) throws TransformationOperationException {
return getSubStringParameter(parameters, fromParam, 0);
} | [
"private",
"Integer",
"getFromParameter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"throws",
"TransformationOperationException",
"{",
"return",
"getSubStringParameter",
"(",
"parameters",
",",
"fromParam",
",",
"0",
")",
";",
"}"
] | Get the 'from' parameter from the parameters. If the parameter is not set 0 is taken instead. | [
"Get",
"the",
"from",
"parameter",
"from",
"the",
"parameters",
".",
"If",
"the",
"parameter",
"is",
"not",
"set",
"0",
"is",
"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/SubStringOperation.java#L97-L99 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java | SubStringOperation.getToParameter | private Integer getToParameter(Map<String, String> parameters, Integer defaultValue)
throws TransformationOperationException {
return getSubStringParameter(parameters, toParam, defaultValue);
} | java | private Integer getToParameter(Map<String, String> parameters, Integer defaultValue)
throws TransformationOperationException {
return getSubStringParameter(parameters, toParam, defaultValue);
} | [
"private",
"Integer",
"getToParameter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"Integer",
"defaultValue",
")",
"throws",
"TransformationOperationException",
"{",
"return",
"getSubStringParameter",
"(",
"parameters",
",",
"toParam",
",",
"d... | Get the 'to' parameter from the parameters. If the parameter is not set the defaultValue is taken instead. | [
"Get",
"the",
"to",
"parameter",
"from",
"the",
"parameters",
".",
"If",
"the",
"parameter",
"is",
"not",
"set",
"the",
"defaultValue",
"is",
"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/SubStringOperation.java#L104-L107 | train |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java | SubStringOperation.getSubStringParameter | private Integer getSubStringParameter(Map<String, String> parameters, String parameterName, Integer defaultValue)
throws TransformationOperationException {
String parameter = parameters.get(parameterName);
if (parameter == null) {
getLogger().debug("The {} parameter is not set, so th... | java | private Integer getSubStringParameter(Map<String, String> parameters, String parameterName, Integer defaultValue)
throws TransformationOperationException {
String parameter = parameters.get(parameterName);
if (parameter == null) {
getLogger().debug("The {} parameter is not set, so th... | [
"private",
"Integer",
"getSubStringParameter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"parameterName",
",",
"Integer",
"defaultValue",
")",
"throws",
"TransformationOperationException",
"{",
"String",
"parameter",
"=",
"parameters"... | Returns the substring parameter with the given parameter or the given default value if the parameter name is not
set. | [
"Returns",
"the",
"substring",
"parameter",
"with",
"the",
"given",
"parameter",
"or",
"the",
"given",
"default",
"value",
"if",
"the",
"parameter",
"name",
"is",
"not",
"set",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java#L113-L126 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/persistence/AbstractBatchingCacheStore.java | AbstractBatchingCacheStore.storeAll | @Override
public void storeAll(Map mapEntries) {
int batchSize = getBatchSize();
if (batchSize == 0 || mapEntries.size() < batchSize) {
storeBatch(mapEntries);
}
else {
Map batch = new HashMap(batchSize);
while (!mapEntries.isEmpty()) {
... | java | @Override
public void storeAll(Map mapEntries) {
int batchSize = getBatchSize();
if (batchSize == 0 || mapEntries.size() < batchSize) {
storeBatch(mapEntries);
}
else {
Map batch = new HashMap(batchSize);
while (!mapEntries.isEmpty()) {
... | [
"@",
"Override",
"public",
"void",
"storeAll",
"(",
"Map",
"mapEntries",
")",
"{",
"int",
"batchSize",
"=",
"getBatchSize",
"(",
")",
";",
"if",
"(",
"batchSize",
"==",
"0",
"||",
"mapEntries",
".",
"size",
"(",
")",
"<",
"batchSize",
")",
"{",
"storeB... | Persist all entries from the specified map into the data store.
@param mapEntries entries to persist | [
"Persist",
"all",
"entries",
"from",
"the",
"specified",
"map",
"into",
"the",
"data",
"store",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/persistence/AbstractBatchingCacheStore.java#L57-L79 | train |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java | BlackBoxExplanationGenerator.getOrderedJustifications | private static <E> List<OWLAxiom> getOrderedJustifications(List<OWLAxiom> mups, final Set<Explanation<E>> allJustifications) {
Comparator<OWLAxiom> mupsComparator = new Comparator<OWLAxiom>() {
public int compare(OWLAxiom o1, OWLAxiom o2) {
// The checker that appears in most MUPS ha... | java | private static <E> List<OWLAxiom> getOrderedJustifications(List<OWLAxiom> mups, final Set<Explanation<E>> allJustifications) {
Comparator<OWLAxiom> mupsComparator = new Comparator<OWLAxiom>() {
public int compare(OWLAxiom o1, OWLAxiom o2) {
// The checker that appears in most MUPS ha... | [
"private",
"static",
"<",
"E",
">",
"List",
"<",
"OWLAxiom",
">",
"getOrderedJustifications",
"(",
"List",
"<",
"OWLAxiom",
">",
"mups",
",",
"final",
"Set",
"<",
"Explanation",
"<",
"E",
">",
">",
"allJustifications",
")",
"{",
"Comparator",
"<",
"OWLAxio... | Orders the axioms in a single MUPS by the frequency of which they appear
in all MUPS.
@param mups The MUPS containing the axioms to be ordered
@param allJustifications The set of all justifications which is used to calculate the ordering
@return The ordered axioms | [
"Orders",
"the",
"axioms",
"in",
"a",
"single",
"MUPS",
"by",
"the",
"frequency",
"of",
"which",
"they",
"appear",
"in",
"all",
"MUPS",
"."
] | 439c5ca67835f5e421adde725e4e8a3bcd760ac8 | https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java#L279-L291 | train |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java | BlackBoxExplanationGenerator.getOccurrences | private static <E> int getOccurrences(OWLAxiom ax, Set<Explanation<E>> axiomSets) {
int count = 0;
for (Explanation<E> explanation : axiomSets) {
if (explanation.getAxioms().contains(ax)) {
count++;
}
}
return count;
} | java | private static <E> int getOccurrences(OWLAxiom ax, Set<Explanation<E>> axiomSets) {
int count = 0;
for (Explanation<E> explanation : axiomSets) {
if (explanation.getAxioms().contains(ax)) {
count++;
}
}
return count;
} | [
"private",
"static",
"<",
"E",
">",
"int",
"getOccurrences",
"(",
"OWLAxiom",
"ax",
",",
"Set",
"<",
"Explanation",
"<",
"E",
">",
">",
"axiomSets",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"Explanation",
"<",
"E",
">",
"explanation",
":"... | Given an checker and a set of explanations this method determines how many explanations
contain the checker.
@param ax The checker that will be counted.
@param axiomSets The explanations to count from
@return the number of occurrences of the specified checker in the explanation | [
"Given",
"an",
"checker",
"and",
"a",
"set",
"of",
"explanations",
"this",
"method",
"determines",
"how",
"many",
"explanations",
"contain",
"the",
"checker",
"."
] | 439c5ca67835f5e421adde725e4e8a3bcd760ac8 | https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java#L302-L310 | train |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java | BlackBoxExplanationGenerator.constructHittingSetTree | private void constructHittingSetTree(E entailment, Explanation<E> justification, Set<Explanation<E>> allJustifications,
Set<Set<OWLAxiom>> satPaths, Set<OWLAxiom> currentPathContents,
int maxExplanations) throws OWLException {
// ... | java | private void constructHittingSetTree(E entailment, Explanation<E> justification, Set<Explanation<E>> allJustifications,
Set<Set<OWLAxiom>> satPaths, Set<OWLAxiom> currentPathContents,
int maxExplanations) throws OWLException {
// ... | [
"private",
"void",
"constructHittingSetTree",
"(",
"E",
"entailment",
",",
"Explanation",
"<",
"E",
">",
"justification",
",",
"Set",
"<",
"Explanation",
"<",
"E",
">",
">",
"allJustifications",
",",
"Set",
"<",
"Set",
"<",
"OWLAxiom",
">",
">",
"satPaths",
... | This is a recursive method that builds a hitting set tree to obtain all
justifications for an unsatisfiable class.
@param justification The current justification for the current entailment. This
corresponds to a node in the hitting set tree.
@param allJustifications All of the MUPS that have been found - this ... | [
"This",
"is",
"a",
"recursive",
"method",
"that",
"builds",
"a",
"hitting",
"set",
"tree",
"to",
"obtain",
"all",
"justifications",
"for",
"an",
"unsatisfiable",
"class",
"."
] | 439c5ca67835f5e421adde725e4e8a3bcd760ac8 | https://github.com/matthewhorridge/owlexplanation/blob/439c5ca67835f5e421adde725e4e8a3bcd760ac8/src/main/java/org/semanticweb/owl/explanation/impl/blackbox/BlackBoxExplanationGenerator.java#L329-L422 | train |
openengsb/openengsb | components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/AbstractTableFactory.java | AbstractTableFactory.onMissingTypeVisit | protected void onMissingTypeVisit(Table table, IndexField<?> field) {
if (!Introspector.isModelClass(field.getType())) {
return;
}
Field idField = Introspector.getOpenEngSBModelIdField(field.getType());
if (idField == null) {
LOG.warn("@Model class {} does not h... | java | protected void onMissingTypeVisit(Table table, IndexField<?> field) {
if (!Introspector.isModelClass(field.getType())) {
return;
}
Field idField = Introspector.getOpenEngSBModelIdField(field.getType());
if (idField == null) {
LOG.warn("@Model class {} does not h... | [
"protected",
"void",
"onMissingTypeVisit",
"(",
"Table",
"table",
",",
"IndexField",
"<",
"?",
">",
"field",
")",
"{",
"if",
"(",
"!",
"Introspector",
".",
"isModelClass",
"(",
"field",
".",
"getType",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"Fiel... | Called when type map returns null.
@param table the table to be created
@param field the field being visited and has no type information | [
"Called",
"when",
"type",
"map",
"returns",
"null",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/AbstractTableFactory.java#L98-L123 | train |
openengsb/openengsb | components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/sql/Column.java | Column.set | public Column set(Option option, boolean set) {
if (set) {
options.add(option);
} else {
options.remove(option);
}
return this;
} | java | public Column set(Option option, boolean set) {
if (set) {
options.add(option);
} else {
options.remove(option);
}
return this;
} | [
"public",
"Column",
"set",
"(",
"Option",
"option",
",",
"boolean",
"set",
")",
"{",
"if",
"(",
"set",
")",
"{",
"options",
".",
"add",
"(",
"option",
")",
";",
"}",
"else",
"{",
"options",
".",
"remove",
"(",
"option",
")",
";",
"}",
"return",
"... | Sets or unsets the given option for this column according to the set flag given.
@param option the option to flag
@param set whether to set or unset the option
@return this for chaining | [
"Sets",
"or",
"unsets",
"the",
"given",
"option",
"for",
"this",
"column",
"according",
"to",
"the",
"set",
"flag",
"given",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/edbi/jdbc/src/main/java/org/openengsb/core/edbi/jdbc/sql/Column.java#L111-L118 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.setStart | public void setStart(int x1, int y1) {
start.x = x1;
start.y = y1;
needsRefresh = true;
} | java | public void setStart(int x1, int y1) {
start.x = x1;
start.y = y1;
needsRefresh = true;
} | [
"public",
"void",
"setStart",
"(",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"start",
".",
"x",
"=",
"x1",
";",
"start",
".",
"y",
"=",
"y1",
";",
"needsRefresh",
"=",
"true",
";",
"}"
] | Sets the start point.
@param x1
the x coordinate of the start point
@param y1
the y coordinate of the start point | [
"Sets",
"the",
"start",
"point",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L90-L94 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.setEnd | public void setEnd(int x2, int y2) {
end.x = x2;
end.y = y2;
needsRefresh = true;
} | java | public void setEnd(int x2, int y2) {
end.x = x2;
end.y = y2;
needsRefresh = true;
} | [
"public",
"void",
"setEnd",
"(",
"int",
"x2",
",",
"int",
"y2",
")",
"{",
"end",
".",
"x",
"=",
"x2",
";",
"end",
".",
"y",
"=",
"y2",
";",
"needsRefresh",
"=",
"true",
";",
"}"
] | Sets the end point.
@param x2
the x coordinate of the end point
@param y2
the y coordinate of the end point | [
"Sets",
"the",
"end",
"point",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L115-L119 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.draw | public void draw(Graphics2D g) {
if (needsRefresh)
refreshCurve();
g.draw(curve); // Draws the main part of the arrow.
drawArrow(g, end, control); // Draws the arrow head.
drawText(g);
} | java | public void draw(Graphics2D g) {
if (needsRefresh)
refreshCurve();
g.draw(curve); // Draws the main part of the arrow.
drawArrow(g, end, control); // Draws the arrow head.
drawText(g);
} | [
"public",
"void",
"draw",
"(",
"Graphics2D",
"g",
")",
"{",
"if",
"(",
"needsRefresh",
")",
"refreshCurve",
"(",
")",
";",
"g",
".",
"draw",
"(",
"curve",
")",
";",
"// Draws the main part of the arrow.",
"drawArrow",
"(",
"g",
",",
"end",
",",
"control",
... | Draws the arrow on the indicated graphics environment.
@param g
the graphics to draw this arrow upon | [
"Draws",
"the",
"arrow",
"on",
"the",
"indicated",
"graphics",
"environment",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L149-L155 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.drawHighlight | public void drawHighlight(Graphics2D g) {
if (needsRefresh)
refreshCurve();
Graphics2D g2 = (Graphics2D) g.create();
g2.setStroke(new java.awt.BasicStroke(6.0f));
g2.setColor(HIGHLIGHT_COLOR);
g2.draw(curve);
g2.transform(affineToText);
g2.fill(bounds);
g2.dispose();
} | java | public void drawHighlight(Graphics2D g) {
if (needsRefresh)
refreshCurve();
Graphics2D g2 = (Graphics2D) g.create();
g2.setStroke(new java.awt.BasicStroke(6.0f));
g2.setColor(HIGHLIGHT_COLOR);
g2.draw(curve);
g2.transform(affineToText);
g2.fill(bounds);
g2.dispose();
} | [
"public",
"void",
"drawHighlight",
"(",
"Graphics2D",
"g",
")",
"{",
"if",
"(",
"needsRefresh",
")",
"refreshCurve",
"(",
")",
";",
"Graphics2D",
"g2",
"=",
"(",
"Graphics2D",
")",
"g",
".",
"create",
"(",
")",
";",
"g2",
".",
"setStroke",
"(",
"new",
... | Draws a highlight of the curve.
@param g
the graphics to draw the highlight of the curve upon | [
"Draws",
"a",
"highlight",
"of",
"the",
"curve",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L167-L177 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.setLabel | public void setLabel(String label) {
this.label = label;
// if (GRAPHICS == null) return;
bounds = METRICS.getStringBounds(getLabel(), GRAPHICS);
boolean upsideDown = end.x < start.x;
float dx = (float) bounds.getWidth() / 2.0f;
float dy = (curvy < 0.0f) ^ upsideDown ? METRICS.getAscent() : -METRICS
.ge... | java | public void setLabel(String label) {
this.label = label;
// if (GRAPHICS == null) return;
bounds = METRICS.getStringBounds(getLabel(), GRAPHICS);
boolean upsideDown = end.x < start.x;
float dx = (float) bounds.getWidth() / 2.0f;
float dy = (curvy < 0.0f) ^ upsideDown ? METRICS.getAscent() : -METRICS
.ge... | [
"public",
"void",
"setLabel",
"(",
"String",
"label",
")",
"{",
"this",
".",
"label",
"=",
"label",
";",
"// if (GRAPHICS == null) return;",
"bounds",
"=",
"METRICS",
".",
"getStringBounds",
"(",
"getLabel",
"(",
")",
",",
"GRAPHICS",
")",
";",
"boolean",
"u... | Sets the label that will be drawn on the high arc point.
@param label
the new label for the arrow | [
"Sets",
"the",
"label",
"that",
"will",
"be",
"drawn",
"on",
"the",
"high",
"arc",
"point",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L224-L235 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.drawArrow | private void drawArrow(Graphics g, Point head, Point away) {
int endX, endY;
double angle = Math.atan2((double) (away.x - head.x),
(double) (away.y - head.y));
angle += ARROW_ANGLE;
endX = ((int) (Math.sin(angle) * ARROW_LENGTH)) + head.x;
endY = ((int) (Math.cos(angle) * ARROW_LENGTH)) + head.y;
g.draw... | java | private void drawArrow(Graphics g, Point head, Point away) {
int endX, endY;
double angle = Math.atan2((double) (away.x - head.x),
(double) (away.y - head.y));
angle += ARROW_ANGLE;
endX = ((int) (Math.sin(angle) * ARROW_LENGTH)) + head.x;
endY = ((int) (Math.cos(angle) * ARROW_LENGTH)) + head.y;
g.draw... | [
"private",
"void",
"drawArrow",
"(",
"Graphics",
"g",
",",
"Point",
"head",
",",
"Point",
"away",
")",
"{",
"int",
"endX",
",",
"endY",
";",
"double",
"angle",
"=",
"Math",
".",
"atan2",
"(",
"(",
"double",
")",
"(",
"away",
".",
"x",
"-",
"head",
... | Draws an arrow head on the graphics object. The arrow geometry is based
on the point of its head as well as another point, which the arrow is
defined as facing away from. This arrow head has no body.
@param g
the graphics object to draw upon
@param head
the point that is the point of the head of the arrow
@param away
... | [
"Draws",
"an",
"arrow",
"head",
"on",
"the",
"graphics",
"object",
".",
"The",
"arrow",
"geometry",
"is",
"based",
"on",
"the",
"point",
"of",
"its",
"head",
"as",
"well",
"as",
"another",
"point",
"which",
"the",
"arrow",
"is",
"defined",
"as",
"facing"... | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L261-L273 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.refreshCurve | public void refreshCurve() {
// System.out.println("Curve refreshing");
needsRefresh = false;
double lengthx = end.x - start.x;
double lengthy = end.y - start.y;
double centerx = ((double) (start.x + end.x)) / 2.0;
double centery = ((double) (start.y + end.y)) / 2.0;
d... | java | public void refreshCurve() {
// System.out.println("Curve refreshing");
needsRefresh = false;
double lengthx = end.x - start.x;
double lengthy = end.y - start.y;
double centerx = ((double) (start.x + end.x)) / 2.0;
double centery = ((double) (start.y + end.y)) / 2.0;
d... | [
"public",
"void",
"refreshCurve",
"(",
")",
"{",
"// System.out.println(\"Curve refreshing\");",
"needsRefresh",
"=",
"false",
";",
"double",
"lengthx",
"=",
"end",
".",
"x",
"-",
"start",
".",
"x",
";",
"double",
"lengthy",
"=",
"end",
".",
"y",
"-",
... | Refreshes the curve object. | [
"Refreshes",
"the",
"curve",
"object",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L278-L304 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.getBounds | public Rectangle2D getBounds() {
if (needsRefresh)
refreshCurve();
Rectangle2D b = curve.getBounds();
Area area = new Area(bounds);
area.transform(affineToText);
b.add(area.getBounds());
return b;
} | java | public Rectangle2D getBounds() {
if (needsRefresh)
refreshCurve();
Rectangle2D b = curve.getBounds();
Area area = new Area(bounds);
area.transform(affineToText);
b.add(area.getBounds());
return b;
} | [
"public",
"Rectangle2D",
"getBounds",
"(",
")",
"{",
"if",
"(",
"needsRefresh",
")",
"refreshCurve",
"(",
")",
";",
"Rectangle2D",
"b",
"=",
"curve",
".",
"getBounds",
"(",
")",
";",
"Area",
"area",
"=",
"new",
"Area",
"(",
"bounds",
")",
";",
"area",
... | Returns the bounds.
@return the rectangular bounds for this curved arrow | [
"Returns",
"the",
"bounds",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L311-L319 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/utility/UI/CurvedArrow.java | CurvedArrow.intersects | private boolean intersects(Point point, int fudge, QuadCurve2D.Float c) {
if (!c.intersects(point.x - fudge, point.y - fudge, fudge << 1,
fudge << 1))
return false;
if (c.getFlatness() < fudge)
return true;
QuadCurve2D.Float f1 = new QuadCurve2D.Float(), f2 = new QuadCurve2D.Float();
c.subdivide(f1, f... | java | private boolean intersects(Point point, int fudge, QuadCurve2D.Float c) {
if (!c.intersects(point.x - fudge, point.y - fudge, fudge << 1,
fudge << 1))
return false;
if (c.getFlatness() < fudge)
return true;
QuadCurve2D.Float f1 = new QuadCurve2D.Float(), f2 = new QuadCurve2D.Float();
c.subdivide(f1, f... | [
"private",
"boolean",
"intersects",
"(",
"Point",
"point",
",",
"int",
"fudge",
",",
"QuadCurve2D",
".",
"Float",
"c",
")",
"{",
"if",
"(",
"!",
"c",
".",
"intersects",
"(",
"point",
".",
"x",
"-",
"fudge",
",",
"point",
".",
"y",
"-",
"fudge",
","... | Checks if something is on the line. If it appears to be, then it
subdivides the curve into halves and tries again recursively until the
flatness of the curve is less than the fudge. Frankly, I am a fucking
genius. I am one of two people in this department that could have
possibly thought of this.
@param point
the poin... | [
"Checks",
"if",
"something",
"is",
"on",
"the",
"line",
".",
"If",
"it",
"appears",
"to",
"be",
"then",
"it",
"subdivides",
"the",
"curve",
"into",
"halves",
"and",
"tries",
"again",
"recursively",
"until",
"the",
"flatness",
"of",
"the",
"curve",
"is",
... | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/utility/UI/CurvedArrow.java#L363-L372 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/framework/multi/MultiDomain.java | MultiDomain.chooseValues | public HashMap<Variable,Object> chooseValues() {
MultiVariable mv = (MultiVariable)myVariable;
Variable[] internalVars = mv.getInternalVariables();
HashMap<Variable,Object> values = new HashMap<Variable,Object>();
for (Variable v: internalVars) {
if (v instanceof MultiVariable) {
MultiVariable nest... | java | public HashMap<Variable,Object> chooseValues() {
MultiVariable mv = (MultiVariable)myVariable;
Variable[] internalVars = mv.getInternalVariables();
HashMap<Variable,Object> values = new HashMap<Variable,Object>();
for (Variable v: internalVars) {
if (v instanceof MultiVariable) {
MultiVariable nest... | [
"public",
"HashMap",
"<",
"Variable",
",",
"Object",
">",
"chooseValues",
"(",
")",
"{",
"MultiVariable",
"mv",
"=",
"(",
"MultiVariable",
")",
"myVariable",
";",
"Variable",
"[",
"]",
"internalVars",
"=",
"mv",
".",
"getInternalVariables",
"(",
")",
";",
... | Chooses values for all internal domains according to their own value choice functions.
@return A value for each internal domain. | [
"Chooses",
"values",
"for",
"all",
"internal",
"domains",
"according",
"to",
"their",
"own",
"value",
"choice",
"functions",
"."
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/framework/multi/MultiDomain.java#L69-L87 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatial/rectangleAlgebra/BoundingBox.java | BoundingBox.getMinRectabgle | public Rectangle getMinRectabgle(){
return new Rectangle((int)xLB.min, (int)yLB.min, (int)(xUB.min - xLB.min), (int)(yUB.min - yLB.min));
} | java | public Rectangle getMinRectabgle(){
return new Rectangle((int)xLB.min, (int)yLB.min, (int)(xUB.min - xLB.min), (int)(yUB.min - yLB.min));
} | [
"public",
"Rectangle",
"getMinRectabgle",
"(",
")",
"{",
"return",
"new",
"Rectangle",
"(",
"(",
"int",
")",
"xLB",
".",
"min",
",",
"(",
"int",
")",
"yLB",
".",
"min",
",",
"(",
"int",
")",
"(",
"xUB",
".",
"min",
"-",
"xLB",
".",
"min",
")",
... | give min rectangle | [
"give",
"min",
"rectangle"
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatial/rectangleAlgebra/BoundingBox.java#L94-L96 | train |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatial/rectangleAlgebra/BoundingBox.java | BoundingBox.getMaxRectabgle | public Rectangle getMaxRectabgle(){
return new Rectangle((int)xLB.max, (int)yLB.max, (int)(xUB.max - xLB.max), (int)(yUB.max - yLB.max));
} | java | public Rectangle getMaxRectabgle(){
return new Rectangle((int)xLB.max, (int)yLB.max, (int)(xUB.max - xLB.max), (int)(yUB.max - yLB.max));
} | [
"public",
"Rectangle",
"getMaxRectabgle",
"(",
")",
"{",
"return",
"new",
"Rectangle",
"(",
"(",
"int",
")",
"xLB",
".",
"max",
",",
"(",
"int",
")",
"yLB",
".",
"max",
",",
"(",
"int",
")",
"(",
"xUB",
".",
"max",
"-",
"xLB",
".",
"max",
")",
... | give max rectangle | [
"give",
"max",
"rectangle"
] | 42aaef2e2b76d0f738427f0dd9653c4f62b40517 | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatial/rectangleAlgebra/BoundingBox.java#L100-L102 | train |
openengsb/openengsb | ui/admin/src/main/java/org/openengsb/ui/admin/wiringPage/WiringPage.java | WiringPage.setLocation | private boolean setLocation(String global, String context, Map<String, Object> properties) {
String locationKey = "location." + context;
Object propvalue = properties.get(locationKey);
if (propvalue == null) {
properties.put(locationKey, global);
} else if (propvalue.getClass... | java | private boolean setLocation(String global, String context, Map<String, Object> properties) {
String locationKey = "location." + context;
Object propvalue = properties.get(locationKey);
if (propvalue == null) {
properties.put(locationKey, global);
} else if (propvalue.getClass... | [
"private",
"boolean",
"setLocation",
"(",
"String",
"global",
",",
"String",
"context",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"locationKey",
"=",
"\"location.\"",
"+",
"context",
";",
"Object",
"propvalue",
"=",
"pr... | returns true if location is not already set in the properties, otherwise false | [
"returns",
"true",
"if",
"location",
"is",
"not",
"already",
"set",
"in",
"the",
"properties",
"otherwise",
"false"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/ui/admin/src/main/java/org/openengsb/ui/admin/wiringPage/WiringPage.java#L259-L282 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/processor/BinaryVersionedPut.java | BinaryVersionedPut.processAll | @SuppressWarnings({"unchecked"})
@Override
public Map processAll(Set setEntries) {
Map results = new LiteMap();
for (BinaryEntry entry : (Set<BinaryEntry>) setEntries) {
Object result = processEntry(entry);
if (result != NO_RESULT) {
results.put(entry.get... | java | @SuppressWarnings({"unchecked"})
@Override
public Map processAll(Set setEntries) {
Map results = new LiteMap();
for (BinaryEntry entry : (Set<BinaryEntry>) setEntries) {
Object result = processEntry(entry);
if (result != NO_RESULT) {
results.put(entry.get... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"@",
"Override",
"public",
"Map",
"processAll",
"(",
"Set",
"setEntries",
")",
"{",
"Map",
"results",
"=",
"new",
"LiteMap",
"(",
")",
";",
"for",
"(",
"BinaryEntry",
"entry",
":",
"(",
"Set",... | Process all entries in the specified set.
@param setEntries set of entries to process
@return map of processed entries' keys to processing result | [
"Process",
"all",
"entries",
"in",
"the",
"specified",
"set",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/processor/BinaryVersionedPut.java#L165-L178 | train |
aseovic/coherence-tools | core/src/main/java/com/seovic/core/processor/BinaryVersionedPut.java | BinaryVersionedPut.processEntry | protected Object processEntry(BinaryEntry entry) {
Binary binCurrent = entry.getBinaryValue();
if (binCurrent == null && !fAllowInsert) {
return fReturn ? null : NO_RESULT;
}
PofValue pvCurrent = getPofValue(binCurrent);
PofValue pvNew = getPofValue("newValue");
... | java | protected Object processEntry(BinaryEntry entry) {
Binary binCurrent = entry.getBinaryValue();
if (binCurrent == null && !fAllowInsert) {
return fReturn ? null : NO_RESULT;
}
PofValue pvCurrent = getPofValue(binCurrent);
PofValue pvNew = getPofValue("newValue");
... | [
"protected",
"Object",
"processEntry",
"(",
"BinaryEntry",
"entry",
")",
"{",
"Binary",
"binCurrent",
"=",
"entry",
".",
"getBinaryValue",
"(",
")",
";",
"if",
"(",
"binCurrent",
"==",
"null",
"&&",
"!",
"fAllowInsert",
")",
"{",
"return",
"fReturn",
"?",
... | Process the specified entry.
@param entry entry to process
@return the result of processing the entry; can be NO_RESULT | [
"Process",
"the",
"specified",
"entry",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/core/src/main/java/com/seovic/core/processor/BinaryVersionedPut.java#L189-L208 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.enhanceModel | public static byte[] enhanceModel(byte[] byteCode, ClassLoader... loaders) throws IOException,
CannotCompileException {
return enhanceModel(byteCode, new Version("1.0.0"), loaders);
} | java | public static byte[] enhanceModel(byte[] byteCode, ClassLoader... loaders) throws IOException,
CannotCompileException {
return enhanceModel(byteCode, new Version("1.0.0"), loaders);
} | [
"public",
"static",
"byte",
"[",
"]",
"enhanceModel",
"(",
"byte",
"[",
"]",
"byteCode",
",",
"ClassLoader",
"...",
"loaders",
")",
"throws",
"IOException",
",",
"CannotCompileException",
"{",
"return",
"enhanceModel",
"(",
"byteCode",
",",
"new",
"Version",
"... | Try to enhance the object defined by the given byte code. Returns the enhanced class or null, if the given class
is no model, as byte array. The version of the model will be set statical to 1.0.0. There may be class loaders
appended, if needed. | [
"Try",
"to",
"enhance",
"the",
"object",
"defined",
"by",
"the",
"given",
"byte",
"code",
".",
"Returns",
"the",
"enhanced",
"class",
"or",
"null",
"if",
"the",
"given",
"class",
"is",
"no",
"model",
"as",
"byte",
"array",
".",
"The",
"version",
"of",
... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L82-L85 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.enhanceModel | public static byte[] enhanceModel(byte[] byteCode, Version modelVersion, ClassLoader... loaders)
throws IOException, CannotCompileException {
CtClass cc = doModelModifications(byteCode, modelVersion, loaders);
if (cc == null) {
return null;
}
byte[] newClass = cc.toBy... | java | public static byte[] enhanceModel(byte[] byteCode, Version modelVersion, ClassLoader... loaders)
throws IOException, CannotCompileException {
CtClass cc = doModelModifications(byteCode, modelVersion, loaders);
if (cc == null) {
return null;
}
byte[] newClass = cc.toBy... | [
"public",
"static",
"byte",
"[",
"]",
"enhanceModel",
"(",
"byte",
"[",
"]",
"byteCode",
",",
"Version",
"modelVersion",
",",
"ClassLoader",
"...",
"loaders",
")",
"throws",
"IOException",
",",
"CannotCompileException",
"{",
"CtClass",
"cc",
"=",
"doModelModific... | Try to enhance the object defined by the given byte code. Returns the enhanced class or null, if the given class
is no model, as byte array. There may be class loaders appended, if needed. | [
"Try",
"to",
"enhance",
"the",
"object",
"defined",
"by",
"the",
"given",
"byte",
"code",
".",
"Returns",
"the",
"enhanced",
"class",
"or",
"null",
"if",
"the",
"given",
"class",
"is",
"no",
"model",
"as",
"byte",
"array",
".",
"There",
"may",
"be",
"c... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L91-L101 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.doModelModifications | private static CtClass doModelModifications(byte[] byteCode, Version modelVersion, ClassLoader... loaders) {
if (!initiated) {
initiate();
}
CtClass cc = null;
LoaderClassPath[] classloaders = new LoaderClassPath[loaders.length];
try {
InputStream stream =... | java | private static CtClass doModelModifications(byte[] byteCode, Version modelVersion, ClassLoader... loaders) {
if (!initiated) {
initiate();
}
CtClass cc = null;
LoaderClassPath[] classloaders = new LoaderClassPath[loaders.length];
try {
InputStream stream =... | [
"private",
"static",
"CtClass",
"doModelModifications",
"(",
"byte",
"[",
"]",
"byteCode",
",",
"Version",
"modelVersion",
",",
"ClassLoader",
"...",
"loaders",
")",
"{",
"if",
"(",
"!",
"initiated",
")",
"{",
"initiate",
"(",
")",
";",
"}",
"CtClass",
"cc... | Try to perform the actual model enhancing. | [
"Try",
"to",
"perform",
"the",
"actual",
"model",
"enhancing",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L106-L143 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.doEnhancement | private static void doEnhancement(CtClass cc, Version modelVersion) throws CannotCompileException,
NotFoundException, ClassNotFoundException {
CtClass inter = cp.get(OpenEngSBModel.class.getName());
cc.addInterface(inter);
addFields(cc);
addGetOpenEngSBModelTail(cc);
addS... | java | private static void doEnhancement(CtClass cc, Version modelVersion) throws CannotCompileException,
NotFoundException, ClassNotFoundException {
CtClass inter = cp.get(OpenEngSBModel.class.getName());
cc.addInterface(inter);
addFields(cc);
addGetOpenEngSBModelTail(cc);
addS... | [
"private",
"static",
"void",
"doEnhancement",
"(",
"CtClass",
"cc",
",",
"Version",
"modelVersion",
")",
"throws",
"CannotCompileException",
",",
"NotFoundException",
",",
"ClassNotFoundException",
"{",
"CtClass",
"inter",
"=",
"cp",
".",
"get",
"(",
"OpenEngSBModel... | Does the steps for the model enhancement. | [
"Does",
"the",
"steps",
"for",
"the",
"model",
"enhancement",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L148-L165 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addFields | private static void addFields(CtClass clazz) throws CannotCompileException, NotFoundException {
CtField tail = CtField.make(String.format("private Map %s = new HashMap();", TAIL_FIELD), clazz);
clazz.addField(tail);
String loggerDefinition = "private static final Logger %s = LoggerFactory.getLog... | java | private static void addFields(CtClass clazz) throws CannotCompileException, NotFoundException {
CtField tail = CtField.make(String.format("private Map %s = new HashMap();", TAIL_FIELD), clazz);
clazz.addField(tail);
String loggerDefinition = "private static final Logger %s = LoggerFactory.getLog... | [
"private",
"static",
"void",
"addFields",
"(",
"CtClass",
"clazz",
")",
"throws",
"CannotCompileException",
",",
"NotFoundException",
"{",
"CtField",
"tail",
"=",
"CtField",
".",
"make",
"(",
"String",
".",
"format",
"(",
"\"private Map %s = new HashMap();\"",
",",
... | Adds the fields for the model tail and the logger to the class. | [
"Adds",
"the",
"fields",
"for",
"the",
"model",
"tail",
"and",
"the",
"logger",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L170-L176 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addGetOpenEngSBModelTail | private static void addGetOpenEngSBModelTail(CtClass clazz) throws CannotCompileException, NotFoundException {
CtClass[] params = generateClassField();
CtMethod method = new CtMethod(cp.get(List.class.getName()), "getOpenEngSBModelTail", params, clazz);
StringBuilder body = new StringBuilder();
... | java | private static void addGetOpenEngSBModelTail(CtClass clazz) throws CannotCompileException, NotFoundException {
CtClass[] params = generateClassField();
CtMethod method = new CtMethod(cp.get(List.class.getName()), "getOpenEngSBModelTail", params, clazz);
StringBuilder body = new StringBuilder();
... | [
"private",
"static",
"void",
"addGetOpenEngSBModelTail",
"(",
"CtClass",
"clazz",
")",
"throws",
"CannotCompileException",
",",
"NotFoundException",
"{",
"CtClass",
"[",
"]",
"params",
"=",
"generateClassField",
"(",
")",
";",
"CtMethod",
"method",
"=",
"new",
"Ct... | Adds the getOpenEngSBModelTail method to the class. | [
"Adds",
"the",
"getOpenEngSBModelTail",
"method",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L181-L189 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addSetOpenEngSBModelTail | private static void addSetOpenEngSBModelTail(CtClass clazz) throws CannotCompileException, NotFoundException {
CtClass[] params = generateClassField(List.class);
CtMethod method = new CtMethod(CtClass.voidType, "setOpenEngSBModelTail", params, clazz);
StringBuilder builder = new StringBuilder();... | java | private static void addSetOpenEngSBModelTail(CtClass clazz) throws CannotCompileException, NotFoundException {
CtClass[] params = generateClassField(List.class);
CtMethod method = new CtMethod(CtClass.voidType, "setOpenEngSBModelTail", params, clazz);
StringBuilder builder = new StringBuilder();... | [
"private",
"static",
"void",
"addSetOpenEngSBModelTail",
"(",
"CtClass",
"clazz",
")",
"throws",
"CannotCompileException",
",",
"NotFoundException",
"{",
"CtClass",
"[",
"]",
"params",
"=",
"generateClassField",
"(",
"List",
".",
"class",
")",
";",
"CtMethod",
"me... | Adds the setOpenEngSBModelTail method to the class. | [
"Adds",
"the",
"setOpenEngSBModelTail",
"method",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L194-L204 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addRetrieveModelName | private static void addRetrieveModelName(CtClass clazz) throws CannotCompileException, NotFoundException {
CtClass[] params = generateClassField();
CtMethod method = new CtMethod(cp.get(String.class.getName()), "retrieveModelName", params, clazz);
StringBuilder builder = new StringBuilder();
... | java | private static void addRetrieveModelName(CtClass clazz) throws CannotCompileException, NotFoundException {
CtClass[] params = generateClassField();
CtMethod method = new CtMethod(cp.get(String.class.getName()), "retrieveModelName", params, clazz);
StringBuilder builder = new StringBuilder();
... | [
"private",
"static",
"void",
"addRetrieveModelName",
"(",
"CtClass",
"clazz",
")",
"throws",
"CannotCompileException",
",",
"NotFoundException",
"{",
"CtClass",
"[",
"]",
"params",
"=",
"generateClassField",
"(",
")",
";",
"CtMethod",
"method",
"=",
"new",
"CtMeth... | Adds the retreiveModelName method to the class. | [
"Adds",
"the",
"retreiveModelName",
"method",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L209-L217 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addRetrieveInternalModelId | private static void addRetrieveInternalModelId(CtClass clazz) throws NotFoundException,
CannotCompileException {
CtField modelIdField = null;
CtClass temp = clazz;
while (temp != null) {
for (CtField field : temp.getDeclaredFields()) {
if (JavassistUtils.hasAn... | java | private static void addRetrieveInternalModelId(CtClass clazz) throws NotFoundException,
CannotCompileException {
CtField modelIdField = null;
CtClass temp = clazz;
while (temp != null) {
for (CtField field : temp.getDeclaredFields()) {
if (JavassistUtils.hasAn... | [
"private",
"static",
"void",
"addRetrieveInternalModelId",
"(",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
"{",
"CtField",
"modelIdField",
"=",
"null",
";",
"CtClass",
"temp",
"=",
"clazz",
";",
"while",
"(",
"temp",
"!=... | Adds the retrieveInternalModelId method to the class. | [
"Adds",
"the",
"retrieveInternalModelId",
"method",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L263-L297 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addRetrieveInternalModelTimestamp | private static void addRetrieveInternalModelTimestamp(CtClass clazz) throws NotFoundException,
CannotCompileException {
CtClass[] params = generateClassField();
CtMethod method = new CtMethod(cp.get(Long.class.getName()), "retrieveInternalModelTimestamp", params, clazz);
StringBuilder bu... | java | private static void addRetrieveInternalModelTimestamp(CtClass clazz) throws NotFoundException,
CannotCompileException {
CtClass[] params = generateClassField();
CtMethod method = new CtMethod(cp.get(Long.class.getName()), "retrieveInternalModelTimestamp", params, clazz);
StringBuilder bu... | [
"private",
"static",
"void",
"addRetrieveInternalModelTimestamp",
"(",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
"{",
"CtClass",
"[",
"]",
"params",
"=",
"generateClassField",
"(",
")",
";",
"CtMethod",
"method",
"=",
"ne... | Adds the retrieveInternalModelTimestamp method to the class. | [
"Adds",
"the",
"retrieveInternalModelTimestamp",
"method",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L302-L312 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addRetrieveInternalModelVersion | private static void addRetrieveInternalModelVersion(CtClass clazz) throws NotFoundException,
CannotCompileException {
CtClass[] params = generateClassField();
CtMethod method = new CtMethod(cp.get(Integer.class.getName()), "retrieveInternalModelVersion", params, clazz);
StringBuilder bui... | java | private static void addRetrieveInternalModelVersion(CtClass clazz) throws NotFoundException,
CannotCompileException {
CtClass[] params = generateClassField();
CtMethod method = new CtMethod(cp.get(Integer.class.getName()), "retrieveInternalModelVersion", params, clazz);
StringBuilder bui... | [
"private",
"static",
"void",
"addRetrieveInternalModelVersion",
"(",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
"{",
"CtClass",
"[",
"]",
"params",
"=",
"generateClassField",
"(",
")",
";",
"CtMethod",
"method",
"=",
"new"... | Adds the retrieveInternalModelVersion method to the class. | [
"Adds",
"the",
"retrieveInternalModelVersion",
"method",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L317-L327 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addToOpenEngSBModelValues | private static void addToOpenEngSBModelValues(CtClass clazz) throws NotFoundException,
CannotCompileException, ClassNotFoundException {
StringBuilder builder = new StringBuilder();
CtClass[] params = generateClassField();
CtMethod m = new CtMethod(cp.get(List.class.getName()), "toOpenEng... | java | private static void addToOpenEngSBModelValues(CtClass clazz) throws NotFoundException,
CannotCompileException, ClassNotFoundException {
StringBuilder builder = new StringBuilder();
CtClass[] params = generateClassField();
CtMethod m = new CtMethod(cp.get(List.class.getName()), "toOpenEng... | [
"private",
"static",
"void",
"addToOpenEngSBModelValues",
"(",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
",",
"ClassNotFoundException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"CtClass",
... | Adds the toOpenEngSBModelValues method to the class. | [
"Adds",
"the",
"toOpenEngSBModelValues",
"method",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L332-L344 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addToOpenEngSBModelEntries | private static void addToOpenEngSBModelEntries(CtClass clazz) throws NotFoundException,
CannotCompileException, ClassNotFoundException {
CtClass[] params = generateClassField();
CtMethod m = new CtMethod(cp.get(List.class.getName()), "toOpenEngSBModelEntries", params, clazz);
StringBuild... | java | private static void addToOpenEngSBModelEntries(CtClass clazz) throws NotFoundException,
CannotCompileException, ClassNotFoundException {
CtClass[] params = generateClassField();
CtMethod m = new CtMethod(cp.get(List.class.getName()), "toOpenEngSBModelEntries", params, clazz);
StringBuild... | [
"private",
"static",
"void",
"addToOpenEngSBModelEntries",
"(",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
",",
"ClassNotFoundException",
"{",
"CtClass",
"[",
"]",
"params",
"=",
"generateClassField",
"(",
")",
";",
"CtMetho... | Adds the getOpenEngSBModelEntries method to the class. | [
"Adds",
"the",
"getOpenEngSBModelEntries",
"method",
"to",
"the",
"class",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L349-L361 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.createModelEntryList | private static String createModelEntryList(CtClass clazz) throws NotFoundException, CannotCompileException {
StringBuilder builder = new StringBuilder();
CtClass tempClass = clazz;
while (tempClass != null) {
for (CtField field : tempClass.getDeclaredFields()) {
Strin... | java | private static String createModelEntryList(CtClass clazz) throws NotFoundException, CannotCompileException {
StringBuilder builder = new StringBuilder();
CtClass tempClass = clazz;
while (tempClass != null) {
for (CtField field : tempClass.getDeclaredFields()) {
Strin... | [
"private",
"static",
"String",
"createModelEntryList",
"(",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"CtClass",
"tempClass",
"=",
"clazz",
";",... | Generates the list of OpenEngSBModelEntries which need to be added. Also adds the entries of the super classes. | [
"Generates",
"the",
"list",
"of",
"OpenEngSBModelEntries",
"which",
"need",
"to",
"be",
"added",
".",
"Also",
"adds",
"the",
"entries",
"of",
"the",
"super",
"classes",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L366-L382 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.handleField | private static String handleField(CtField field, CtClass clazz) throws NotFoundException, CannotCompileException {
StringBuilder builder = new StringBuilder();
CtClass fieldType = field.getType();
String property = field.getName();
if (fieldType.equals(cp.get(File.class.getName()))) {
... | java | private static String handleField(CtField field, CtClass clazz) throws NotFoundException, CannotCompileException {
StringBuilder builder = new StringBuilder();
CtClass fieldType = field.getType();
String property = field.getName();
if (fieldType.equals(cp.get(File.class.getName()))) {
... | [
"private",
"static",
"String",
"handleField",
"(",
"CtField",
"field",
",",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"CtClass",
"fieldType",
... | Analyzes the given field and add logic based on the type of the field. | [
"Analyzes",
"the",
"given",
"field",
"and",
"add",
"logic",
"based",
"on",
"the",
"type",
"of",
"the",
"field",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L387-L410 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.handleFileField | private static String handleFileField(String property, CtClass clazz) throws NotFoundException,
CannotCompileException {
String wrapperName = property + "wrapper";
StringBuilder builder = new StringBuilder();
builder.append(createTrace(String.format("Handle File type property '%s'", prop... | java | private static String handleFileField(String property, CtClass clazz) throws NotFoundException,
CannotCompileException {
String wrapperName = property + "wrapper";
StringBuilder builder = new StringBuilder();
builder.append(createTrace(String.format("Handle File type property '%s'", prop... | [
"private",
"static",
"String",
"handleFileField",
"(",
"String",
"property",
",",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
"{",
"String",
"wrapperName",
"=",
"property",
"+",
"\"wrapper\"",
";",
"StringBuilder",
"builder",... | Creates the logic which is needed to handle fields which are File types, since they need special treatment. | [
"Creates",
"the",
"logic",
"which",
"is",
"needed",
"to",
"handle",
"fields",
"which",
"are",
"File",
"types",
"since",
"they",
"need",
"special",
"treatment",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L415-L429 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.getFieldGetter | private static CtMethod getFieldGetter(CtField field, CtClass clazz) throws NotFoundException {
if (field == null) {
return null;
}
return getFieldGetter(field, clazz, false);
} | java | private static CtMethod getFieldGetter(CtField field, CtClass clazz) throws NotFoundException {
if (field == null) {
return null;
}
return getFieldGetter(field, clazz, false);
} | [
"private",
"static",
"CtMethod",
"getFieldGetter",
"(",
"CtField",
"field",
",",
"CtClass",
"clazz",
")",
"throws",
"NotFoundException",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"getFieldGetter",
"(",
"field",
",... | Returns the getter to a given field of the given class object and returns null if there is no getter for the
given field defined. | [
"Returns",
"the",
"getter",
"to",
"a",
"given",
"field",
"of",
"the",
"given",
"class",
"object",
"and",
"returns",
"null",
"if",
"there",
"is",
"no",
"getter",
"for",
"the",
"given",
"field",
"defined",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L435-L440 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.getFieldGetter | private static CtMethod getFieldGetter(CtField field, CtClass clazz, boolean failover) throws NotFoundException {
CtMethod method = new CtMethod(field.getType(), "descCreateMethod", new CtClass[]{}, clazz);
String desc = method.getSignature();
String getter = getPropertyGetter(field, failover);
... | java | private static CtMethod getFieldGetter(CtField field, CtClass clazz, boolean failover) throws NotFoundException {
CtMethod method = new CtMethod(field.getType(), "descCreateMethod", new CtClass[]{}, clazz);
String desc = method.getSignature();
String getter = getPropertyGetter(field, failover);
... | [
"private",
"static",
"CtMethod",
"getFieldGetter",
"(",
"CtField",
"field",
",",
"CtClass",
"clazz",
",",
"boolean",
"failover",
")",
"throws",
"NotFoundException",
"{",
"CtMethod",
"method",
"=",
"new",
"CtMethod",
"(",
"field",
".",
"getType",
"(",
")",
",",... | Returns the getter method in case it exists or returns null if this is not the case. The failover parameter is
needed to deal with boolean types, since it should be allowed to allow getters in the form of "isXXX" or
"getXXX". | [
"Returns",
"the",
"getter",
"method",
"in",
"case",
"it",
"exists",
"or",
"returns",
"null",
"if",
"this",
"is",
"not",
"the",
"case",
".",
"The",
"failover",
"parameter",
"is",
"needed",
"to",
"deal",
"with",
"boolean",
"types",
"since",
"it",
"should",
... | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L447-L461 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.getPropertyGetter | private static String getPropertyGetter(CtField field, boolean failover) throws NotFoundException {
String property = field.getName();
if (!failover && isBooleanType(field)) {
return String.format("is%s%s", Character.toUpperCase(property.charAt(0)), property.substring(1));
} else {
... | java | private static String getPropertyGetter(CtField field, boolean failover) throws NotFoundException {
String property = field.getName();
if (!failover && isBooleanType(field)) {
return String.format("is%s%s", Character.toUpperCase(property.charAt(0)), property.substring(1));
} else {
... | [
"private",
"static",
"String",
"getPropertyGetter",
"(",
"CtField",
"field",
",",
"boolean",
"failover",
")",
"throws",
"NotFoundException",
"{",
"String",
"property",
"=",
"field",
".",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"failover",
"&&",
"isBooleanTyp... | Returns the name of the corresponding getter to a properties name and type. The failover is needed to support
both getter name types for boolean properties. | [
"Returns",
"the",
"name",
"of",
"the",
"corresponding",
"getter",
"to",
"a",
"properties",
"name",
"and",
"type",
".",
"The",
"failover",
"is",
"needed",
"to",
"support",
"both",
"getter",
"name",
"types",
"for",
"boolean",
"properties",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L467-L474 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.generateClassField | private static CtClass[] generateClassField(Class<?>... classes) throws NotFoundException {
CtClass[] result = new CtClass[classes.length];
for (int i = 0; i < classes.length; i++) {
result[i] = cp.get(classes[i].getName());
}
return result;
} | java | private static CtClass[] generateClassField(Class<?>... classes) throws NotFoundException {
CtClass[] result = new CtClass[classes.length];
for (int i = 0; i < classes.length; i++) {
result[i] = cp.get(classes[i].getName());
}
return result;
} | [
"private",
"static",
"CtClass",
"[",
"]",
"generateClassField",
"(",
"Class",
"<",
"?",
">",
"...",
"classes",
")",
"throws",
"NotFoundException",
"{",
"CtClass",
"[",
"]",
"result",
"=",
"new",
"CtClass",
"[",
"classes",
".",
"length",
"]",
";",
"for",
... | Generates a CtClass field out of a Class field. | [
"Generates",
"a",
"CtClass",
"field",
"out",
"of",
"a",
"Class",
"field",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L487-L493 | train |
openengsb/openengsb | components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java | ManipulationUtils.addFileFunction | private static void addFileFunction(CtClass clazz, String property)
throws NotFoundException, CannotCompileException {
String wrapperName = property + "wrapper";
String funcName = "set";
funcName = funcName + Character.toUpperCase(wrapperName.charAt(0));
funcName = funcName + wra... | java | private static void addFileFunction(CtClass clazz, String property)
throws NotFoundException, CannotCompileException {
String wrapperName = property + "wrapper";
String funcName = "set";
funcName = funcName + Character.toUpperCase(wrapperName.charAt(0));
funcName = funcName + wra... | [
"private",
"static",
"void",
"addFileFunction",
"(",
"CtClass",
"clazz",
",",
"String",
"property",
")",
"throws",
"NotFoundException",
",",
"CannotCompileException",
"{",
"String",
"wrapperName",
"=",
"property",
"+",
"\"wrapper\"",
";",
"String",
"funcName",
"=",
... | Adds the functionality that the models can handle File objects themselves. | [
"Adds",
"the",
"functionality",
"that",
"the",
"models",
"can",
"handle",
"File",
"objects",
"themselves",
"."
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L498-L511 | train |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/internal/XLinkConnectorManagerImpl.java | XLinkConnectorManagerImpl.urlEncodeParameter | private static String urlEncodeParameter(String parameter) {
try {
return URLEncoder.encode(parameter, "UTF-8");
} catch (UnsupportedEncodingException ex) {
log.warn("Could not encode parameter.", ex);
}
return parameter;
} | java | private static String urlEncodeParameter(String parameter) {
try {
return URLEncoder.encode(parameter, "UTF-8");
} catch (UnsupportedEncodingException ex) {
log.warn("Could not encode parameter.", ex);
}
return parameter;
} | [
"private",
"static",
"String",
"urlEncodeParameter",
"(",
"String",
"parameter",
")",
"{",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"parameter",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"ex",
")",
"{",
"log"... | URLEncodes the given Parameter in UTF-8 | [
"URLEncodes",
"the",
"given",
"Parameter",
"in",
"UTF",
"-",
"8"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/internal/XLinkConnectorManagerImpl.java#L222-L229 | train |
BrunoEberhard/minimal-j | src/main/java/org/minimalj/frontend/impl/swing/toolkit/SwingFrontend.java | SwingFrontend.runWithContext | public static void runWithContext(Runnable r) {
try {
browserStack.push(SwingFrame.getActiveWindow().getVisibleTab());
Subject.setCurrent(SwingFrame.getActiveWindow().getSubject());
r.run();
} finally {
Subject.setCurrent(null);
browserStack.pop();
}
} | java | public static void runWithContext(Runnable r) {
try {
browserStack.push(SwingFrame.getActiveWindow().getVisibleTab());
Subject.setCurrent(SwingFrame.getActiveWindow().getSubject());
r.run();
} finally {
Subject.setCurrent(null);
browserStack.pop();
}
} | [
"public",
"static",
"void",
"runWithContext",
"(",
"Runnable",
"r",
")",
"{",
"try",
"{",
"browserStack",
".",
"push",
"(",
"SwingFrame",
".",
"getActiveWindow",
"(",
")",
".",
"getVisibleTab",
"(",
")",
")",
";",
"Subject",
".",
"setCurrent",
"(",
"SwingF... | As the current subject can be different for each Swing Window this method
ensure that no wrong subject stays as current subject
@param r a runnable (normally a lambda is used) | [
"As",
"the",
"current",
"subject",
"can",
"be",
"different",
"for",
"each",
"Swing",
"Window",
"this",
"method",
"ensure",
"that",
"no",
"wrong",
"subject",
"stays",
"as",
"current",
"subject"
] | f7c5461b2b47a10b383aee1e2f1f150f6773703b | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/frontend/impl/swing/toolkit/SwingFrontend.java#L380-L389 | train |
aseovic/coherence-tools | loader/src/main/java/com/seovic/loader/source/AbstractBaseSource.java | AbstractBaseSource.createResourceReader | protected Reader createResourceReader(Resource resource) {
try {
return new InputStreamReader(resource.getInputStream());
}
catch (IOException e) {
throw new RuntimeException(e);
}
} | java | protected Reader createResourceReader(Resource resource) {
try {
return new InputStreamReader(resource.getInputStream());
}
catch (IOException e) {
throw new RuntimeException(e);
}
} | [
"protected",
"Reader",
"createResourceReader",
"(",
"Resource",
"resource",
")",
"{",
"try",
"{",
"return",
"new",
"InputStreamReader",
"(",
"resource",
".",
"getInputStream",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new... | Create a reader for the specified resource.
@param resource resource to create reader for
@return reader for the specified resource | [
"Create",
"a",
"reader",
"for",
"the",
"specified",
"resource",
"."
] | 561a1d7e572ad98657fcd26beb1164891b0cd6fe | https://github.com/aseovic/coherence-tools/blob/561a1d7e572ad98657fcd26beb1164891b0cd6fe/loader/src/main/java/com/seovic/loader/source/AbstractBaseSource.java#L136-L143 | train |
openengsb/openengsb | components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraph.java | OrientModelGraph.shutdown | public void shutdown() {
ClassLoader origClassLoader = Thread.currentThread().getContextClassLoader();
try {
ClassLoader orientClassLoader = OIndexes.class.getClassLoader();
Thread.currentThread().setContextClassLoader(orientClassLoader);
graph.close();
} fina... | java | public void shutdown() {
ClassLoader origClassLoader = Thread.currentThread().getContextClassLoader();
try {
ClassLoader orientClassLoader = OIndexes.class.getClassLoader();
Thread.currentThread().setContextClassLoader(orientClassLoader);
graph.close();
} fina... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"ClassLoader",
"origClassLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"try",
"{",
"ClassLoader",
"orientClassLoader",
"=",
"OIndexes",
".",
"class",
".",
"getC... | Shuts down the graph database | [
"Shuts",
"down",
"the",
"graph",
"database"
] | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/graphdb-orient/src/main/java/org/openengsb/core/ekb/graph/orient/internal/OrientModelGraph.java#L78-L87 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.