mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test++
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo<caret> () {
|
||||
}
|
||||
|
||||
void bar () {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Test {
|
||||
void foo () throws Exception {
|
||||
}
|
||||
|
||||
void bar () {
|
||||
try {
|
||||
foo();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo<caret> () {
|
||||
}
|
||||
|
||||
void bar () {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo () throws RuntimeException {
|
||||
}
|
||||
|
||||
void bar () {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo<caret> () {
|
||||
}
|
||||
|
||||
void bar () throws Exception {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void foo () throws Exception {
|
||||
}
|
||||
|
||||
void bar () throws Exception {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import java.util.*;
|
||||
|
||||
class A {
|
||||
List <caret>method() { }
|
||||
}
|
||||
|
||||
class Q implements List, Runnable {
|
||||
}
|
||||
|
||||
class Z implements List {
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
Q method() { }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
Z method() { }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import java.util.*;
|
||||
|
||||
class A {
|
||||
Runnable method() { }
|
||||
}
|
||||
|
||||
class Q implements List, Runnable {
|
||||
}
|
||||
|
||||
class Z implements List {
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
Q method() { }
|
||||
}
|
||||
|
||||
class C extends A {
|
||||
Runnable method() { }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class C {
|
||||
C<caret>() {
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
int i;
|
||||
C1(int i, int k) {
|
||||
this.i = i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class C {
|
||||
C(int j) {
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
int i;
|
||||
C1(int i, int k) {
|
||||
super(27);
|
||||
this.i = i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
enum En {
|
||||
A {},
|
||||
B {},
|
||||
C;
|
||||
|
||||
<caret>En() { }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
enum En {
|
||||
A(10) {},
|
||||
B(10) {},
|
||||
C(10);
|
||||
|
||||
En(int i) { }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class C {
|
||||
void <caret>method() {
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
void method() {
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
{
|
||||
new C().method();
|
||||
new C1().method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
public class C {
|
||||
public <caret>C(int i) {
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
{
|
||||
C c = new C(10);
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
public class C {
|
||||
public C(int i) {
|
||||
this();
|
||||
}
|
||||
|
||||
public C() {
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
{
|
||||
C c = new C(10);
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
public class C {
|
||||
public <caret>C() {
|
||||
}
|
||||
}
|
||||
|
||||
public class C1 extends C {
|
||||
public C1(String s) {
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
{
|
||||
C c = new C();
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
public class C {
|
||||
public C() {
|
||||
this(27);
|
||||
}
|
||||
|
||||
public C(int i) {
|
||||
}
|
||||
}
|
||||
|
||||
public class C1 extends C {
|
||||
public C1(String s) {
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
{
|
||||
C c = new C();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
abstract class C {
|
||||
abstract void <caret>method();
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
void method() {
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
abstract class C {
|
||||
void method() {
|
||||
method(27);
|
||||
}
|
||||
|
||||
abstract void <caret>method(int i);
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
void method(int i) {
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
class C {
|
||||
void <caret>method(int i, String s) {
|
||||
System.out.println("i = " + i + " s = " + s);
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
void method(int i, String s) {
|
||||
System.out.println("i = " + i + " s = " + s);
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
{
|
||||
new C().method(1, null);
|
||||
new C1().method(1, null);
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
class C {
|
||||
void method(int i, String s) {
|
||||
method(s, 'a', i);
|
||||
}
|
||||
|
||||
void method(String s, char c, int j) {
|
||||
System.out.println("i = " + j + " s = " + s);
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
void method(String s, char c, int j) {
|
||||
System.out.println("i = " + j + " s = " + s);
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
{
|
||||
new C().method(1, null);
|
||||
new C1().method(1, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class C {
|
||||
String <caret>method() {
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
String method() {
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
class C {
|
||||
String method() {
|
||||
return method(27);
|
||||
}
|
||||
|
||||
String <caret>method(int i) {
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
String method(int i) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
class C {
|
||||
void method() {
|
||||
method(27);
|
||||
}
|
||||
|
||||
void method(int i) {
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C {
|
||||
void method(int i) {
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
{
|
||||
new C().method();
|
||||
new C1().method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class C<T> {
|
||||
void method<caret>();
|
||||
}
|
||||
|
||||
class C1 extends C<String> {
|
||||
void method();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class C<T> {
|
||||
void put<caret>(Object o) {
|
||||
System.out.println(o);
|
||||
}
|
||||
}
|
||||
|
||||
class CString extends C<String> {
|
||||
void put(Object o) {
|
||||
System.out.println(o+"Text");
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class C<T> {
|
||||
void put(T t) {
|
||||
System.out.println(t);
|
||||
}
|
||||
}
|
||||
|
||||
class CString extends C<String> {
|
||||
void put(String t) {
|
||||
System.out.println(t +"Text");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class C<T> {
|
||||
T method(T x, C<T> y);
|
||||
}
|
||||
|
||||
class C1 extends C<String> {
|
||||
String method(String x, C<String> y);
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
void f<caret>oo(){}
|
||||
|
||||
class A extends Foo {
|
||||
void foo(){
|
||||
super.foo();
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
void foo(int i){}
|
||||
|
||||
class A extends Foo {
|
||||
void foo(int i){
|
||||
super.foo(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
public int method<caret>(int i, int j) {
|
||||
return i - j;
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public void method(int j, int i) {
|
||||
return i - j;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
public int method<caret>(int j, int i) {
|
||||
return i - j;
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public void method(int i, int j) {
|
||||
return i - j;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
class MyException extends Exception{
|
||||
}
|
||||
|
||||
class MyException1 extends Exception{
|
||||
}
|
||||
|
||||
class Test {
|
||||
void foo<caret> () throws MyException,
|
||||
MyException1 {
|
||||
}
|
||||
|
||||
void bar () {
|
||||
try {
|
||||
foo();
|
||||
}
|
||||
catch (MyException e) {}
|
||||
catch (MyException1 myException1) {}
|
||||
}
|
||||
}
|
||||
|
||||
class Derived extends Test {
|
||||
void foo() throws MyException,
|
||||
MyException1 {
|
||||
|
||||
}
|
||||
|
||||
void bar () {
|
||||
try {
|
||||
foo();
|
||||
}
|
||||
catch (MyException e) {}
|
||||
catch (MyException1 myException1) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
class MyException extends Exception{
|
||||
}
|
||||
|
||||
class MyException1 extends Exception{
|
||||
}
|
||||
|
||||
class Test {
|
||||
void foo () throws MyException1, MyException {
|
||||
}
|
||||
|
||||
void bar () {
|
||||
try {
|
||||
foo();
|
||||
}
|
||||
catch (MyException e) {}
|
||||
catch (MyException1 myException1) {}
|
||||
}
|
||||
}
|
||||
|
||||
class Derived extends Test {
|
||||
void foo() throws MyException1, MyException {
|
||||
|
||||
}
|
||||
|
||||
void bar () {
|
||||
try {
|
||||
foo();
|
||||
}
|
||||
catch (MyException e) {}
|
||||
catch (MyException1 myException1) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
void <caret>foo(String[] s, int a) {}
|
||||
|
||||
{
|
||||
foo(new String[]{"a", "bbb"}, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Test {
|
||||
static final String[] strs = new String[] { "a" };
|
||||
|
||||
void <caret>foo(String[] s, int a) {}
|
||||
|
||||
{
|
||||
foo(strs, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Test {
|
||||
static final String[] strs = new String[] { "a" };
|
||||
|
||||
void <caret>foo(int a, String... s) {}
|
||||
|
||||
{
|
||||
foo(1, strs);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
void foo(int a, String... s) {}
|
||||
|
||||
{
|
||||
foo(1, "a", "bbb");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class X {
|
||||
|
||||
/**
|
||||
* Has a method called {@link #mymethod(int,int)}.
|
||||
*/
|
||||
public class TestRefactorLink {
|
||||
public void <caret>mymethod(int y, int z) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class X {
|
||||
|
||||
/**
|
||||
* Has a method called {@link #mymethod(int,boolean)}.
|
||||
*/
|
||||
public class TestRefactorLink {
|
||||
public void mymethod(int y, boolean b) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
void method<caret>(int i);
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
void method(int k);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
void method();
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
void method();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
void <caret>foo() {
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
void boo() {
|
||||
super.foo();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
void <caret>foo(int nnn) {
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
void boo() {
|
||||
super.foo(-222);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class C<T> {
|
||||
protected <U> U method<caret>(){
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C<String> {
|
||||
protected <V> V method(){
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class C<T> {
|
||||
protected <U> U method(T t, U u, C<U> cu){
|
||||
}
|
||||
}
|
||||
|
||||
class C1 extends C<String> {
|
||||
protected <V> V method(String t, V u, C<V> cu){
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import java.util.List;
|
||||
|
||||
class C {
|
||||
void <caret>method() {
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
List myList;
|
||||
{
|
||||
C c = new C();
|
||||
c.method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import java.util.List;
|
||||
|
||||
class C {
|
||||
void method(List l) {
|
||||
}
|
||||
}
|
||||
|
||||
class Usage {
|
||||
List myList;
|
||||
{
|
||||
C c = new C();
|
||||
c.method(myList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class C {
|
||||
void <caret>method(int... args) {
|
||||
}
|
||||
|
||||
{
|
||||
method(1,2);
|
||||
method(1,2,3);
|
||||
method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class C {
|
||||
void <caret>method(boolean b, int... args) {
|
||||
}
|
||||
|
||||
{
|
||||
method(true, 1,2);
|
||||
method(true, 1,2,3);
|
||||
method(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user