<p>I'm currently creating an explicit reference to this in the outer class so that I have a name to refer to in the anonymous inner class.  Is there a better way to do this?</p>

[{'answer_id': 31216, 'author': 'John Topley', 'author_id': 1450, 'author_profile': 'https://Stackoverflow.com/users/1450', 'pm_score': 4, 'selected': False, 'text': '<p>Use <code>EnclosingClass.this</code></p>\n'}, {'answer_id': 31218, 'author': 'Frank Krueger', 'author_id': 338, 'author_profile': 'https://Stackoverflow.com/users/338', 'pm_score': 8, 'selected': True, 'text': '<p>I just found this recently. Use <code>OuterClassName.this</code>.</p>\n\n<pre><code>class Outer {\n    void foo() {\n        new Thread() {\n            public void run() {\n                Outer.this.bar();\n            }\n        }.start();\n    }\n    void bar() {\n        System.out.println("BAR!");\n    }\n}\n</code></pre>\n\n<p><strong>Updated</strong> If you just want the object itself (instead of invoking members), then <code>Outer.this</code> is the way to go.</p>\n'}, {'answer_id': 73469, 'author': 'Scott Stanchfield', 'author_id': 12541, 'author_profile': 'https://Stackoverflow.com/users/12541', 'pm_score': 1, 'selected': False, 'text': '<p>You can still use Outer.class to get the class of the outer class object (which will return the same Class object as Outer.this.getClass() but is more efficient)</p>\n\n<p>If you want to access statics in the enclosing class, you can use Outer.name where name is  the static field or method.</p>\n'}]
['https://Stackoverflow.com/questions/31201', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1288/']