mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
Java: minor UAST optimization (IDEA-375485)
GitOrigin-RevId: 3551a8a0af9f2eb7428da63a1e5f83aa7bc81778
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6141932aa7
commit
e61cfd625f
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.uast.kotlin
|
||||
|
||||
import com.intellij.psi.*
|
||||
@@ -66,7 +66,7 @@ class KotlinUEnumConstant(
|
||||
get() = emptyList()
|
||||
|
||||
override val valueArgumentCount: Int
|
||||
get() = psi.argumentList?.expressions?.size ?: 0
|
||||
get() = psi.argumentList?.expressionCount ?: 0
|
||||
|
||||
override val valueArguments: List<UExpression>
|
||||
get() = valueArgumentsPart.getOrBuild {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.uast.java
|
||||
|
||||
import com.intellij.psi.*
|
||||
@@ -275,7 +274,7 @@ class JavaUEnumConstant(
|
||||
override val typeArguments: List<PsiType>
|
||||
get() = emptyList()
|
||||
override val valueArgumentCount: Int
|
||||
get() = sourcePsi.argumentList?.expressions?.size ?: 0
|
||||
get() = sourcePsi.argumentList?.expressionCount ?: 0
|
||||
|
||||
override val valueArguments: List<UExpression>
|
||||
get() = valueArgumentsPart.getOrBuild {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.uast.java
|
||||
|
||||
import com.intellij.psi.PsiMethod
|
||||
@@ -29,7 +29,7 @@ class JavaUObjectLiteralExpression(
|
||||
}
|
||||
|
||||
override val valueArgumentCount: Int
|
||||
get() = sourcePsi.argumentList?.expressions?.size ?: 0
|
||||
get() = sourcePsi.argumentList?.expressionCount ?: 0
|
||||
|
||||
override val valueArguments: List<UExpression>
|
||||
get() = valueArgumentsPart.getOrBuild {
|
||||
@@ -41,7 +41,7 @@ class JavaUObjectLiteralExpression(
|
||||
override val typeArgumentCount: Int
|
||||
get() {
|
||||
if (typeArgumentCountLazy == Int.MIN_VALUE) {
|
||||
typeArgumentCountLazy = sourcePsi.classReference?.typeParameters?.size ?: 0
|
||||
typeArgumentCountLazy = sourcePsi.classReference?.typeParameterCount ?: 0
|
||||
}
|
||||
return typeArgumentCountLazy
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class JavaConstructorUCallExpression(
|
||||
return when {
|
||||
initializer != null -> initializer.initializers.size
|
||||
sourcePsi.arrayDimensions.isNotEmpty() -> sourcePsi.arrayDimensions.size
|
||||
else -> sourcePsi.argumentList?.expressions?.size ?: 0
|
||||
else -> sourcePsi.argumentList?.expressionCount ?: 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ class JavaConstructorUCallExpression(
|
||||
override val typeArgumentCount: Int
|
||||
get() {
|
||||
if (typeArgumentCountLazy == Int.MIN_VALUE) {
|
||||
typeArgumentCountLazy = sourcePsi.classReference?.typeParameters?.size ?: 0
|
||||
typeArgumentCountLazy = sourcePsi.classReference?.typeParameterCount ?: 0
|
||||
}
|
||||
|
||||
return typeArgumentCountLazy
|
||||
|
||||
Reference in New Issue
Block a user