Fixed two possible index out of bounds exceptions in ExtractorReferenceContributor and BogusAssertionInspection. Prepared release.
This commit is contained in:
parent
66b725c4d2
commit
45307b364d
@ -793,8 +793,9 @@ Feel free to use the code (in package ```de.platon42.intellij.jupiter```) for yo
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
#### V1.10 (unreleased)
|
#### V1.10 (31-Jul-20) Friday the 31st Edition
|
||||||
- Updated libraries to the latest versions (including AssertJ 3.16.1 and Kotlin 1.40-rc).
|
- Updated libraries to the latest versions (including AssertJ 3.16.1 and Kotlin 1.40-rc).
|
||||||
|
- Fixed two possible index out of bounds exceptions in ExtractorReferenceContributor and BogusAssertionInspection.
|
||||||
|
|
||||||
#### V1.9 (25-Feb-20) Mardi Gras Edition
|
#### V1.9 (25-Feb-20) Mardi Gras Edition
|
||||||
- TwistedAssertion inspection will no longer warn for ```.matches()``` and ```doesNotMatch()``` for regular expressions.
|
- TwistedAssertion inspection will no longer warn for ```.matches()``` and ```doesNotMatch()``` for regular expressions.
|
||||||
|
@ -7,7 +7,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'de.platon42'
|
group 'de.platon42'
|
||||||
version '1.9'
|
version '1.10'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -43,9 +43,10 @@ intellij {
|
|||||||
|
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
changeNotes """
|
changeNotes """
|
||||||
<h4>V1.10 (unreleased)</h4>
|
<h4>V1.10 (31-Jul-20) Friday the 31st Edition</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Updated libraries to the latest versions (including AssertJ 3.16.1 and Kotlin 1.40-rc).
|
<li>Updated libraries to the latest versions (including AssertJ 3.16.1 and Kotlin 1.40-rc).
|
||||||
|
<li>Fixed two possible index out of bounds exceptions in ExtractorReferenceContributor and BogusAssertionInspection.
|
||||||
</ul>
|
</ul>
|
||||||
<p>Full changelog available at <a href="https://github.com/chrisly42/cajon-plugin#changelog">Github project site</a>.</p>
|
<p>Full changelog available at <a href="https://github.com/chrisly42/cajon-plugin#changelog">Github project site</a>.</p>
|
||||||
"""
|
"""
|
||||||
|
@ -132,6 +132,7 @@ class BogusAssertionInspection : AbstractAssertJInspection() {
|
|||||||
// Note: replace with TrackingEquivalenceChecker() for IDEA >= 2019.1
|
// Note: replace with TrackingEquivalenceChecker() for IDEA >= 2019.1
|
||||||
val equivalenceChecker = EquivalenceChecker.getCanonicalPsiEquivalence()!!
|
val equivalenceChecker = EquivalenceChecker.getCanonicalPsiEquivalence()!!
|
||||||
val isSameExpression = allCalls
|
val isSameExpression = allCalls
|
||||||
|
.filter { it.argumentList.expressions.size == 1 }
|
||||||
.filter(SAME_ACTUAL_AND_EXPECTED_MATCHERS::test)
|
.filter(SAME_ACTUAL_AND_EXPECTED_MATCHERS::test)
|
||||||
.any { equivalenceChecker.expressionsAreEquivalent(actualExpression, it.firstArg) }
|
.any { equivalenceChecker.expressionsAreEquivalent(actualExpression, it.firstArg) }
|
||||||
if (isSameExpression) {
|
if (isSameExpression) {
|
||||||
|
@ -124,6 +124,7 @@ class ExtractorReferenceContributor : PsiReferenceContributor() {
|
|||||||
if (!CallMatcher.anyOf(EXTRACTING_FROM_ITERABLE, FLAT_EXTRACTING_FROM_ITERABLE).test(methodCallExpression)) return null
|
if (!CallMatcher.anyOf(EXTRACTING_FROM_ITERABLE, FLAT_EXTRACTING_FROM_ITERABLE).test(methodCallExpression)) return null
|
||||||
|
|
||||||
val iterableType = findActualType(methodCallExpression) ?: return null
|
val iterableType = findActualType(methodCallExpression) ?: return null
|
||||||
|
if (iterableType.parameters.isEmpty()) return null
|
||||||
val innerType = iterableType.resolveGenerics().substitutor.substitute(iterableType.parameters[0])
|
val innerType = iterableType.resolveGenerics().substitutor.substitute(iterableType.parameters[0])
|
||||||
val containingClass = PsiTypesUtil.getPsiClass(innerType) ?: return null
|
val containingClass = PsiTypesUtil.getPsiClass(innerType) ?: return null
|
||||||
return if (isResultOf) lookupMethod(containingClass, literal) else lookupFieldOrProperty(containingClass, literal, 0)
|
return if (isResultOf) lookupMethod(containingClass, literal) else lookupFieldOrProperty(containingClass, literal, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user