mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup, touch file to ensure that it will be recompiled
This commit is contained in:
@@ -66,12 +66,9 @@ internal class DefaultProjectStoreImpl(override val project: ProjectImpl, privat
|
||||
|
||||
override fun getStateStorage(storageSpec: Storage) = storage
|
||||
|
||||
override fun startExternalization(): StateStorageManager.ExternalizationSession? {
|
||||
val externalizationSession = storage.startExternalization()
|
||||
return if (externalizationSession == null) null else MyExternalizationSession(externalizationSession)
|
||||
}
|
||||
override fun startExternalization() = storage.startExternalization()?.let { MyExternalizationSession(it) }
|
||||
|
||||
override fun expandMacros(file: String) = throw UnsupportedOperationException("Method expandMacros not implemented in " + javaClass)
|
||||
override fun expandMacros(file: String) = throw UnsupportedOperationException()
|
||||
|
||||
override fun getOldStorage(component: Any, componentName: String, operation: StateStorageOperation) = storage
|
||||
}
|
||||
@@ -104,7 +101,7 @@ internal class DefaultProjectStoreImpl(override val project: ProjectImpl, privat
|
||||
// ExportSettingsAction checks only "State" annotation presence, but doesn't require PersistentStateComponent implementation, so, we can just specify annotation
|
||||
@State(name = "ProjectManager", storages = arrayOf(Storage(file = DefaultProjectStoreImpl.FILE_SPEC)))
|
||||
private class DefaultProjectExportableAndSaveTrigger : SettingsSavingComponent {
|
||||
@Volatile var project: Project? = null;
|
||||
@Volatile var project: Project? = null
|
||||
|
||||
override fun save() {
|
||||
// we must trigger save
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.jetbrains.protocolReader
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.util.Arrays
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* A class that makes accurate java source file update. If only header
|
||||
@@ -16,19 +16,19 @@ class FileUpdater(private val file: Path) {
|
||||
val out = TextOutput(builder)
|
||||
|
||||
fun update() {
|
||||
if (builder.length() == 0) {
|
||||
if (builder.length == 0) {
|
||||
Files.delete(file)
|
||||
return
|
||||
}
|
||||
|
||||
val newContent = builder.toString().getBytes(StandardCharsets.UTF_8)
|
||||
val newContent = builder.toString().toByteArray(StandardCharsets.UTF_8)
|
||||
if (Files.exists(file)) {
|
||||
if (Arrays.equals(Files.readAllBytes(file), newContent)) {
|
||||
return
|
||||
}
|
||||
}
|
||||
else {
|
||||
Files.createDirectories(file.getParent())
|
||||
Files.createDirectories(file.parent)
|
||||
}
|
||||
Files.write(file, newContent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user