[Analysis API, FIR] migrate ::class.java -> ::class inside error messages
They seem to provide similar results and the `.java` part is redundant
This commit is contained in:
committed by
Space Team
parent
24db4e62f5
commit
08400d930f
+1
-1
@@ -1283,7 +1283,7 @@ internal class KtFirCallResolver(
|
|||||||
action()
|
action()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
rethrowExceptionWithDetails(
|
rethrowExceptionWithDetails(
|
||||||
"Error during resolving call ${element::class.java.name}",
|
"Error during resolving call ${element::class}",
|
||||||
exception = e,
|
exception = e,
|
||||||
) {
|
) {
|
||||||
withPsiEntry("psi", element, analysisSession::getModule)
|
withPsiEntry("psi", element, analysisSession::getModule)
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ object KtFirReferenceResolver : ResolveCache.PolyVariantResolver<KtReference> {
|
|||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
if (shouldIjPlatformExceptionBeRethrown(e)) throw e
|
if (shouldIjPlatformExceptionBeRethrown(e)) throw e
|
||||||
|
|
||||||
errorWithAttachment("Unable to resolve reference ${ref.element::class.java}", cause = e) {
|
errorWithAttachment("Unable to resolve reference ${ref.element::class}", cause = e) {
|
||||||
withPsiEntry("reference", ref.element)
|
withPsiEntry("reference", ref.element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ abstract class AbstractHLExpressionTypeTest : AbstractAnalysisApiSingleFileTest(
|
|||||||
is KtExpression -> selected
|
is KtExpression -> selected
|
||||||
is KtValueArgument -> selected.getArgumentExpression()
|
is KtValueArgument -> selected.getArgumentExpression()
|
||||||
else -> null
|
else -> null
|
||||||
} ?: error("expect an expression but got ${selected.text}, ${selected::class.java}")
|
} ?: error("expect an expression but got ${selected.text}, ${selected::class}")
|
||||||
val type = executeOnPooledThreadInReadAction {
|
val type = executeOnPooledThreadInReadAction {
|
||||||
analyseForTest(expression) { expression.getKtType()?.render(renderer, position = Variance.INVARIANT) }
|
analyseForTest(expression) { expression.getKtType()?.render(renderer, position = Variance.INVARIANT) }
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ abstract class AbstractAnalysisApiExpressionPsiTypeProviderTest : AbstractAnalys
|
|||||||
val declarationAtCaret = when (val element = testServices.expressionMarkerProvider.getSelectedElement(ktFile)) {
|
val declarationAtCaret = when (val element = testServices.expressionMarkerProvider.getSelectedElement(ktFile)) {
|
||||||
is KtExpression -> element
|
is KtExpression -> element
|
||||||
is KtValueArgument -> element.getArgumentExpression()!!
|
is KtValueArgument -> element.getArgumentExpression()!!
|
||||||
else -> error("Unexpected element: $element of ${element::class.java}")
|
else -> error("Unexpected element: $element of ${element::class}")
|
||||||
}
|
}
|
||||||
val containingDeclaration = declarationAtCaret.parentOfType<KtDeclaration>()
|
val containingDeclaration = declarationAtCaret.parentOfType<KtDeclaration>()
|
||||||
?: error("Can't find containing declaration for $declarationAtCaret")
|
?: error("Can't find containing declaration for $declarationAtCaret")
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ internal fun KtAnalysisSession.stringRepresentation(any: Any): String = with(any
|
|||||||
is KtConstructorSymbol -> "<constructor>"
|
is KtConstructorSymbol -> "<constructor>"
|
||||||
is KtPropertyGetterSymbol -> callableIdIfNonLocal ?: "<getter>"
|
is KtPropertyGetterSymbol -> callableIdIfNonLocal ?: "<getter>"
|
||||||
is KtPropertySetterSymbol -> callableIdIfNonLocal ?: "<setter>"
|
is KtPropertySetterSymbol -> callableIdIfNonLocal ?: "<setter>"
|
||||||
else -> error("unexpected symbol kind in KtCall: ${this@with::class.java}")
|
else -> error("unexpected symbol kind in KtCall: ${this@with::class}")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
append("(")
|
append("(")
|
||||||
|
|||||||
+1
-1
@@ -187,7 +187,7 @@ public class DebugSymbolRenderer(
|
|||||||
is KtClassLikeSymbol -> renderId(symbol.classIdIfNonLocal, symbol)
|
is KtClassLikeSymbol -> renderId(symbol.classIdIfNonLocal, symbol)
|
||||||
is KtCallableSymbol -> renderId(symbol.callableIdIfNonLocal, symbol)
|
is KtCallableSymbol -> renderId(symbol.callableIdIfNonLocal, symbol)
|
||||||
is KtNamedSymbol -> renderValue(symbol.name, renderSymbolsFully = false)
|
is KtNamedSymbol -> renderValue(symbol.name, renderSymbolsFully = false)
|
||||||
else -> error("Unsupported symbol ${symbol::class.java.name}")
|
else -> error("Unsupported symbol ${symbol::class}")
|
||||||
}
|
}
|
||||||
append(")")
|
append(")")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -34,6 +34,6 @@ fun FirElementWithResolveState.getContainingFile(): FirFile? {
|
|||||||
moduleComponents.cache.getCachedFirFile(ktFile)
|
moduleComponents.cache.getCachedFirFile(ktFile)
|
||||||
?: error("Fir file for dandling modifier list cannot be null")
|
?: error("Fir file for dandling modifier list cannot be null")
|
||||||
}
|
}
|
||||||
else -> errorWithFirSpecificEntries("Unsupported declaration ${this::class.java}", fir = this)
|
else -> errorWithFirSpecificEntries("Unsupported declaration ${this::class}", fir = this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -230,7 +230,7 @@ open class AbstractSymbolLightClassesParentingTestBase(
|
|||||||
assertions.assertTrue(owner is SymbolLightMemberModifierList<*>)
|
assertions.assertTrue(owner is SymbolLightMemberModifierList<*>)
|
||||||
|
|
||||||
else ->
|
else ->
|
||||||
throw IllegalStateException("Unexpected annotation owner kind: ${lastDeclaration::class.java}")
|
throw IllegalStateException("Unexpected annotation owner kind: ${lastDeclaration::class}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty
|
|||||||
is ConeClassLikeType -> fullyExpandedType(session)
|
is ConeClassLikeType -> fullyExpandedType(session)
|
||||||
is ConeSimpleKotlinType -> this
|
is ConeSimpleKotlinType -> this
|
||||||
is ConeFlexibleType -> null
|
is ConeFlexibleType -> null
|
||||||
else -> errorWithAttachment("Unknown simpleType: ${this::class.java}") {
|
else -> errorWithAttachment("Unknown simpleType: ${this::class}") {
|
||||||
withConeTypeEntry("type", this@asSimpleType as? ConeKotlinType)
|
withConeTypeEntry("type", this@asSimpleType as? ConeKotlinType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1198,7 +1198,7 @@ open class PsiRawFirBuilder(
|
|||||||
block = when (file) {
|
block = when (file) {
|
||||||
is KtExpressionCodeFragment -> file.getContentElement()?.toFirBlock() ?: buildEmptyExpressionBlock()
|
is KtExpressionCodeFragment -> file.getContentElement()?.toFirBlock() ?: buildEmptyExpressionBlock()
|
||||||
is KtBlockCodeFragment -> configureBlockWithoutBuilding(file.getContentElement()).build()
|
is KtBlockCodeFragment -> configureBlockWithoutBuilding(file.getContentElement()).build()
|
||||||
else -> error("Unexpected code fragment type: " + file::class.java)
|
else -> error("Unexpected code fragment type: ${file::class}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2267,7 +2267,7 @@ open class PsiRawFirBuilder(
|
|||||||
is KtEscapeStringTemplateEntry -> KtNodeTypes.ESCAPE_STRING_TEMPLATE_ENTRY
|
is KtEscapeStringTemplateEntry -> KtNodeTypes.ESCAPE_STRING_TEMPLATE_ENTRY
|
||||||
is KtSimpleNameStringTemplateEntry -> KtNodeTypes.SHORT_STRING_TEMPLATE_ENTRY
|
is KtSimpleNameStringTemplateEntry -> KtNodeTypes.SHORT_STRING_TEMPLATE_ENTRY
|
||||||
is KtBlockStringTemplateEntry -> KtNodeTypes.LONG_STRING_TEMPLATE_ENTRY
|
is KtBlockStringTemplateEntry -> KtNodeTypes.LONG_STRING_TEMPLATE_ENTRY
|
||||||
else -> errorWithAttachment("invalid node type ${element::class.java}") {
|
else -> errorWithAttachment("invalid node type ${element::class}") {
|
||||||
withPsiEntry("element", element)
|
withPsiEntry("element", element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user