diff --git a/core-java-modules/core-java-11-2/README.md b/core-java-modules/core-java-11-2/README.md index c87936b07d..ca9a306b82 100644 --- a/core-java-modules/core-java-11-2/README.md +++ b/core-java-modules/core-java-11-2/README.md @@ -7,3 +7,4 @@ This module contains articles about Java 11 core features - [Guide to Java Reflection](http://www.baeldung.com/java-reflection) - [Guide to Java 8’s Collectors](https://www.baeldung.com/java-8-collectors) - [New Features in Java 11](https://www.baeldung.com/java-11-new-features) +- [Getting the Java Version at Runtime](https://www.baeldung.com/get-java-version-runtime) diff --git a/core-java-modules/core-java-lang-4/README.md b/core-java-modules/core-java-lang-4/README.md index 8b8dff4bd1..e1023513eb 100644 --- a/core-java-modules/core-java-lang-4/README.md +++ b/core-java-modules/core-java-lang-4/README.md @@ -5,3 +5,4 @@ This module contains articles about core features in the Java language - [The Java final Keyword – Impact on Performance](https://www.baeldung.com/java-final-performance) - [The package-info.java File](https://www.baeldung.com/java-package-info) - [What are Compile-time Constants in Java?](https://www.baeldung.com/java-compile-time-constants) +- [Java Objects.hash() vs Objects.hashCode()](https://www.baeldung.com/java-objects-hash-vs-objects-hashcode) diff --git a/core-java-modules/core-java-lang-oop-patterns/README.md b/core-java-modules/core-java-lang-oop-patterns/README.md index 178a556a96..df68a1413a 100644 --- a/core-java-modules/core-java-lang-oop-patterns/README.md +++ b/core-java-modules/core-java-lang-oop-patterns/README.md @@ -7,3 +7,4 @@ This module contains articles about Object-oriented programming (OOP) patterns i - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](https://www.baeldung.com/java-inheritance-composition) - [Immutable Objects in Java](https://www.baeldung.com/java-immutable-object) - [How to Make a Deep Copy of an Object in Java](https://www.baeldung.com/java-deep-copy) +- [Using an Interface vs. Abstract Class in Java](https://www.baeldung.com/java-interface-vs-abstract-class) diff --git a/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java b/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java new file mode 100644 index 0000000000..921876c0d5 --- /dev/null +++ b/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java @@ -0,0 +1,54 @@ +package com.baeldung.ignore.pattern.metacharacters; + +import static org.junit.Assert.assertEquals; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.junit.Test; + +public class IgnoringPatternMetacharactersUnitTest { + private static final String dollarAmounts = "$100.25, $100.50, $150.50, $100.50, $100.75"; + private static final String patternStr = "$100.50"; + + @Test + public void givenPatternStringHasMetacharacters_whenPatternMatchedWithoutEscapingMetacharacters_thenNoMatchesFound() { + Pattern pattern = Pattern.compile(patternStr); + Matcher matcher = pattern.matcher(dollarAmounts); + + int matches = 0; + while (matcher.find()) { + matches++; + } + + assertEquals(0, matches); + } + + @Test + public void givenPatternStringHasMetacharacters_whenPatternCompiledUsingManuallyMetaEscapedPattern_thenMatchingSuccessful() { + String metaEscapedPatternStr = "\\Q" + patternStr + "\\E"; + Pattern pattern = Pattern.compile(metaEscapedPatternStr); + Matcher matcher = pattern.matcher(dollarAmounts); + + int matches = 0; + while (matcher.find()) { + matches++; + } + + assertEquals(2, matches); + } + + @Test + public void givenPatternStringHasMetacharacters_whenPatternCompiledUsingLiteralPatternFromQuote_thenMatchingSuccessful() { + String literalPatternStr = Pattern.quote(patternStr); + Pattern pattern = Pattern.compile(literalPatternStr); + Matcher matcher = pattern.matcher(dollarAmounts); + + int matches = 0; + while (matcher.find()) { + matches++; + } + + assertEquals(2, matches); + } +} diff --git a/core-java-modules/core-java-streams-3/README.md b/core-java-modules/core-java-streams-3/README.md index 26b4dfe975..48ebf145d2 100644 --- a/core-java-modules/core-java-streams-3/README.md +++ b/core-java-modules/core-java-streams-3/README.md @@ -12,4 +12,5 @@ This module contains articles about the Stream API in Java. - [Should We Close a Java Stream?](https://www.baeldung.com/java-stream-close) - [Returning Stream vs. Collection](https://www.baeldung.com/java-return-stream-collection) - [Convert a Java Enumeration Into a Stream](https://www.baeldung.com/java-enumeration-to-stream) +- [When to Use a Parallel Stream in Java](https://www.baeldung.com/java-when-to-use-parallel-stream) - More articles: [[<-- prev>]](/../core-java-streams-2) diff --git a/core-java-modules/core-java-string-conversions-2/README.md b/core-java-modules/core-java-string-conversions-2/README.md index afdd7e5760..3bd3ba927e 100644 --- a/core-java-modules/core-java-string-conversions-2/README.md +++ b/core-java-modules/core-java-string-conversions-2/README.md @@ -6,4 +6,5 @@ This module contains articles about string conversions from/to another type. - [Java String Conversions](https://www.baeldung.com/java-string-conversions) - [Convert String to Byte Array and Reverse in Java](https://www.baeldung.com/java-string-to-byte-array) - [Convert Character Array to String in Java](https://www.baeldung.com/java-char-array-to-string) +- [Converting String to BigDecimal in Java](https://www.baeldung.com/java-string-to-bigdecimal) - More articles: [[<-- prev]](/core-java-string-conversions) diff --git a/core-java-modules/core-java-string-operations-3/README.md b/core-java-modules/core-java-string-operations-3/README.md index bc4af852ed..ad4ada3a68 100644 --- a/core-java-modules/core-java-string-operations-3/README.md +++ b/core-java-modules/core-java-string-operations-3/README.md @@ -3,3 +3,4 @@ - [Version Comparison in Java](https://www.baeldung.com/java-comparing-versions) - [Java (String) or .toString()?](https://www.baeldung.com/java-string-casting-vs-tostring) - [Split Java String by Newline](https://www.baeldung.com/java-string-split-by-newline) +- [Split a String in Java and Keep the Delimiters](https://www.baeldung.com/java-split-string-keep-delimiters) diff --git a/maven-modules/maven-copy-files/README.md b/maven-modules/maven-copy-files/README.md new file mode 100644 index 0000000000..1e3a75cb0b --- /dev/null +++ b/maven-modules/maven-copy-files/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Copying Files With Maven](https://www.baeldung.com/maven-copy-files) diff --git a/maven-modules/maven-printing-plugins/pom.xml b/maven-modules/maven-printing-plugins/pom.xml index 6ea1ab2a84..805c3c1633 100644 --- a/maven-modules/maven-printing-plugins/pom.xml +++ b/maven-modules/maven-printing-plugins/pom.xml @@ -49,9 +49,11 @@ echo - Hello, world - Embed a line break: ${line.separator} - ArtifactId is ${project.artifactId} + + Hello, world + Embed a line break: ${line.separator} + ArtifactId is ${project.artifactId} + INFO /logs/log-echo.txt true diff --git a/persistence-modules/java-jpa-3/README.md b/persistence-modules/java-jpa-3/README.md index 9c9e040825..e607043880 100644 --- a/persistence-modules/java-jpa-3/README.md +++ b/persistence-modules/java-jpa-3/README.md @@ -10,3 +10,4 @@ This module contains articles about the Java Persistence API (JPA) in Java. - [JPA CascadeType.REMOVE vs orphanRemoval](https://www.baeldung.com/jpa-cascade-remove-vs-orphanremoval) - [A Guide to MultipleBagFetchException in Hibernate](https://www.baeldung.com/java-hibernate-multiplebagfetchexception) - [How to Convert a Hibernate Proxy to a Real Entity Object](https://www.baeldung.com/hibernate-proxy-to-real-entity-object) +- [Returning an Auto-Generated Id with JPA](https://www.baeldung.com/jpa-get-auto-generated-id) diff --git a/persistence-modules/spring-data-jpa-annotations/README.md b/persistence-modules/spring-data-jpa-annotations/README.md index 3892e75733..5a5440b1ed 100644 --- a/persistence-modules/spring-data-jpa-annotations/README.md +++ b/persistence-modules/spring-data-jpa-annotations/README.md @@ -9,6 +9,7 @@ This module contains articles about annotations used in Spring Data JPA - [Spring JPA @Embedded and @EmbeddedId](https://www.baeldung.com/spring-jpa-embedded-method-parameters) - [Programmatic Transaction Management in Spring](https://www.baeldung.com/spring-programmatic-transaction-management) - [JPA Entity Lifecycle Events](https://www.baeldung.com/jpa-entity-lifecycle-events) +- [Overriding Column Definition With @AttributeOverride](https://www.baeldung.com/jpa-attributeoverride) ### Eclipse Config After importing the project into Eclipse, you may see the following error: diff --git a/persistence-modules/spring-data-jpa-crud/README.md b/persistence-modules/spring-data-jpa-crud/README.md index dc0c78c87e..81559bb773 100644 --- a/persistence-modules/spring-data-jpa-crud/README.md +++ b/persistence-modules/spring-data-jpa-crud/README.md @@ -10,6 +10,7 @@ This module contains articles about CRUD operations in Spring Data JPA - [Batch Insert/Update with Hibernate/JPA](https://www.baeldung.com/jpa-hibernate-batch-insert-update) - [Difference Between save() and saveAndFlush() in Spring Data JPA](https://www.baeldung.com/spring-data-jpa-save-saveandflush) - [Generate Database Schema with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-generate-db-schema) +- [How to Implement a Soft Delete with Spring JPA](https://www.baeldung.com/spring-jpa-soft-delete) ### Eclipse Config After importing the project into Eclipse, you may see the following error: diff --git a/spring-boot-modules/spring-boot-cassandre/README.md b/spring-boot-modules/spring-boot-cassandre/README.md index 14ffbb7d6b..4dfef587db 100644 --- a/spring-boot-modules/spring-boot-cassandre/README.md +++ b/spring-boot-modules/spring-boot-cassandre/README.md @@ -8,4 +8,4 @@ This project is an example of a trading bot developed with Cassandre * `mvn spring-boot:run` - Run the bot ## Relevant Articles -- [Build a Trading Bot with Cassandre Spring Boot Starter](https://www.baeldung.com/build-a-trading-bot-with-cassandre-spring-boot-starter/) +- [Build a Trading Bot with Cassandre Spring Boot Starter](https://www.baeldung.com/cassandre-spring-boot-trading-bot) diff --git a/spring-boot-modules/spring-boot-mvc-3/README.md b/spring-boot-modules/spring-boot-mvc-3/README.md index bc3eb9e496..f9c6989b3c 100644 --- a/spring-boot-modules/spring-boot-mvc-3/README.md +++ b/spring-boot-modules/spring-boot-mvc-3/README.md @@ -9,4 +9,5 @@ This module contains articles about Spring Web MVC in Spring Boot projects. - [Spring MVC Async vs Spring WebFlux](https://www.baeldung.com/spring-mvc-async-vs-webflux) - [Differences in @Valid and @Validated Annotations in Spring](https://www.baeldung.com/spring-valid-vs-validated) - [CharacterEncodingFilter In SpringBoot](https://www.baeldung.com/spring-boot-characterencodingfilter) +- [HandlerInterceptors vs. Filters in Spring MVC](https://www.baeldung.com/spring-mvc-handlerinterceptor-vs-filter) - More articles: [[prev -->]](/spring-boot-modules/spring-boot-mvc-2) diff --git a/testing-modules/testing-libraries-2/README.md b/testing-modules/testing-libraries-2/README.md index f8361904b8..868d8f307d 100644 --- a/testing-modules/testing-libraries-2/README.md +++ b/testing-modules/testing-libraries-2/README.md @@ -2,3 +2,4 @@ - [Guide to the System Rules Library](https://www.baeldung.com/java-system-rules-junit) - [Guide to the System Stubs Library](https://www.baeldung.com/java-system-stubs) +- [Code Coverage with SonarQube and JaCoCo](https://www.baeldung.com/sonarqube-jacoco-code-coverage)