diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/ClassInnerStuffCache.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/ClassInnerStuffCache.java index 51536ad28103..a253beb642a8 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/ClassInnerStuffCache.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/ClassInnerStuffCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -232,13 +232,9 @@ public class ClassInnerStuffCache { private PsiMethod getSyntheticMethod(String text) { PsiElementFactory factory = JavaPsiFacade.getInstance(myClass.getProject()).getElementFactory(); - PsiMethod method = factory.createMethodFromText(text, myClass); - return new LightMethod(myClass.getManager(), method, myClass) { - @Override - public int getTextOffset() { - return myClass.getTextOffset(); - } - }; + LightMethod method = new LightMethod(myClass.getManager(), factory.createMethodFromText(text, myClass), myClass); + method.setNavigationElement(myClass); + return method; } public void dropCaches() {