java-synthetic-methods

Eclipse warning about synthetic accessor for private static nested classes in Java?

流过昼夜 提交于 2019-11-26 16:12:00
问题 My coworker suggested making several of the Eclipse code-formatting and warning settings to be more rigorous. The majority of these changes make sense, but I get this one weird warning in Java. Here's some test code to reproduce the "problem": package com.example.bugs; public class WeirdInnerClassJavaWarning { private static class InnerClass { public void doSomething() {} } final private InnerClass anInstance; { this.anInstance = new InnerClass(); // !!! this.anInstance.doSomething(); } } //