File tree Expand file tree Collapse file tree 3 files changed +4
-24
lines changed
src/main/kotlin/org/axonframework/intellij/ide/plugin Expand file tree Collapse file tree 3 files changed +4
-24
lines changed Original file line number Diff line number Diff line change 4
4
5
5
## [ 0.6.0]
6
6
7
+ ### Fixed
8
+ - Solved memory leak by excessive caching of handler calculation result
9
+
7
10
### Added
8
11
9
12
- Users can now report their exceptions and will be stored in our Sentry installation
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import com.intellij.codeInsight.daemon.LineMarkerProvider
21
21
import com.intellij.psi.PsiElement
22
22
import org.axonframework.intellij.ide.plugin.api.MessageHandlerType
23
23
import org.axonframework.intellij.ide.plugin.util.annotationResolver
24
- import org.axonframework.intellij.ide.plugin.util.cacheData
25
24
import org.axonframework.intellij.ide.plugin.util.resolvePayloadType
26
25
import org.axonframework.intellij.ide.plugin.util.toQualifiedName
27
26
import org.jetbrains.uast.UAnnotation
@@ -38,9 +37,7 @@ import org.jetbrains.uast.toUElementOfType
38
37
*/
39
38
abstract class AbstractHandlerLineMarkerProvider : LineMarkerProvider {
40
39
override fun getLineMarkerInfo (element : PsiElement ): LineMarkerInfo <* >? {
41
- val info = element.cacheData(" Axon_annotationInfo" ) {
42
- getInfoForAnnotatedFunction(element)
43
- }
40
+ val info = getInfoForAnnotatedFunction(element)
44
41
if (info != null ) {
45
42
return createLineMarker(element, info.first, info.second)
46
43
}
Original file line number Diff line number Diff line change 17
17
package org.axonframework.intellij.ide.plugin.util
18
18
19
19
import com.intellij.openapi.project.Project
20
- import com.intellij.openapi.util.Key
21
- import com.intellij.psi.PsiElement
22
- import com.intellij.psi.util.CachedValue
23
20
import com.intellij.psi.util.CachedValueProvider
24
21
import com.intellij.psi.util.CachedValuesManager
25
22
import com.intellij.psi.util.PsiModificationTracker
26
23
27
-
28
- /* *
29
- * Used to cache data on a PsiElement using the user data map.
30
- *
31
- * Uses PsiModificationTracker under the hood, so everything is re-computed when code changes.
32
- */
33
- fun <T > PsiElement.cacheData (key : String , supplier : () -> T ): T {
34
- val cacheKey = Key <CachedValue <T >>(key)
35
- val cache = getUserData(cacheKey)
36
- if (cache == null ) {
37
- val createCachedValue = project.createCachedValue(supplier)
38
- putUserData(cacheKey, createCachedValue)
39
- return createCachedValue.value
40
- }
41
- return cache.value
42
- }
43
-
44
24
/* *
45
25
* Convenience method to quickly create a cached value for a project based on PSI modifications.
46
26
*/
You can’t perform that action at this time.
0 commit comments