Merge branch 'master' of git.labs.intellij.net:idea/community

This commit is contained in:
Mikhail Sokolov
2018-04-13 19:16:05 +03:00
5 changed files with 20 additions and 6 deletions
@@ -20,5 +20,6 @@
<orderEntry type="module" module-name="intellij.platform.testExtensions" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="TEST" />
<orderEntry type="library" name="XStream" level="project" />
<orderEntry type="library" name="lz4-java" level="project" />
</component>
</module>
@@ -9,8 +9,8 @@ import com.intellij.util.ArrayUtil
import com.intellij.util.SystemProperties
import com.intellij.util.isEmpty
import gnu.trove.THashMap
import org.iq80.snappy.SnappyFramedInputStream
import org.iq80.snappy.SnappyFramedOutputStream
import net.jpountz.lz4.LZ4BlockInputStream
import net.jpountz.lz4.LZ4BlockOutputStream
import org.jdom.Element
import java.io.ByteArrayInputStream
import java.util.*
@@ -18,13 +18,13 @@ import java.util.concurrent.atomic.AtomicReferenceArray
fun archiveState(state: Element): BufferExposingByteArrayOutputStream {
val byteOut = BufferExposingByteArrayOutputStream()
SnappyFramedOutputStream(byteOut).use {
LZ4BlockOutputStream(byteOut).use {
serializeElementToBinary(state, it)
}
return byteOut
}
private fun unarchiveState(state: ByteArray) = SnappyFramedInputStream(ByteArrayInputStream(state), false).use { deserializeElementFromBinary(it) }
private fun unarchiveState(state: ByteArray) = LZ4BlockInputStream(ByteArrayInputStream(state)).use { deserializeElementFromBinary(it) }
fun getNewByteIfDiffers(key: String, newState: Any, oldState: ByteArray): ByteArray? {
val newBytes: ByteArray
@@ -924,14 +924,20 @@ open class RunManagerImpl(internal val project: Project) : RunManagerEx(), Persi
}
else {
val templateConfiguration = getConfigurationTemplate(configuration.factory).configuration
val templateTasks = if (templateConfiguration === configuration) {
val isTemplate = templateConfiguration === configuration
val templateTasks = if (isTemplate) {
getHardcodedBeforeRunTasks(configuration)
}
else {
getTemplateBeforeRunTasks(templateConfiguration)
}
if (templateConfiguration === configuration) {
if (isTemplate) {
if (tasks == templateTasks) {
// nothing is changed
return
}
// we must update all existing configuration tasks to ensure that effective tasks (own + template) are the same as before template configuration change
// see testTemplates test
lock.read {
@@ -59,4 +59,10 @@ public class DeprecatedDuplicatesIconPathPatcher extends IconPathPatcher {
public String patchPath(String path) {
return ourDeprecatedIconsReplacements.get(path);
}
@Nullable
@Override
public Class getContextClass(String path) {
return DeprecatedDuplicatesIconPathPatcher.class;
}
}
@@ -267,6 +267,7 @@ public class RegistryValue {
void resetCache() {
myStringCachedValue = null;
myIntCachedValue = null;
myDoubleCachedValue = null;
myBooleanCachedValue = null;
}