Getting FindBugs error "st write to static from instance method"

27 views Asked by At

I have a text file and I am reading the contents of the file in this way.

VARIABLE1 = new String(Files.readAllBytes(Paths.get(VARIABLE1PATH)), StandardCharsets.UTF_8);

However, this throws the following error.

Write to static field .....test.VARIABLE1 from instance method

Is there a way to fix this?

I was not expecting an error

0

There are 0 answers