diff --git a/platform/platform-api/src/com/intellij/credentialStore/CredentialAttributes.kt b/platform/platform-api/src/com/intellij/credentialStore/CredentialAttributes.kt index 602f343cf010..814b23be723a 100644 --- a/platform/platform-api/src/com/intellij/credentialStore/CredentialAttributes.kt +++ b/platform/platform-api/src/com/intellij/credentialStore/CredentialAttributes.kt @@ -34,26 +34,22 @@ class Credentials(user: String?, val password: OneTimeString? = null) { fun getPasswordAsString() = password?.toString() - override fun equals(other: Any?): Boolean { - if (other !is Credentials) return false - return userName == other.userName && password == other.password - } + override fun equals(other: Any?) = other is Credentials && userName == other.userName && password == other.password override fun hashCode() = (userName?.hashCode() ?: 0) * 37 + (password?.hashCode() ?: 0) override fun toString() = "userName: $userName, password size: ${password?.length ?: 0}" } -@Suppress("FunctionName", "DeprecatedCallableAddReplaceWith") -/** - * @deprecated Never use it in a new code. - */ +/** @deprecated Never use it in a new code. */ @Deprecated("Never use it in a new code.") +@Suppress("FunctionName", "DeprecatedCallableAddReplaceWith") fun CredentialAttributes(requestor: Class<*>, userName: String?) = CredentialAttributes(requestor.name, userName, requestor) @Contract("null -> false") fun Credentials?.isFulfilled() = this != null && userName != null && !password.isNullOrEmpty() +@Contract("null -> false") fun Credentials?.hasOnlyUserName() = this != null && userName != null && password.isNullOrEmpty() fun Credentials?.isEmpty() = this == null || (userName == null && password.isNullOrEmpty()) diff --git a/platform/platform-impl/src/com/intellij/errorreport/error/InternalEAPException.java b/platform/platform-impl/src/com/intellij/errorreport/error/InternalEAPException.java index 0d1c30189eb7..72533b409688 100644 --- a/platform/platform-impl/src/com/intellij/errorreport/error/InternalEAPException.java +++ b/platform/platform-impl/src/com/intellij/errorreport/error/InternalEAPException.java @@ -1,22 +1,8 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 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.errorreport.error; public class InternalEAPException extends Exception { - public InternalEAPException(String message) { - super(message); - } -} + public InternalEAPException(String message) { + super(message); + } +} \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/errorreport/error/NoSuchEAPUserException.java b/platform/platform-impl/src/com/intellij/errorreport/error/NoSuchEAPUserException.java index 4dd4838c576d..1ce838790e36 100644 --- a/platform/platform-impl/src/com/intellij/errorreport/error/NoSuchEAPUserException.java +++ b/platform/platform-impl/src/com/intellij/errorreport/error/NoSuchEAPUserException.java @@ -1,22 +1,8 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 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.errorreport.error; public class NoSuchEAPUserException extends Exception { - public NoSuchEAPUserException(String message) { - super(message); - } -} + public NoSuchEAPUserException(String message) { + super(message); + } +} \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/errorreport/error/UpdateAvailableException.java b/platform/platform-impl/src/com/intellij/errorreport/error/UpdateAvailableException.java index ee9b40efa242..665beaa00b59 100644 --- a/platform/platform-impl/src/com/intellij/errorreport/error/UpdateAvailableException.java +++ b/platform/platform-impl/src/com/intellij/errorreport/error/UpdateAvailableException.java @@ -1,22 +1,8 @@ -/* - * Copyright 2000-2011 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 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.errorreport.error; public class UpdateAvailableException extends Exception { - public UpdateAvailableException(String update) { - super(update); - } -} + public UpdateAvailableException(String update) { + super(update); + } +} \ No newline at end of file