From 397fe99a92f6d39da897b944afe8e12c8a33e410 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 2 Jun 2016 17:39:21 +0300 Subject: [PATCH] Cleanup (javadoc; clear field name) --- .../src/com/intellij/psi/PsiTypeElement.java | 16 ++++++++++++---- .../intellij/psi/impl/compiled/ClsFieldImpl.java | 6 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/java/java-psi-api/src/com/intellij/psi/PsiTypeElement.java b/java/java-psi-api/src/com/intellij/psi/PsiTypeElement.java index c6d464950fc4..3decf6544bd1 100644 --- a/java/java-psi-api/src/com/intellij/psi/PsiTypeElement.java +++ b/java/java-psi-api/src/com/intellij/psi/PsiTypeElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 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. @@ -23,7 +23,7 @@ import org.jetbrains.annotations.Nullable; * Represents the occurrence of a type in Java source code, for example, as a return * type of the method or the type of a method parameter. */ -public interface PsiTypeElement extends PsiElement,PsiAnnotationOwner { +public interface PsiTypeElement extends PsiElement, PsiAnnotationOwner { /** * The empty array of PSI directories which can be reused to avoid unnecessary allocations. */ @@ -39,10 +39,18 @@ public interface PsiTypeElement extends PsiElement,PsiAnnotationOwner { /** * Returns the type referenced by the type element. + *

+ * Note: when a containing element (field, method etc.) has C-style array declarations, + * the result of this method may differ from an actual type. * * @return the referenced type. + * @see PsiField#getType() + * @see PsiMethod#getReturnType() + * @see PsiParameter#getType() + * @see PsiVariable#getType() */ - @NotNull PsiType getType(); + @NotNull + PsiType getType(); /** * Returns the reference element pointing to the referenced type, or if the type element @@ -53,4 +61,4 @@ public interface PsiTypeElement extends PsiElement,PsiAnnotationOwner { */ @Nullable PsiJavaCodeReferenceElement getInnermostComponentReferenceElement(); -} +} \ No newline at end of file diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsFieldImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsFieldImpl.java index e775d281b5f3..010a0bb90051 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsFieldImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsFieldImpl.java @@ -41,12 +41,12 @@ import java.util.Set; import static com.intellij.util.ObjectUtils.assertNotNull; public class ClsFieldImpl extends ClsMemberImpl implements PsiField, PsiVariableEx, ClsModifierListOwner { - private final NotNullLazyValue myType; + private final NotNullLazyValue myTypeElement; private final NullableLazyValue myInitializer; public ClsFieldImpl(@NotNull PsiFieldStub stub) { super(stub); - myType = new AtomicNotNullLazyValue() { + myTypeElement = new AtomicNotNullLazyValue() { @NotNull @Override protected PsiTypeElement compute() { @@ -86,7 +86,7 @@ public class ClsFieldImpl extends ClsMemberImpl implements PsiFiel @Override public PsiTypeElement getTypeElement() { - return myType.getValue(); + return myTypeElement.getValue(); } @Override