mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
Apply Kotlin inspection "Redundant semicolon"
GitOrigin-RevId: e97056ead03cff412fc10cee0d5fa2d4cc7dde30
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3427459014
commit
c6138e8d67
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.intellij.lang.regexp.inspection.custom;
|
||||
package org.intellij.lang.regexp.inspection.custom
|
||||
|
||||
import com.intellij.find.FindBundle
|
||||
import com.intellij.find.FindModel
|
||||
|
||||
@@ -77,7 +77,7 @@ internal class ProblemSearcher(private val file: PsiFile, private val memberType
|
||||
override fun visitForeachStatement(statement: PsiForeachStatement) {
|
||||
visitStatement(statement)
|
||||
val element = statement.iterationParameter
|
||||
if (element == null) return;
|
||||
if (element == null) return
|
||||
findProblem(element)
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,13 @@ class JavaLibraryDataServiceExtension : LibraryDataServiceExtension {
|
||||
if (getMavenCoordinates(libraryData) != null) {
|
||||
return ImportedLibraryType.IMPORTED_LIBRARY_KIND
|
||||
}
|
||||
return null;
|
||||
return null
|
||||
}
|
||||
|
||||
override fun prepareNewLibrary(libraryData: LibraryData,
|
||||
libraryModel: Library.ModifiableModel) {
|
||||
val properties = (libraryModel as? LibraryEx)?.properties
|
||||
val coords = getMavenCoordinates(libraryData);
|
||||
val coords = getMavenCoordinates(libraryData)
|
||||
if (properties is ImportedLibraryProperties && coords != null) {
|
||||
(libraryModel as? LibraryEx.ModifiableModelEx)?.properties = ImportedLibraryProperties(coords)
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class ExecutorAction private constructor(val origin: AnAction,
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is ActionGroupWrapper && delegate == other.delegate;
|
||||
return other is ActionGroupWrapper && delegate == other.delegate
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
|
||||
@@ -35,7 +35,7 @@ class IndexIdRuleValidator : CustomValidationRule() {
|
||||
return validatePlugin(getPluginInfoById(pluginId))
|
||||
}else if(!runningFromSources){
|
||||
//if pluginId is null & not from sources -> this is core index, so allow it
|
||||
return ValidationResultType.ACCEPTED;
|
||||
return ValidationResultType.ACCEPTED
|
||||
}else{ // if (runningFromSources)
|
||||
|
||||
//RC: isn't it taxing to scan the lists of all file/stub indexes on _each_ indexId validation?
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.ApiStatus
|
||||
@ApiStatus.Experimental
|
||||
class NonBinaryFileTypeInputFilter(private val acceptInput: FileBasedIndex.InputFilter) : BaseFileTypeInputFilter() {
|
||||
override fun acceptFileType(fileType: FileType): ThreeState {
|
||||
return if (fileType.isBinary) ThreeState.NO else ThreeState.UNSURE;
|
||||
return if (fileType.isBinary) ThreeState.NO else ThreeState.UNSURE
|
||||
}
|
||||
|
||||
override fun slowPathIfFileTypeHintUnsure(file: IndexedFile): Boolean {
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.awt.datatransfer.StringSelection
|
||||
|
||||
abstract class CopyPathProvider : AnAction() {
|
||||
companion object {
|
||||
@JvmField val QUALIFIED_NAME : Key<@NlsSafe String> = Key.create("QUALIFIED_NAME");
|
||||
@JvmField val QUALIFIED_NAME : Key<@NlsSafe String> = Key.create("QUALIFIED_NAME")
|
||||
}
|
||||
|
||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
|
||||
|
||||
@@ -44,6 +44,6 @@ class GotoClassItemProvider(val context: PsiElement?) : DefaultChooseByNameItemP
|
||||
true
|
||||
}
|
||||
|
||||
return processByNames(base, true, indicator, context, consumerFQN, names, FindSymbolParameters.simple(project, false));
|
||||
return processByNames(base, true, indicator, context, consumerFQN, names, FindSymbolParameters.simple(project, false))
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import com.intellij.ide.actions.searcheverywhere.remote.SearchEverywhereRemoteSu
|
||||
class SearchEverywhereRemoteSupportServiceImpl: SearchEverywhereRemoteSupportService {
|
||||
|
||||
override fun getConverters(contributorID: String?): List<RemoteSearchEverywhereConverter<*, *>> {
|
||||
val res = mutableListOf<RemoteSearchEverywhereConverter<*, *>>();
|
||||
val res = mutableListOf<RemoteSearchEverywhereConverter<*, *>>()
|
||||
RemoteSearchEverywhereConverterSupplier.EP_NAME.extensionList
|
||||
.filter { it.contributorsList().contains(contributorID) }
|
||||
.forEach { res.add(it.createConverter()) }
|
||||
|
||||
@@ -65,7 +65,7 @@ class RuntimeChooserPresenter: ColoredListCellRenderer<RuntimeChooserItem>() {
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val SEPARATOR: @NlsSafe String = " ";
|
||||
private const val SEPARATOR: @NlsSafe String = " "
|
||||
|
||||
fun SimpleColoredComponent.presetRuntime(value: RuntimeChooserItemWithFixedLocation) {
|
||||
value.version?.let {
|
||||
|
||||
@@ -31,7 +31,7 @@ class FileBasedIndexTumbler(private val reason: @NonNls String) {
|
||||
|
||||
fun turnOff() {
|
||||
val app = ApplicationManager.getApplication()
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsDispatchThread()
|
||||
LOG.assertTrue(!app.isWriteAccessAllowed)
|
||||
try {
|
||||
if (nestedLevelCount == 0) {
|
||||
|
||||
@@ -43,13 +43,13 @@ class SpeedSearchAdvertiser : ComponentAdvertiser() {
|
||||
|
||||
val label = JLabel(IdeBundle.message("speed.search.got.it.text"))
|
||||
.apply {
|
||||
foreground = JBUI.CurrentTheme.Advertiser.foreground();
|
||||
foreground = JBUI.CurrentTheme.Advertiser.foreground()
|
||||
font = adFont()
|
||||
}
|
||||
|
||||
panel.add(label)
|
||||
panel.add(actionLink)
|
||||
panel.background = JBUI.CurrentTheme.Advertiser.background();
|
||||
panel.background = JBUI.CurrentTheme.Advertiser.background()
|
||||
|
||||
addComponentAdvertiser(panel)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.ui.tabs;
|
||||
package com.intellij.ui.tabs
|
||||
|
||||
import com.intellij.ui.tabs.impl.TabLabel
|
||||
import java.awt.Font
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.diagnostic;
|
||||
package com.intellij.diagnostic
|
||||
|
||||
open class KotlinCompilerCrash(message: String, cause: Throwable? = null, val version: String) : Exception(message, cause, false, false) {
|
||||
}
|
||||
@@ -336,7 +336,7 @@ object Switcher : BaseSwitcherAction(null) {
|
||||
myPopup.showCenteredInCurrentWindow(project)
|
||||
|
||||
if (Registry.`is`("highlighting.passes.cache")) {
|
||||
HighlightingPassesCache.getInstance(project).schedule(getNotOpenedRecentFiles());
|
||||
HighlightingPassesCache.getInstance(project).schedule(getNotOpenedRecentFiles())
|
||||
}
|
||||
}
|
||||
private fun getNotOpenedRecentFiles(): List<VirtualFile> {
|
||||
|
||||
@@ -29,4 +29,4 @@ class UseProjectColorsCheckboxAction : CheckboxAction(IdeBundle.message("checkbo
|
||||
override fun getActionUpdateThread(): ActionUpdateThread {
|
||||
return ActionUpdateThread.BGT
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -32,7 +32,7 @@ internal class CheckVFSHealthAction : AnAction() {
|
||||
FSRecords.checkSanity()
|
||||
}
|
||||
catch (t: Throwable){
|
||||
FSRecords.LOG.warn("VFS health check: old sanity-checking version", t);
|
||||
FSRecords.LOG.warn("VFS health check: old sanity-checking version", t)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ object PersistentFSRecordsStorageFactory {
|
||||
@JvmStatic
|
||||
@JvmName("setRecordsStorageImplementation")
|
||||
fun setRecordsStorageImplementation(value: RecordsStorageKind) {
|
||||
RECORDS_STORAGE_KIND = value;
|
||||
RECORDS_STORAGE_KIND = value
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
@@ -18,7 +18,7 @@ class IdeGraphicsEnvironment: SunGraphicsEnvironment() {
|
||||
|
||||
@JvmStatic
|
||||
val isRealHeadless: Boolean
|
||||
get() = PlatformGraphicsInfo.getDefaultHeadlessProperty();
|
||||
get() = PlatformGraphicsInfo.getDefaultHeadlessProperty()
|
||||
|
||||
@JvmStatic
|
||||
private fun getClientInstance(): ClientGraphicsEnvironment {
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestModulePropertiesBridge(private val currentModule: Module): TestModuleP
|
||||
}
|
||||
|
||||
override fun setProductionModuleName(moduleName: String?) {
|
||||
ApplicationManager.getApplication().assertWriteAccessAllowed();
|
||||
ApplicationManager.getApplication().assertWriteAccessAllowed()
|
||||
val moduleEntity = getModuleEntity() ?: error("Module entity with name: ${currentModule.name} should be available")
|
||||
if (moduleEntity.testProperties?.productionModuleId?.name == moduleName) return
|
||||
workspaceModel.updateProjectModel("Linking production module with the test") { builder ->
|
||||
@@ -42,7 +42,7 @@ class TestModulePropertiesBridge(private val currentModule: Module): TestModuleP
|
||||
}
|
||||
|
||||
fun setProductionModuleNameToBuilder(moduleName: String?, builder: MutableEntityStorage) {
|
||||
ApplicationManager.getApplication().assertWriteAccessAllowed();
|
||||
ApplicationManager.getApplication().assertWriteAccessAllowed()
|
||||
val moduleEntity = builder.resolve(ModuleId(currentModule.name)) ?: error("Module entity with name: ${currentModule.name} should be available")
|
||||
if (moduleEntity.testProperties?.productionModuleId?.name == moduleName) return
|
||||
moduleEntity.testProperties?.let { builder.removeEntity(it) }
|
||||
|
||||
@@ -248,7 +248,7 @@ object CodeWithMeClientDownloader {
|
||||
@ApiStatus.Experimental
|
||||
fun downloadClientAndJdk(clientBuildVersion: String,
|
||||
progressIndicator: ProgressIndicator): ExtractedJetBrainsClientData? {
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
|
||||
val jdkBuildProgressIndicator = progressIndicator.createSubProgress(0.1)
|
||||
val jdkBuild = if (isClientWithBundledJre(clientBuildVersion)) {
|
||||
@@ -290,7 +290,7 @@ object CodeWithMeClientDownloader {
|
||||
fun downloadClientAndJdk(clientBuildVersion: String,
|
||||
jreBuild: String?,
|
||||
progressIndicator: ProgressIndicator): ExtractedJetBrainsClientData? {
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
|
||||
val sessionInfo = createSessionInfo(clientBuildVersion, jreBuild, true)
|
||||
return downloadClientAndJdk(sessionInfo, progressIndicator)
|
||||
@@ -330,7 +330,7 @@ object CodeWithMeClientDownloader {
|
||||
*/
|
||||
fun downloadClientAndJdk(sessionInfoResponse: JetbrainsClientDownloadInfo,
|
||||
progressIndicator: ProgressIndicator): ExtractedJetBrainsClientData? {
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
|
||||
val tempDir = FileUtil.createTempDirectory("jb-cwm-dl", null).toPath()
|
||||
LOG.info("Downloading Thin Client in $tempDir...")
|
||||
@@ -532,7 +532,7 @@ object CodeWithMeClientDownloader {
|
||||
}
|
||||
|
||||
private fun downloadWithRetries(url: URI, path: Path, progressIndicator: ProgressIndicator) {
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
|
||||
@Suppress("LocalVariableName")
|
||||
val MAX_ATTEMPTS = 5
|
||||
|
||||
@@ -60,10 +60,10 @@ open class TestProjectManager : ProjectManagerImpl() {
|
||||
}
|
||||
|
||||
suspend fun loadAndOpenProject(path: Path, parent: Disposable): Project {
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
val project = getInstanceEx().openProjectAsync(path, OpenProjectTask {})!!
|
||||
Disposer.register(parent) {
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
runBlocking {
|
||||
getInstanceEx().forceCloseProjectAsync(project)
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ fun <T> withThreadLocal(variable: ThreadLocal<T>, update: (value: T) -> T): Acce
|
||||
val previousValue = variable.get()
|
||||
val newValue = update(previousValue)
|
||||
if (newValue === previousValue) {
|
||||
return AccessToken.EMPTY_ACCESS_TOKEN;
|
||||
return AccessToken.EMPTY_ACCESS_TOKEN
|
||||
}
|
||||
variable.set(newValue)
|
||||
return object : AccessToken() {
|
||||
|
||||
@@ -69,7 +69,7 @@ open class IgnoreFileActionGroup(private val ignoreFileType: IgnoreFileType) :
|
||||
|
||||
presentation.isPopupGroup = actions.size > 1
|
||||
presentation.isPerformGroup = actions.size == 1
|
||||
e.presentation.putClientProperty(ActionButton.HIDE_DROPDOWN_ICON, e.presentation.isPerformGroup);
|
||||
e.presentation.putClientProperty(ActionButton.HIDE_DROPDOWN_ICON, e.presentation.isPerformGroup)
|
||||
presentation.isVisible = actions.isNotEmpty()
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ internal class ModuleVcsDetector(private val project: Project) {
|
||||
}
|
||||
|
||||
override fun getOrder(): Int {
|
||||
return VcsInitObject.MAPPINGS.order + 10;
|
||||
return VcsInitObject.MAPPINGS.order + 10
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ fun <Y : Any> runAndCatchNotNull(errorMessage: String, action: () -> Y?): Y {
|
||||
private fun assertInnocentThreadToWait() {
|
||||
require(!ApplicationManager.getApplication().isWriteAccessAllowed) { "Must not leak write action" }
|
||||
require(!ApplicationManager.getApplication().isWriteIntentLockAcquired) { "Must not run in Write Thread" }
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertReadAccessNotAllowed();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
ApplicationManager.getApplication().assertReadAccessNotAllowed()
|
||||
}
|
||||
|
||||
suspend fun yieldThroughInvokeLater() {
|
||||
|
||||
@@ -10,7 +10,7 @@ abstract class WslHashFilter protected constructor(private val operator: WslHash
|
||||
* @return true if [fileName] matches, false otherwise.
|
||||
*/
|
||||
fun matches(fileName: String): Boolean {
|
||||
return matcher.matches(fileName);
|
||||
return matcher.matches(fileName)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,5 +6,5 @@ import javax.swing.JComponent
|
||||
|
||||
@ApiStatus.Experimental
|
||||
abstract class CustomComponentEvaluator(name: String) : XFullValueEvaluator() {
|
||||
open fun createComponent(fullValue: String?) : JComponent? = null;
|
||||
open fun createComponent(fullValue: String?) : JComponent? = null
|
||||
}
|
||||
@@ -112,7 +112,7 @@ class EditorConfigFileHierarchyServiceImpl(private val project: Project) : Edito
|
||||
*/
|
||||
private fun findApplicableFiles(virtualFile: VirtualFile): List<EditorConfigPsiFile>? {
|
||||
val app = ApplicationManager.getApplication()
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
app.assertReadAccessAllowed()
|
||||
return when {
|
||||
!EditorConfigRegistry.shouldStopAtProjectRoot() -> findParentPsiFiles(virtualFile)
|
||||
@@ -128,7 +128,7 @@ class EditorConfigFileHierarchyServiceImpl(private val project: Project) : Edito
|
||||
*/
|
||||
private fun findParentPsiFiles(file: VirtualFile): List<EditorConfigPsiFile>? {
|
||||
val app = ApplicationManager.getApplication()
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
app.assertReadAccessAllowed()
|
||||
val expectedCacheDropsCount = cacheDropsCount
|
||||
|
||||
@@ -155,7 +155,7 @@ class EditorConfigFileHierarchyServiceImpl(private val project: Project) : Edito
|
||||
*/
|
||||
private fun findParentFiles(file: VirtualFile): List<VirtualFile>? {
|
||||
val app = ApplicationManager.getApplication()
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
app.assertReadAccessAllowed()
|
||||
val fileName = EditorConfigFileConstants.FILE_NAME
|
||||
val expectedCacheDropsCount = cacheDropsCount
|
||||
|
||||
@@ -31,6 +31,6 @@ class GitCheckoutCommand(text: String, line: Int) : AbstractCommand(text, line,
|
||||
val dataContext = DataManager.getInstance().getDataContext(focusedComponent)
|
||||
val gitRepository = GitBranchUtil.guessRepositoryForOperation(context.project, dataContext)
|
||||
brancher.checkoutNewBranchStartingFrom(branchName, branchName, true, mutableListOf(gitRepository), Runnable { actionCallback.setDone() })
|
||||
return actionCallback.toPromise();
|
||||
return actionCallback.toPromise()
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ open class GHOpenInBrowserActionGroup
|
||||
val data = getData(e.dataContext)
|
||||
e.presentation.isEnabledAndVisible = !data.isNullOrEmpty()
|
||||
e.presentation.isPerformGroup = data?.size == 1
|
||||
e.presentation.putClientProperty(ActionButton.HIDE_DROPDOWN_ICON, e.presentation.isPerformGroup);
|
||||
e.presentation.putClientProperty(ActionButton.HIDE_DROPDOWN_ICON, e.presentation.isPerformGroup)
|
||||
e.presentation.isPopupGroup = true
|
||||
e.presentation.isDisableGroupIfEmpty = false
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ internal class GradleServerEnvironmentSetupImpl(private val project: Project,
|
||||
configuration: TargetEnvironmentConfiguration
|
||||
): List<Pair<String, TargetValue<String>?>> {
|
||||
val targetBuildArguments = ArrayList<Pair<String, TargetValue<String>?>>()
|
||||
val iterator = parameters.arguments?.iterator() ?: return targetBuildArguments;
|
||||
val iterator = parameters.arguments?.iterator() ?: return targetBuildArguments
|
||||
while (iterator.hasNext()) {
|
||||
val arg = iterator.next()
|
||||
if (arg == INIT_SCRIPT_CMD_OPTION && iterator.hasNext()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.jvmcompat;
|
||||
package org.jetbrains.plugins.gradle.jvmcompat
|
||||
|
||||
import com.intellij.ReviseWhenPortedToJDK
|
||||
import java.io.BufferedInputStream
|
||||
@@ -13,7 +13,7 @@ import javax.xml.stream.XMLInputFactory
|
||||
fun main(args: Array<String>) {
|
||||
assert(args.size == 3) { "Should be 3 files: Path to JSON, path to result file dir, path to ApplicationInfo.xml" }
|
||||
val applicationVersion = readAppVersion(Paths.get(args[2]))
|
||||
generateJvmSupportMatrices(Paths.get(args[0]), Paths.get(args[1]), applicationVersion);
|
||||
generateJvmSupportMatrices(Paths.get(args[0]), Paths.get(args[1]), applicationVersion)
|
||||
}
|
||||
|
||||
fun generateJvmSupportMatrices(json: Path, kt: Path, applicationVersion: String, copyrightComment: String? = null) {
|
||||
@@ -27,7 +27,7 @@ fun generateJvmSupportMatrices(json: Path, kt: Path, applicationVersion: String,
|
||||
}
|
||||
val classFileData = ClassFileData(copyrightComment ?: createCopyrightComment(), parsedData)
|
||||
|
||||
val fileData = getGeneratedString(classFileData);
|
||||
val fileData = getGeneratedString(classFileData)
|
||||
kt.toFile().writeText(fileData, Charsets.UTF_8)
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ fun readAppVersion(appInfoPath: Path): String {
|
||||
val xmlInputFactory: XMLInputFactory = XMLInputFactory.newInstance()
|
||||
BufferedInputStream(FileInputStream(appInfoPath.toFile())).use { bis ->
|
||||
val reader = xmlInputFactory.createXMLEventReader(bis)
|
||||
val startDocument = reader.nextEvent();
|
||||
val startDocument = reader.nextEvent()
|
||||
assert(startDocument.isStartDocument)
|
||||
if (reader.hasNext()) {
|
||||
val startElement = reader.nextEvent()
|
||||
|
||||
@@ -17,7 +17,7 @@ abstract class IdeVersionedDataParser<T : IdeVersionedDataState> {
|
||||
}
|
||||
|
||||
fun <T> parseVersion(p: String?, transform: (String) -> T): T? {
|
||||
if (p == null || p == "INF") return null;
|
||||
if (p == null || p == "INF") return null
|
||||
return transform(p)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class VersionCatalogsLocator(val myProject: Project) {
|
||||
val externalProjectPath = ExternalSystemApiUtil.getExternalRootProjectPath(module) ?: return emptyMap()
|
||||
val projectInfo = ProjectDataManager.getInstance()
|
||||
.getExternalProjectData(myProject, GradleConstants.SYSTEM_ID, externalProjectPath)
|
||||
?: return emptyMap();
|
||||
?: return emptyMap()
|
||||
val versionCatalogsModel = projectInfo.externalProjectStructure?.let {
|
||||
ExternalSystemApiUtil.find(it, BuildScriptClasspathData.VERSION_CATALOGS)?.data
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ object GrazieReplaceTypoQuickFix {
|
||||
if (shreds.isEmpty()) return emptyList()
|
||||
|
||||
if (replacement.isEmpty() && removalWouldGlueUnrelatedTokens(localRange, text)) {
|
||||
replacement = " ";
|
||||
replacement = " "
|
||||
}
|
||||
|
||||
val best = if (isWordMiddle(text, localRange.endOffset)) shreds.last() else shreds.first()
|
||||
|
||||
@@ -48,9 +48,9 @@ class MavenDistributionsInfo : DistributionsInfo {
|
||||
fun asDistributionInfo(mavenHome: String): DistributionInfo {
|
||||
val info = MavenVersionAwareSupportExtension.MAVEN_VERSION_SUPPORT.extensionList.map {
|
||||
it.asDistributionInfo(mavenHome)
|
||||
}.firstOrNull();
|
||||
}.firstOrNull()
|
||||
|
||||
if (info != null) return info;
|
||||
if (info != null) return info
|
||||
val version = MavenUtil.getMavenVersionByMavenHome(mavenHome)
|
||||
return when (mavenHome) {
|
||||
MavenServerManager.WRAPPED_MAVEN -> WrappedDistributionInfo()
|
||||
@@ -62,7 +62,7 @@ class MavenDistributionsInfo : DistributionsInfo {
|
||||
|
||||
val home = MavenVersionAwareSupportExtension.MAVEN_VERSION_SUPPORT.extensionList.map {
|
||||
it.asMavenHome(distribution)
|
||||
}.firstOrNull();
|
||||
}.firstOrNull()
|
||||
if (home != null) return home
|
||||
return when (distribution) {
|
||||
is WrappedDistributionInfo -> MavenServerManager.WRAPPED_MAVEN
|
||||
|
||||
@@ -59,12 +59,12 @@ class MavenWslTargetConfigurator : MavenImporter("", ""),
|
||||
return
|
||||
}
|
||||
dataHolder.putUserData(WSL_DISTRIBUTION, wslDistribution)
|
||||
val mavenPath = wslDistribution.resolveMavenHomeDirectory(null);
|
||||
val mavenPath = wslDistribution.resolveMavenHomeDirectory(null)
|
||||
dataHolder.putUserData(MAVEN_HOME_DIR, mavenPath)
|
||||
val targetMavenPath = mavenPath?.let { wslDistribution.getWslPath(it.path) }
|
||||
dataHolder.putUserData(MAVEN_TARGET_PATH, targetMavenPath);
|
||||
dataHolder.putUserData(MAVEN_TARGET_PATH, targetMavenPath)
|
||||
val mavenVersion = MavenUtil.getMavenVersion(mavenPath)
|
||||
dataHolder.putUserData(MAVEN_HOME_VERSION, mavenVersion);
|
||||
dataHolder.putUserData(MAVEN_HOME_VERSION, mavenVersion)
|
||||
val jdkPath = getJdkPath(project, wslDistribution)
|
||||
dataHolder.putUserData(JDK_PATH, jdkPath)
|
||||
|
||||
@@ -92,7 +92,7 @@ class MavenWslTargetConfigurator : MavenImporter("", ""),
|
||||
dataHolder: UserDataHolder,
|
||||
wslDistribution: WSLDistribution): MavenRuntimeTargetConfiguration? {
|
||||
val mavenConfig = MavenRuntimeTargetConfiguration()
|
||||
val targetMavenPath = dataHolder.getUserData(MAVEN_TARGET_PATH);
|
||||
val targetMavenPath = dataHolder.getUserData(MAVEN_TARGET_PATH)
|
||||
|
||||
if (targetMavenPath == null) {
|
||||
MavenProjectsManager.getInstance(project).syncConsole.addWarning(MavenProjectBundle.message("wsl.misconfigured.title"),
|
||||
@@ -101,7 +101,7 @@ class MavenWslTargetConfigurator : MavenImporter("", ""),
|
||||
return null
|
||||
}
|
||||
|
||||
val mavenVersion = dataHolder.getUserData(MAVEN_HOME_VERSION);
|
||||
val mavenVersion = dataHolder.getUserData(MAVEN_HOME_VERSION)
|
||||
mavenConfig.homePath = targetMavenPath
|
||||
mavenConfig.versionString = mavenVersion ?: ""
|
||||
configuration.addLanguageRuntime(mavenConfig)
|
||||
@@ -113,7 +113,7 @@ class MavenWslTargetConfigurator : MavenImporter("", ""),
|
||||
dataHolder: UserDataHolder,
|
||||
wslDistribution: WSLDistribution): JavaLanguageRuntimeConfiguration? {
|
||||
val javaConfig = JavaLanguageRuntimeConfiguration()
|
||||
val jdkPath = dataHolder.getUserData(JDK_PATH);
|
||||
val jdkPath = dataHolder.getUserData(JDK_PATH)
|
||||
|
||||
if (jdkPath == null) {
|
||||
MavenProjectsManager.getInstance(project).syncConsole.addWarning(MavenProjectBundle.message("wsl.misconfigured.title"),
|
||||
|
||||
@@ -226,7 +226,7 @@ internal class WorkspaceModuleImporter(
|
||||
mavenArtifact.version,
|
||||
mavenArtifact.packaging,
|
||||
mavenArtifact.classifier)).state) ?: return
|
||||
libPropertiesElement.name = JpsLibraryTableSerializer.PROPERTIES_TAG;
|
||||
libPropertiesElement.name = JpsLibraryTableSerializer.PROPERTIES_TAG
|
||||
val xmlTag = JDOMUtil.writeElement(libPropertiesElement)
|
||||
builder addEntity LibraryPropertiesEntity(libraryKind.kindId, libraryEntity.entitySource) {
|
||||
library = libraryEntity
|
||||
|
||||
@@ -143,7 +143,7 @@ internal class WorkspaceProjectImporter(
|
||||
}
|
||||
else {
|
||||
MavenLog.LOG.info("Project has been migrated to external project files storage")
|
||||
notifyUserAboutExternalStorageMigration();
|
||||
notifyUserAboutExternalStorageMigration()
|
||||
}
|
||||
}
|
||||
return migratedToExternalStorage
|
||||
|
||||
@@ -159,7 +159,7 @@ class MavenImportingManager(val project: Project) {
|
||||
}
|
||||
}
|
||||
|
||||
val vfsRefreshPromise = AsyncPromise<Any?>();
|
||||
val vfsRefreshPromise = AsyncPromise<Any?>()
|
||||
VirtualFileManager.getInstance().asyncRefresh {
|
||||
vfsRefreshPromise.setResult(null)
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ class MavenProjectManagerListenerToBusBridge(project: Project) : MavenProjectsMa
|
||||
}
|
||||
|
||||
override fun importAndResolveScheduled() {
|
||||
eventPublisher.importAndResolveScheduled();
|
||||
eventPublisher.importAndResolveScheduled()
|
||||
}
|
||||
|
||||
override fun projectImportCompleted() {
|
||||
eventPublisher.projectImportCompleted();
|
||||
eventPublisher.projectImportCompleted()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,7 +62,7 @@ class DummyMavenServerConnector(project: @NotNull Project,
|
||||
}
|
||||
|
||||
class DummyMavenServer(val project: Project) : MavenServer {
|
||||
private lateinit var watchdog: IdeaWatchdog;
|
||||
private lateinit var watchdog: IdeaWatchdog
|
||||
override fun setWatchdog(watchdog: IdeaWatchdog) {
|
||||
this.watchdog = watchdog
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class DummyIndexer : MavenServerIndexer {
|
||||
override fun processArtifacts(indexId: MavenIndexId, startFrom: Int, token: MavenToken?): List<IndexedMavenId>? = null
|
||||
|
||||
override fun addArtifacts(indexId: MavenIndexId, artifactFiles: MutableCollection<File>, token: MavenToken): MutableList<AddArtifactResponse> {
|
||||
val responses = mutableListOf<AddArtifactResponse>();
|
||||
val responses = mutableListOf<AddArtifactResponse>()
|
||||
for (artifactFile in artifactFiles) {
|
||||
responses.add(AddArtifactResponse(artifactFile, IndexedMavenId(null, null, null, null, null)))
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class RestartMavenEmbeddersQuickFix : BuildIssueQuickFix {
|
||||
val future = CompletableFuture<Void>()
|
||||
ApplicationManager.getApplication().executeOnPooledThread {
|
||||
MavenProjectsManager.getInstance(project).embeddersManager.reset()
|
||||
MavenProjectsManager.getInstance(project).forceUpdateAllProjectsOrFindAllAvailablePomFiles();
|
||||
MavenProjectsManager.getInstance(project).forceUpdateAllProjectsOrFindAllAvailablePomFiles()
|
||||
future.complete(null)
|
||||
}
|
||||
return future
|
||||
|
||||
@@ -54,7 +54,7 @@ class RootsToWorkingCopies(private val project: Project) : VcsMappingListener, D
|
||||
|
||||
@RequiresBackgroundThread
|
||||
fun getMatchingCopy(url: Url?): WorkingCopy? {
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
if (url == null) return null
|
||||
|
||||
val roots = ProjectLevelVcsManager.getInstance(project).getRootsUnderVcs(vcs)
|
||||
@@ -71,7 +71,7 @@ class RootsToWorkingCopies(private val project: Project) : VcsMappingListener, D
|
||||
|
||||
@RequiresBackgroundThread
|
||||
fun getWcRoot(root: VirtualFile): WorkingCopy? {
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread();
|
||||
ApplicationManager.getApplication().assertIsNonDispatchThread()
|
||||
|
||||
synchronized(myLock) {
|
||||
if (myUnversioned.contains(root)) return null
|
||||
|
||||
@@ -150,7 +150,7 @@ open class PydevConsoleRunnerFactory : PythonConsoleRunnerFactory() {
|
||||
}
|
||||
if (path != null && !path.exists()) {
|
||||
thisLogger().warn("Can't find $path")
|
||||
path = null;
|
||||
path = null
|
||||
}
|
||||
return path?.let { targetPath(it) } ?: if (!workingDir.isNullOrBlank()) constant(workingDir) else null
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ fun addDefaultEnvironments(sdk: Sdk,
|
||||
* @param envs map of envs to add variable
|
||||
*/
|
||||
private fun setCorrectStdOutEncoding(envs: Map<String, String>) {
|
||||
val defaultCharset = PydevConsoleRunnerImpl.CONSOLE_CHARSET;
|
||||
val defaultCharset = PydevConsoleRunnerImpl.CONSOLE_CHARSET
|
||||
val encoding = defaultCharset.name()
|
||||
PythonEnvUtil.setPythonIOEncoding(PythonEnvUtil.setPythonUnbuffered(envs), encoding)
|
||||
}
|
||||
@@ -214,7 +214,7 @@ private fun setCorrectStdOutEncoding(envs: Map<String, String>) {
|
||||
* @param commandLine command line
|
||||
*/
|
||||
fun setCorrectStdOutEncoding(commandLine: GeneralCommandLine) {
|
||||
val defaultCharset = PydevConsoleRunnerImpl.CONSOLE_CHARSET;
|
||||
val defaultCharset = PydevConsoleRunnerImpl.CONSOLE_CHARSET
|
||||
commandLine.charset = defaultCharset
|
||||
PythonEnvUtil.setPythonIOEncoding(commandLine.environment, defaultCharset.name())
|
||||
}
|
||||
|
||||
@@ -461,10 +461,10 @@ private class StreamLoader(private val name: String, private val loaderClass: Cl
|
||||
stream.reader().useLines { it.forEach(consumer::accept) }
|
||||
}
|
||||
catch (exception: ProcessCanceledException) {
|
||||
throw exception;
|
||||
throw exception
|
||||
}
|
||||
catch (exception: CancellationException) {
|
||||
throw exception;
|
||||
throw exception
|
||||
}
|
||||
catch (e: Exception) {
|
||||
LOG.error(e)
|
||||
|
||||
@@ -80,7 +80,7 @@ fun <T : UElement> UElement.getParentOfType(
|
||||
@JvmOverloads
|
||||
fun UElement?.getUCallExpression(searchLimit: Int = Int.MAX_VALUE): UCallExpression? {
|
||||
if (this == null) return null
|
||||
var u: UElement? = this;
|
||||
var u: UElement? = this
|
||||
for (i in 1..searchLimit) {
|
||||
if (u == null) break
|
||||
if (u is UCallExpression) return u
|
||||
|
||||
@@ -97,10 +97,10 @@ fun <T : UElement> convertOrReport(psiElement: PsiElement, parent: UElement, exp
|
||||
|
||||
internal inline fun <T, R> ThreadLocal<T>.withValue(value: T, block: () -> R): R {
|
||||
val old = this.get()
|
||||
if (old == value) return block.invoke();
|
||||
if (old == value) return block.invoke()
|
||||
try {
|
||||
this.set(value)
|
||||
return block.invoke();
|
||||
return block.invoke()
|
||||
}
|
||||
finally {
|
||||
if (old == null)
|
||||
|
||||
Reference in New Issue
Block a user