From d3af25788b02730f800e9976fdd2bf19fb74ce54 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Wed, 1 May 2024 12:13:04 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Java=208=20=E7=89=88=E6=9C=AC=E5=90=88?= =?UTF-8?q?=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/compiler.xml | 2 + .idea/encodings.xml | 2 + core-java-modules/core-java-11/pom.xml | 2 +- .../baeldung/game/RockPaperScissorsGame.java | 73 -------- .../ChidlCircleInterfaceImpl.java | 14 -- .../ChildCircleClass.java | 5 - .../interfaceVsAbstractClass/CircleClass.java | 23 --- .../CircleInterface.java | 14 -- .../com/baeldung/jarArguments/JarExample.java | 18 -- .../java/com/baeldung/localization/App.java | 21 --- .../com/baeldung/localization/ICUFormat.java | 29 ---- .../baeldung/localization/JavaSEFormat.java | 24 --- .../baeldung/localization/Localization.java | 18 -- .../baeldung/stream/SkipLimitComparison.java | 46 ----- .../java/com/baeldung/uuid/UuidHelper.java | 33 ---- .../main/resources/META-INF/persistence.xml | 34 ---- .../src/main/resources/example_manifest.txt | 1 - .../src/main/resources/formats_en.properties | 2 - .../src/main/resources/formats_fr.properties | 2 - .../src/main/resources/formats_it.properties | 2 - .../src/main/resources/formats_pl.properties | 2 - .../src/main/resources/messages_en.properties | 1 - .../src/main/resources/messages_fr.properties | 1 - .../src/main/resources/messages_it.properties | 1 - .../src/main/resources/messages_pl.properties | 1 - .../BiFunctionalInterfacesUnitTest.java | 164 ------------------ .../InterfaceVsAbstractClassUnitTest.java | 21 --- .../localization/ICUFormatUnitTest.java | 74 -------- core-java-modules/core-java-8/README.md | 3 + .../anonymousclass/AnonymousClassExample.java | 2 +- .../argsVsvarargs/StringArrayAndVarargs.java | 2 +- .../helpervsutilityclasses/MyHelperClass.java | 2 +- .../MyUtilityClass.java | 2 +- .../LambdaExpressionExample.java | 2 +- .../main/java/com/ossez/localization/App.java | 1 + .../StringArrayAndVarargsUnitTest.java | 6 +- .../BiFunctionalInterfacesUnitTest.java | 7 +- .../MyHelperClassUnitTest.java | 2 +- .../MyUtilityClassUnitTest.java | 2 +- .../ossez/localization/ICUFormatUnitTest.java | 2 + .../core-java-collections-list-2/pom.xml | 4 +- core-java-modules/core-java-numbers/pom.xml | 4 +- .../spring-data-jpa-repo-2/pom.xml | 2 +- .../spring-data-jpa-repo/pom.xml | 2 +- pom.xml | 2 +- 45 files changed, 31 insertions(+), 646 deletions(-) delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/game/RockPaperScissorsGame.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/ChidlCircleInterfaceImpl.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/ChildCircleClass.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/CircleClass.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/CircleInterface.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/jarArguments/JarExample.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/App.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/ICUFormat.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/JavaSEFormat.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/Localization.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/stream/SkipLimitComparison.java delete mode 100644 core-java-modules/core-java-8-2/src/main/java/com/baeldung/uuid/UuidHelper.java delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/META-INF/persistence.xml delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/example_manifest.txt delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/formats_en.properties delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/formats_fr.properties delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/formats_it.properties delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/formats_pl.properties delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/messages_en.properties delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/messages_fr.properties delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/messages_it.properties delete mode 100644 core-java-modules/core-java-8-2/src/main/resources/messages_pl.properties delete mode 100644 core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java delete mode 100644 core-java-modules/core-java-8-2/src/test/java/com/baeldung/interfaceVsAbstractClass/InterfaceVsAbstractClassUnitTest.java delete mode 100644 core-java-modules/core-java-8-2/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java rename core-java-modules/{core-java-8-2/src/main/java/com/baeldung => core-java-8/src/main/java/com/ossez}/anonymousclass/AnonymousClassExample.java (89%) rename core-java-modules/{core-java-8-2/src/main/java/com/baeldung => core-java-8/src/main/java/com/ossez}/argsVsvarargs/StringArrayAndVarargs.java (93%) rename core-java-modules/{core-java-8-2/src/main/java/com/baeldung => core-java-8/src/main/java/com/ossez}/helpervsutilityclasses/MyHelperClass.java (95%) rename core-java-modules/{core-java-8-2/src/main/java/com/baeldung => core-java-8/src/main/java/com/ossez}/helpervsutilityclasses/MyUtilityClass.java (90%) rename core-java-modules/{core-java-8-2/src/main/java/com/baeldung => core-java-8/src/main/java/com/ossez}/lambdaexpression/LambdaExpressionExample.java (85%) rename core-java-modules/{core-java-8-2/src/test/java/com/baeldung => core-java-8/src/test/java/com/ossez}/argsVsvarargs/StringArrayAndVarargsUnitTest.java (77%) rename core-java-modules/{core-java-8-2/src/test/java/com/baeldung => core-java-8/src/test/java/com/ossez}/helpervsutilityclasses/MyHelperClassUnitTest.java (92%) rename core-java-modules/{core-java-8-2/src/test/java/com/baeldung => core-java-8/src/test/java/com/ossez}/helpervsutilityclasses/MyUtilityClassUnitTest.java (88%) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 0157d6258d..f0cf84067d 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -20,6 +20,7 @@ + @@ -42,6 +43,7 @@ + diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 0b25056ada..4ba500396a 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -61,6 +61,8 @@ + + diff --git a/core-java-modules/core-java-11/pom.xml b/core-java-modules/core-java-11/pom.xml index 3483ab54e7..edcfd3d231 100644 --- a/core-java-modules/core-java-11/pom.xml +++ b/core-java-modules/core-java-11/pom.xml @@ -20,7 +20,7 @@ com.google.guava guava - ${version.guava} + ${guava.version} org.openjdk.jmh diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/game/RockPaperScissorsGame.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/game/RockPaperScissorsGame.java deleted file mode 100644 index 17f0f02698..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/game/RockPaperScissorsGame.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.baeldung.game; - -import java.util.*; - -class RockPaperScissorsGame { - - enum Move { - ROCK("rock"), - PAPER("paper"), - SCISSORS("scissors"); - - private String value; - - Move(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - } - - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - int wins = 0; - int losses = 0; - - System.out.println("Welcome to Rock-Paper-Scissors! Please enter \"rock\", \"paper\", \"scissors\", or \"quit\" to exit."); - - while (true) { - System.out.println("-------------------------"); - System.out.print("Enter your move: "); - String playerMove = scanner.nextLine(); - - if (playerMove.equals("quit")) { - System.out.println("You won " + wins + " times and lost " + losses + " times."); - System.out.println("Thanks for playing! See you again."); - break; - } - - if (Arrays.stream(Move.values()).noneMatch(x -> x.getValue().equals(playerMove))) { - System.out.println("Your move isn't valid!"); - continue; - } - - String computerMove = getComputerMove(); - - if (playerMove.equals(computerMove)) { - System.out.println("It's a tie!"); - } else if (isPlayerWin(playerMove, computerMove)) { - System.out.println("You won!"); - wins++; - } else { - System.out.println("You lost!"); - losses++; - } - } - } - - private static boolean isPlayerWin(String playerMove, String computerMove) { - return playerMove.equals(Move.ROCK.value) && computerMove.equals(Move.SCISSORS.value) - || (playerMove.equals(Move.SCISSORS.value) && computerMove.equals(Move.PAPER.value)) - || (playerMove.equals(Move.PAPER.value) && computerMove.equals(Move.ROCK.value)); - } - - private static String getComputerMove() { - Random random = new Random(); - int randomNumber = random.nextInt(3); - String computerMove = Move.values()[randomNumber].getValue(); - System.out.println("Computer move: " + computerMove); - return computerMove; - } -} \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/ChidlCircleInterfaceImpl.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/ChidlCircleInterfaceImpl.java deleted file mode 100644 index 2aadf2e2e8..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/ChidlCircleInterfaceImpl.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.interfaceVsAbstractClass; - -public class ChidlCircleInterfaceImpl implements CircleInterface { - private String color; - - @Override - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/ChildCircleClass.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/ChildCircleClass.java deleted file mode 100644 index 8d26bda306..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/ChildCircleClass.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.baeldung.interfaceVsAbstractClass; - -public class ChildCircleClass extends CircleClass { - -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/CircleClass.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/CircleClass.java deleted file mode 100644 index 048ffa4fe9..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/CircleClass.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.interfaceVsAbstractClass; - -import java.util.Arrays; -import java.util.List; - -public abstract class CircleClass { - - private String color; - private List allowedColors = Arrays.asList("RED", "GREEN", "BLUE"); - - public boolean isValid() { - return allowedColors.contains(getColor()); - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/CircleInterface.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/CircleInterface.java deleted file mode 100644 index a0c3a6d9c6..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/interfaceVsAbstractClass/CircleInterface.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.interfaceVsAbstractClass; - -import java.util.Arrays; -import java.util.List; - -public interface CircleInterface { - List allowedColors = Arrays.asList("RED", "GREEN", "BLUE"); - - String getColor(); - - public default boolean isValid() { - return allowedColors.contains(getColor()); - } -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/jarArguments/JarExample.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/jarArguments/JarExample.java deleted file mode 100644 index c2fb809790..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/jarArguments/JarExample.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.jarArguments; - -public class JarExample { - - public static void main(String[] args) { - System.out.println("Hello Baeldung Reader in JarExample!"); - - if(args == null) { - System.out.println("You have not provided any arguments!"); - }else { - System.out.println("There are "+args.length+" argument(s)!"); - for(int i=0; i locales = Arrays.asList(new Locale[] { Locale.UK, Locale.ITALY, Locale.FRANCE, Locale.forLanguageTag("pl-PL") }); - Localization.run(locales); - JavaSEFormat.run(locales); - ICUFormat.run(locales); - } - -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/ICUFormat.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/ICUFormat.java deleted file mode 100644 index f7bc357933..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/ICUFormat.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.baeldung.localization; - -import java.util.List; -import java.util.Locale; -import java.util.ResourceBundle; - -import com.ibm.icu.text.MessageFormat; - -public class ICUFormat { - - public static String getLabel(Locale locale, Object[] data) { - ResourceBundle bundle = ResourceBundle.getBundle("formats", locale); - String format = bundle.getString("label-icu"); - MessageFormat formatter = new MessageFormat(format, locale); - return formatter.format(data); - } - - public static void run(List locales) { - System.out.println("ICU formatter"); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { "Alice", "female", 0 }))); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { "Alice", "female", 1 }))); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { "Alice", "female", 2 }))); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { "Alice", "female", 3 }))); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { "Bob", "male", 0 }))); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { "Bob", "male", 1 }))); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { "Bob", "male", 2 }))); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { "Bob", "male", 3 }))); - } -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/JavaSEFormat.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/JavaSEFormat.java deleted file mode 100644 index c95dfffa13..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/JavaSEFormat.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.baeldung.localization; - -import java.text.MessageFormat; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.ResourceBundle; - -public class JavaSEFormat { - - public static String getLabel(Locale locale, Object[] data) { - ResourceBundle bundle = ResourceBundle.getBundle("formats", locale); - final String pattern = bundle.getString("label"); - final MessageFormat formatter = new MessageFormat(pattern, locale); - return formatter.format(data); - } - - public static void run(List locales) { - System.out.println("Java formatter"); - final Date date = new Date(System.currentTimeMillis()); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { date, "Alice", 0 }))); - locales.forEach(locale -> System.out.println(getLabel(locale, new Object[] { date, "Alice", 2 }))); - } -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/Localization.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/Localization.java deleted file mode 100644 index 17a6598ce0..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/localization/Localization.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.baeldung.localization; - -import java.util.List; -import java.util.Locale; -import java.util.ResourceBundle; - -public class Localization { - - public static String getLabel(Locale locale) { - final ResourceBundle bundle = ResourceBundle.getBundle("messages", locale); - return bundle.getString("label"); - } - - public static void run(List locales) { - locales.forEach(locale -> System.out.println(getLabel(locale))); - } - -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/stream/SkipLimitComparison.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/stream/SkipLimitComparison.java deleted file mode 100644 index 65f12ada45..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/stream/SkipLimitComparison.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.baeldung.stream; - -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -public class SkipLimitComparison { - - public static void main(String[] args) { - skipExample(); - limitExample(); - limitInfiniteStreamExample(); - getEvenNumbers(10, 10).stream() - .forEach(System.out::println); - } - - public static void skipExample() { - Stream.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - .filter(i -> i % 2 == 0) - .skip(2) - .forEach(i -> System.out.print(i + " ")); - } - - public static void limitExample() { - Stream.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) - .filter(i -> i % 2 == 0) - .limit(2) - .forEach(i -> System.out.print(i + " ")); - } - - public static void limitInfiniteStreamExample() { - Stream.iterate(0, i -> i + 1) - .filter(i -> i % 2 == 0) - .limit(10) - .forEach(System.out::println); - } - - private static List getEvenNumbers(int offset, int limit) { - return Stream.iterate(0, i -> i + 1) - .filter(i -> i % 2 == 0) - .skip(offset) - .limit(limit) - .collect(Collectors.toList()); - } - -} diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/uuid/UuidHelper.java b/core-java-modules/core-java-8-2/src/main/java/com/baeldung/uuid/UuidHelper.java deleted file mode 100644 index 5807262094..0000000000 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/uuid/UuidHelper.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.baeldung.uuid; - -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.UUID; - -public class UuidHelper { - - public static byte[] convertUUIDToBytes(UUID uuid) { - ByteBuffer bb = ByteBuffer.wrap(new byte[16]); - bb.putLong(uuid.getMostSignificantBits()); - bb.putLong(uuid.getLeastSignificantBits()); - return bb.array(); - } - - public static UUID convertBytesToUUID(byte[] bytes) { - ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); - long high = byteBuffer.getLong(); - long low = byteBuffer.getLong(); - return new UUID(high, low); - } - - public static void main(String[] args) { - UUID uuid = UUID.randomUUID(); - System.out.println("Original UUID: " + uuid); - - byte[] bytes = convertUUIDToBytes(uuid); - System.out.println("Converted byte array: " + Arrays.toString(bytes)); - - UUID uuidNew = convertBytesToUUID(bytes); - System.out.println("Converted UUID: " + uuidNew); - } -} diff --git a/core-java-modules/core-java-8-2/src/main/resources/META-INF/persistence.xml b/core-java-modules/core-java-8-2/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index c412ca0839..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Persist Optional Return Type Demo - org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.optionalreturntype.User - com.baeldung.optionalreturntype.UserOptional - - true - - - - - - - - - - - - - \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/main/resources/example_manifest.txt b/core-java-modules/core-java-8-2/src/main/resources/example_manifest.txt deleted file mode 100644 index 71abcb05fb..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/example_manifest.txt +++ /dev/null @@ -1 +0,0 @@ -Main-Class: com.baeldung.jarArguments.JarExample diff --git a/core-java-modules/core-java-8-2/src/main/resources/formats_en.properties b/core-java-modules/core-java-8-2/src/main/resources/formats_en.properties deleted file mode 100644 index 41e0e00119..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/formats_en.properties +++ /dev/null @@ -1,2 +0,0 @@ -label=On {0, date, short} {1} has sent you {2, choice, 0#no messages|1#a message|2#two messages|2<{2,number,integer} messages}. -label-icu={0} has sent you {2, plural, =0 {no messages} =1 {a message} other {{2, number, integer} messages}}. \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/main/resources/formats_fr.properties b/core-java-modules/core-java-8-2/src/main/resources/formats_fr.properties deleted file mode 100644 index c2d5159b32..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/formats_fr.properties +++ /dev/null @@ -1,2 +0,0 @@ -label={0, date, short}, {1}{2, choice, 0# ne|0<} vous a envoy {2, choice, 0#aucun message|1#un message|2#deux messages|2<{2,number,integer} messages}. -label-icu={0} {2, plural, =0 {ne } other {}}vous a envoy {2, plural, =0 {aucun message} =1 {un message} other {{2, number, integer} messages}}. \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/main/resources/formats_it.properties b/core-java-modules/core-java-8-2/src/main/resources/formats_it.properties deleted file mode 100644 index 43fd1eee1c..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/formats_it.properties +++ /dev/null @@ -1,2 +0,0 @@ -label={0, date, short} {1} ti ha inviato {2, choice, 0#nessun messagio|1#un messaggio|2#due messaggi|2<{2, number, integer} messaggi}. -label-icu={0} {2, plural, =0 {non } other {}}ti ha inviato {2, plural, =0 {nessun messaggio} =1 {un messaggio} other {{2, number, integer} messaggi}}. \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/main/resources/formats_pl.properties b/core-java-modules/core-java-8-2/src/main/resources/formats_pl.properties deleted file mode 100644 index 9333ec3396..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/formats_pl.properties +++ /dev/null @@ -1,2 +0,0 @@ -label=W {0, date, short} {1}{2, choice, 0# nie|0<} wys\u0142a\u0142a ci {2, choice, 0#\u017Cadnych wiadomo\u015Bci|1#wiadomo\u015B\u0107|2#dwie wiadomo\u015Bci|2<{2, number, integer} wiadomo\u015Bci}. -label-icu={0} {2, plural, =0 {nie } other {}}{1, select, male {wys\u0142a\u0142} female {wys\u0142a\u0142a} other {wys\u0142a\u0142o}} ci {2, plural, =0 {\u017Cadnej wiadomo\u015Bci} =1 {wiadomo\u015B\u0107} other {{2, number, integer} wiadomo\u015Bci}}. diff --git a/core-java-modules/core-java-8-2/src/main/resources/messages_en.properties b/core-java-modules/core-java-8-2/src/main/resources/messages_en.properties deleted file mode 100644 index bcbca9483c..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/messages_en.properties +++ /dev/null @@ -1 +0,0 @@ -label=Alice has sent you a message. diff --git a/core-java-modules/core-java-8-2/src/main/resources/messages_fr.properties b/core-java-modules/core-java-8-2/src/main/resources/messages_fr.properties deleted file mode 100644 index 6716102568..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/messages_fr.properties +++ /dev/null @@ -1 +0,0 @@ -label=Alice vous a envoy un message. \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/main/resources/messages_it.properties b/core-java-modules/core-java-8-2/src/main/resources/messages_it.properties deleted file mode 100644 index 6929a8c091..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/messages_it.properties +++ /dev/null @@ -1 +0,0 @@ -label=Alice ti ha inviato un messaggio. \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/main/resources/messages_pl.properties b/core-java-modules/core-java-8-2/src/main/resources/messages_pl.properties deleted file mode 100644 index 5515a9920e..0000000000 --- a/core-java-modules/core-java-8-2/src/main/resources/messages_pl.properties +++ /dev/null @@ -1 +0,0 @@ -label=Alice wys\u0142a\u0142a ci wiadomo\u015B\u0107. \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java b/core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java deleted file mode 100644 index 0ae59d9f77..0000000000 --- a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.baeldung.bifunction; - -import org.junit.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.function.BiFunction; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.assertj.core.api.Assertions.assertThat; - -public class BiFunctionalInterfacesUnitTest { - @Test - public void givenStreamValues_whenMappedToNewValues() { - List mapped = Stream.of("hello", "world") - .map(word -> word + "!") - .collect(Collectors.toList()); - - assertThat(mapped).containsExactly("hello!", "world!"); - } - - @Test - public void givenStreamValues_whenReducedWithPrefixingOperation() { - String result = Stream.of("hello", "world") - .reduce("", (a, b) -> b + "-" + a); - - assertThat(result).isEqualTo("world-hello-"); - } - - @Test - public void givenStreamValues_whenReducedWithPrefixingLambda_thenHasNoTrailingDash() { - String result = Stream.of("hello", "world") - .reduce("", (a, b) -> combineWithoutTrailingDash(a, b)); - - assertThat(result).isEqualTo("world-hello"); - } - - private String combineWithoutTrailingDash(String a, String b) { - if (a.isEmpty()) { - return b; - } - return b + "-" + a; - } - - @Test - public void givenStreamValues_whenReducedWithPrefixingMethodReference_thenHasNoTrailingDash() { - String result = Stream.of("hello", "world") - .reduce("", this::combineWithoutTrailingDash); - - assertThat(result).isEqualTo("world-hello"); - } - - @Test - public void givenTwoLists_whenCombined() { - List list1 = Arrays.asList("a", "b", "c"); - List list2 = Arrays.asList(1, 2, 3); - - List result = new ArrayList<>(); - for (int i=0; i < list1.size(); i++) { - result.add(list1.get(i) + list2.get(i)); - } - - assertThat(result).containsExactly("a1", "b2", "c3"); - } - - @Test - public void givenTwoLists_whenCombinedWithGeneralPurposeCombiner() { - List list1 = Arrays.asList("a", "b", "c"); - List list2 = Arrays.asList(1, 2, 3); - - List result = listCombiner(list1, list2, (letter, number) -> letter + number); - - assertThat(result).containsExactly("a1", "b2", "c3"); - } - - private static List listCombiner(List list1, - List list2, - BiFunction combiner) { - List result = new ArrayList<>(); - for (int i = 0; i < list1.size(); i++) { - result.add(combiner.apply(list1.get(i), list2.get(i))); - } - return result; - } - - @Test - public void givenTwoLists_whenComparedWithCombiningFunction() { - List list1 = Arrays.asList(1.0d, 2.1d, 3.3d); - List list2 = Arrays.asList(0.1f, 0.2f, 4f); - - // algorithm to determine if the value in list1 > value in list 2 - List result = listCombiner(list1, list2, (doubleNumber, floatNumber) -> doubleNumber > floatNumber); - - assertThat(result).containsExactly(true, true, false); - } - - @Test - public void givenTwoLists_whenComparedWithCombiningFunctionByMethodReference() { - List list1 = Arrays.asList(1.0d, 2.1d, 3.3d); - List list2 = Arrays.asList(0.1f, 0.2f, 4f); - - // algorithm to determine if the value in list1 > value in list 2 - List result = listCombiner(list1, list2, this::firstIsGreaterThanSecond); - - assertThat(result).containsExactly(true, true, false); - } - - private boolean firstIsGreaterThanSecond(Double a, Float b) { - return a > b; - } - - @Test - public void givenTwoLists_whenComparedForEqualityByCombiningFunction() { - List list1 = Arrays.asList(0.1f, 0.2f, 4f); - List list2 = Arrays.asList(0.1f, 0.2f, 4f); - - List result = listCombiner(list1, list2, (float1, float2) -> float1.equals(float2)); - - assertThat(result).containsExactly(true, true, true); - } - - @Test - public void givenTwoLists_whenComparedForEqualityByCombiningFunctionWithMethodReference() { - List list1 = Arrays.asList(0.1f, 0.2f, 4f); - List list2 = Arrays.asList(0.1f, 0.2f, 4f); - - List result = listCombiner(list1, list2, Float::equals); - - assertThat(result).containsExactly(true, true, true); - } - - @Test - public void givenTwoLists_whenComparedWithCombiningFunctionWithCompareTo() { - List list1 = Arrays.asList(1.0d, 2.1d, 3.3d); - List list2 = Arrays.asList(0.1d, 0.2d, 4d); - - List result = listCombiner(list1, list2, Double::compareTo); - - assertThat(result).containsExactly(1, 1, -1); - } - - /** - * Allows you to to pass in a lambda or method reference and then - * get access to the BiFunction it is meant to become - */ - private static BiFunction asBiFunction(BiFunction function) { - return function; - } - - @Test - public void givenTwoLists_whenComparedWithCombiningFunctionWithComposedBiFunction() { - List list1 = Arrays.asList(1.0d, 2.1d, 3.3d); - List list2 = Arrays.asList(0.1d, 0.2d, 4d); - - List result = listCombiner(list1, list2, - asBiFunction(Double::compareTo) - .andThen(i -> i > 0)); - - assertThat(result).containsExactly(true, true, false); - } -} diff --git a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/interfaceVsAbstractClass/InterfaceVsAbstractClassUnitTest.java b/core-java-modules/core-java-8-2/src/test/java/com/baeldung/interfaceVsAbstractClass/InterfaceVsAbstractClassUnitTest.java deleted file mode 100644 index 8cba13ddeb..0000000000 --- a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/interfaceVsAbstractClass/InterfaceVsAbstractClassUnitTest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.baeldung.interfaceVsAbstractClass; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -public class InterfaceVsAbstractClassUnitTest { - @Test - public void givenAbstractClass_whenValidCircleUsed_thenPass() { - CircleClass redCircle = new ChildCircleClass(); - redCircle.setColor("RED"); - assertTrue(redCircle.isValid()); - } - - @Test - public void givenInterface_whenValidCircleWithoutStateUsed_thenPass() { - ChidlCircleInterfaceImpl redCircleWithoutState = new ChidlCircleInterfaceImpl(); - redCircleWithoutState.setColor("RED"); - assertTrue(redCircleWithoutState.isValid()); - } -} diff --git a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java b/core-java-modules/core-java-8-2/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java deleted file mode 100644 index 2c8f9b47f3..0000000000 --- a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/localization/ICUFormatUnitTest.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.baeldung.localization; - -import static org.junit.Assert.assertEquals; - -import java.util.Locale; - -import org.junit.Test; - -import com.baeldung.localization.ICUFormat; - -public class ICUFormatUnitTest { - - @Test - public void givenInUK_whenAliceSendsNothing_thenCorrectMessage() { - assertEquals("Alice has sent you no messages.", ICUFormat.getLabel(Locale.UK, new Object[] { "Alice", "female", 0 })); - } - - @Test - public void givenInUK_whenAliceSendsOneMessage_thenCorrectMessage() { - assertEquals("Alice has sent you a message.", ICUFormat.getLabel(Locale.UK, new Object[] { "Alice", "female", 1 })); - } - - @Test - public void givenInUK_whenBobSendsSixMessages_thenCorrectMessage() { - assertEquals("Bob has sent you 6 messages.", ICUFormat.getLabel(Locale.UK, new Object[] { "Bob", "male", 6 })); - } - - @Test - public void givenInItaly_whenAliceSendsNothing_thenCorrectMessage() { - assertEquals("Alice non ti ha inviato nessun messaggio.", ICUFormat.getLabel(Locale.ITALY, new Object[] { "Alice", "female", 0 })); - } - - @Test - public void givenInItaly_whenAliceSendsOneMessage_thenCorrectMessage() { - assertEquals("Alice ti ha inviato un messaggio.", ICUFormat.getLabel(Locale.ITALY, new Object[] { "Alice", "female", 1 })); - } - - @Test - public void givenInItaly_whenBobSendsSixMessages_thenCorrectMessage() { - assertEquals("Bob ti ha inviato 6 messaggi.", ICUFormat.getLabel(Locale.ITALY, new Object[] { "Bob", "male", 6 })); - } - - @Test - public void givenInFrance_whenAliceSendsNothing_thenCorrectMessage() { - assertEquals("Alice ne vous a envoyé aucun message.", ICUFormat.getLabel(Locale.FRANCE, new Object[] { "Alice", "female", 0 })); - } - - @Test - public void givenInFrance_whenAliceSendsOneMessage_thenCorrectMessage() { - assertEquals("Alice vous a envoyé un message.", ICUFormat.getLabel(Locale.FRANCE, new Object[] { "Alice", "female", 1 })); - } - - @Test - public void givenInFrance_whenBobSendsSixMessages_thenCorrectMessage() { - assertEquals("Bob vous a envoyé 6 messages.", ICUFormat.getLabel(Locale.FRANCE, new Object[] { "Bob", "male", 6 })); - } - - - @Test - public void givenInPoland_whenAliceSendsNothing_thenCorrectMessage() { - assertEquals("Alice nie wysłała ci żadnej wiadomości.", ICUFormat.getLabel(Locale.forLanguageTag("pl-PL"), new Object[] { "Alice", "female", 0 })); - } - - @Test - public void givenInPoland_whenAliceSendsOneMessage_thenCorrectMessage() { - assertEquals("Alice wysłała ci wiadomość.", ICUFormat.getLabel(Locale.forLanguageTag("pl-PL"), new Object[] { "Alice", "female", 1 })); - } - - @Test - public void givenInPoland_whenBobSendsSixMessages_thenCorrectMessage() { - assertEquals("Bob wysłał ci 6 wiadomości.", ICUFormat.getLabel(Locale.forLanguageTag("pl-PL"), new Object[] { "Bob", "male", 6 })); - } - -} diff --git a/core-java-modules/core-java-8/README.md b/core-java-modules/core-java-8/README.md index 690997caa8..6a160683a1 100644 --- a/core-java-modules/core-java-8/README.md +++ b/core-java-modules/core-java-8/README.md @@ -18,4 +18,7 @@ - [Interface With Default Methods vs Abstract Class](https://www.baeldung.com/java-interface-default-method-vs-abstract-class) - [Convert Between Byte Array and UUID in Java](https://www.baeldung.com/java-byte-array-to-uuid) - [Create a Simple “Rock-Paper-Scissors” Game in Java](https://www.baeldung.com/java-rock-paper-scissors) +- [VarArgs vs Array Input Parameters in Java](https://www.baeldung.com/varargs-vs-array) +- [Lambda Expression vs. Anonymous Inner Class](https://www.baeldung.com/java-lambdas-vs-anonymous-class) +- [Java Helper vs. Utility Classes](https://www.baeldung.com/java-helper-vs-utility-classes) - [Java 8 开始新增的 Optional 类](https://www.ossez.com/t/java-8-optional/13964) \ No newline at end of file diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/anonymousclass/AnonymousClassExample.java b/core-java-modules/core-java-8/src/main/java/com/ossez/anonymousclass/AnonymousClassExample.java similarity index 89% rename from core-java-modules/core-java-8-2/src/main/java/com/baeldung/anonymousclass/AnonymousClassExample.java rename to core-java-modules/core-java-8/src/main/java/com/ossez/anonymousclass/AnonymousClassExample.java index 1ea85942ee..f029bbb963 100644 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/anonymousclass/AnonymousClassExample.java +++ b/core-java-modules/core-java-8/src/main/java/com/ossez/anonymousclass/AnonymousClassExample.java @@ -1,4 +1,4 @@ -package com.baeldung.anonymousclass; +package com.ossez.anonymousclass; public class AnonymousClassExample{ diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/argsVsvarargs/StringArrayAndVarargs.java b/core-java-modules/core-java-8/src/main/java/com/ossez/argsVsvarargs/StringArrayAndVarargs.java similarity index 93% rename from core-java-modules/core-java-8-2/src/main/java/com/baeldung/argsVsvarargs/StringArrayAndVarargs.java rename to core-java-modules/core-java-8/src/main/java/com/ossez/argsVsvarargs/StringArrayAndVarargs.java index dc9137646f..1a8ed48021 100644 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/argsVsvarargs/StringArrayAndVarargs.java +++ b/core-java-modules/core-java-8/src/main/java/com/ossez/argsVsvarargs/StringArrayAndVarargs.java @@ -1,4 +1,4 @@ -package com.baeldung.argsVsvarargs; +package com.ossez.argsVsvarargs; public class StringArrayAndVarargs { public static void capitalizeNames(String[] args) { diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/helpervsutilityclasses/MyHelperClass.java b/core-java-modules/core-java-8/src/main/java/com/ossez/helpervsutilityclasses/MyHelperClass.java similarity index 95% rename from core-java-modules/core-java-8-2/src/main/java/com/baeldung/helpervsutilityclasses/MyHelperClass.java rename to core-java-modules/core-java-8/src/main/java/com/ossez/helpervsutilityclasses/MyHelperClass.java index 40b58bf200..3c5b3c20aa 100644 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/helpervsutilityclasses/MyHelperClass.java +++ b/core-java-modules/core-java-8/src/main/java/com/ossez/helpervsutilityclasses/MyHelperClass.java @@ -1,4 +1,4 @@ -package com.baeldung.helpervsutilityclasses; +package com.ossez.helpervsutilityclasses; class MyHelperClass { public double discount; diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/helpervsutilityclasses/MyUtilityClass.java b/core-java-modules/core-java-8/src/main/java/com/ossez/helpervsutilityclasses/MyUtilityClass.java similarity index 90% rename from core-java-modules/core-java-8-2/src/main/java/com/baeldung/helpervsutilityclasses/MyUtilityClass.java rename to core-java-modules/core-java-8/src/main/java/com/ossez/helpervsutilityclasses/MyUtilityClass.java index 1f0075995c..f846aef885 100644 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/helpervsutilityclasses/MyUtilityClass.java +++ b/core-java-modules/core-java-8/src/main/java/com/ossez/helpervsutilityclasses/MyUtilityClass.java @@ -1,4 +1,4 @@ -package com.baeldung.helpervsutilityclasses; +package com.ossez.helpervsutilityclasses; public final class MyUtilityClass { diff --git a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/lambdaexpression/LambdaExpressionExample.java b/core-java-modules/core-java-8/src/main/java/com/ossez/lambdaexpression/LambdaExpressionExample.java similarity index 85% rename from core-java-modules/core-java-8-2/src/main/java/com/baeldung/lambdaexpression/LambdaExpressionExample.java rename to core-java-modules/core-java-8/src/main/java/com/ossez/lambdaexpression/LambdaExpressionExample.java index 95128b934c..daca78512a 100644 --- a/core-java-modules/core-java-8-2/src/main/java/com/baeldung/lambdaexpression/LambdaExpressionExample.java +++ b/core-java-modules/core-java-8/src/main/java/com/ossez/lambdaexpression/LambdaExpressionExample.java @@ -1,4 +1,4 @@ -package com.baeldung.lambdaexpression; +package com.ossez.lambdaexpression; public class LambdaExpressionExample{ diff --git a/core-java-modules/core-java-8/src/main/java/com/ossez/localization/App.java b/core-java-modules/core-java-8/src/main/java/com/ossez/localization/App.java index f1fee46776..bf99289272 100644 --- a/core-java-modules/core-java-8/src/main/java/com/ossez/localization/App.java +++ b/core-java-modules/core-java-8/src/main/java/com/ossez/localization/App.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Locale; public class App { + /** * Runs all available formatter * diff --git a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/argsVsvarargs/StringArrayAndVarargsUnitTest.java b/core-java-modules/core-java-8/src/test/java/com/ossez/argsVsvarargs/StringArrayAndVarargsUnitTest.java similarity index 77% rename from core-java-modules/core-java-8-2/src/test/java/com/baeldung/argsVsvarargs/StringArrayAndVarargsUnitTest.java rename to core-java-modules/core-java-8/src/test/java/com/ossez/argsVsvarargs/StringArrayAndVarargsUnitTest.java index f917373229..8521f70250 100644 --- a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/argsVsvarargs/StringArrayAndVarargsUnitTest.java +++ b/core-java-modules/core-java-8/src/test/java/com/ossez/argsVsvarargs/StringArrayAndVarargsUnitTest.java @@ -1,7 +1,7 @@ -package com.baeldung.argsVsvarargs; +package com.ossez.argsVsvarargs; -import static com.baeldung.argsVsvarargs.StringArrayAndVarargs.capitalizeNames; -import static com.baeldung.argsVsvarargs.StringArrayAndVarargs.firstLetterOfWords; +import static com.ossez.argsVsvarargs.StringArrayAndVarargs.capitalizeNames; +import static com.ossez.argsVsvarargs.StringArrayAndVarargs.firstLetterOfWords; import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; diff --git a/core-java-modules/core-java-8/src/test/java/com/ossez/bifunction/BiFunctionalInterfacesUnitTest.java b/core-java-modules/core-java-8/src/test/java/com/ossez/bifunction/BiFunctionalInterfacesUnitTest.java index c20fcdf5a4..eae9a66b39 100644 --- a/core-java-modules/core-java-8/src/test/java/com/ossez/bifunction/BiFunctionalInterfacesUnitTest.java +++ b/core-java-modules/core-java-8/src/test/java/com/ossez/bifunction/BiFunctionalInterfacesUnitTest.java @@ -4,7 +4,6 @@ import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; -import java.util.Comparator; import java.util.List; import java.util.function.BiFunction; import java.util.stream.Collectors; @@ -71,7 +70,7 @@ public class BiFunctionalInterfacesUnitTest { List list1 = Arrays.asList("a", "b", "c"); List list2 = Arrays.asList(1, 2, 3); - List result = listCombiner(list1, list2, (a, b) -> a + b); + List result = listCombiner(list1, list2, (letter, number) -> letter + number); assertThat(result).containsExactly("a1", "b2", "c3"); } @@ -92,7 +91,7 @@ public class BiFunctionalInterfacesUnitTest { List list2 = Arrays.asList(0.1f, 0.2f, 4f); // algorithm to determine if the value in list1 > value in list 2 - List result = listCombiner(list1, list2, (a, b) -> a > b); + List result = listCombiner(list1, list2, (doubleNumber, floatNumber) -> doubleNumber > floatNumber); assertThat(result).containsExactly(true, true, false); } @@ -117,7 +116,7 @@ public class BiFunctionalInterfacesUnitTest { List list1 = Arrays.asList(0.1f, 0.2f, 4f); List list2 = Arrays.asList(0.1f, 0.2f, 4f); - List result = listCombiner(list1, list2, (a, b) -> a.equals(b)); + List result = listCombiner(list1, list2, (float1, float2) -> float1.equals(float2)); assertThat(result).containsExactly(true, true, true); } diff --git a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/helpervsutilityclasses/MyHelperClassUnitTest.java b/core-java-modules/core-java-8/src/test/java/com/ossez/helpervsutilityclasses/MyHelperClassUnitTest.java similarity index 92% rename from core-java-modules/core-java-8-2/src/test/java/com/baeldung/helpervsutilityclasses/MyHelperClassUnitTest.java rename to core-java-modules/core-java-8/src/test/java/com/ossez/helpervsutilityclasses/MyHelperClassUnitTest.java index a0c1afea52..52c37a2a75 100644 --- a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/helpervsutilityclasses/MyHelperClassUnitTest.java +++ b/core-java-modules/core-java-8/src/test/java/com/ossez/helpervsutilityclasses/MyHelperClassUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.helpervsutilityclasses; +package com.ossez.helpervsutilityclasses; import static org.junit.jupiter.api.Assertions.*; diff --git a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/helpervsutilityclasses/MyUtilityClassUnitTest.java b/core-java-modules/core-java-8/src/test/java/com/ossez/helpervsutilityclasses/MyUtilityClassUnitTest.java similarity index 88% rename from core-java-modules/core-java-8-2/src/test/java/com/baeldung/helpervsutilityclasses/MyUtilityClassUnitTest.java rename to core-java-modules/core-java-8/src/test/java/com/ossez/helpervsutilityclasses/MyUtilityClassUnitTest.java index 8b29f51959..2f06b3652d 100644 --- a/core-java-modules/core-java-8-2/src/test/java/com/baeldung/helpervsutilityclasses/MyUtilityClassUnitTest.java +++ b/core-java-modules/core-java-8/src/test/java/com/ossez/helpervsutilityclasses/MyUtilityClassUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.helpervsutilityclasses; +package com.ossez.helpervsutilityclasses; import static org.junit.jupiter.api.Assertions.*; diff --git a/core-java-modules/core-java-8/src/test/java/com/ossez/localization/ICUFormatUnitTest.java b/core-java-modules/core-java-8/src/test/java/com/ossez/localization/ICUFormatUnitTest.java index 3aef525e91..33ace5deeb 100644 --- a/core-java-modules/core-java-8/src/test/java/com/ossez/localization/ICUFormatUnitTest.java +++ b/core-java-modules/core-java-8/src/test/java/com/ossez/localization/ICUFormatUnitTest.java @@ -6,6 +6,8 @@ import java.util.Locale; import org.junit.Test; +import com.ossez.localization.ICUFormat; + public class ICUFormatUnitTest { @Test diff --git a/core-java-modules/core-java-collections-list-2/pom.xml b/core-java-modules/core-java-collections-list-2/pom.xml index 2b3c00601e..574c761ad5 100644 --- a/core-java-modules/core-java-collections-list-2/pom.xml +++ b/core-java-modules/core-java-collections-list-2/pom.xml @@ -8,9 +8,9 @@ core-java-collections-list-2 - com.baeldung.core-java-modules + com.ossez.core-java-modules core-java-modules - 0.0.1-SNAPSHOT + 0.0.2-SNAPSHOT diff --git a/core-java-modules/core-java-numbers/pom.xml b/core-java-modules/core-java-numbers/pom.xml index debc90638e..2bb6060e9b 100644 --- a/core-java-modules/core-java-numbers/pom.xml +++ b/core-java-modules/core-java-numbers/pom.xml @@ -8,9 +8,9 @@ core-java-numbers - com.baeldung.core-java-modules + com.ossez.core-java-modules core-java-modules - 0.0.1-SNAPSHOT + 0.0.2-SNAPSHOT diff --git a/persistence-modules/spring-data-jpa-repo-2/pom.xml b/persistence-modules/spring-data-jpa-repo-2/pom.xml index aac12db474..a32cc1e888 100644 --- a/persistence-modules/spring-data-jpa-repo-2/pom.xml +++ b/persistence-modules/spring-data-jpa-repo-2/pom.xml @@ -42,7 +42,7 @@ com.google.guava guava - ${version.guava} + ${guava.version} diff --git a/persistence-modules/spring-data-jpa-repo/pom.xml b/persistence-modules/spring-data-jpa-repo/pom.xml index 2ead30e7da..5e114ba565 100644 --- a/persistence-modules/spring-data-jpa-repo/pom.xml +++ b/persistence-modules/spring-data-jpa-repo/pom.xml @@ -7,7 +7,7 @@ spring-data-jpa-repo - com.baeldung + com.ossez parent-boot-3 0.0.1-SNAPSHOT ../../parent-boot-3 diff --git a/pom.xml b/pom.xml index 75bae43378..02ec984661 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ 3.0.0 - 31.1-jre + 31.1-jre 1.18.28 2.12.5 1.2.0 From 74b06e2df2ff31b993d5f6caa277dfe1466f550c Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Wed, 1 May 2024 12:13:19 -0400 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/checkstyle-idea.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .idea/checkstyle-idea.xml diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000000..b767a3113c --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + 10.14.2 + JavaOnly + true + + + \ No newline at end of file