-
/*
- * Copyright 2000-2011 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2000-2011 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions;
import com.intellij.lang.ASTNode;
*/
public class GrThisReferenceExpressionImpl extends GrThisSuperReferenceExpressionBase implements GrThisReferenceExpression {
- private static final NullableFunction<GrThisReferenceExpressionImpl,PsiType> TYPE_CALCULATOR =
+ private static final NullableFunction<GrThisReferenceExpressionImpl, PsiType> TYPE_CALCULATOR =
new NullableFunction<GrThisReferenceExpressionImpl, PsiType>() {
@Override
public PsiType fun(GrThisReferenceExpressionImpl ref) {
return GroovyPsiManager.getInstance(getProject()).getType(this, TYPE_CALCULATOR);
}
- private PsiType createType(PsiClass context) {
+ private PsiType createType(@NotNull PsiClass context) {
final JavaPsiFacade facade = JavaPsiFacade.getInstance(context.getProject());
PsiElementFactory elementFactory = facade.getElementFactory();
//create instance of java.lang.Class<CurrentClass>
if (context instanceof PsiAnonymousClass) {
final PsiClassType type = ((PsiAnonymousClass)context).getBaseClassType();
- final PsiClass aClass =
- facade.findClass(CommonClassNames.JAVA_LANG_CLASS, context.getResolveScope());
+ final PsiClass aClass = facade.findClass(CommonClassNames.JAVA_LANG_CLASS, context.getResolveScope());
if (aClass != null) {
return elementFactory.createType(aClass, type);
}