Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
357a1315
Commit
357a1315
authored
6 years ago
by
Vladimir Krivosheev
Browse files
Options
Download
Email Patches
Plain Diff
IDEA-CR-43092 use "obsolete" instead of "stalled"
parent
2b014e08
Branches unavailable
Tags unavailable
No related merge requests found
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt
+5
-5
...ation-store-impl/src/ComponentStoreWithExtraComponents.kt
platform/configuration-store-impl/src/ObsoleteStorageBean.java
+1
-1
...orm/configuration-store-impl/src/ObsoleteStorageBean.java
platform/configuration-store-impl/src/ProjectStoreImpl.kt
+2
-2
platform/configuration-store-impl/src/ProjectStoreImpl.kt
platform/configuration-store-impl/testSrc/ApplicationStoreTest.kt
+14
-14
.../configuration-store-impl/testSrc/ApplicationStoreTest.kt
platform/configuration-store-impl/testSrc/ProjectStoreTest.kt
+6
-6
...form/configuration-store-impl/testSrc/ProjectStoreTest.kt
platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml
+1
-1
...atform-resources/src/META-INF/PlatformExtensionPoints.xml
platform/platform-resources/src/META-INF/PlatformExtensions.xml
+14
-14
...rm/platform-resources/src/META-INF/PlatformExtensions.xml
with
43 additions
and
43 deletions
+43
-43
platform/configuration-store-impl/src/ComponentStoreWithExtraComponents.kt
+
5
-
5
View file @
357a1315
...
@@ -11,8 +11,8 @@ import kotlinx.coroutines.coroutineScope
...
@@ -11,8 +11,8 @@ import kotlinx.coroutines.coroutineScope
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.launch
import
java.util.concurrent.atomic.AtomicBoolean
import
java.util.concurrent.atomic.AtomicBoolean
// A way to remove
stalled/unused
component data.
// A way to remove
obsolete
component data.
internal
val
STALLED
_STORAGE_EP
=
ExtensionPointName
<
Stalled
StorageBean
>(
"com.intellij.
stalled
Storage"
)
internal
val
OBSOLETE
_STORAGE_EP
=
ExtensionPointName
<
Obsolete
StorageBean
>(
"com.intellij.
obsolete
Storage"
)
abstract
class
ComponentStoreWithExtraComponents
:
ComponentStoreImpl
()
{
abstract
class
ComponentStoreWithExtraComponents
:
ComponentStoreImpl
()
{
@Suppress
(
"DEPRECATION"
)
@Suppress
(
"DEPRECATION"
)
...
@@ -81,14 +81,14 @@ abstract class ComponentStoreWithExtraComponents : ComponentStoreImpl() {
...
@@ -81,14 +81,14 @@ abstract class ComponentStoreWithExtraComponents : ComponentStoreImpl() {
override
fun
commitComponents
(
isForce
:
Boolean
,
session
:
SaveSessionProducerManager
,
errors
:
MutableList
<
Throwable
>)
{
override
fun
commitComponents
(
isForce
:
Boolean
,
session
:
SaveSessionProducerManager
,
errors
:
MutableList
<
Throwable
>)
{
// ensure that this task will not interrupt regular saving
// ensure that this task will not interrupt regular saving
LOG
.
runAndLogException
{
LOG
.
runAndLogException
{
commit
Stalled
Components
(
session
,
false
)
commit
Obsolete
Components
(
session
,
false
)
}
}
super
.
commitComponents
(
isForce
,
session
,
errors
)
super
.
commitComponents
(
isForce
,
session
,
errors
)
}
}
internal
open
fun
commit
Stalled
Components
(
session
:
SaveSessionProducerManager
,
isProjectLevel
:
Boolean
)
{
internal
open
fun
commit
Obsolete
Components
(
session
:
SaveSessionProducerManager
,
isProjectLevel
:
Boolean
)
{
for
(
bean
in
STALLED
_STORAGE_EP
.
extensionList
)
{
for
(
bean
in
OBSOLETE
_STORAGE_EP
.
extensionList
)
{
if
(
bean
.
isProjectLevel
!=
isProjectLevel
)
{
if
(
bean
.
isProjectLevel
!=
isProjectLevel
)
{
continue
continue
}
}
...
...
This diff is collapsed.
Click to expand it.
platform/configuration-store-impl/src/
Stalled
StorageBean.java
→
platform/configuration-store-impl/src/
Obsolete
StorageBean.java
+
1
-
1
View file @
357a1315
...
@@ -7,7 +7,7 @@ import com.intellij.util.xmlb.annotations.XCollection;
...
@@ -7,7 +7,7 @@ import com.intellij.util.xmlb.annotations.XCollection;
import
java.util.List
;
import
java.util.List
;
final
class
Stalled
StorageBean
{
final
class
Obsolete
StorageBean
{
@Attribute
@Attribute
public
String
file
;
public
String
file
;
...
...
This diff is collapsed.
Click to expand it.
platform/configuration-store-impl/src/ProjectStoreImpl.kt
+
2
-
2
View file @
357a1315
...
@@ -353,9 +353,9 @@ private open class ProjectStoreImpl(project: Project, private val pathMacroManag
...
@@ -353,9 +353,9 @@ private open class ProjectStoreImpl(project: Project, private val pathMacroManag
final
override
fun
createSaveSessionProducerManager
()
=
ProjectSaveSessionProducerManager
(
project
)
final
override
fun
createSaveSessionProducerManager
()
=
ProjectSaveSessionProducerManager
(
project
)
final
override
fun
commit
Stalled
Components
(
session
:
SaveSessionProducerManager
,
isProjectLevel
:
Boolean
)
{
final
override
fun
commit
Obsolete
Components
(
session
:
SaveSessionProducerManager
,
isProjectLevel
:
Boolean
)
{
if
(
isDirectoryBased
)
{
if
(
isDirectoryBased
)
{
super
.
commit
Stalled
Components
(
session
,
true
)
super
.
commit
Obsolete
Components
(
session
,
true
)
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
platform/configuration-store-impl/testSrc/ApplicationStoreTest.kt
+
14
-
14
View file @
357a1315
...
@@ -299,10 +299,10 @@ internal class ApplicationStoreTest {
...
@@ -299,10 +299,10 @@ internal class ApplicationStoreTest {
@Test
@Test
fun
`remove
stalled
data`
()
=
runBlocking
<
Unit
>
{
fun
`remove
stalled
data`
()
=
runBlocking
<
Unit
>
{
val
stalled
StorageBean
=
Stalled
StorageBean
()
val
obsolete
StorageBean
=
Obsolete
StorageBean
()
stalled
StorageBean
.
file
=
"i_do_not_want_to_be_deleted_but.xml"
obsolete
StorageBean
.
file
=
"i_do_not_want_to_be_deleted_but.xml"
stalled
StorageBean
.
components
.
addAll
(
listOf
(
"loser1"
,
"loser2"
,
"lucky"
))
obsolete
StorageBean
.
components
.
addAll
(
listOf
(
"loser1"
,
"loser2"
,
"lucky"
))
PlatformTestUtil
.
maskExtensions
(
STALLED
_STORAGE_EP
,
listOf
(
stalled
StorageBean
),
disposableRule
.
disposable
)
PlatformTestUtil
.
maskExtensions
(
OBSOLETE
_STORAGE_EP
,
listOf
(
obsolete
StorageBean
),
disposableRule
.
disposable
)
@State
(
name
=
"loser1"
,
storages
=
[(
Storage
(
value
=
"i_do_not_want_to_be_deleted_but.xml"
))])
@State
(
name
=
"loser1"
,
storages
=
[(
Storage
(
value
=
"i_do_not_want_to_be_deleted_but.xml"
))])
class
AOther
:
A
()
class
AOther
:
A
()
...
@@ -325,8 +325,8 @@ internal class ApplicationStoreTest {
...
@@ -325,8 +325,8 @@ internal class ApplicationStoreTest {
componentStore
.
save
()
componentStore
.
save
()
// all must be saved regardless of
stalled
StorageBean because we have such components
// all must be saved regardless of
obsolete
StorageBean because we have such components
assertThat
(
testAppConfig
.
resolve
(
stalled
StorageBean
.
file
)).
isEqualTo
(
"""
assertThat
(
testAppConfig
.
resolve
(
obsolete
StorageBean
.
file
)).
isEqualTo
(
"""
<application>
<application>
<component name="loser1" foo="old" />
<component name="loser1" foo="old" />
<component name="loser2" foo="old?" />
<component name="loser2" foo="old?" />
...
@@ -338,7 +338,7 @@ internal class ApplicationStoreTest {
...
@@ -338,7 +338,7 @@ internal class ApplicationStoreTest {
// first looser is deleted since state equals to default (no committed component data)
// first looser is deleted since state equals to default (no committed component data)
componentStore
.
save
()
componentStore
.
save
()
assertThat
(
testAppConfig
.
resolve
(
stalled
StorageBean
.
file
)).
isEqualTo
(
"""
assertThat
(
testAppConfig
.
resolve
(
obsolete
StorageBean
.
file
)).
isEqualTo
(
"""
<application>
<application>
<component name="loser2" foo="old?" />
<component name="loser2" foo="old?" />
<component name="lucky" bar="foo" />
<component name="lucky" bar="foo" />
...
@@ -349,7 +349,7 @@ internal class ApplicationStoreTest {
...
@@ -349,7 +349,7 @@ internal class ApplicationStoreTest {
// second looser is deleted since state equals to default (no committed component data)
// second looser is deleted since state equals to default (no committed component data)
componentStore
.
save
()
componentStore
.
save
()
assertThat
(
testAppConfig
.
resolve
(
stalled
StorageBean
.
file
)).
isEqualTo
(
"""
assertThat
(
testAppConfig
.
resolve
(
obsolete
StorageBean
.
file
)).
isEqualTo
(
"""
<application>
<application>
<component name="lucky" bar="foo" />
<component name="lucky" bar="foo" />
</application>
</application>
...
@@ -358,12 +358,12 @@ internal class ApplicationStoreTest {
...
@@ -358,12 +358,12 @@ internal class ApplicationStoreTest {
@Test
@Test
fun
`remove
stalled
data
-
keep
file
if
another
unknown
component`
()
=
runBlocking
<
Unit
>
{
fun
`remove
stalled
data
-
keep
file
if
another
unknown
component`
()
=
runBlocking
<
Unit
>
{
val
stalled
StorageBean
=
Stalled
StorageBean
()
val
obsolete
StorageBean
=
Obsolete
StorageBean
()
stalled
StorageBean
.
file
=
"i_will_be_not_deleted.xml"
obsolete
StorageBean
.
file
=
"i_will_be_not_deleted.xml"
stalled
StorageBean
.
components
.
addAll
(
listOf
(
"Loser"
))
obsolete
StorageBean
.
components
.
addAll
(
listOf
(
"Loser"
))
PlatformTestUtil
.
maskExtensions
(
STALLED
_STORAGE_EP
,
listOf
(
stalled
StorageBean
),
disposableRule
.
disposable
)
PlatformTestUtil
.
maskExtensions
(
OBSOLETE
_STORAGE_EP
,
listOf
(
obsolete
StorageBean
),
disposableRule
.
disposable
)
testAppConfig
.
resolve
(
stalled
StorageBean
.
file
).
write
(
"""
testAppConfig
.
resolve
(
obsolete
StorageBean
.
file
).
write
(
"""
<application>
<application>
<component name="Unknown" data="some data" />
<component name="Unknown" data="some data" />
<component name="Loser" foo="old?" />
<component name="Loser" foo="old?" />
...
@@ -372,7 +372,7 @@ internal class ApplicationStoreTest {
...
@@ -372,7 +372,7 @@ internal class ApplicationStoreTest {
componentStore
.
save
()
componentStore
.
save
()
assertThat
(
testAppConfig
.
resolve
(
stalled
StorageBean
.
file
)).
isEqualTo
(
"""
assertThat
(
testAppConfig
.
resolve
(
obsolete
StorageBean
.
file
)).
isEqualTo
(
"""
<application>
<application>
<component name="Unknown" data="some data" />
<component name="Unknown" data="some data" />
</application>
</application>
...
...
This diff is collapsed.
Click to expand it.
platform/configuration-store-impl/testSrc/ProjectStoreTest.kt
+
6
-
6
View file @
357a1315
...
@@ -182,16 +182,16 @@ internal class ProjectStoreTest {
...
@@ -182,16 +182,16 @@ internal class ProjectStoreTest {
"""
.
trimIndent
())
"""
.
trimIndent
())
it
.
path
it
.
path
})
{
project
->
})
{
project
->
val
stalled
StorageBean
=
Stalled
StorageBean
()
val
obsolete
StorageBean
=
Obsolete
StorageBean
()
val
storageFileName
=
"foo.xml"
val
storageFileName
=
"foo.xml"
stalled
StorageBean
.
file
=
storageFileName
obsolete
StorageBean
.
file
=
storageFileName
stalled
StorageBean
.
components
.
addAll
(
listOf
(
"AppLevelLoser"
))
obsolete
StorageBean
.
components
.
addAll
(
listOf
(
"AppLevelLoser"
))
val
projectStalledStorageBean
=
Stalled
StorageBean
()
val
projectStalledStorageBean
=
Obsolete
StorageBean
()
projectStalledStorageBean
.
file
=
storageFileName
projectStalledStorageBean
.
file
=
storageFileName
projectStalledStorageBean
.
isProjectLevel
=
true
projectStalledStorageBean
.
isProjectLevel
=
true
projectStalledStorageBean
.
components
.
addAll
(
listOf
(
"ProjectLevelLoser"
))
projectStalledStorageBean
.
components
.
addAll
(
listOf
(
"ProjectLevelLoser"
))
PlatformTestUtil
.
maskExtensions
(
STALLED
_STORAGE_EP
,
listOf
(
stalled
StorageBean
,
projectStalledStorageBean
),
project
)
PlatformTestUtil
.
maskExtensions
(
OBSOLETE
_STORAGE_EP
,
listOf
(
obsolete
StorageBean
,
projectStalledStorageBean
),
project
)
val
componentStore
=
project
.
stateStore
val
componentStore
=
project
.
stateStore
...
@@ -204,7 +204,7 @@ internal class ProjectStoreTest {
...
@@ -204,7 +204,7 @@ internal class ProjectStoreTest {
componentStore
.
save
()
componentStore
.
save
()
assertThat
(
Paths
.
get
(
project
.
stateStore
.
storageManager
.
expandMacros
(
PROJECT_CONFIG_DIR
)).
resolve
(
stalled
StorageBean
.
file
)).
isEqualTo
(
"""
assertThat
(
Paths
.
get
(
project
.
stateStore
.
storageManager
.
expandMacros
(
PROJECT_CONFIG_DIR
)).
resolve
(
obsolete
StorageBean
.
file
)).
isEqualTo
(
"""
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<project version="4">
<component name="AppLevelLoser" foo="old?" />
<component name="AppLevelLoser" foo="old?" />
...
...
This diff is collapsed.
Click to expand it.
platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml
+
1
-
1
View file @
357a1315
...
@@ -348,6 +348,6 @@
...
@@ -348,6 +348,6 @@
<extensionPoint
qualifiedName=
"com.intellij.search.traverseUiHelper"
interface=
"com.intellij.ide.ui.search.TraverseUIHelper"
/>
<extensionPoint
qualifiedName=
"com.intellij.search.traverseUiHelper"
interface=
"com.intellij.ide.ui.search.TraverseUIHelper"
/>
<extensionPoint
name=
"
stalled
Storage"
beanClass=
"com.intellij.configurationStore.
Stalled
StorageBean"
/>
<extensionPoint
name=
"
obsolete
Storage"
beanClass=
"com.intellij.configurationStore.
Obsolete
StorageBean"
/>
</extensionPoints>
</extensionPoints>
</idea-plugin>
</idea-plugin>
This diff is collapsed.
Click to expand it.
platform/platform-resources/src/META-INF/PlatformExtensions.xml
+
14
-
14
View file @
357a1315
...
@@ -600,28 +600,28 @@
...
@@ -600,28 +600,28 @@
<rawEditorTypedHandler
implementationClass=
"com.intellij.openapi.editor.impl.EditorFactoryImpl$MyRawTypedHandler"
/>
<rawEditorTypedHandler
implementationClass=
"com.intellij.openapi.editor.impl.EditorFactoryImpl$MyRawTypedHandler"
/>
<
stalled
Storage
file=
"statistics.toolbar.clicks.xml"
>
<
obsolete
Storage
file=
"statistics.toolbar.clicks.xml"
>
<components>
<components>
<component>
ToolbarClicksCollector
</component>
<component>
ToolbarClicksCollector
</component>
</components>
</components>
</
stalled
Storage>
</
obsolete
Storage>
<
stalled
Storage
file=
"statistics.main_menu.xml"
>
<
obsolete
Storage
file=
"statistics.main_menu.xml"
>
<components>
<components>
<component>
MainMenuCollector
</component>
<component>
MainMenuCollector
</component>
</components>
</components>
</
stalled
Storage>
</
obsolete
Storage>
<
stalled
Storage
file=
"statistics.shortcuts.xml"
>
<
obsolete
Storage
file=
"statistics.shortcuts.xml"
>
<components>
<components>
<component>
ShortcutsCollector
</component>
<component>
ShortcutsCollector
</component>
</components>
</components>
</
stalled
Storage>
</
obsolete
Storage>
<
stalled
Storage
file=
"statistics.application.usages.xml"
>
<
obsolete
Storage
file=
"statistics.application.usages.xml"
>
<components>
<components>
<component>
StatisticsApplicationUsages
</component>
<component>
StatisticsApplicationUsages
</component>
<component>
UsageTrigger
</component>
<component>
UsageTrigger
</component>
</components>
</components>
</
stalled
Storage>
</
obsolete
Storage>
<
stalled
Storage
file=
"usage.statistics.xml"
>
<
obsolete
Storage
file=
"usage.statistics.xml"
>
<components>
<components>
<component>
StatisticsApplicationUsages
</component>
<component>
StatisticsApplicationUsages
</component>
<component>
UsageTrigger
</component>
<component>
UsageTrigger
</component>
...
@@ -634,18 +634,18 @@
...
@@ -634,18 +634,18 @@
<component>
ActionsCollector
</component>
<component>
ActionsCollector
</component>
<component>
FUSApplicationUsageTrigger
</component>
<component>
FUSApplicationUsageTrigger
</component>
</components>
</components>
</
stalled
Storage>
</
obsolete
Storage>
<
stalled
Storage
file=
"usage.statistics.xml"
isProjectLevel=
"true"
>
<
obsolete
Storage
file=
"usage.statistics.xml"
isProjectLevel=
"true"
>
<components>
<components>
<component>
FUSProjectUsageTrigger
</component>
<component>
FUSProjectUsageTrigger
</component>
</components>
</components>
</
stalled
Storage>
</
obsolete
Storage>
<
stalled
Storage
file=
"workspace.xml"
isProjectLevel=
"true"
>
<
obsolete
Storage
file=
"workspace.xml"
isProjectLevel=
"true"
>
<components>
<components>
<component>
FUSProjectUsageTrigger
</component>
<component>
FUSProjectUsageTrigger
</component>
</components>
</components>
</
stalled
Storage>
</
obsolete
Storage>
<postStartupActivity
implementation=
"com.intellij.ide.StartUpPerformanceReporter"
order=
"last"
/>
<postStartupActivity
implementation=
"com.intellij.ide.StartUpPerformanceReporter"
order=
"last"
/>
</extensions>
</extensions>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help