add explicit type parameters available for conditional expr (IDEA-1179)

This commit is contained in:
anna
2012-02-17 21:38:34 +01:00
parent 0ff1e1201c
commit 8e7b3a443c
16 changed files with 297 additions and 1 deletions
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
static <T> List<T> f() { return new ArrayList<T>(); }
void someMethod(boolean b) {
List<String> s = b ? Test.<String>f() : f();
}
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
<T> List<T> f() { return new ArrayList<T>(); }
void someMethod(boolean b) {
List<String> s = b ? this.<String>f() : new ArrayList<String>();
}
}
@@ -0,0 +1,13 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
void someMethod(boolean b) {
List<String> s = b ? Foo.<String>f() : new ArrayList<String>();
}
}
class Foo{
static <T> List<T> f() { return new ArrayList<T>(); }
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
<T> List<T> f() { return new ArrayList<T>(); }
void someMethod(Test t, boolean b) {
List<String> s = b ? t.<String>f() : new ArrayList<String>();
}
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
static <T> List<T> f() { return new ArrayList<T>(); }
void someMethod(Test t, boolean b) {
List<String> s = b ? t.<String>f() : new ArrayList<String>();
}
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
static <T> List<T> f() { return new ArrayList<T>(); }
void someMethod(boolean b) {
List<String> s = b ? Test.<String>f() : new ArrayList<String>();
}
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
static <T> List<T> f() { return new ArrayList<T>(); }
void someMethod(boolean b) {
List<String> s = b ? f<caret>() : f();
}
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
<T> List<T> f() { return new ArrayList<T>(); }
void someMethod(boolean b) {
List<String> s = b ? f<caret>() : new ArrayList<String>();
}
}
@@ -0,0 +1,13 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
void someMethod(boolean b) {
List<String> s = b ? Foo.f<caret>() : new ArrayList<String>();
}
}
class Foo{
static <T> List<T> f() { return new ArrayList<T>(); }
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
<T> List<T> f() { return new ArrayList<T>(); }
void someMethod(Test t, boolean b) {
List<String> s = b ? t.f<caret>() : new ArrayList<String>();
}
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
static <T> List<T> f() { return new ArrayList<T>(); }
void someMethod(Test t, boolean b) {
List<String> s = b ? t.f<caret>() : new ArrayList<String>();
}
}
@@ -0,0 +1,9 @@
// "Add explicit type arguments" "true"
import java.util.*;
class Test {
static <T> List<T> f() { return new ArrayList<T>(); }
void someMethod(boolean b) {
List<String> s = b ? f<caret>() : new ArrayList<String>();
}
}
@@ -0,0 +1,26 @@
/*
* Copyright 2000-2012 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.
*/
package com.intellij.codeInsight.daemon.quickFix;
public class AddTypeArgumentsConditionalTest extends LightQuickFix15TestCase {
public void test() throws Exception { doAllTests(); }
@Override
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/addTypeArgumentsConditional";
}
}