diff --git a/README.md b/README.md index dea2cfb..c35c6fc 100644 --- a/README.md +++ b/README.md @@ -793,8 +793,9 @@ Feel free to use the code (in package ```de.platon42.intellij.jupiter```) for yo ## 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). +- Fixed two possible index out of bounds exceptions in ExtractorReferenceContributor and BogusAssertionInspection. #### V1.9 (25-Feb-20) Mardi Gras Edition - TwistedAssertion inspection will no longer warn for ```.matches()``` and ```doesNotMatch()``` for regular expressions. diff --git a/build.gradle b/build.gradle index 7da3d70..115d002 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group 'de.platon42' -version '1.9' +version '1.10' repositories { mavenCentral() @@ -43,9 +43,10 @@ intellij { patchPluginXml { changeNotes """ -
Full changelog available at Github project site.
""" diff --git a/src/main/java/de/platon42/intellij/plugins/cajon/inspections/BogusAssertionInspection.kt b/src/main/java/de/platon42/intellij/plugins/cajon/inspections/BogusAssertionInspection.kt index 3b4c59b..5e082c3 100644 --- a/src/main/java/de/platon42/intellij/plugins/cajon/inspections/BogusAssertionInspection.kt +++ b/src/main/java/de/platon42/intellij/plugins/cajon/inspections/BogusAssertionInspection.kt @@ -132,6 +132,7 @@ class BogusAssertionInspection : AbstractAssertJInspection() { // Note: replace with TrackingEquivalenceChecker() for IDEA >= 2019.1 val equivalenceChecker = EquivalenceChecker.getCanonicalPsiEquivalence()!! val isSameExpression = allCalls + .filter { it.argumentList.expressions.size == 1 } .filter(SAME_ACTUAL_AND_EXPECTED_MATCHERS::test) .any { equivalenceChecker.expressionsAreEquivalent(actualExpression, it.firstArg) } if (isSameExpression) { diff --git a/src/main/java/de/platon42/intellij/plugins/cajon/references/ExtractorReferenceContributor.kt b/src/main/java/de/platon42/intellij/plugins/cajon/references/ExtractorReferenceContributor.kt index ff69374..898e1f6 100644 --- a/src/main/java/de/platon42/intellij/plugins/cajon/references/ExtractorReferenceContributor.kt +++ b/src/main/java/de/platon42/intellij/plugins/cajon/references/ExtractorReferenceContributor.kt @@ -124,6 +124,7 @@ class ExtractorReferenceContributor : PsiReferenceContributor() { if (!CallMatcher.anyOf(EXTRACTING_FROM_ITERABLE, FLAT_EXTRACTING_FROM_ITERABLE).test(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 containingClass = PsiTypesUtil.getPsiClass(innerType) ?: return null return if (isResultOf) lookupMethod(containingClass, literal) else lookupFieldOrProperty(containingClass, literal, 0)