This commit is contained in:
Dmitry Jemerov
2009-09-10 21:57:00 +04:00
parent 7980717db9
commit 10ca2b4e5f
48 changed files with 10 additions and 4 deletions
@@ -0,0 +1,4 @@
public class Foo {
public static void <caret>method(Foo anObject) {
}
}
@@ -0,0 +1,13 @@
public class Foo {
public int myData;
static int method(int i) {
return myData + i;
}
}
class Bar {
public Foo myFoo;
int a(int b) {
return Foo.method(b*2);
}
}
@@ -0,0 +1,13 @@
public class Foo {
public int myData;
static int <caret>method(Foo anObject, int i) {
return anObject.myData + i;
}
}
class Bar {
public Foo myFoo;
int a(int b) {
return Foo.method(myFoo, b*2);
}
}
@@ -0,0 +1,12 @@
public class Foo {
public int myData;
static int <caret>method(Foo anObject, int i) {
return anObject.myData + i;
}
}
public class Bar extends Foo {
int method(int b) {
return super.method(this, b*2);
}
}
@@ -0,0 +1,6 @@
class Foo extends java.util.Vector {
static int <caret>method(Foo anObject) {
return anObject.toString();
}
}
@@ -0,0 +1,5 @@
class Foo {
static Foo bar(Foo anObject) {
return anObject;
}
}
@@ -0,0 +1,11 @@
public class Test {
static Test <caret>method(final Test anObject) {
final Test[] result = new int[1];
new Runnable() {
public void run() {
result[0] = anObject;
}
}.run();
return result[0];
}
}
@@ -0,0 +1,9 @@
public class Foo {
Foo getAnotherFoo() {}
static void tryMakeMeStatic(Foo anObject, boolean b) {
if (b) {
Foo.tryMakeMeStatic(anObject.getAnotherFoo(), !b);
}
}
}
@@ -0,0 +1,11 @@
public class Test {
void anotherMethod(String s);
String field;
/**
* @param anObject
* @param field
*/
static void method(Test anObject, String field) {
anObject.anotherMethod(field);
}
}
@@ -0,0 +1,10 @@
public class Test {
String field;
/**
* @param field
*/
static String method(String field) {
return field;
}
}
@@ -0,0 +1,5 @@
class C<T> {
static <T> void method(C<T> anObject) {
System.out.println(anObject);
}
}
@@ -0,0 +1,7 @@
class C {
int myField;
static void method(C anObject, int i) {
anObject.myField = i;
}
}
@@ -0,0 +1,6 @@
public class Foo {
static int i;
public static int <caret>method(Foo anObject) {
return i;
}
}
@@ -0,0 +1,20 @@
import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
final class Bug
extends JFrame {
public Bug() {
foo(this);
}
public static void foo(Bug anObject) {
anObject.addWindowListener(anObject.new MyWindowListener());
}
private class MyWindowListener
extends WindowAdapter {
public void windowActivated(WindowEvent e) {
}
}
}
@@ -0,0 +1,5 @@
class Bar1 {
public static void Foo() {
Foo();
}
}
@@ -0,0 +1,15 @@
class Test {
public static void foo(Test anObject) {
anObject.bar();
}
void bar() {
}
class A {
void blah() {
foo(Test.this);
}
}
}
@@ -0,0 +1,6 @@
class MethodOwner6<T> {
public static <T> T foo(T t)
{
return t;
}
}
@@ -0,0 +1,6 @@
public class Foo {
int i;
public static int method(Foo anObject) {
return anObject.i;
}
}
@@ -0,0 +1,6 @@
public class Foo {
public int i;
public static int method(Foo anObject) {
return anObject.i;
}
}
@@ -0,0 +1,6 @@
public class Foo {
public int i;
public static int <caret>method(Foo anObject) {
return anObject.i;
}
}
@@ -0,0 +1,6 @@
public class Foo extends Bar {
public int i;
public static int <caret>method(Foo anObject) {
return anObject.i;
}
}
@@ -0,0 +1,10 @@
public class Foo {
public int f(int i) {
return 0;
}
public static int <caret>method(Foo anObject, int i) {
return anObject.f(i);
}
}
@@ -0,0 +1,12 @@
public class Foo {
public int myData;
static int method(final Foo anObject, int i) {
new Runnable () {
void f() {};
public void run() {
this.f(anObject.myData);
}
}
return anObject.myData + anObject.myData;
}
}
@@ -0,0 +1,12 @@
public class Foo {
public int myData;
static int <caret>method(Foo anObject, int i) {
return anObject.myData + i;
}
}
public class Bar extends Foo {
int a(int b) {
return method(this, b*2);
}
}
@@ -0,0 +1,4 @@
public class Foo {
public void <caret>method() {
}
}
@@ -0,0 +1,13 @@
public class Foo {
public int myData;
int <caret>method(int i) {
return myData + i;
}
}
class Bar {
public Foo myFoo;
int a(int b) {
return myFoo.method(b*2);
}
}
@@ -0,0 +1,12 @@
public class Foo {
public int myData;
int <caret>method(int i) {
return myData + i;
}
}
public class Bar extends Foo {
int method(int b) {
return super.method(b*2);
}
}
@@ -0,0 +1,6 @@
class Foo extends java.util.Vector {
int <caret>method() {
return super.toString();
}
}
@@ -0,0 +1,5 @@
class Foo {
Foo <caret>bar() {
return this;
}
}
@@ -0,0 +1,11 @@
public class Test {
Test <caret>method() {
final Test[] result = new int[1];
new Runnable() {
public void run() {
result[0] = Test.this;
}
}.run();
return result[0];
}
}
@@ -0,0 +1,9 @@
public class Foo {
Foo getAnotherFoo() {}
void <caret>tryMakeMeStatic(boolean b) {
if (b) {
getAnotherFoo().tryMakeMeStatic(!b);
}
}
}
@@ -0,0 +1,9 @@
public class Test {
void anotherMethod(String s);
String field;
/**
*/
void <caret>method() {
anotherMethod(field);
}
}
@@ -0,0 +1,9 @@
public class Test {
String field;
/**
*/
String <caret>method() {
return field;
}
}
@@ -0,0 +1,5 @@
class C<T> {
void <caret>method() {
System.out.println(this);
}
}
@@ -0,0 +1,7 @@
class C {
int myField;
void <caret>method(int i) {
myField = i;
}
}
@@ -0,0 +1,6 @@
public class Foo {
static int i;
public int <caret>method() {
return i;
}
}
@@ -0,0 +1,20 @@
import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
final class Bug
extends JFrame {
public Bug() {
foo();
}
public void <caret>foo() {
addWindowListener(new MyWindowListener());
}
private class MyWindowListener
extends WindowAdapter {
public void windowActivated(WindowEvent e) {
}
}
}
@@ -0,0 +1,5 @@
class Bar1 {
public void <caret>Foo() {
this.Foo();
}
}
@@ -0,0 +1,15 @@
class Test {
public void <caret>foo() {
bar();
}
void bar() {
}
class A {
void blah() {
foo();
}
}
}
@@ -0,0 +1,6 @@
class MethodOwner6<T> {
public T <caret>foo(T t)
{
return t;
}
}
@@ -0,0 +1,6 @@
public class Foo {
int i;
public int <caret>method() {
return i;
}
}
@@ -0,0 +1,6 @@
public class Foo {
public int i;
public int <caret>method() {
return this.i;
}
}
@@ -0,0 +1,6 @@
public class Foo {
public int i;
public int <caret>method() {
return super.i;
}
}
@@ -0,0 +1,6 @@
public class Foo extends Bar {
public int i;
public int <caret>method() {
return super.i;
}
}
@@ -0,0 +1,10 @@
public class Foo {
public int f(int i) {
return 0;
}
public int <caret>method(int i) {
return f(i);
}
}
@@ -0,0 +1,12 @@
public class Foo {
public int myData;
int <caret>method(int i) {
new Runnable () {
void f() {};
public void run() {
this.f(myData);
}
}
return this.myData + myData;
}
}
@@ -0,0 +1,12 @@
public class Foo {
public int myData;
int <caret>method(int i) {
return myData + i;
}
}
public class Bar extends Foo {
int a(int b) {
return method(b*2);
}
}