now we trying to generify constructor only in case when we have two or more constructors in class

This commit is contained in:
Sergey Ignatov
2011-11-16 17:14:43 +04:00
parent 234f98b164
commit 532142d12a
11 changed files with 12 additions and 46 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ public class Converter {
);
// we create primary constructor from all non final fields and fields without initializers
if (!psiClass.isEnum() && !psiClass.isInterface() && getPrimaryConstructorForThisCase(psiClass) == null) {
if (!psiClass.isEnum() && !psiClass.isInterface() && psiClass.getConstructors().length > 1 && getPrimaryConstructorForThisCase(psiClass) == null) {
final List<Field> finalOrWithEmptyInitializer = getFinalOrWithEmptyInitializer(fields);
final Map<String, String> initializers = new HashMap<String, String>();
@@ -1,10 +1,7 @@
open class Library(ourOut : PrintStream?) {
open class Library() {
class object {
val ourOut : PrintStream?
}
{
$ourOut = ourOut
}
}
open class User() {
open fun main() : Unit {
@@ -1,8 +1,5 @@
open class Library(myString : String?) {
open class Library() {
public val myString : String?
{
$myString = myString
}
}
open class User() {
open fun main() : Unit {
@@ -1,9 +1,5 @@
class T(a : String?, b : String?) {
class T() {
var a : String?
var b : String?
var c : String? = "abc"
{
$a = a
$b = b
}
}
@@ -1,12 +1,6 @@
open class Base(myFirst : String?) {
open class Base() {
private var myFirst : String?
{
$myFirst = myFirst
}
}
open class Child(mySecond : String?) : Base() {
open class Child() : Base() {
private var mySecond : String?
{
$mySecond = mySecond
}
}
+1 -4
View File
@@ -1,6 +1,3 @@
open class C(f : Foo?) {
open class C() {
var f : Foo?
{
$f = f
}
}
+1 -4
View File
@@ -1,6 +1,3 @@
open class C(f : Foo?) {
open class C() {
private var f : Foo?
{
$f = f
}
}
+1 -4
View File
@@ -1,6 +1,3 @@
open class C(f : Foo?) {
open class C() {
protected var f : Foo?
{
$f = f
}
}
+1 -4
View File
@@ -1,6 +1,3 @@
open class C(f : Foo?) {
open class C() {
public var f : Foo?
{
$f = f
}
}
+1 -4
View File
@@ -1,6 +1,3 @@
open class C(f : Foo?) {
open class C() {
val f : Foo? = Foo(1, 2)
{
$f = f
}
}
+1 -4
View File
@@ -1,6 +1,3 @@
open class C(f : Foo?) {
open class C() {
var f : Foo?
{
$f = f
}
}