Merge branch 'master' of https://github.com/eugenp/tutorials into BAEL-3860

This commit is contained in:
mthomas 2020-03-28 04:59:27 -05:00
commit 46b732527b
35 changed files with 110 additions and 48 deletions

View File

@ -19,4 +19,5 @@ This module contains articles about algorithms. Some classes of algorithms, e.g.
- [Balanced Brackets Algorithm in Java](https://www.baeldung.com/java-balanced-brackets-algorithm)
- [Efficiently Merge Sorted Java Sequences](https://www.baeldung.com/java-merge-sorted-sequences)
- [Introduction to Greedy Algorithms with Java](https://www.baeldung.com/java-greedy-algorithms)
- [The Caesar Cipher in Java](https://www.baeldung.com/java-caesar-cipher)
- More articles: [[<-- prev]](/../algorithms-miscellaneous-4)

View File

@ -1,3 +0,0 @@
### Relevant Articles:
- [Building Java Applications with Bazel](https://www.baeldung.com/bazel-build-tool)

View File

@ -10,6 +10,3 @@ This module contains articles about Java 9 core features
- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap)
- [Immutable Set in Java](https://www.baeldung.com/java-immutable-set)
- [Immutable ArrayList in Java](https://www.baeldung.com/java-immutable-list)
Note: also contains part of the code for the article
[How to Filter a Collection in Java](https://www.baeldung.com/java-collection-filtering).

View File

@ -10,7 +10,6 @@ This module contains articles about Java arrays
- [Multi-Dimensional Arrays In Java](https://www.baeldung.com/java-jagged-arrays)
- [Find Sum and Average in a Java Array](https://www.baeldung.com/java-array-sum-average)
- [Arrays in Java: A Reference Guide](https://www.baeldung.com/java-arrays-guide)
- [Read and Write User Input in Java](https://www.baeldung.com/java-console-input-output)
- [How to Reverse an Array in Java](http://www.baeldung.com/java-invert-array)
- [Sorting Arrays in Java](https://www.baeldung.com/java-sorting-arrays)
- [Checking If an Array Is Sorted in Java](https://www.baeldung.com/java-check-sorted-array)

View File

@ -12,7 +12,6 @@ This module contains articles about Object-oriented programming (OOP) in Java
- [Immutable Objects in Java](https://www.baeldung.com/java-immutable-object)
- [Inheritance and Composition (Is-a vs Has-a relationship) in Java](https://www.baeldung.com/java-inheritance-composition)
- [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors)
- [Composition, Aggregation, and Association in Java](https://www.baeldung.com/java-composition-aggregation-association)
- [Static and Default Methods in Interfaces in Java](https://www.baeldung.com/java-static-default-methods)
- [Java Copy Constructor](https://www.baeldung.com/java-copy-constructor)
- [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class)

View File

@ -5,12 +5,9 @@ This module contains articles about Java syntax
### Relevant Articles:
- [The Basics of Java Generics](https://www.baeldung.com/java-generics)
- [Java Primitive Conversions](https://www.baeldung.com/java-primitive-conversions)
- [The Java continue and break Keywords](https://www.baeldung.com/java-continue-and-break)
- [A Guide to Creating Objects in Java](https://www.baeldung.com/java-initialization)
- [A Guide to Java Loops](https://www.baeldung.com/java-loops)
- [Varargs in Java](https://www.baeldung.com/java-varargs)
- [A Guide to Java Enums](https://www.baeldung.com/a-guide-to-java-enums)
- [Infinite Loops in Java](https://www.baeldung.com/infinite-loops-java)
- [Java Switch Statement](https://www.baeldung.com/java-switch)
- [Breaking Out of Nested Loops](https://www.baeldung.com/java-breaking-out-nested-loop)
- [Java Do-While Loop](https://www.baeldung.com/java-do-while-loop)

View File

@ -13,7 +13,4 @@ This module contains articles about numbers in Java.
- [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers)
- [Finding the Least Common Multiple in Java](https://www.baeldung.com/java-least-common-multiple)
- [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers)
- [Generating Random Numbers in a Range in Java](https://www.baeldung.com/java-generating-random-numbers-in-range)
- [Listing Numbers Within a Range in Java](https://www.baeldung.com/java-listing-numbers-within-a-range)
- [Fibonacci Series in Java](https://www.baeldung.com/java-fibonacci)
- More articles: [[<-- prev]](/../java-numbers)
- More articles: [[<-- prev]](/java-numbers) [[next -->]](/java-numbers-3)

View File

@ -1,5 +1,13 @@
## Java Number Cookbooks and Examples
This module contains articles about numbers in Java.
### Relevant Articles:
- [Generating Random Numbers](https://www.baeldung.com/java-generating-random-numbers)
- [Convert Double to Long in Java](https://www.baeldung.com/java-convert-double-long)
- [Check for null Before Calling Parse in Double.parseDouble](https://www.baeldung.com/java-check-null-parse-double)
- [Generating Random Numbers in a Range in Java](https://www.baeldung.com/java-generating-random-numbers-in-range)
- [Listing Numbers Within a Range in Java](https://www.baeldung.com/java-listing-numbers-within-a-range)
- [Fibonacci Series in Java](https://www.baeldung.com/java-fibonacci)
- More articles: [[<-- prev]](/java-numbers-2)

View File

@ -1,7 +1,5 @@
package com.baeldung.fibonacci;
import static java.lang.Math.pow;
public class FibonacciSeriesUtils {
public static int nthFibonacciTermRecursiveMethod(int n) {

View File

@ -8,7 +8,6 @@ This module contains articles about numbers in Java.
- [BigDecimal and BigInteger in Java](http://www.baeldung.com/java-bigdecimal-biginteger)
- [Find All Pairs of Numbers in an Array That Add Up to a Given Sum](http://www.baeldung.com/java-algorithm-number-pairs-sum)
- [Java Random Long, Float, Integer and Double](http://www.baeldung.com/java-generate-random-long-float-integer-double)
- [Using Math.sin with Degrees](https://www.baeldung.com/java-math-sin-degrees)
- [A Practical Guide to DecimalFormat](http://www.baeldung.com/java-decimalformat)
- [Calculating the nth Root in Java](https://www.baeldung.com/java-nth-root)
- [Convert Double to String, Removing Decimal Places](https://www.baeldung.com/java-double-to-string)

View File

@ -1,8 +1,8 @@
### Relevant Articles:
- TBD
- [Improved Java Logging with Mapped Diagnostic Context (MDC)](http://www.baeldung.com/mdc-in-log4j-2-logback)
- [Java Logging with Nested Diagnostic Context (NDC)](http://www.baeldung.com/java-logging-ndc-log4j)
- [Drools Using Rules from Excel Files](http://www.baeldung.com/drools-excel)
- [Improved Java Logging with Mapped Diagnostic Context (MDC)](https://www.baeldung.com/mdc-in-log4j-2-logback)
- [Java Logging with Nested Diagnostic Context (NDC)](https:www.baeldung.com/java-logging-ndc-log4j)
- [Drools Using Rules from Excel Files](https://www.baeldung.com/drools-excel)
### References

View File

@ -1,7 +1,3 @@
## Spring All
This module contains articles about Spring
### Relevant Articles:
- [The @Scheduled Annotation in Spring](https://www.baeldung.com/spring-scheduled-tasks)

View File

@ -11,3 +11,4 @@ This module contains articles about Spring Boot customization
- [Spring Boot: Configuring a Main Class](https://www.baeldung.com/spring-boot-main-class)
- [How to Define a Spring Boot Filter?](https://www.baeldung.com/spring-boot-add-filter)
- [Guide to the Favicon in Spring Boot](https://www.baeldung.com/spring-boot-favicon)
- [Spring Boot Exit Codes](https://www.baeldung.com/spring-boot-exit-codes)

View File

@ -0,0 +1,31 @@
package com.baeldung.exitcode.event;
import org.springframework.boot.ExitCodeEvent;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.event.EventListener;
@SpringBootApplication
public class ExitCodeEventDemoApplication {
public static void main(String[] args) {
System.exit(
SpringApplication.exit(
SpringApplication.run(ExitCodeEventDemoApplication.class, args)
)
);
}
@Bean
DemoListener demoListenerBean() {
return new DemoListener();
}
private static class DemoListener {
@EventListener
public void exitEvent(ExitCodeEvent event) {
System.out.println("Exit code: " + event.getExitCode());
}
}
}

View File

@ -0,0 +1,31 @@
package com.baeldung.exitcode.exception;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.ExitCodeExceptionMapper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class ExitCodeExceptionMapperDemoApplication {
public static void main(String[] args) {
SpringApplication.run(ExitCodeExceptionMapperDemoApplication.class, args);
}
@Bean
CommandLineRunner createException() {
return args -> Integer.parseInt("test");
}
@Bean
ExitCodeExceptionMapper exitCodeToExceptionMapper() {
return exception -> {
// set exit code based on the exception type
if (exception.getCause() instanceof NumberFormatException) {
return 80;
}
return 1;
};
}
}

View File

@ -0,0 +1,22 @@
package com.baeldung.exitcode.generator;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ExitCodeGeneratorDemoApplication implements ExitCodeGenerator {
public static void main(String[] args) {
System.exit(
SpringApplication.exit(
SpringApplication.run(ExitCodeGeneratorDemoApplication.class, args)
)
);
}
@Override
public int getExitCode() {
return 42;
}
}

View File

@ -1,3 +0,0 @@
### Relevant Articles
- [Unable to Find @SpringBootConfiguration with @DataJpaTest](https://www.baeldung.com/spring-boot-unable-to-find-springbootconfiguration-with-datajpatest)

View File

@ -1,3 +0,0 @@
### Relevant Articles:
- [Unable to Find @SpringBootConfiguration with @DataJpaTest](https://www.baeldung.com/spring-boot-unable-to-find-springbootconfiguration-with-datajpatest)

View File

@ -1,6 +1,6 @@
## Spring Boot Custom Starter
This module contains articles about writing [Spring Boot Starters](https://www.baeldung.com/spring-boot-starters).
This module contains articles about writing Spring Boot Starters.
### Relevant Articles:
- [Creating a Custom Starter with Spring Boot](https://www.baeldung.com/spring-boot-custom-starter)

View File

@ -79,7 +79,11 @@
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>jcenter-snapshots</id>
<name>jcenter</name>
<url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
</repository>
</repositories>
<pluginRepositories>

View File

@ -1,3 +0,0 @@
### Relevant Articles:
- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging)

View File

@ -1,3 +0,0 @@
### Relevant Articles:
- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging)

View File

@ -22,7 +22,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [An Introduction to Kong](https://www.baeldung.com/kong)
- [Spring Boot: Configuring a Main Class](https://www.baeldung.com/spring-boot-main-class)
- [A Quick Intro to the SpringBootServletInitializer](https://www.baeldung.com/spring-boot-servlet-initializer)
- [Guide to the Favicon in Spring Boot](https://www.baeldung.com/spring-boot-favicon)
- [Spring Shutdown Callbacks](https://www.baeldung.com/spring-shutdown-callbacks)
- [Container Configuration in Spring Boot 2](https://www.baeldung.com/embeddedservletcontainercustomizer-configurableembeddedservletcontainer-spring-boot)
- [Validation in Spring Boot](https://www.baeldung.com/spring-boot-bean-validation)
- [Running Setup Data on Startup in Spring](https://www.baeldung.com/running-setup-logic-on-startup-in-spring)

View File

@ -12,4 +12,5 @@ This module contains articles about Spring MVC
- [Excluding URLs for a Filter in a Spring Web Application](https://www.baeldung.com/spring-exclude-filter)
- [Guide to Flash Attributes in a Spring Web Application](https://www.baeldung.com/spring-web-flash-attributes)
- [Handling URL Encoded Form Data in Spring REST](https://www.baeldung.com/spring-url-encoded-form-data)
- [Reading HttpServletRequest Multiple Times in Spring](https://www.baeldung.com/spring-reading-httpservletrequest-multiple-times)
- More articles: [[<-- prev]](/spring-mvc-basics-2)[[more -->]](/spring-mvc-basics-4)

View File

@ -4,4 +4,4 @@ This module contains articles about Spring Reactor
## Relevant articles:
- [Introduction to Spring Reactor](https://www.baeldung.com/spring-reactor)
- [Introduction to Project Reactor Bus](https://www.baeldung.com/reactor-bus)

View File

@ -4,4 +4,4 @@
- [Guide to Spring Retry](https://www.baeldung.com/spring-retry)
- [How To Do @Async in Spring](https://www.baeldung.com/spring-async)
- [Conditionally Enable Scheduled Jobs in Spring](https://www.baeldung.com/spring-scheduled-enabled-conditionally)
- [Remote Debugging with IntelliJ IDEA](https://www.baeldung.com/intellij-remote-debugging)

View File

@ -8,12 +8,11 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
The "Learn Spring Security" Classes: http://github.learnspringsecurity.com
### Relevant Articles:
- [Spring REST Service Security](https://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/)
- [Setting Up Swagger 2 with a Spring REST API](https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api)
- [Custom Error Message Handling for REST API](https://www.baeldung.com/global-error-handler-in-a-spring-rest-api)
- [Spring Security Context Propagation with @Async](https://www.baeldung.com/spring-security-async-principal-propagation)
- [Servlet 3 Async Support with Spring MVC and Spring Security](https://www.baeldung.com/spring-mvc-async-security)
- [Intro to Spring Security Expressions](https://www.baeldung.com/spring-security-expressions)
- [Spring Security for a REST API](https://www.baeldung.com/securing-a-restful-web-service-with-spring-security)
- [Spring Security Expressions - hasRole Example](https://www.baeldung.com/spring-security-expressions-basic)
- [Error Handling for REST with Spring](https://www.baeldung.com/exception-handling-for-rest-with-spring)

View File

@ -1,4 +1,3 @@
## Relevant articles:
- [Introduction to SPNEGO/Kerberos Authentication in Spring](https://www.baeldung.com/spring-security-kerberos)
- [Spring Security Kerberos Integration](https://www.baeldung.com/spring-security-kerberos-integration)

View File

@ -5,6 +5,6 @@ This module contains articles about migrating to JUnit 5.
The code for the JUnit 4 - JUnit 5 E-book is in `com.baeldung.junit4` and `com.baeldung.junit5`.
### Relevant Articles:
- [JUnit 5 Migration](https://www.baeldung.com/junit-5-migration)
- [A Quick JUnit vs TestNG Comparison](https://www.baeldung.com/junit-vs-testng)
- [Assertions in JUnit 4 and JUnit 5](https://www.baeldung.com/junit-assertions)

View File

@ -3,6 +3,4 @@
- [Mockitos Java 8 Features](https://www.baeldung.com/mockito-2-java-8)
- [Lazy Verification with Mockito 2](https://www.baeldung.com/mockito-2-lazy-verification)
- [Mockito Strict Stubbing and The UnnecessaryStubbingException](https://www.baeldung.com/mockito-unnecessary-stubbing-exception)
- [Quick Guide to BDDMockito](https://www.baeldung.com/bdd-mockito)
- [Mockito Using Spies](https://www.baeldung.com/mockito-spy)
- [Mockito and Fluent APIs](https://www.baeldung.com/mockito-fluent-apis)