From 575d68cb78bbbb25a9b83e1abbcea3bc5264bdd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20L=C3=BCthi?= Date: Mon, 25 Sep 2023 07:47:27 +0200 Subject: [PATCH 1/9] Add LogCollectorAssertions class --- .../validator/LogCollectorAssertions.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/test/java/ch/interlis/iox_j/validator/LogCollectorAssertions.java diff --git a/src/test/java/ch/interlis/iox_j/validator/LogCollectorAssertions.java b/src/test/java/ch/interlis/iox_j/validator/LogCollectorAssertions.java new file mode 100644 index 00000000..e52bb690 --- /dev/null +++ b/src/test/java/ch/interlis/iox_j/validator/LogCollectorAssertions.java @@ -0,0 +1,30 @@ +package ch.interlis.iox_j.validator; + +import ch.interlis.iox.IoxLogEvent; +import org.junit.Assert; + +import java.util.List; + +public class LogCollectorAssertions { + public static void AssertContainsError(String text, int count, LogCollector logCollector){ + Assert.assertEquals( String.format("Wrong number of error logs containing <%s> found.", text), count, CountOccurrences(text, logCollector.getErrs())); + } + + public static void AssertContainsWarning(String text, int count, LogCollector logCollector){ + Assert.assertEquals(String.format("Wrong number of warning logs containing <%s> found.", text), count, CountOccurrences(text, logCollector.getWarn())); + } + + public static void AssertContainsInfo(String text, int count, LogCollector logCollector){ + Assert.assertEquals(String.format("Wrong number of info logs containing <%s> found.", text), count, CountOccurrences(text, logCollector.getInfo())); + } + + private static int CountOccurrences(String text, List logEvents){ + int i = 0; + for (IoxLogEvent event : logEvents) { + if (event.getEventMsg().contains(text)){ + i++; + } + } + return i; + } +} From 4278edca30a0a22a0af69ce9ce1d0616818e21e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20L=C3=BCthi?= Date: Mon, 18 Sep 2023 16:52:23 +0200 Subject: [PATCH 2/9] Add tests for 2.4 Unique constraint with (BASKET) --- .../data/validator/UniqueConstraints24.ili | 11 ++ .../validator/UniqueConstraints24Test.java | 108 ++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 src/test/data/validator/UniqueConstraints24.ili create mode 100644 src/test/java/ch/interlis/iox_j/validator/UniqueConstraints24Test.java diff --git a/src/test/data/validator/UniqueConstraints24.ili b/src/test/data/validator/UniqueConstraints24.ili new file mode 100644 index 00000000..f7a39429 --- /dev/null +++ b/src/test/data/validator/UniqueConstraints24.ili @@ -0,0 +1,11 @@ +INTERLIS 2.4; + +MODEL ModelA AT "mailto:test@localhost" VERSION "2023-09-05" = + TOPIC TopicA = + CLASS ClassA = + attr1 : MANDATORY 0..999; + UNIQUE UniqueConstraintGlobal: attr1; + UNIQUE (BASKET) UniqueConstraintBasket: attr1; + END ClassA; + END TopicA; +END ModelA. diff --git a/src/test/java/ch/interlis/iox_j/validator/UniqueConstraints24Test.java b/src/test/java/ch/interlis/iox_j/validator/UniqueConstraints24Test.java new file mode 100644 index 00000000..caddf8a3 --- /dev/null +++ b/src/test/java/ch/interlis/iox_j/validator/UniqueConstraints24Test.java @@ -0,0 +1,108 @@ +package ch.interlis.iox_j.validator; + +import ch.ehi.basics.settings.Settings; +import ch.interlis.ili2c.config.Configuration; +import ch.interlis.ili2c.config.FileEntry; +import ch.interlis.ili2c.config.FileEntryKind; +import ch.interlis.ili2c.metamodel.TransferDescription; +import ch.interlis.iom_j.Iom_jObject; +import ch.interlis.iox_j.EndBasketEvent; +import ch.interlis.iox_j.EndTransferEvent; +import ch.interlis.iox_j.ObjectEvent; +import ch.interlis.iox_j.StartBasketEvent; +import ch.interlis.iox_j.StartTransferEvent; +import ch.interlis.iox_j.logging.LogEventFactory; +import org.junit.Before; +import org.junit.Test; + +import java.util.UUID; + +import static org.junit.Assert.assertNotNull; + +public class UniqueConstraints24Test { + + private TransferDescription td=null; + private Validator validator=null; + private LogCollector logger=null; + + private ObjectEvent CreateClassA(int attr1){ + Iom_jObject iomJObject = new Iom_jObject("ModelA.TopicA.ClassA", UUID.randomUUID().toString()); + iomJObject.addattrvalue("attr1", Integer.toString(attr1)); + return new ObjectEvent(iomJObject); + } + + @Before + public void setUp() throws Exception { + Configuration ili2cConfig=new Configuration(); + FileEntry fileEntry=new FileEntry("src/test/data/validator/UniqueConstraints24.ili", FileEntryKind.ILIMODELFILE); + ili2cConfig.addFileEntry(fileEntry); + td=ch.interlis.ili2c.Ili2c.runCompiler(ili2cConfig); + assertNotNull(td); + + ValidationConfig modelConfig=new ValidationConfig(); + logger=new LogCollector(); + LogEventFactory errFactory=new LogEventFactory(); + Settings settings=new Settings(); + validator=new Validator(td, modelConfig, logger, errFactory, settings); + } + + @Test + public void UniqueConstraintGlobal_Ok(){ + validator.validate(new StartTransferEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(new EndBasketEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(3)); + validator.validate(CreateClassA(4)); + validator.validate(new EndBasketEvent()); + validator.validate(new EndTransferEvent()); + LogCollectorAssertions.AssertContainsError("UniqueConstraintGlobal",0, logger); + } + + @Test + public void UniqueConstraintGlobal_Fail(){ + validator.validate(new StartTransferEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(new EndBasketEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(3)); + validator.validate(CreateClassA(1)); + validator.validate(new EndBasketEvent()); + validator.validate(new EndTransferEvent()); + LogCollectorAssertions.AssertContainsError("UniqueConstraintGlobal", 1, logger); + } + + @Test + public void UniqueConstraintBasket_Ok(){ + validator.validate(new StartTransferEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(new EndBasketEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(new EndBasketEvent()); + validator.validate(new EndTransferEvent()); + LogCollectorAssertions.AssertContainsError("UniqueConstraintBasket",0, logger); + } + + @Test + public void UniqueConstraintBasket_Fail(){ + validator.validate(new StartTransferEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(new EndBasketEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(1)); + validator.validate(new EndBasketEvent()); + validator.validate(new EndTransferEvent()); + LogCollectorAssertions.AssertContainsError("UniqueConstraintBasket", 1, logger); + } +} \ No newline at end of file From 25458feed8b803dcda09d67ce5ef038eb07d6d22 Mon Sep 17 00:00:00 2001 From: Philipp Luethi Date: Tue, 19 Sep 2023 16:45:28 +0200 Subject: [PATCH 3/9] Add support for Basket constrained Unique constraints --- .../ch/interlis/iox_j/validator/Validator.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/ch/interlis/iox_j/validator/Validator.java b/src/main/java/ch/interlis/iox_j/validator/Validator.java index 321f7bf6..28348a85 100644 --- a/src/main/java/ch/interlis/iox_j/validator/Validator.java +++ b/src/main/java/ch/interlis/iox_j/validator/Validator.java @@ -763,6 +763,7 @@ private void iterateThroughAllObjects(){ for (String basketId : objectPool.getBasketIds()){ // iterate through iomObjects Iterator objectIterator = (objectPool.getObjectsOfBasketId(basketId)).valueIterator(); + UpdateCurrentBasket(basketId); while (objectIterator.hasNext()){ IomObject iomObj = objectIterator.next(); if(iomObj!=null){ @@ -874,6 +875,16 @@ private void iterateThroughAllObjects(){ validateSetConstraint(setConstraint); } } + + private void UpdateCurrentBasket(String basketId) { + currentBasketId = basketId; + for (UniquenessConstraint uniquenessConstraint: seenUniqueConstraintValues.keySet()) { + if (uniquenessConstraint.getBasket()){ + seenUniqueConstraintValues.get(uniquenessConstraint).clear(); + } + } + } + private void validateConstraints(IomObject iomObj, Viewable classOfIomObj) { if(!ValidationConfig.OFF.equals(constraintValidation)){ Viewable classOfCurrentObj=classOfIomObj; @@ -977,7 +988,6 @@ private void validateConstraintsOfEmbeddedAssociation(RoleDef role, IomObject io if (propc >= 1) { IomObject embeddedLinkObj = iomObj.getattrobj(role.getName(), 0); AssociationDef roleOwner = (AssociationDef) role.getContainer(); - Viewable classOfCurrentObj = roleOwner; if (classOfCurrentObj != null) { String iomObjOid = iomObj.getobjectoid(); @@ -1083,8 +1093,8 @@ private void validateUniquenessConstraint(IomObject parentObject,IomObject iomOb if(!ValidationConfig.OFF.equals(constraintValidation)){ String constraintName = getScopedName(uniquenessConstraint); String checkUniqueConstraint=null; - if(!enforceConstraintValidation){ - checkUniqueConstraint=validationConfig.getConfigValue(constraintName, ValidationConfig.CHECK); + if(!enforceConstraintValidation) { + checkUniqueConstraint = validationConfig.getConfigValue(constraintName, ValidationConfig.CHECK); } if(ValidationConfig.OFF.equals(checkUniqueConstraint)){ if(!configOffOufputReduction.contains(ValidationConfig.CHECK+":"+constraintName)){ From 21fed78f10d78664eafe496e2c0d8b0c455265ce Mon Sep 17 00:00:00 2001 From: Philipp Luethi Date: Wed, 20 Sep 2023 17:00:52 +0200 Subject: [PATCH 4/9] Add SET CONSTRAINT tests --- src/test/data/validator/SetConstraints24.ili | 11 ++ .../iox_j/validator/SetConstraints24Test.java | 108 ++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 src/test/data/validator/SetConstraints24.ili create mode 100644 src/test/java/ch/interlis/iox_j/validator/SetConstraints24Test.java diff --git a/src/test/data/validator/SetConstraints24.ili b/src/test/data/validator/SetConstraints24.ili new file mode 100644 index 00000000..50960838 --- /dev/null +++ b/src/test/data/validator/SetConstraints24.ili @@ -0,0 +1,11 @@ +INTERLIS 2.4; + +MODEL ModelA AT "mailto:test@localhost" VERSION "2023-09-05" = + TOPIC TopicA = + CLASS ClassA = + attr1 : MANDATORY 0..999; + SET CONSTRAINT SetConstraintGlobal: INTERLIS.objectCount(ALL) <= 3; + SET CONSTRAINT (BASKET) SetConstraintBasket: INTERLIS.objectCount(ALL) <= 2; + END ClassA; + END TopicA; +END ModelA. diff --git a/src/test/java/ch/interlis/iox_j/validator/SetConstraints24Test.java b/src/test/java/ch/interlis/iox_j/validator/SetConstraints24Test.java new file mode 100644 index 00000000..0da45a68 --- /dev/null +++ b/src/test/java/ch/interlis/iox_j/validator/SetConstraints24Test.java @@ -0,0 +1,108 @@ +package ch.interlis.iox_j.validator; + +import ch.ehi.basics.settings.Settings; +import ch.interlis.ili2c.config.Configuration; +import ch.interlis.ili2c.config.FileEntry; +import ch.interlis.ili2c.config.FileEntryKind; +import ch.interlis.ili2c.metamodel.TransferDescription; +import ch.interlis.iom_j.Iom_jObject; +import ch.interlis.iox_j.EndBasketEvent; +import ch.interlis.iox_j.EndTransferEvent; +import ch.interlis.iox_j.ObjectEvent; +import ch.interlis.iox_j.StartBasketEvent; +import ch.interlis.iox_j.StartTransferEvent; +import ch.interlis.iox_j.logging.LogEventFactory; +import org.junit.Before; +import org.junit.Test; + +import java.util.UUID; + +import static org.junit.Assert.assertNotNull; + +public class SetConstraints24Test { + + private TransferDescription td=null; + private Validator validator=null; + private LogCollector logger=null; + + private ObjectEvent CreateClassA(int attr1){ + Iom_jObject iomJObject = new Iom_jObject("ModelA.TopicA.ClassA", UUID.randomUUID().toString()); + iomJObject.addattrvalue("attr1", Integer.toString(attr1)); + return new ObjectEvent(iomJObject); + } + + @Before + public void setUp() throws Exception { + Configuration ili2cConfig=new Configuration(); + FileEntry fileEntry=new FileEntry("src/test/data/validator/SetConstraints24.ili", FileEntryKind.ILIMODELFILE); + ili2cConfig.addFileEntry(fileEntry); + td=ch.interlis.ili2c.Ili2c.runCompiler(ili2cConfig); + assertNotNull(td); + + ValidationConfig modelConfig=new ValidationConfig(); + logger=new LogCollector(); + LogEventFactory errFactory=new LogEventFactory(); + Settings settings=new Settings(); + validator=new Validator(td, modelConfig, logger, errFactory, settings); + } + + @Test + public void SetConstraintGlobal_Ok(){ + validator.validate(new StartTransferEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(new EndBasketEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(3)); + validator.validate(new EndBasketEvent()); + validator.validate(new EndTransferEvent()); + LogCollectorAssertions.AssertContainsError("SetConstraintGlobal",0, logger); + } + + @Test + public void SetConstraintGlobal_Fail(){ + validator.validate(new StartTransferEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(new EndBasketEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(3)); + validator.validate(CreateClassA(4)); + validator.validate(new EndBasketEvent()); + validator.validate(new EndTransferEvent()); + LogCollectorAssertions.AssertContainsError("SetConstraintGlobal", 1, logger); + } + + @Test + public void SetConstraintBasket_Ok(){ + validator.validate(new StartTransferEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(new EndBasketEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(new EndBasketEvent()); + validator.validate(new EndTransferEvent()); + LogCollectorAssertions.AssertContainsError("SetConstraintBasket",0, logger); + } + + @Test + public void SetConstraintBasket_Fail(){ + validator.validate(new StartTransferEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(CreateClassA(3)); + validator.validate(new EndBasketEvent()); + validator.validate(new StartBasketEvent("ModelA.TopicA", UUID.randomUUID().toString())); + validator.validate(CreateClassA(1)); + validator.validate(CreateClassA(2)); + validator.validate(CreateClassA(3)); + validator.validate(new EndBasketEvent()); + validator.validate(new EndTransferEvent()); + LogCollectorAssertions.AssertContainsError("SetConstraintBasket", 2, logger); + } +} \ No newline at end of file From 97c351b95268d137aaab00d341c1ebc8d42e0b77 Mon Sep 17 00:00:00 2001 From: Philipp Luethi Date: Fri, 22 Sep 2023 16:54:02 +0200 Subject: [PATCH 5/9] Add validation support for SET CONSTRAINT with BASKET limitation --- .../interlis/iox_j/validator/Validator.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/ch/interlis/iox_j/validator/Validator.java b/src/main/java/ch/interlis/iox_j/validator/Validator.java index 28348a85..877b5afe 100644 --- a/src/main/java/ch/interlis/iox_j/validator/Validator.java +++ b/src/main/java/ch/interlis/iox_j/validator/Validator.java @@ -870,9 +870,16 @@ private void iterateThroughAllObjects(){ } } } + for(SetConstraint setConstraint:setConstraints.keySet()){ + if(setConstraint.getBasket()){ + validateSetConstraint(setConstraint); + } + } } for(SetConstraint setConstraint:setConstraints.keySet()){ - validateSetConstraint(setConstraint); + if(!setConstraint.getBasket()) { + validateSetConstraint(setConstraint); + } } } @@ -883,6 +890,12 @@ private void UpdateCurrentBasket(String basketId) { seenUniqueConstraintValues.get(uniquenessConstraint).clear(); } } + + for (SetConstraint setConstraint: setConstraints.keySet()){ + if(setConstraint.getBasket()){ + setConstraints.get(setConstraint).clear(); + } + } } private void validateConstraints(IomObject iomObj, Viewable classOfIomObj) { @@ -1311,8 +1324,9 @@ private void validateSetConstraint(SetConstraint setConstraint) { } logMsg(checkConstraint,msg); } else { - if(!setConstraintOufputReduction.contains(setConstraint+":"+constraintName)){ - setConstraintOufputReduction.add(setConstraint+":"+constraintName); + String constraintIdentifier = setConstraint+":"+constraintName+(setConstraint.getBasket() ? ":Basket("+currentBasketId+")" : ""); + if(!setConstraintOufputReduction.contains(constraintIdentifier)){ + setConstraintOufputReduction.add(constraintIdentifier); logMsg(checkConstraint,rsrc.getString("validateSetConstraint.setConstraintIsNotTrue"), getDisplayName(setConstraint)); } } From 3c68f8fd2a5f03cd4f0ebe77d0ffca21618f430e Mon Sep 17 00:00:00 2001 From: Philipp Luethi Date: Wed, 27 Sep 2023 18:38:33 +0200 Subject: [PATCH 6/9] Nullcheck setConstraints as null is used as no object marker --- src/main/java/ch/interlis/iox_j/validator/Validator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ch/interlis/iox_j/validator/Validator.java b/src/main/java/ch/interlis/iox_j/validator/Validator.java index 877b5afe..e2960323 100644 --- a/src/main/java/ch/interlis/iox_j/validator/Validator.java +++ b/src/main/java/ch/interlis/iox_j/validator/Validator.java @@ -892,7 +892,7 @@ private void UpdateCurrentBasket(String basketId) { } for (SetConstraint setConstraint: setConstraints.keySet()){ - if(setConstraint.getBasket()){ + if(setConstraint.getBasket() && setConstraints.get(setConstraint) != null){ setConstraints.get(setConstraint).clear(); } } From b854845b8f11c5e173764def3014be203ee392f2 Mon Sep 17 00:00:00 2001 From: Philipp Luethi Date: Thu, 28 Sep 2023 13:36:31 +0200 Subject: [PATCH 7/9] Indent using spaces --- src/main/java/ch/interlis/iox_j/validator/Validator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ch/interlis/iox_j/validator/Validator.java b/src/main/java/ch/interlis/iox_j/validator/Validator.java index e2960323..9fe33756 100644 --- a/src/main/java/ch/interlis/iox_j/validator/Validator.java +++ b/src/main/java/ch/interlis/iox_j/validator/Validator.java @@ -1324,7 +1324,7 @@ private void validateSetConstraint(SetConstraint setConstraint) { } logMsg(checkConstraint,msg); } else { - String constraintIdentifier = setConstraint+":"+constraintName+(setConstraint.getBasket() ? ":Basket("+currentBasketId+")" : ""); + String constraintIdentifier = setConstraint+":"+constraintName+(setConstraint.getBasket() ? ":Basket("+currentBasketId+")" : ""); if(!setConstraintOufputReduction.contains(constraintIdentifier)){ setConstraintOufputReduction.add(constraintIdentifier); logMsg(checkConstraint,rsrc.getString("validateSetConstraint.setConstraintIsNotTrue"), getDisplayName(setConstraint)); From 52374003a2d4f4b4156a5554e6041da393fc5e7f Mon Sep 17 00:00:00 2001 From: Patrick Ackermann Date: Mon, 23 Oct 2023 07:48:38 +0200 Subject: [PATCH 8/9] Rename getBasket to perBasket --- .../java/ch/interlis/iox_j/validator/Validator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/ch/interlis/iox_j/validator/Validator.java b/src/main/java/ch/interlis/iox_j/validator/Validator.java index 9fe33756..5bc6a16a 100644 --- a/src/main/java/ch/interlis/iox_j/validator/Validator.java +++ b/src/main/java/ch/interlis/iox_j/validator/Validator.java @@ -871,13 +871,13 @@ private void iterateThroughAllObjects(){ } } for(SetConstraint setConstraint:setConstraints.keySet()){ - if(setConstraint.getBasket()){ + if(setConstraint.perBasket()){ validateSetConstraint(setConstraint); } } } for(SetConstraint setConstraint:setConstraints.keySet()){ - if(!setConstraint.getBasket()) { + if(!setConstraint.perBasket()) { validateSetConstraint(setConstraint); } } @@ -886,13 +886,13 @@ private void iterateThroughAllObjects(){ private void UpdateCurrentBasket(String basketId) { currentBasketId = basketId; for (UniquenessConstraint uniquenessConstraint: seenUniqueConstraintValues.keySet()) { - if (uniquenessConstraint.getBasket()){ + if (uniquenessConstraint.perBasket()){ seenUniqueConstraintValues.get(uniquenessConstraint).clear(); } } for (SetConstraint setConstraint: setConstraints.keySet()){ - if(setConstraint.getBasket() && setConstraints.get(setConstraint) != null){ + if(setConstraint.perBasket() && setConstraints.get(setConstraint) != null){ setConstraints.get(setConstraint).clear(); } } @@ -1324,7 +1324,7 @@ private void validateSetConstraint(SetConstraint setConstraint) { } logMsg(checkConstraint,msg); } else { - String constraintIdentifier = setConstraint+":"+constraintName+(setConstraint.getBasket() ? ":Basket("+currentBasketId+")" : ""); + String constraintIdentifier = setConstraint+":"+constraintName+(setConstraint.perBasket() ? ":Basket("+currentBasketId+")" : ""); if(!setConstraintOufputReduction.contains(constraintIdentifier)){ setConstraintOufputReduction.add(constraintIdentifier); logMsg(checkConstraint,rsrc.getString("validateSetConstraint.setConstraintIsNotTrue"), getDisplayName(setConstraint)); From 80eb009873f10322ea68bafb7dae287ac631149d Mon Sep 17 00:00:00 2001 From: Patrick Ackermann Date: Mon, 23 Oct 2023 07:48:38 +0200 Subject: [PATCH 9/9] Make function name lower case --- src/main/java/ch/interlis/iox_j/validator/Validator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/interlis/iox_j/validator/Validator.java b/src/main/java/ch/interlis/iox_j/validator/Validator.java index 5bc6a16a..ee410e75 100644 --- a/src/main/java/ch/interlis/iox_j/validator/Validator.java +++ b/src/main/java/ch/interlis/iox_j/validator/Validator.java @@ -763,7 +763,7 @@ private void iterateThroughAllObjects(){ for (String basketId : objectPool.getBasketIds()){ // iterate through iomObjects Iterator objectIterator = (objectPool.getObjectsOfBasketId(basketId)).valueIterator(); - UpdateCurrentBasket(basketId); + updateCurrentBasket(basketId); while (objectIterator.hasNext()){ IomObject iomObj = objectIterator.next(); if(iomObj!=null){ @@ -883,7 +883,7 @@ private void iterateThroughAllObjects(){ } } - private void UpdateCurrentBasket(String basketId) { + private void updateCurrentBasket(String basketId) { currentBasketId = basketId; for (UniquenessConstraint uniquenessConstraint: seenUniqueConstraintValues.keySet()) { if (uniquenessConstraint.perBasket()){