Skip to content

Commit

Permalink
build: upgrade idea SDK version (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
tangcent authored Mar 20, 2022
1 parent e050e39 commit 749a074
Show file tree
Hide file tree
Showing 31 changed files with 97 additions and 85 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8
systemProp.file.encoding=UTF-8
org.gradle.daemon=true
org.gradle.workers.max=8
idea_version=2017.3.5
idea_version=2019.1.4
kotlin_version=1.4.31
junit_version=5.7.1
descriptionFile=parts/pluginDescription.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ open class CachedResourceResolver : DefaultResourceResolver() {
}

private const val URL_CACHE_EXPIRE = "url.cache.expire"
private val LOG = org.apache.log4j.Logger.getLogger(CachedResourceResolver::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(CachedResourceResolver::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ class DataEventCollector : DataContext {
this.anActionEvent = anActionEvent
}

override fun getData(dataId: String?): Any? {
if (dataId == null) {
return null
}
override fun getData(dataId: String): Any? {
if (cache.containsKey(dataId)) {
return cache[dataId]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1689,4 +1689,4 @@ fun LazyAction.disposable(): DisposableLazyAction {
return DisposableLazyAction(this)
}

private val LOG = org.apache.log4j.Logger.getLogger(DefaultMethodInferHelper::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(DefaultMethodInferHelper::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -442,4 +442,4 @@ open class DefaultPostmanApiHelper : PostmanApiHelper {

}

private val LOG = org.apache.log4j.Logger.getLogger(DefaultPostmanApiHelper::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(DefaultPostmanApiHelper::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,4 @@ class PostmanApiExporter {
}
}

private val LOG = org.apache.log4j.Logger.getLogger(PostmanApiExporter::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(PostmanApiExporter::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,4 @@ class PostmanCachedApiHelper : DefaultPostmanApiHelper(), CacheSwitcher {
}
}

private val LOG = org.apache.log4j.Logger.getLogger(PostmanCachedApiHelper::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(PostmanCachedApiHelper::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ abstract class AbstractEasyApiConfigurable(private var myProject: Project?) : Se
}
}

private val LOG = org.apache.log4j.Logger.getLogger(EasyApiConfigurable::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(EasyApiConfigurable::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -667,4 +667,4 @@ abstract class AbstractApiDashboardDialog : JDialog() {
}
}

private val LOG = org.apache.log4j.Logger.getLogger(AbstractApiDashboardDialog::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(AbstractApiDashboardDialog::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -1040,4 +1040,4 @@ class ApiDashboardDialog : AbstractApiDashboardDialog() {

}

private val LOG = org.apache.log4j.Logger.getLogger(ApiDashboardDialog::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(ApiDashboardDialog::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -620,4 +620,4 @@ class EasyApiSettingGUI : AbstractEasyApiSettingGUI() {
}
}

private val LOG = org.apache.log4j.Logger.getLogger(YapiDashboardDialog::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(YapiDashboardDialog::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ class ScriptExecutorDialog : JDialog() {
this.editor = editor
val debugDialog = this
document.addDocumentListener(object : com.intellij.openapi.editor.event.DocumentListener {
override fun documentChanged(event: com.intellij.openapi.editor.event.DocumentEvent?) {
override fun documentChanged(event: com.intellij.openapi.editor.event.DocumentEvent) {
autoComputer.value(debugDialog::scriptText, document.text)
super.documentChanged(event)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,4 +827,4 @@ class YapiDashboardDialog : AbstractApiDashboardDialog() {

}

private val LOG = org.apache.log4j.Logger.getLogger(YapiDashboardDialog::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(YapiDashboardDialog::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ class AdaptiveMarkdownRender : MarkdownRender {
}
}

private val LOG = org.apache.log4j.Logger.getLogger(AdaptiveMarkdownRender::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(AdaptiveMarkdownRender::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ class Settings : ProjectSettingsSupport, ApplicationSettingsSupport {
return result
}

override fun toString(): String {
return "Settings(methodDocEnable=$methodDocEnable, genericEnable=$genericEnable, feignEnable=$feignEnable, quarkusEnable=$quarkusEnable, pullNewestDataBefore=$pullNewestDataBefore, postmanToken=$postmanToken, postmanWorkspace=$postmanWorkspace, postmanExportMode=$postmanExportMode, postmanCollections=$postmanCollections, wrapCollection=$wrapCollection, autoMergeScript=$autoMergeScript, postmanJson5FormatType='$postmanJson5FormatType', queryExpanded=$queryExpanded, formExpanded=$formExpanded, readGetter=$readGetter, readSetter=$readSetter, inferEnable=$inferEnable, inferMaxDeep=$inferMaxDeep, yapiServer=$yapiServer, yapiTokens=$yapiTokens, enableUrlTemplating=$enableUrlTemplating, switchNotice=$switchNotice, loginMode=$loginMode, yapiReqBodyJson5=$yapiReqBodyJson5, yapiResBodyJson5=$yapiResBodyJson5, httpTimeOut=$httpTimeOut, trustHosts=${trustHosts.contentToString()}, useRecommendConfig=$useRecommendConfig, recommendConfigs='$recommendConfigs', logLevel=$logLevel, logCharset='$logCharset', outputDemo=$outputDemo, outputCharset='$outputCharset', markdownFormatType='$markdownFormatType', builtInConfig=$builtInConfig)"
}

companion object {
const val DEFAULT_INFER_MAX_DEEP = 4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class XmlSettingBinder : SettingBinder {

override fun save(t: Settings?) {
if (t == null) {
projectSettingsComponent?.loadState(null)
applicationSettingsComponent.loadState(null)
projectSettingsComponent?.loadState(ProjectSettings())
applicationSettingsComponent.loadState(ApplicationSettings())
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.itangcent.idea.plugin.settings.xml

import com.itangcent.idea.plugin.settings.MarkdownFormatType
import com.itangcent.idea.plugin.settings.PostmanJson5FormatType
import com.itangcent.idea.plugin.settings.Settings
import com.itangcent.idea.plugin.settings.helper.RecommendConfigLoader
import com.itangcent.idea.utils.Charsets

Expand Down Expand Up @@ -113,7 +114,7 @@ class ApplicationSettings : ApplicationSettingsSupport {

override var inferEnable: Boolean = false

override var inferMaxDeep: Int = 0
override var inferMaxDeep: Int = Settings.DEFAULT_INFER_MAX_DEEP

//endregion

Expand All @@ -138,7 +139,7 @@ class ApplicationSettings : ApplicationSettingsSupport {
//unit:s
override var httpTimeOut: Int = 5

override var trustHosts: Array<String> = emptyArray()
override var trustHosts: Array<String> = Settings.DEFAULT_TRUST_HOSTS

//endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ApplicationSettingsComponent : PersistentStateComponent<ApplicationSetting
return applicationSettings?.copy()
}

override fun loadState(state: ApplicationSettings?) {
override fun loadState(state: ApplicationSettings) {
this.applicationSettings = state
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ProjectSettingsComponent : PersistentStateComponent<ProjectSettings> {
return projectSettings?.copy()
}

override fun loadState(state: ProjectSettings?) {
override fun loadState(state: ProjectSettings) {
this.projectSettings = state
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,4 @@ fun SqliteDataResourceHelper.ExpiredBeanDAO.delete(str: String) {
this.delete(str.toByteArray(Charsets.UTF_8))
}

private val LOG = org.apache.log4j.Logger.getLogger(SqliteDataResourceHelper::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(SqliteDataResourceHelper::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ abstract class Charsets {
* Returns a charset object for the named charset.
*/
fun forName(charset: String): Charsets? {
return SUPPORTED_CHARSETS.firstOrNull { it.displayName() == charset }
?: tryLoadCharset(charset)
return SUPPORTED_CHARSETS.firstOrNull {
it.displayName() == charset || it.charset().name() == charset
} ?: tryLoadCharset(charset)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ open class CustomizedPsiClassHelper : ContextualPsiClassHelper() {
val obj = try {
GsonExUtils.fromJson<Any>(valueText)
} catch (e: Exception) {
LOG.error("failed parse json:\n$valueText\n", e)
LOG.warn("failed parse json:\n$valueText\n", e)
return
}
if (isOriginal(obj)) {
Expand Down Expand Up @@ -132,4 +132,4 @@ open class CustomizedPsiClassHelper : ContextualPsiClassHelper() {
}
}

private val LOG = org.apache.log4j.Logger.getLogger(CustomizedPsiClassHelper::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(CustomizedPsiClassHelper::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object JacksonUtils {

init {
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY)
objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator(), ObjectMapper.DefaultTyping.NON_FINAL)
objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL)
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
Expand Down Expand Up @@ -48,4 +48,4 @@ object JacksonUtils {
}
}

private val LOG = org.apache.log4j.Logger.getLogger(JacksonUtils::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(JacksonUtils::class.java)
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ object SpiCompositeLoader {
return exclusions
}

val LOG = org.apache.log4j.Logger.getLogger(SpiCompositeLoader::class.java)!!
val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(SpiCompositeLoader::class.java)!!
}
4 changes: 2 additions & 2 deletions idea-plugin/src/main/kotlin/com/itangcent/task/Task.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ abstract class BaseTask(
}
Thread.sleep(100)
}
LOG.error("wait task $this done timeout")
LOG.warn("wait task $this done timeout")
}

override fun disposed(): Boolean {
Expand Down Expand Up @@ -237,4 +237,4 @@ abstract class AsyncTask(actionContext: ActionContext, taskManager: TaskManager)
return ret
}
}
private val LOG = org.apache.log4j.Logger.getLogger(Task::class.java)
private val LOG = com.intellij.openapi.diagnostic.Logger.getInstance(Task::class.java)
Loading

0 comments on commit 749a074

Please sign in to comment.