Making Old Java Work

With Burningwave Tools, it is possible to perform dependency shrinking and also make applications created with old Java versions work on Java 9 and later versions. To adapt applications to Java 9 and later, you must create an application adapater and run it with JDK 9 or later. In this application adapter you must load, by using PathHelper, the JDK libraries the target application was developed with and pass to the method captureAndStore of the TwoPassCapturer component, as the first parameter, the name of the class of your application that contains the main method. In the example below, we're adapting a Java 8 Spring Boot application to Java 9 or later. 

Java
 




xxxxxxxxxx
1
24


1
ComponentSupplier componentSupplier = ComponentContainer.getInstance();
2
PathHelper pathHelper = componentSupplier.getPathHelper();
3
Collection<String> paths = pathHelper.getAllMainClassPaths();
4

          
5
if (JVMInfo.getVersion() > 8) {
6
    paths.addAll(pathHelper.getPaths("dependencies-capturer.additional-resources-path"));
7
}
8

          
9
List<String> _paths = new ArrayList<>(paths);
10
Collections.sort(_paths);
11

          
12
Result result = TwoPassCapturer.getInstance().captureAndStore(
13
    //Here you indicate the main class of your application
14
    "com.springbootappadapter.SpringBootWebApplication",
15
    args,
16
    paths,
17
    //Here you indicate the destination path where extracted
18
    //classes and resources will be stored  
19
    System.getProperty("user.home") + "/Desktop/dependencies",
20
    true,
21
    //Here you indicate the waiting time after the main of your
22
    //application has been executed. This is useful, for example, 
23
    //for spring boot applications to make it possible, once started,
24
    //to run rest methods to continue extracting the dependencies
25
    0L
26
);
27
result.waitForTaskEnding();



The Pitfalls in C++ Unit Testing

Recently there has been a surge of interest in C++ unit testing. C++ unit testing has not been common in C++ development in the past.

Although C++ is a kind of programming language that fits well with unit testing, several complexities require extra care. In this article, I’ll discuss the most common pitfalls.

Migrating a Legacy Spring Application to Spring Boot 2

Out with the old, in with Spring Boot 2

Recently, we decided to monitor the metrics of legacy Spring applications we were running on our production systems. While searching around, I realized that a nice way to not reinvent the wheel was to integrate my app with the Spring Boot Actuator. By using the actuator, we have many tools like Grafana and Prometheus for easily monitoring our applications. However, in order to integrate such a legacy Spring application with the Spring Boot Actuator, you need to make it Spring-Boot-ready first.

You may also like:  How to Deal With Legacy Code

Since Spring Boot 1.5 reached the end of its life at the beginning of August, I decided to move to Spring Boot 2 and start playing with it.