Code Insight: Format generated declarations

#KT-11176 Fixed
(cherry picked from commit 3641ad6)
This commit is contained in:
Alexey Sedunov
2016-06-30 15:02:14 +03:00
parent a33f946c14
commit 3ba776fffa
51 changed files with 57 additions and 69 deletions
@@ -7,7 +7,7 @@ class A(val n: IntArray, val s: Array<String>) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -20,7 +20,7 @@ class A(val n: IntArray, val s: Array<String>) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result = Arrays.hashCode(n)
result = 31 * result + Arrays.hashCode(s)
result = 31 * result + f.hashCode()
@@ -4,7 +4,7 @@ class Test {
field = value.toUpperCase()
}
var name: String = ""
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -16,7 +16,7 @@ class Test {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result = serial.hashCode()
result = 31 * result + name.hashCode()
return result
@@ -5,13 +5,13 @@ class Test {
var name: String = ""
get
override fun equals(other: Any?): Boolean{
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
return 0
}
@@ -3,7 +3,7 @@ class A<T>(val n: T) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -14,7 +14,7 @@ class A<T>(val n: T) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
return n?.hashCode() ?: 0
}
}
@@ -4,7 +4,7 @@ class A<T>(val n: T) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is A<*>) return false
@@ -13,7 +13,7 @@ class A<T>(val n: T) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
return n?.hashCode() ?: 0
}
}
@@ -5,7 +5,7 @@ class A(val n: Int, val s: String) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -18,7 +18,7 @@ class A(val n: Int, val s: String) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result = n
result = 31 * result + s.hashCode()
result = 31 * result + f.hashCode()
@@ -5,7 +5,7 @@ class A(val n: Int?, val s: String) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -18,7 +18,7 @@ class A(val n: Int?, val s: String) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result = n ?: 0
result = 31 * result + s.hashCode()
result = 31 * result + (f?.hashCode() ?: 0)
@@ -10,7 +10,7 @@ class A(val n: Int, val s: String) : X() {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
if (!super.equals(other)) return false
@@ -24,7 +24,7 @@ class A(val n: Int, val s: String) : X() {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result = super.hashCode()
result = 31 * result + n
result = 31 * result + s.hashCode()
@@ -3,7 +3,7 @@ class A(val result: Int, val s: String) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -15,7 +15,7 @@ class A(val result: Int, val s: String) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result1 = result
result1 = 31 * result1 + s.hashCode()
return result1
@@ -4,13 +4,13 @@ class A {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
return 0
}
}
@@ -9,14 +9,14 @@ class A : X() {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
if (!super.equals(other)) return false
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
return super.hashCode()
}
}
@@ -7,7 +7,7 @@ class A(val n: IntArray?, val s: Array<String>?) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -20,7 +20,7 @@ class A(val n: IntArray?, val s: Array<String>?) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result = n?.let { Arrays.hashCode(it) } ?: 0
result = 31 * result + (s?.let { Arrays.hashCode(it) } ?: 0)
result = 31 * result + f.hashCode()
@@ -3,7 +3,7 @@ class A(val n: Int) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -14,7 +14,7 @@ class A(val n: Int) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
return n
}
}
@@ -3,7 +3,7 @@ class A(val n: Int?) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
@@ -14,7 +14,7 @@ class A(val n: Int?) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
return n ?: 0
}
}
@@ -4,7 +4,7 @@ class A(val n: Int) {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is A) return false
@@ -13,7 +13,7 @@ class A(val n: Int) {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
return n
}
}
@@ -3,7 +3,7 @@ class A(val n: Int) : X() {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
if (!super.equals(other)) return false
@@ -15,7 +15,7 @@ class A(val n: Int) : X() {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result = super.hashCode()
result = 31 * result + n
return result
@@ -8,7 +8,7 @@ class A(val n: Int) : X() {
}
<caret>override fun equals(other: Any?): Boolean{
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
if (!super.equals(other)) return false
@@ -20,7 +20,7 @@ class A(val n: Int) : X() {
return true
}
override fun hashCode(): Int{
override fun hashCode(): Int {
var result = super.hashCode()
result = 31 * result + n
return result