diff --git a/jetbrains/README.md b/jetbrains/README.md
new file mode 100644
index 0000000000..a63d4dffba
--- /dev/null
+++ b/jetbrains/README.md
@@ -0,0 +1,5 @@
+## Jetbrains
+
+This module contains articles about Jetbrains' libraries.
+
+### Relevant articles:
diff --git a/jetbrains/pom.xml b/jetbrains/pom.xml
new file mode 100644
index 0000000000..a10fd3b913
--- /dev/null
+++ b/jetbrains/pom.xml
@@ -0,0 +1,37 @@
+
+
+ 4.0.0
+ jetbrains
+ 1.0-SNAPSHOT
+ jetbrains
+ jar
+ http://maven.apache.org
+
+
+ com.baeldung
+ parent-java
+ 0.0.1-SNAPSHOT
+ ../parent-java
+
+
+
+
+ org.apache.commons
+ commons-lang3
+ ${apache.commons.version}
+
+
+ org.jetbrains
+ annotations
+ ${jetbrains.annotations.version}
+
+
+
+
+ 3.12.0
+ 24.0.1
+
+
+
\ No newline at end of file
diff --git a/jetbrains/src/main/java/com/baeldung/annotations/Demo.java b/jetbrains/src/main/java/com/baeldung/annotations/Demo.java
new file mode 100644
index 0000000000..3638d13581
--- /dev/null
+++ b/jetbrains/src/main/java/com/baeldung/annotations/Demo.java
@@ -0,0 +1,112 @@
+package com.baeldung.annotations;
+
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.jetbrains.annotations.Contract;
+
+public class Demo {
+
+ @Contract("_ -> new")
+ Person fromName(String name) {
+ return new Person().withName(name);
+ }
+
+ @Contract(" -> fail")
+ void alwaysFail() {
+ throw new RuntimeException();
+ }
+
+ @Contract(" -> fail")
+ void doNothingWithWrongContract() {
+
+ }
+
+ @Contract("_, null -> null; null, _ -> param2; _, !null -> !null")
+ String concatenateOnlyIfSecondArgumentIsNotNull(String head, String tail) {
+ if (tail == null) {
+ return null;
+ }
+ if (head == null) {
+ return tail;
+ }
+ return head + tail;
+ }
+
+ void uselessNullCheck() {
+ String head = "1234";
+ String tail = "5678";
+ String concatenation = concatenateOnlyIfSecondArgumentIsNotNull(head, tail);
+ if (concatenation != null) {
+ System.out.println(concatenation);
+ }
+ }
+
+ void uselessNullCheckOnInferredAnnotation() {
+ if (StringUtils.isEmpty(null)) {
+ System.out.println("baeldung");
+ }
+ }
+
+ @Contract(pure = true)
+ String replace(String string, char oldChar, char newChar) {
+ return string.replace(oldChar, newChar);
+ }
+
+ @Contract(value = "true -> false; false -> true", pure = true)
+ boolean not(boolean input) {
+ return !input;
+ }
+
+ @Contract("true -> new")
+ void contractExpectsWrongParameterType(List integers) {
+
+ }
+
+ @Contract("_, _ -> new")
+ void contractExpectsMoreParametersThanMethodHas(String s) {
+
+ }
+
+ @Contract("_ -> _; null -> !null")
+ String secondContractClauseNotReachable(String s) {
+ return "";
+ }
+
+ @Contract("_ -> true")
+ void contractExpectsWrongReturnType(String s) {
+
+ }
+
+ // NB: the following examples demonstrate how to use the mutates attribute of the annotation
+ // This attribute is currently experimental and could be changed or removed in the future
+ @Contract(mutates = "param")
+ void incrementArrayFirstElement(Integer[] integers) {
+ if (integers.length > 0) {
+ integers[0] = integers[0] + 1;
+ }
+ }
+
+ @Contract(pure = true, mutates = "param")
+ void impossibleToMutateParamInPureFunction(List strings) {
+ if (strings != null) {
+ strings.forEach(System.out::println);
+ }
+ }
+
+ @Contract(mutates = "param3")
+ void impossibleToMutateThirdParamWhenMethodHasOnlyTwoParams(int a, int b) {
+
+ }
+
+ @Contract(mutates = "param")
+ void impossibleToMutableImmutableType(String s) {
+
+ }
+
+ @Contract(mutates = "this")
+ static void impossibleToMutateThisInStaticMethod() {
+
+ }
+
+}
diff --git a/jetbrains/src/main/java/com/baeldung/annotations/Person.java b/jetbrains/src/main/java/com/baeldung/annotations/Person.java
new file mode 100644
index 0000000000..086b73b47f
--- /dev/null
+++ b/jetbrains/src/main/java/com/baeldung/annotations/Person.java
@@ -0,0 +1,15 @@
+package com.baeldung.annotations;
+
+import org.jetbrains.annotations.Contract;
+
+public class Person {
+
+ String name;
+
+ @Contract("_ -> this")
+ Person withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+}
diff --git a/pom.xml b/pom.xml
index b349c49f9e..0f024d2d3e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -352,6 +352,7 @@
java-jdi
java-websocket
+ jetbrains
jhipster-5
jmh
@@ -730,7 +731,7 @@
spring-boot-modules/spring-boot-react
spring-ejb-modules/ejb-beans
vaadin
- vavr-modules
+ vavr-modules
@@ -934,7 +935,6 @@
asm
atomikos
atomix
-
bazel
code-generation