From 33682ad3e8049d3ae627632540057857925a3b7d Mon Sep 17 00:00:00 2001 From: saksham93 <37399540+saksham93@users.noreply.github.com> Date: Sun, 16 Feb 2020 23:02:40 +0400 Subject: [PATCH 01/10] Modularisation for design patterns: (#1179) 1. Chain 2. Collection-Pipeline --- .../java/com/iluwatar/chain/module-info.java | 26 +++++++++++++++++++ .../collectionpipeline/module-info.java | 26 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 chain/src/main/java/com/iluwatar/chain/module-info.java create mode 100644 collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/module-info.java diff --git a/chain/src/main/java/com/iluwatar/chain/module-info.java b/chain/src/main/java/com/iluwatar/chain/module-info.java new file mode 100644 index 000000000000..4f11ab327766 --- /dev/null +++ b/chain/src/main/java/com/iluwatar/chain/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.chain { + requires org.slf4j; +} \ No newline at end of file diff --git a/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/module-info.java b/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/module-info.java new file mode 100644 index 000000000000..f8bd30a68177 --- /dev/null +++ b/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.collectionpipeline { + requires org.slf4j; +} \ No newline at end of file From 33e4a870cac3225e2f0e70e538c081dac570d4e4 Mon Sep 17 00:00:00 2001 From: yichen88 <30594441+yichen88@users.noreply.github.com> Date: Sat, 7 Mar 2020 12:12:06 +0100 Subject: [PATCH 02/10] Fix imperative-style. (#1180) Signed-off-by: yichen88 --- .../ImperativeProgramming.java | 68 +++++++++++++++---- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/ImperativeProgramming.java b/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/ImperativeProgramming.java index 5341d27439ae..bdf2d5e80872 100644 --- a/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/ImperativeProgramming.java +++ b/collection-pipeline/src/main/java/com/iluwatar/collectionpipeline/ImperativeProgramming.java @@ -23,12 +23,12 @@ package com.iluwatar.collectionpipeline; -import java.util.Collection; +import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * Imperative-style programming to iterate over the list and get the names of cars made later than @@ -57,11 +57,27 @@ private ImperativeProgramming() { * @return {@link List} of {@link String} of car models built after year 2000 */ public static List getModelsAfter2000(List cars) { - return cars.stream() - .filter(car -> car.getYear() > 2000) - .sorted(Comparator.comparingInt(Car::getYear)) - .map(Car::getModel) - .collect(Collectors.toList()); + List carsSortedByYear = new ArrayList<>(); + + for (Car car : cars) { + if (car.getYear() > 2000) { + carsSortedByYear.add(car); + } + } + + Collections.sort(carsSortedByYear, new Comparator() { + @Override + public int compare(Car car1, Car car2) { + return car1.getYear() - car2.getYear(); + } + }); + + List models = new ArrayList<>(); + for (Car car : carsSortedByYear) { + models.add(car.getModel()); + } + + return models; } /** @@ -71,7 +87,17 @@ public static List getModelsAfter2000(List cars) { * @return {@link Map} with category as key and cars belonging to that category as value */ public static Map> getGroupingOfCarsByCategory(List cars) { - return cars.stream().collect(Collectors.groupingBy(Car::getCategory)); + Map> groupingByCategory = new HashMap<>(); + for (Car car : cars) { + if (groupingByCategory.containsKey(car.getCategory())) { + groupingByCategory.get(car.getCategory()).add(car); + } else { + List categoryCars = new ArrayList<>(); + categoryCars.add(car); + groupingByCategory.put(car.getCategory(), categoryCars); + } + } + return groupingByCategory; } /** @@ -82,11 +108,25 @@ public static Map> getGroupingOfCarsByCategory(List car * @return {@link List} of {@link Car} to belonging to the group */ public static List getSedanCarsOwnedSortedByDate(List persons) { - return persons.stream() - .map(Person::getCars) - .flatMap(Collection::stream) - .filter(car -> car.getCategory() == Category.SEDAN) - .sorted(Comparator.comparingInt(Car::getYear)) - .collect(Collectors.toList()); + List cars = new ArrayList<>(); + for (Person person : persons) { + cars.addAll(person.getCars()); + } + + List sedanCars = new ArrayList<>(); + for (Car car : cars) { + if (Category.SEDAN.equals(car.getCategory())) { + sedanCars.add(car); + } + } + + sedanCars.sort(new Comparator() { + @Override + public int compare(Car o1, Car o2) { + return o1.getYear() - o2.getYear(); + } + }); + + return sedanCars; } } From 1c558ff4c5ac9c0d189793555723daa6c68a7890 Mon Sep 17 00:00:00 2001 From: saksham93 <37399540+saksham93@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:20:44 +0400 Subject: [PATCH 03/10] Organised below design patterns into modules: (#1181) 1. Command 2. Composite --- .../com/iluwatar/command/module-info.java | 26 +++++++++++++++++++ .../com/iluwatar/composite/module-info.java | 26 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 command/src/main/java/com/iluwatar/command/module-info.java create mode 100644 composite/src/main/java/com/iluwatar/composite/module-info.java diff --git a/command/src/main/java/com/iluwatar/command/module-info.java b/command/src/main/java/com/iluwatar/command/module-info.java new file mode 100644 index 000000000000..0e0c0b31ff4d --- /dev/null +++ b/command/src/main/java/com/iluwatar/command/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.command { + requires org.slf4j; +} \ No newline at end of file diff --git a/composite/src/main/java/com/iluwatar/composite/module-info.java b/composite/src/main/java/com/iluwatar/composite/module-info.java new file mode 100644 index 000000000000..d75a7b8f8795 --- /dev/null +++ b/composite/src/main/java/com/iluwatar/composite/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.composite { + requires org.slf4j; +} \ No newline at end of file From 4e01ca39fd82dca682c9284551fedf441ee7be85 Mon Sep 17 00:00:00 2001 From: saksham93 <37399540+saksham93@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:22:55 +0400 Subject: [PATCH 04/10] Organised below design patterns into modules: (#1182) 1. Converter 2. Dao --- .../com/iluwatar/converter/module-info.java | 26 +++++++++++++++++ .../java/com/iluwatar/dao/module-info.java | 29 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 converter/src/main/java/com/iluwatar/converter/module-info.java create mode 100644 dao/src/main/java/com/iluwatar/dao/module-info.java diff --git a/converter/src/main/java/com/iluwatar/converter/module-info.java b/converter/src/main/java/com/iluwatar/converter/module-info.java new file mode 100644 index 000000000000..d83a43c6b24a --- /dev/null +++ b/converter/src/main/java/com/iluwatar/converter/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.converter { + requires org.slf4j; +} \ No newline at end of file diff --git a/dao/src/main/java/com/iluwatar/dao/module-info.java b/dao/src/main/java/com/iluwatar/dao/module-info.java new file mode 100644 index 000000000000..08e4f662ed95 --- /dev/null +++ b/dao/src/main/java/com/iluwatar/dao/module-info.java @@ -0,0 +1,29 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.dao { + requires org.slf4j; + requires java.sql; + requires h2; + requires java.naming; +} \ No newline at end of file From eaf3598807cfcfe6e527d13175d956a64706a6a9 Mon Sep 17 00:00:00 2001 From: saksham93 <37399540+saksham93@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:24:31 +0400 Subject: [PATCH 05/10] Organised below design patterns into modules: (#1183) 1. Data Mapper 2. Data Transfer Object --- .../com/iluwatar/datamapper/module-info.java | 26 +++++++++++++++++++ .../iluwatar/datatransfer/module-info.java | 26 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 data-mapper/src/main/java/com/iluwatar/datamapper/module-info.java create mode 100644 data-transfer-object/src/main/java/com/iluwatar/datatransfer/module-info.java diff --git a/data-mapper/src/main/java/com/iluwatar/datamapper/module-info.java b/data-mapper/src/main/java/com/iluwatar/datamapper/module-info.java new file mode 100644 index 000000000000..7abd7882657f --- /dev/null +++ b/data-mapper/src/main/java/com/iluwatar/datamapper/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.datamapper { + requires org.slf4j; +} \ No newline at end of file diff --git a/data-transfer-object/src/main/java/com/iluwatar/datatransfer/module-info.java b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/module-info.java new file mode 100644 index 000000000000..25685d4d0e7d --- /dev/null +++ b/data-transfer-object/src/main/java/com/iluwatar/datatransfer/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.datatransfer { + requires org.slf4j; +} \ No newline at end of file From 54db4497a368204b47d1d4030a70f4b59e22ac09 Mon Sep 17 00:00:00 2001 From: saksham93 <37399540+saksham93@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:47:24 +0400 Subject: [PATCH 06/10] Organised the below patterns into modules: (#1185) 1. Decorator 2. Delegation --- .../com/iluwatar/decorator/module-info.java | 26 +++++++++++++++++++ .../com/iluwatar/delegation/module-info.java | 26 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 decorator/src/main/java/com/iluwatar/decorator/module-info.java create mode 100644 delegation/src/main/java/com/iluwatar/delegation/module-info.java diff --git a/decorator/src/main/java/com/iluwatar/decorator/module-info.java b/decorator/src/main/java/com/iluwatar/decorator/module-info.java new file mode 100644 index 000000000000..50d17f02222e --- /dev/null +++ b/decorator/src/main/java/com/iluwatar/decorator/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.decorator { + requires org.slf4j; +} \ No newline at end of file diff --git a/delegation/src/main/java/com/iluwatar/delegation/module-info.java b/delegation/src/main/java/com/iluwatar/delegation/module-info.java new file mode 100644 index 000000000000..156477cded19 --- /dev/null +++ b/delegation/src/main/java/com/iluwatar/delegation/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.delegation { + requires org.slf4j; +} \ No newline at end of file From 6bf3a13064418e7312cbe6b718a5e7ea5680af8c Mon Sep 17 00:00:00 2001 From: saksham93 <37399540+saksham93@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:48:25 +0400 Subject: [PATCH 07/10] Import of design patterns into modules: (#1186) 1. DIrty flag 2. Double checked locking --- .../com/iluwatar/dirtyflag/module-info.java | 26 +++++++++++++++++++ .../doublechecked/locking/module-info.java | 26 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 dirty-flag/src/main/java/com/iluwatar/dirtyflag/module-info.java create mode 100644 double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/module-info.java diff --git a/dirty-flag/src/main/java/com/iluwatar/dirtyflag/module-info.java b/dirty-flag/src/main/java/com/iluwatar/dirtyflag/module-info.java new file mode 100644 index 000000000000..bf47d2cd7daf --- /dev/null +++ b/dirty-flag/src/main/java/com/iluwatar/dirtyflag/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.dirtyflag { + requires org.slf4j; +} \ No newline at end of file diff --git a/double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/module-info.java b/double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/module-info.java new file mode 100644 index 000000000000..4f4216ea7c5c --- /dev/null +++ b/double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.doublecheckedlocking { + requires org.slf4j; +} \ No newline at end of file From 16ef70bfdc8ad60c726c5765d0716a82110d57db Mon Sep 17 00:00:00 2001 From: saksham93 <37399540+saksham93@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:50:51 +0400 Subject: [PATCH 08/10] Organisation of patterns into modules: (#1187) 1. Double DIspatch 2. EIP Message Channel --- .../iluwatar/doubledispatch/module-info.java | 26 ++++++++++++++++++ .../eip/message/channel/module-info.java | 27 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 double-dispatch/src/main/java/com/iluwatar/doubledispatch/module-info.java create mode 100644 eip-message-channel/src/main/java/com/iluwatar/eip/message/channel/module-info.java diff --git a/double-dispatch/src/main/java/com/iluwatar/doubledispatch/module-info.java b/double-dispatch/src/main/java/com/iluwatar/doubledispatch/module-info.java new file mode 100644 index 000000000000..b1bc2e824c6a --- /dev/null +++ b/double-dispatch/src/main/java/com/iluwatar/doubledispatch/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.doubledispatch { + requires org.slf4j; +} \ No newline at end of file diff --git a/eip-message-channel/src/main/java/com/iluwatar/eip/message/channel/module-info.java b/eip-message-channel/src/main/java/com/iluwatar/eip/message/channel/module-info.java new file mode 100644 index 000000000000..b904ee1c835d --- /dev/null +++ b/eip-message-channel/src/main/java/com/iluwatar/eip/message/channel/module-info.java @@ -0,0 +1,27 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.eipmessagechannel { + requires org.slf4j; + requires camel.core; +} \ No newline at end of file From a410004a8f3ce77b0c80c55c774887a5e1ead710 Mon Sep 17 00:00:00 2001 From: saksham93 <37399540+saksham93@users.noreply.github.com> Date: Sat, 7 Mar 2020 15:53:19 +0400 Subject: [PATCH 09/10] Organisation of design patterns into modules: (#1188) 1. EIP Publish Channel 2. Event Aggregator --- .../eip/publish/subscribe/module-info.java | 27 +++++++++++++++++++ .../event/aggregator/module-info.java | 26 ++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 eip-publish-subscribe/src/main/java/com/iluwatar/eip/publish/subscribe/module-info.java create mode 100644 event-aggregator/src/main/java/com/iluwatar/event/aggregator/module-info.java diff --git a/eip-publish-subscribe/src/main/java/com/iluwatar/eip/publish/subscribe/module-info.java b/eip-publish-subscribe/src/main/java/com/iluwatar/eip/publish/subscribe/module-info.java new file mode 100644 index 000000000000..50eab8360ab3 --- /dev/null +++ b/eip-publish-subscribe/src/main/java/com/iluwatar/eip/publish/subscribe/module-info.java @@ -0,0 +1,27 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.eippublishsubscribe { + requires org.slf4j; + requires camel.core; +} \ No newline at end of file diff --git a/event-aggregator/src/main/java/com/iluwatar/event/aggregator/module-info.java b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/module-info.java new file mode 100644 index 000000000000..93ebd3173c9f --- /dev/null +++ b/event-aggregator/src/main/java/com/iluwatar/event/aggregator/module-info.java @@ -0,0 +1,26 @@ +/* + * The MIT License + * Copyright © 2014-2019 Ilkka Seppälä + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +module com.iluwatar.eventaggregator { + requires org.slf4j; +} \ No newline at end of file From 0ad67c872635f0246453a4b9ce1a3ea30b5a0cc4 Mon Sep 17 00:00:00 2001 From: Jonathan Leitschuh Date: Thu, 12 Mar 2020 14:37:36 -0400 Subject: [PATCH 10/10] Use HTTPS instead of HTTP to resolve dependencies (#1184) This fixes a security vulnerability in this project where the `pom.xml` files were configuring Maven to resolve dependencies over HTTP instead of HTTPS. Signed-off-by: Jonathan Leitschuh --- naked-objects/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/naked-objects/pom.xml b/naked-objects/pom.xml index 0ca5a3ef3cb4..5b7a2e0c79ea 100644 --- a/naked-objects/pom.xml +++ b/naked-objects/pom.xml @@ -52,7 +52,7 @@ Cloudbees snapshots - http://repository-estatio.forge.cloudbees.com/snapshot/ + https://repository-estatio.forge.cloudbees.com/snapshot/