[uast] add UAnnotated#uAnnotations instead of #annotations

GitOrigin-RevId: 61851be3b0a9526ecb21d6f4f6b91b833f306d28
This commit is contained in:
Daniil Ovchinnikov
2019-06-27 18:46:34 +03:00
committed by intellij-monorepo-bot
parent 69d390a5e7
commit cd3ee635f8
56 changed files with 148 additions and 795 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInspection.reference; package com.intellij.codeInspection.reference;
@@ -292,7 +292,7 @@ public class RefClassImpl extends RefJavaElementImpl implements RefClass {
RefJavaUtil.getInstance().addReferencesTo(uClass, this, classInitializer.getUastBody()); RefJavaUtil.getInstance().addReferencesTo(uClass, this, classInitializer.getUastBody());
} }
RefJavaUtil.getInstance().addReferencesTo(uClass, this, ((UAnnotated)uClass).getAnnotations().toArray(UElementKt.EMPTY_ARRAY)); RefJavaUtil.getInstance().addReferencesTo(uClass, this, ((UAnnotated)uClass).getUAnnotations().toArray(UElementKt.EMPTY_ARRAY));
for (PsiTypeParameter parameter : uClass.getJavaPsi().getTypeParameters()) { for (PsiTypeParameter parameter : uClass.getJavaPsi().getTypeParameters()) {
UElement uTypeParameter = UastContextKt.toUElement(parameter); UElement uTypeParameter = UastContextKt.toUElement(parameter);

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInspection.reference; package com.intellij.codeInspection.reference;
import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationManager;
@@ -126,7 +126,7 @@ public class RefFieldImpl extends RefJavaElementImpl implements RefField {
if (uField != null) { if (uField != null) {
final RefJavaUtil refUtil = RefJavaUtil.getInstance(); final RefJavaUtil refUtil = RefJavaUtil.getInstance();
refUtil.addReferencesTo(uField, this, uField.getUastInitializer()); refUtil.addReferencesTo(uField, this, uField.getUastInitializer());
refUtil.addReferencesTo(uField, this, ((UAnnotated)uField).getAnnotations().toArray(UElementKt.EMPTY_ARRAY)); refUtil.addReferencesTo(uField, this, ((UAnnotated)uField).getUAnnotations().toArray(UElementKt.EMPTY_ARRAY));
if (uField instanceof UEnumConstant) { if (uField instanceof UEnumConstant) {
refUtil.addReferencesTo(uField, this, uField); refUtil.addReferencesTo(uField, this, uField);
} }

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInspection.reference; package com.intellij.codeInspection.reference;
@@ -99,7 +99,7 @@ public class RefParameterImpl extends RefJavaElementImpl implements RefParameter
final RefJavaUtil refUtil = RefJavaUtil.getInstance(); final RefJavaUtil refUtil = RefJavaUtil.getInstance();
final UParameter parameter = getUastElement(); final UParameter parameter = getUastElement();
if (parameter != null) { if (parameter != null) {
List<UAnnotation> annotations = ((UAnnotated)parameter).getAnnotations(); List<UAnnotation> annotations = ((UAnnotated)parameter).getUAnnotations();
refUtil.addReferencesTo(parameter, this, annotations.toArray(UElementKt.EMPTY_ARRAY)); refUtil.addReferencesTo(parameter, this, annotations.toArray(UElementKt.EMPTY_ARRAY));
UTypeReferenceExpression typeReference = parameter.getTypeReference(); UTypeReferenceExpression typeReference = parameter.getTypeReference();
refUtil.addReferencesTo(parameter, this, typeReference); refUtil.addReferencesTo(parameter, this, typeReference);

View File

@@ -101,7 +101,7 @@ private class UnstableTypeUsedInSignatureVisitor(
} }
private fun isInsideUnstableDeclaration(node: UDeclaration): Boolean { private fun isInsideUnstableDeclaration(node: UDeclaration): Boolean {
if (node.annotations.any { it.qualifiedName in unstableApiAnnotations }) { if (node.uAnnotations.any { it.qualifiedName in unstableApiAnnotations }) {
return true return true
} }
val containingClass = node.getContainingUClass() val containingClass = node.getContainingUClass()

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.groovy.lang.psi.uast package org.jetbrains.plugins.groovy.lang.psi.uast
import com.intellij.psi.* import com.intellij.psi.*
@@ -35,7 +35,7 @@ class GrUClass(val grElement: GrTypeDefinition,
override val uastParent: UElement? by lazy(parentProvider) override val uastParent: UElement? by lazy(parentProvider)
override val annotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) } override val uAnnotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override fun getSuperClass(): UClass? = super.getSuperClass() override fun getSuperClass(): UClass? = super.getSuperClass()
@@ -67,7 +67,7 @@ class GrUMethod(val grElement: GrMethod,
override val uastAnchor: UIdentifier override val uastAnchor: UIdentifier
get() = UIdentifier(grElement.nameIdentifierGroovy, this) get() = UIdentifier(grElement.nameIdentifierGroovy, this)
override val annotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) } override val uAnnotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override fun getBody(): PsiCodeBlock? = null override fun getBody(): PsiCodeBlock? = null
@@ -94,7 +94,7 @@ class GrUParameter(val grElement: GrParameter,
override val uastAnchor: UIdentifier override val uastAnchor: UIdentifier
get() = UIdentifier(grElement.nameIdentifierGroovy, this) get() = UIdentifier(grElement.nameIdentifierGroovy, this)
override val annotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) } override val uAnnotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override fun getInitializer(): PsiExpression? = grElement.initializer override fun getInitializer(): PsiExpression? = grElement.initializer

View File

@@ -1,6 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package org.jetbrains.plugins.groovy.lang.psi.uast package org.jetbrains.plugins.groovy.lang.psi.uast
import com.intellij.psi.PsiComment import com.intellij.psi.PsiComment
@@ -19,7 +17,7 @@ class GrUFile(override val sourcePsi: GroovyFile, override val languagePlugin: U
override val imports: List<UImportStatement> = emptyList<UImportStatement>() // not implemented override val imports: List<UImportStatement> = emptyList<UImportStatement>() // not implemented
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = sourcePsi.packageDefinition?.annotationList?.annotations?.map { GrUAnnotation(it, { this }) } ?: emptyList() get() = sourcePsi.packageDefinition?.annotationList?.annotations?.map { GrUAnnotation(it, { this }) } ?: emptyList()
override val classes: List<GrUClass> by lazy { sourcePsi.classes.mapNotNull { (it as? GrTypeDefinition)?.let { GrUClass(it, { this }) } } } override val classes: List<GrUClass> by lazy { sourcePsi.classes.mapNotNull { (it as? GrTypeDefinition)?.let { GrUClass(it, { this }) } } }

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.groovy.lang.psi.uast package org.jetbrains.plugins.groovy.lang.psi.uast
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
@@ -23,7 +23,7 @@ class GrUReferenceExpression(
override val uastParent: UElement? by lazy(parentProvider) override val uastParent: UElement? by lazy(parentProvider)
override val annotations: List<UAnnotation> = emptyList() override val uAnnotations: List<UAnnotation> = emptyList()
override fun resolve(): PsiElement? = sourcePsi.resolve() override fun resolve(): PsiElement? = sourcePsi.resolve()
override fun multiResolve(): Iterable<ResolveResult> = override fun multiResolve(): Iterable<ResolveResult> =

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.groovy.lang.psi.uast package org.jetbrains.plugins.groovy.lang.psi.uast
import com.intellij.lang.Language import com.intellij.lang.Language
@@ -70,7 +70,7 @@ class GrULiteral(val grElement: GrLiteral, val parentProvider: () -> UElement?)
override fun evaluate(): Any? = value override fun evaluate(): Any? = value
override val uastParent: UElement? by lazy(parentProvider) override val uastParent: UElement? by lazy(parentProvider)
override val psi: PsiElement? = grElement override val psi: PsiElement? = grElement
override val annotations: List<UAnnotation> = emptyList() //not implemented override val uAnnotations: List<UAnnotation> = emptyList() //not implemented
override val isString: Boolean override val isString: Boolean
get() = super<UInjectionHost>.isString get() = super<UInjectionHost>.isString
override val psiLanguageInjectionHost: PsiLanguageInjectionHost override val psiLanguageInjectionHost: PsiLanguageInjectionHost
@@ -86,7 +86,7 @@ class GrUNamedExpression(val grElement: GrAnnotationNameValuePair, val parentPro
override val uastParent: UElement? by lazy(parentProvider) override val uastParent: UElement? by lazy(parentProvider)
override val psi: GrAnnotationNameValuePair = grElement override val psi: GrAnnotationNameValuePair = grElement
override val annotations: List<UAnnotation> = emptyList() //not implemented override val uAnnotations: List<UAnnotation> = emptyList() //not implemented
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (other !is GrUNamedExpression) return false if (other !is GrUNamedExpression) return false
@@ -131,6 +131,6 @@ class GrUnknownUExpression(override val psi: PsiElement?, override val uastParen
override fun asLogString(): String = "GrUnknownUExpression(grElement)" override fun asLogString(): String = "GrUnknownUExpression(grElement)"
override val annotations: List<UAnnotation> = emptyList() //not implemented override val uAnnotations: List<UAnnotation> = emptyList() //not implemented
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
@@ -47,10 +33,23 @@ interface UExpression : UElement, UAnnotated {
* Represents an annotated element. * Represents an annotated element.
*/ */
interface UAnnotated : UElement { interface UAnnotated : UElement {
@Deprecated(
message = "Will be removed to avoid clash with com.intellij.psi.PsiModifierListOwner#getAnnotations",
replaceWith = ReplaceWith(expression = "uAnnotations"),
level = DeprecationLevel.WARNING
)
@JvmDefault
val annotations: List<UAnnotation>
get() = uAnnotations
/** /**
* Returns the list of annotations applied to the current element. * Returns the list of annotations applied to the current element.
*/ */
val annotations: List<UAnnotation> @Suppress("DEPRECATION")
@JvmDefault
val uAnnotations: List<UAnnotation>
get() = annotations
/** /**
* Looks up for annotation element using the annotation qualified name. * Looks up for annotation element using the annotation qualified name.
@@ -58,7 +57,7 @@ interface UAnnotated : UElement {
* @param fqName the qualified name to search * @param fqName the qualified name to search
* @return the first annotation element with the specified qualified name, or null if there is no annotation with such name. * @return the first annotation element with the specified qualified name, or null if there is no annotation with such name.
*/ */
fun findAnnotation(fqName: String): UAnnotation? = annotations.firstOrNull { it.qualifiedName == fqName } fun findAnnotation(fqName: String): UAnnotation? = uAnnotations.firstOrNull { it.qualifiedName == fqName }
} }
/** /**
@@ -86,7 +85,7 @@ interface ULabeled : UElement {
*/ */
open class UastEmptyExpression(override val uastParent: UElement?) : UExpression { open class UastEmptyExpression(override val uastParent: UElement?) : UExpression {
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = emptyList() get() = emptyList()
override val psi: PsiElement? override val psi: PsiElement?

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -47,7 +33,7 @@ interface UDoWhileExpression : ULoopExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitDoWhileExpression(this)) return if (visitor.visitDoWhileExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
condition.accept(visitor) condition.accept(visitor)
body.accept(visitor) body.accept(visitor)
visitor.afterVisitDoWhileExpression(this) visitor.afterVisitDoWhileExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -47,7 +33,7 @@ interface UForEachExpression : ULoopExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitForEachExpression(this)) return if (visitor.visitForEachExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
iteratedValue.accept(visitor) iteratedValue.accept(visitor)
body.accept(visitor) body.accept(visitor)
visitor.afterVisitForEachExpression(this) visitor.afterVisitForEachExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -52,7 +38,7 @@ interface UForExpression : ULoopExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitForExpression(this)) return if (visitor.visitForExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
declaration?.accept(visitor) declaration?.accept(visitor)
condition?.accept(visitor) condition?.accept(visitor)
update?.accept(visitor) update?.accept(visitor)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -68,7 +54,7 @@ interface UIfExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitIfExpression(this)) return if (visitor.visitIfExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
condition.accept(visitor) condition.accept(visitor)
thenExpression?.accept(visitor) thenExpression?.accept(visitor)
elseExpression?.accept(visitor) elseExpression?.accept(visitor)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -51,7 +37,7 @@ interface USwitchExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitSwitchExpression(this)) return if (visitor.visitSwitchExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
expression?.accept(visitor) expression?.accept(visitor)
body.accept(visitor) body.accept(visitor)
visitor.afterVisitSwitchExpression(this) visitor.afterVisitSwitchExpression(this)
@@ -83,7 +69,7 @@ interface USwitchClauseExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitSwitchClauseExpression(this)) return if (visitor.visitSwitchClauseExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
caseValues.acceptList(visitor) caseValues.acceptList(visitor)
visitor.afterVisitSwitchClauseExpression(this) visitor.afterVisitSwitchClauseExpression(this)
} }
@@ -110,7 +96,7 @@ interface USwitchClauseExpressionWithBody : USwitchClauseExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitSwitchClauseExpression(this)) return if (visitor.visitSwitchClauseExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
caseValues.acceptList(visitor) caseValues.acceptList(visitor)
body.accept(visitor) body.accept(visitor)
visitor.afterVisitSwitchClauseExpression(this) visitor.afterVisitSwitchClauseExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiType import com.intellij.psi.PsiType
@@ -79,7 +65,7 @@ interface UTryExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitTryExpression(this)) return if (visitor.visitTryExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
resourceVariables.acceptList(visitor) resourceVariables.acceptList(visitor)
tryClause.accept(visitor) tryClause.accept(visitor)
catchClauses.acceptList(visitor) catchClauses.acceptList(visitor)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -42,7 +28,7 @@ interface UWhileExpression : ULoopExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitWhileExpression(this)) return if (visitor.visitWhileExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
condition.accept(visitor) condition.accept(visitor)
body.accept(visitor) body.accept(visitor)
visitor.afterVisitWhileExpression(this) visitor.afterVisitWhileExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiAnonymousClass import com.intellij.psi.PsiAnonymousClass
@@ -69,7 +55,7 @@ interface UClass : UDeclaration, PsiClass {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitClass(this)) return if (visitor.visitClass(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
uastDeclarations.acceptList(visitor) uastDeclarations.acceptList(visitor)
visitor.afterVisitClass(this) visitor.afterVisitClass(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiClassInitializer import com.intellij.psi.PsiClassInitializer
@@ -41,7 +27,7 @@ interface UClassInitializer : UDeclaration, PsiClassInitializer {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitInitializer(this)) return if (visitor.visitInitializer(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
uastBody.accept(visitor) uastBody.accept(visitor)
visitor.afterVisitInitializer(this) visitor.afterVisitInitializer(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
@@ -65,8 +51,8 @@ interface UFile : UElement, UAnnotated {
override fun asLogString(): String = log("package = $packageName") override fun asLogString(): String = log("package = $packageName")
override fun asRenderString(): String = buildString { override fun asRenderString(): String = buildString {
if (annotations.isNotEmpty()) { if (uAnnotations.isNotEmpty()) {
annotations.joinTo(buffer = this, separator = "\n", postfix = "\n", transform = UAnnotation::asRenderString) uAnnotations.joinTo(buffer = this, separator = "\n", postfix = "\n", transform = UAnnotation::asRenderString)
} }
val packageName = this@UFile.packageName val packageName = this@UFile.packageName
@@ -92,7 +78,7 @@ interface UFile : UElement, UAnnotated {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitFile(this)) return if (visitor.visitFile(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
imports.acceptList(visitor) imports.acceptList(visitor)
classes.acceptList(visitor) classes.acceptList(visitor)
visitor.afterVisitFile(this) visitor.afterVisitFile(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.* import com.intellij.psi.*
@@ -50,23 +36,23 @@ interface UMethod : UDeclaration, PsiMethod {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitMethod(this)) return if (visitor.visitMethod(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
uastParameters.acceptList(visitor) uastParameters.acceptList(visitor)
uastBody?.accept(visitor) uastBody?.accept(visitor)
visitor.afterVisitMethod(this) visitor.afterVisitMethod(this)
} }
override fun asRenderString(): String = buildString { override fun asRenderString(): String = buildString {
if (annotations.isNotEmpty()) { if (uAnnotations.isNotEmpty()) {
annotations.joinTo(buffer = this, separator = "\n", postfix = "\n", transform = UAnnotation::asRenderString) uAnnotations.joinTo(buffer = this, separator = "\n", postfix = "\n", transform = UAnnotation::asRenderString)
} }
append(javaPsi.renderModifiers()) append(javaPsi.renderModifiers())
append("fun ").append(name) append("fun ").append(name)
uastParameters.joinTo(this, prefix = "(", postfix = ")") { parameter -> uastParameters.joinTo(this, prefix = "(", postfix = ")") { parameter ->
val annotationsText = if (parameter.annotations.isNotEmpty()) val annotationsText = if (parameter.uAnnotations.isNotEmpty())
parameter.annotations.joinToString(separator = " ", postfix = " ") { it.asRenderString() } parameter.uAnnotations.joinToString(separator = " ", postfix = " ") { it.asRenderString() }
else else
"" ""
annotationsText + parameter.name + ": " + parameter.type.canonicalText annotationsText + parameter.name + ": " + parameter.type.canonicalText
@@ -113,7 +99,7 @@ interface UAnnotationMethod : UMethod, PsiAnnotationMethod {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitMethod(this)) return if (visitor.visitMethod(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
uastParameters.acceptList(visitor) uastParameters.acceptList(visitor)
uastBody?.accept(visitor) uastBody?.accept(visitor)
uastDefaultValue?.accept(visitor) uastDefaultValue?.accept(visitor)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.* import com.intellij.psi.*
@@ -60,8 +46,8 @@ interface UVariable : UDeclaration, PsiVariable {
override fun asLogString(): String = log("name = $name") override fun asLogString(): String = log("name = $name")
override fun asRenderString(): String = buildString { override fun asRenderString(): String = buildString {
if (annotations.isNotEmpty()) { if (uAnnotations.isNotEmpty()) {
annotations.joinTo(this, separator = " ", postfix = " ") { it.asRenderString() } uAnnotations.joinTo(this, separator = " ", postfix = " ") { it.asRenderString() }
} }
append(javaPsiInternal.renderModifiers()) append(javaPsiInternal.renderModifiers())
append("var ").append(javaPsiInternal.name).append(": ").append(javaPsiInternal.type.getCanonicalText(false)) append("var ").append(javaPsiInternal.name).append(": ").append(javaPsiInternal.type.getCanonicalText(false))
@@ -74,7 +60,7 @@ interface UVariableEx : UVariable, UDeclarationEx {
} }
private fun UVariable.visitContents(visitor: UastVisitor) { private fun UVariable.visitContents(visitor: UastVisitor) {
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
uastInitializer?.accept(visitor) uastInitializer?.accept(visitor)
} }
@@ -141,7 +127,7 @@ interface UEnumConstant : UField, UCallExpression, PsiEnumConstant {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitEnumConstant(this)) return if (visitor.visitEnumConstant(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
methodIdentifier?.accept(visitor) methodIdentifier?.accept(visitor)
classReference?.accept(visitor) classReference?.accept(visitor)
valueArguments.acceptList(visitor) valueArguments.acceptList(visitor)
@@ -153,8 +139,8 @@ interface UEnumConstant : UField, UCallExpression, PsiEnumConstant {
visitor.visitEnumConstantExpression(this, data) visitor.visitEnumConstantExpression(this, data)
override fun asRenderString(): String = buildString { override fun asRenderString(): String = buildString {
if (annotations.isNotEmpty()) { if (uAnnotations.isNotEmpty()) {
annotations.joinTo(this, separator = " ", postfix = " ", transform = UAnnotation::asRenderString) uAnnotations.joinTo(this, separator = " ", postfix = " ", transform = UAnnotation::asRenderString)
} }
append(name) append(name)
if (valueArguments.isNotEmpty()) { if (valueArguments.isNotEmpty()) {

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -36,7 +22,7 @@ interface UArrayAccessExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitArrayAccessExpression(this)) return if (visitor.visitArrayAccessExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
receiver.accept(visitor) receiver.accept(visitor)
indices.acceptList(visitor) indices.acceptList(visitor)
visitor.afterVisitArrayAccessExpression(this) visitor.afterVisitArrayAccessExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiMethod import com.intellij.psi.PsiMethod
@@ -52,7 +38,7 @@ interface UBinaryExpression : UPolyadicExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitBinaryExpression(this)) return if (visitor.visitBinaryExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
leftOperand.accept(visitor) leftOperand.accept(visitor)
rightOperand.accept(visitor) rightOperand.accept(visitor)
visitor.afterVisitBinaryExpression(this) visitor.afterVisitBinaryExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -52,7 +38,7 @@ interface UBinaryExpressionWithType : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitBinaryExpressionWithType(this)) return if (visitor.visitBinaryExpressionWithType(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
operand.accept(visitor) operand.accept(visitor)
typeReference?.accept(visitor) typeReference?.accept(visitor)
visitor.afterVisitBinaryExpressionWithType(this) visitor.afterVisitBinaryExpressionWithType(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface UBlockExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitBlockExpression(this)) return if (visitor.visitBlockExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
expressions.acceptList(visitor) expressions.acceptList(visitor)
visitor.afterVisitBlockExpression(this) visitor.afterVisitBlockExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -28,7 +14,7 @@ interface UBreakExpression : UJumpExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitBreakExpression(this)) return if (visitor.visitBreakExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
visitor.afterVisitBreakExpression(this) visitor.afterVisitBreakExpression(this)
} }
@@ -46,7 +32,7 @@ interface UBreakWithValueExpression : UBreakExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitBreakExpression(this)) return if (visitor.visitBreakExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
valueExpression?.accept(visitor) valueExpression?.accept(visitor)
visitor.afterVisitBreakExpression(this) visitor.afterVisitBreakExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -97,7 +83,7 @@ interface UCallExpression : UExpression, UResolvable {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitCallExpression(this)) return if (visitor.visitCallExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
methodIdentifier?.accept(visitor) methodIdentifier?.accept(visitor)
classReference?.accept(visitor) classReference?.accept(visitor)
valueArguments.acceptList(visitor) valueArguments.acceptList(visitor)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -45,7 +31,7 @@ interface UCallableReferenceExpression : UReferenceExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitCallableReferenceExpression(this)) return if (visitor.visitCallableReferenceExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
qualifierExpression?.accept(visitor) qualifierExpression?.accept(visitor)
visitor.afterVisitCallableReferenceExpression(this) visitor.afterVisitCallableReferenceExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -43,7 +29,7 @@ interface UClassLiteralExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitClassLiteralExpression(this)) return if (visitor.visitClassLiteralExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
expression?.accept(visitor) expression?.accept(visitor)
visitor.afterVisitClassLiteralExpression(this) visitor.afterVisitClassLiteralExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -28,7 +14,7 @@ interface UContinueExpression : UJumpExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitContinueExpression(this)) return if (visitor.visitContinueExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
visitor.afterVisitContinueExpression(this) visitor.afterVisitContinueExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -32,7 +18,7 @@ interface UDeclarationsExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitDeclarationsExpression(this)) return if (visitor.visitDeclarationsExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
declarations.acceptList(visitor) declarations.acceptList(visitor)
visitor.afterVisitDeclarationsExpression(this) visitor.afterVisitDeclarationsExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -36,7 +22,7 @@ interface UExpressionList : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitExpressionList(this)) return if (visitor.visitExpressionList(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
expressions.acceptList(visitor) expressions.acceptList(visitor)
visitor.afterVisitExpressionList(this) visitor.afterVisitExpressionList(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -36,7 +22,7 @@ interface ULabeledExpression : UExpression, ULabeled {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitLabeledExpression(this)) return if (visitor.visitLabeledExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
expression.accept(visitor) expression.accept(visitor)
visitor.afterVisitLabeledExpression(this) visitor.afterVisitLabeledExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiType import com.intellij.psi.PsiType
@@ -42,7 +28,7 @@ interface ULambdaExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitLambdaExpression(this)) return if (visitor.visitLambdaExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
valueParameters.acceptList(visitor) valueParameters.acceptList(visitor)
body.accept(visitor) body.accept(visitor)
visitor.afterVisitLambdaExpression(this) visitor.afterVisitLambdaExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -50,7 +36,7 @@ interface ULiteralExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitLiteralExpression(this)) return if (visitor.visitLiteralExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
visitor.afterVisitLiteralExpression(this) visitor.afterVisitLiteralExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -25,7 +11,7 @@ interface UNamedExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitElement(this)) return if (visitor.visitElement(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
expression.accept(visitor) expression.accept(visitor)
visitor.afterVisitElement(this) visitor.afterVisitElement(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiType import com.intellij.psi.PsiType
@@ -51,7 +37,7 @@ interface UObjectLiteralExpression : UCallExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitObjectLiteralExpression(this)) return if (visitor.visitObjectLiteralExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
valueArguments.acceptList(visitor) valueArguments.acceptList(visitor)
declaration.accept(visitor) declaration.accept(visitor)
visitor.afterVisitObjectLiteralExpression(this) visitor.afterVisitObjectLiteralExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface UParenthesizedExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitParenthesizedExpression(this)) return if (visitor.visitParenthesizedExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
expression.accept(visitor) expression.accept(visitor)
visitor.afterVisitParenthesizedExpression(this) visitor.afterVisitParenthesizedExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -38,7 +24,7 @@ interface UPolyadicExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitPolyadicExpression(this)) return if (visitor.visitPolyadicExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
operands.acceptList(visitor) operands.acceptList(visitor)
visitor.afterVisitPolyadicExpression(this) visitor.afterVisitPolyadicExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -43,7 +29,7 @@ interface UQualifiedReferenceExpression : UReferenceExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitQualifiedReferenceExpression(this)) return if (visitor.visitQualifiedReferenceExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
receiver.accept(visitor) receiver.accept(visitor)
selector.accept(visitor) selector.accept(visitor)
visitor.afterVisitQualifiedReferenceExpression(this) visitor.afterVisitQualifiedReferenceExpression(this)

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -32,7 +18,7 @@ interface UReturnExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitReturnExpression(this)) return if (visitor.visitReturnExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
returnExpression?.accept(visitor) returnExpression?.accept(visitor)
visitor.afterVisitReturnExpression(this) visitor.afterVisitReturnExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface USimpleNameReferenceExpression : UReferenceExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitSimpleNameReferenceExpression(this)) return if (visitor.visitSimpleNameReferenceExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
visitor.afterVisitSimpleNameReferenceExpression(this) visitor.afterVisitSimpleNameReferenceExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface USuperExpression : UInstanceExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitSuperExpression(this)) return if (visitor.visitSuperExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
visitor.afterVisitSuperExpression(this) visitor.afterVisitSuperExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface UThisExpression : UInstanceExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitThisExpression(this)) return if (visitor.visitThisExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
visitor.afterVisitThisExpression(this) visitor.afterVisitThisExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
@@ -32,7 +18,7 @@ interface UThrowExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitThrowExpression(this)) return if (visitor.visitThrowExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
thrownExpression.accept(visitor) thrownExpression.accept(visitor)
visitor.afterVisitThrowExpression(this) visitor.afterVisitThrowExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiType import com.intellij.psi.PsiType
@@ -35,7 +21,7 @@ interface UTypeReferenceExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitTypeReferenceExpression(this)) return if (visitor.visitTypeReferenceExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
visitor.afterVisitTypeReferenceExpression(this) visitor.afterVisitTypeReferenceExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast package org.jetbrains.uast
import com.intellij.psi.PsiMethod import com.intellij.psi.PsiMethod
@@ -46,7 +32,7 @@ interface UUnaryExpression : UExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitUnaryExpression(this)) return if (visitor.visitUnaryExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
operand.accept(visitor) operand.accept(visitor)
visitor.afterVisitUnaryExpression(this) visitor.afterVisitUnaryExpression(this)
} }
@@ -60,7 +46,7 @@ interface UPrefixExpression : UUnaryExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitPrefixExpression(this)) return if (visitor.visitPrefixExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
operand.accept(visitor) operand.accept(visitor)
visitor.afterVisitPrefixExpression(this) visitor.afterVisitPrefixExpression(this)
} }
@@ -78,7 +64,7 @@ interface UPostfixExpression : UUnaryExpression {
override fun accept(visitor: UastVisitor) { override fun accept(visitor: UastVisitor) {
if (visitor.visitPostfixExpression(this)) return if (visitor.visitPostfixExpression(this)) return
annotations.acceptList(visitor) uAnnotations.acceptList(visitor)
operand.accept(visitor) operand.accept(visitor)
visitor.afterVisitPostfixExpression(this) visitor.afterVisitPostfixExpression(this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast.java package org.jetbrains.uast.java
@@ -129,7 +115,7 @@ abstract class JavaAbstractUExpression(givenParent: UElement?) : JavaAbstractUEl
return JavaPsiFacade.getInstance(project).constantEvaluationHelper.computeConstantExpression(sourcePsi) return JavaPsiFacade.getInstance(project).constantEvaluationHelper.computeConstantExpression(sourcePsi)
} }
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = emptyList() get() = emptyList()
override fun getExpressionType(): PsiType? { override fun getExpressionType(): PsiType? {

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast.java package org.jetbrains.uast.java
import com.intellij.psi.* import com.intellij.psi.*
@@ -170,7 +156,7 @@ internal class DummyUBreakExpression(val valueExpressionPsi: PsiExpression,
get() = null get() = null
override val label: String? override val label: String?
get() = null get() = null
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = emptyList() get() = emptyList()
override val valueExpression: UExpression? by lazy { JavaConverter.convertExpression(valueExpressionPsi, this) } override val valueExpression: UExpression? by lazy { JavaConverter.convertExpression(valueExpressionPsi, this) }
@@ -190,7 +176,7 @@ internal class DummyUBreakExpression(val valueExpressionPsi: PsiExpression,
class JavaUDefaultCaseExpression(override val sourcePsi: PsiElement?, givenParent: UElement?) class JavaUDefaultCaseExpression(override val sourcePsi: PsiElement?, givenParent: UElement?)
: JavaAbstractUExpression(givenParent), UElement { : JavaAbstractUExpression(givenParent), UElement {
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = emptyList() get() = emptyList()
override fun asLogString(): String = "UDefaultCaseExpression" override fun asLogString(): String = "UDefaultCaseExpression"

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast.java package org.jetbrains.uast.java
@@ -50,7 +36,7 @@ abstract class AbstractJavaUClass(givenParent: UElement?) : JavaAbstractUElement
override val uastAnchor: UIdentifier? override val uastAnchor: UIdentifier?
get() = UIdentifier(javaPsi.nameIdentifier, this) get() = UIdentifier(javaPsi.nameIdentifier, this)
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = javaPsi.annotations.map { JavaUAnnotation(it, this) } get() = javaPsi.annotations.map { JavaUAnnotation(it, this) }
override fun equals(other: Any?): Boolean = other is AbstractJavaUClass && javaPsi == other.javaPsi override fun equals(other: Any?): Boolean = other is AbstractJavaUClass && javaPsi == other.javaPsi

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast.java package org.jetbrains.uast.java
@@ -38,7 +24,7 @@ class JavaUClassInitializer(
getLanguagePlugin().convertElement(sourcePsi.body, this, null) as? UExpression ?: UastEmptyExpression(this) getLanguagePlugin().convertElement(sourcePsi.body, this, null) as? UExpression ?: UastEmptyExpression(this)
} }
override val annotations: List<JavaUAnnotation> by lz { sourcePsi.annotations.map { JavaUAnnotation(it, this) } } override val uAnnotations: List<JavaUAnnotation> by lz { sourcePsi.annotations.map { JavaUAnnotation(it, this) } }
override fun equals(other: Any?): Boolean = this === other override fun equals(other: Any?): Boolean = this === other
override fun hashCode(): Int = sourcePsi.hashCode() override fun hashCode(): Int = sourcePsi.hashCode()

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast.java package org.jetbrains.uast.java
import com.intellij.psi.PsiComment import com.intellij.psi.PsiComment
@@ -29,7 +15,7 @@ class JavaUFile(override val sourcePsi: PsiJavaFile, override val languagePlugin
sourcePsi.importList?.allImportStatements?.map { JavaUImportStatement(it, this) } ?: listOf() sourcePsi.importList?.allImportStatements?.map { JavaUImportStatement(it, this) } ?: listOf()
} }
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = sourcePsi.packageStatement?.annotationList?.annotations?.map { JavaUAnnotation(it, this) } ?: emptyList() get() = sourcePsi.packageStatement?.annotationList?.annotations?.map { JavaUAnnotation(it, this) } ?: emptyList()
override val classes: List<UClass> by lz { sourcePsi.classes.map { JavaUClass.create(it, this) } } override val classes: List<UClass> by lz { sourcePsi.classes.map { JavaUClass.create(it, this) } }

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.uast.java package org.jetbrains.uast.java
@@ -25,7 +25,7 @@ open class JavaUMethod(
getLanguagePlugin().convertElement(body, this) as? UExpression getLanguagePlugin().convertElement(body, this) as? UExpression
} }
override val annotations: List<JavaUAnnotation> by lz { sourcePsi.annotations.map { JavaUAnnotation(it, this) } } override val uAnnotations: List<JavaUAnnotation> by lz { sourcePsi.annotations.map { JavaUAnnotation(it, this) } }
override val uastParameters: List<JavaUParameter> by lz { override val uastParameters: List<JavaUParameter> by lz {
sourcePsi.parameterList.parameters.map { JavaUParameter(it, this) } sourcePsi.parameterList.parameters.map { JavaUParameter(it, this) }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast.java package org.jetbrains.uast.java
@@ -35,7 +21,7 @@ abstract class AbstractJavaUVariable(givenParent: UElement?) : JavaAbstractUElem
getLanguagePlugin().convertElement(initializer, this) as? UExpression getLanguagePlugin().convertElement(initializer, this) as? UExpression
} }
override val annotations: List<JavaUAnnotation> by lz { javaPsi.annotations.map { JavaUAnnotation(it, this) } } override val uAnnotations: List<JavaUAnnotation> by lz { javaPsi.annotations.map { JavaUAnnotation(it, this) } }
override val typeReference: UTypeReferenceExpression? by lz { override val typeReference: UTypeReferenceExpression? by lz {
getLanguagePlugin().convertOpt<UTypeReferenceExpression>(javaPsi.typeElement, this) getLanguagePlugin().convertOpt<UTypeReferenceExpression>(javaPsi.typeElement, this)
} }

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast.java package org.jetbrains.uast.java
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
@@ -30,7 +16,7 @@ class JavaUDeclarationsExpression(
this.declarations = declarations this.declarations = declarations
} }
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = emptyList() get() = emptyList()
@Suppress("OverridingDeprecatedMember") @Suppress("OverridingDeprecatedMember")

View File

@@ -1,18 +1,4 @@
/* // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2017 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.uast.java package org.jetbrains.uast.java
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
@@ -26,6 +12,6 @@ class UnknownJavaExpression(
) : JavaAbstractUElement(uastParent), UExpression, UElement { ) : JavaAbstractUElement(uastParent), UExpression, UElement {
override fun asLogString(): String = "[!] " + UnknownJavaExpression::class.java.simpleName + " ($sourcePsi)" override fun asLogString(): String = "[!] " + UnknownJavaExpression::class.java.simpleName + " ($sourcePsi)"
override val annotations: List<UAnnotation> override val uAnnotations: List<UAnnotation>
get() = emptyList() get() = emptyList()
} }