Issue
I have a project developed in Java 11 and have to adapt in another, but using Java 8.
Some part of this Java 11 project uses the String
method isBlank()
, that is not recognized in Java 8. What is the best approach to adapt this method in Java 8 project?
Solution
Best approach would be to use Apache Commons StringUtils.isBlank(String)
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
- uses a commonly used library
- proven
- uses centralized code
- is very similar to the source that has to be converted
- Not falling for 'Not invented here' syndrome
Answered By - Nicktar
Answer Checked By - Pedro (JavaFixing Volunteer)