lombok-intellij-plugin icon indicating copy to clipboard operation
lombok-intellij-plugin copied to clipboard

Variable 'log' might not have been initialized

Open magnusekstrand opened this issue 3 years ago • 2 comments

Short description

When trying to log from a static block the 'log' variable is marked as not initialized inside IntelliJ

Expected behavior

Variable 'log' should not be marked as not initialized

Version information

  • IDEA Version: IntelliJ IDEA 2020.3.3, Build #IU-203.7717.56, built on March 15, 2021
  • JDK Version: JDK 11.0.4
  • OS Type & Version: Windows 10 Enterprise, version 20H2
  • Lombok Plugin Version: Bundled with IntelliJ (203.7717.56)
  • Lombok Dependency Version: 1.18.18

Steps to reproduce

Create a class like this in IntelliJ and it will mark 'log' variable as not initialized.

import lombok.extern.slf4j.Slf4j;

@Slf4j public class VariableNotInitialized { static { log.info("Variable 'log' might not have been initialized"); } }

Sample project

n/a

Additional information

n/a

Stacktrace

n/a

Variable_log_might_not_have_been_initialized

magnusekstrand avatar Mar 25 '21 14:03 magnusekstrand

Same here; Tracking this then

dquintela avatar Mar 25 '21 17:03 dquintela

https://youtrack.jetbrains.com/issue/IDEA-265211

mplushnikov avatar Mar 27 '21 14:03 mplushnikov