I'm using Lombok (I have the plugin installed and I also restarted the IDE), however I'm getting a strange error. Here's my code:
@RequiredArgsConstructor
@Slf4j
@Service
@Profile("parser")
public class ParserExecutorService implements CommandLineRunner {
@Value("${input.directory}")
String inputDirectory;
@Override
public void run(String... args) throws Exception {
getLogFiles();
}
public void getLogFiles() {
File inputDirectory = new File(inputDirectory);
The last line throws an error:
Value 'inputDirectory' might not have been initialized
However, when I provide there a normal String, i.e.:
File inputDirectory = new File("c:/temp");
and I print the "inputDirectory" below that, then it is visible with a proper value in the console.
So, why on Earth it throws this error while using this property?
I tried setting it to
private final String inputDirectory;
but it didn't help either.