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