mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 08:51:02 +07:00
test++
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
class AddStaticTest {
|
||||
static main(){
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
void <caret>foo(){
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddStaticTest {
|
||||
static main(){
|
||||
foo();
|
||||
}
|
||||
|
||||
static void foo(){
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
class AnonymousTest {
|
||||
interface Thing {
|
||||
boolean thing();
|
||||
}
|
||||
|
||||
void dupeHolder() {
|
||||
Thing thing = new Thing() {
|
||||
public boolean thing() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Thing <caret>duplicator(final boolean thingReturn) {
|
||||
return new Thing() {
|
||||
public boolean thing() {
|
||||
return thingReturn;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
class AnonymousTest {
|
||||
interface Thing {
|
||||
boolean thing();
|
||||
}
|
||||
|
||||
void dupeHolder() {
|
||||
Thing thing = duplicator(false);
|
||||
}
|
||||
|
||||
Thing duplicator(final boolean thingReturn) {
|
||||
return new Thing() {
|
||||
public boolean thing() {
|
||||
return thingReturn;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
class AnonymousTest1 {
|
||||
interface Thing {
|
||||
boolean thing();
|
||||
}
|
||||
|
||||
void dupeHolder() {
|
||||
if (new Thing() {
|
||||
public boolean thing() {
|
||||
return false;
|
||||
}
|
||||
}.thing());
|
||||
}
|
||||
|
||||
void <caret>duplicator(final boolean thingReturn) {
|
||||
if (new Thing() {
|
||||
public boolean thing() {
|
||||
return thingReturn;
|
||||
}
|
||||
}.thing());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
class AnonymousTest1 {
|
||||
interface Thing {
|
||||
boolean thing();
|
||||
}
|
||||
|
||||
void dupeHolder() {
|
||||
duplicator(false);
|
||||
}
|
||||
|
||||
void duplicator(final boolean thingReturn) {
|
||||
if (new Thing() {
|
||||
public boolean thing() {
|
||||
return thingReturn;
|
||||
}
|
||||
}.thing());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
class A {
|
||||
|
||||
class I {
|
||||
}
|
||||
|
||||
class I1 {
|
||||
}
|
||||
|
||||
public void foo() {
|
||||
Object innerOne = new I1() {
|
||||
};
|
||||
innerOne.toString();
|
||||
}
|
||||
|
||||
public void <caret>bar() {
|
||||
Object innerTwo = new I() {
|
||||
};
|
||||
innerTwo.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
public class A {
|
||||
private B myField;
|
||||
|
||||
public void method() {
|
||||
String a = myField.bbb.xxx();
|
||||
}
|
||||
|
||||
public B get<caret>Field() {
|
||||
return myField;
|
||||
}
|
||||
|
||||
private static class B {
|
||||
private C bbb;
|
||||
}
|
||||
|
||||
private static class C {
|
||||
String xxx() {return null;}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
public class A {
|
||||
private B myField;
|
||||
|
||||
public void method() {
|
||||
String a = getField().bbb.xxx();
|
||||
}
|
||||
|
||||
public B getField() {
|
||||
return myField;
|
||||
}
|
||||
|
||||
private static class B {
|
||||
private C bbb;
|
||||
}
|
||||
|
||||
private static class C {
|
||||
String xxx() {return null;}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
public class DeclarationUsage {
|
||||
private int myField;
|
||||
public void met<caret>hod(int p) {
|
||||
int v = 0;
|
||||
myField += p;
|
||||
}
|
||||
public void context() {
|
||||
int v = 0;
|
||||
myField += v;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
int v1a = v1.hashCode();
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int v2a = v2.hashCode();
|
||||
AbstractList<Double> v3 = new ArrayList<Double>(0);
|
||||
int v3a = v3.hashCode();
|
||||
AbstractList<Integer> v4 = new ArrayList<Integer>(0);
|
||||
int v4a = v4.hashCode();
|
||||
}
|
||||
|
||||
public <T extends List> int <caret>method(T t) {
|
||||
return t.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
int v1a = v1.hashCode();
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int v2a = method(v2);
|
||||
AbstractList<Double> v3 = new ArrayList<Double>(0);
|
||||
int v3a = method(v3);
|
||||
AbstractList<Integer> v4 = new ArrayList<Integer>(0);
|
||||
int v4a = method(v4);
|
||||
}
|
||||
|
||||
public <T extends List> int method(T t) {
|
||||
return t.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
int v1a = v1.hashCode();
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int v2a = v2.hashCode();
|
||||
AbstractList<Double> v3 = new ArrayList<Double>(0);
|
||||
int v3a = v3.hashCode();
|
||||
AbstractList<Integer> v4 = new ArrayList<Integer>(0);
|
||||
int v4a = v4.hashCode();
|
||||
}
|
||||
|
||||
public <T extends List<Integer>> int <caret>method(T t) {
|
||||
return t.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
int v1a = v1.hashCode();
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int v2a = v2.hashCode();
|
||||
AbstractList<Double> v3 = new ArrayList<Double>(0);
|
||||
int v3a = v3.hashCode();
|
||||
AbstractList<Integer> v4 = new ArrayList<Integer>(0);
|
||||
int v4a = method(v4);
|
||||
}
|
||||
|
||||
public <T extends List<Integer>> int method(T t) {
|
||||
return t.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
int v1a = v1.hashCode();
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int v2a = v2.hashCode();
|
||||
AbstractList<Double> v3 = new ArrayList<Double>(0);
|
||||
int v3a = v3.hashCode();
|
||||
AbstractList<Integer> v4 = new ArrayList<Integer>(0);
|
||||
int v4a = v4.hashCode();
|
||||
}
|
||||
|
||||
public <T extends List<? extends Number>> int <caret>method(T t) {
|
||||
return t.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
int v1a = v1.hashCode();
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int v2a = v2.hashCode();
|
||||
AbstractList<Double> v3 = new ArrayList<Double>(0);
|
||||
int v3a = method(v3);
|
||||
AbstractList<Integer> v4 = new ArrayList<Integer>(0);
|
||||
int v4a = method(v4);
|
||||
}
|
||||
|
||||
public <T extends List<? extends Number>> int method(T t) {
|
||||
return t.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
int v1a = v1.hashCode();
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int v2a = v2.hashCode();
|
||||
AbstractList<Double> v3 = new ArrayList<Double>(0);
|
||||
int v3a = v3.hashCode();
|
||||
AbstractList<Integer> v4 = new ArrayList<Integer>(0);
|
||||
int v4a = v4.hashCode();
|
||||
}
|
||||
|
||||
public <T> int <caret>method(T t) {
|
||||
return t.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
int v1a = method(v1);
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int v2a = method(v2);
|
||||
AbstractList<Double> v3 = new ArrayList<Double>(0);
|
||||
int v3a = method(v3);
|
||||
AbstractList<Integer> v4 = new ArrayList<Integer>(0);
|
||||
int v4a = method(v4);
|
||||
}
|
||||
|
||||
public <T> int method(T t) {
|
||||
return t.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int res = v1.hashCode() + v2.size();
|
||||
}
|
||||
|
||||
public <T, U extends List> int <caret>method(T t, U u) {
|
||||
return t.hashCode() + u.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Genmeth {
|
||||
public void context() {
|
||||
Integer v1 = 0;
|
||||
AbstractList<String> v2 = new ArrayList<String>(0);
|
||||
int res = method(v1, v2);
|
||||
}
|
||||
|
||||
public <T, U extends List> int <caret>method(T t, U u) {
|
||||
return t.hashCode() + u.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void <caret>method(boolean bp) {
|
||||
// method begins
|
||||
String /*egg*/ var = /*egg*/"var value"; // inside method
|
||||
myField += bp ?/*egg*/ var.length() : /*egg*/ this.hashCode(); /* inside method */
|
||||
/* method ends */
|
||||
}
|
||||
|
||||
public void context(boolean bp) {
|
||||
/* before fragment */
|
||||
String var/*egg*/ = "var value"/*egg*/; // inside context
|
||||
myField += /*egg*/ bp ? var.length() : this.hashCode(/*egg*/); /* inside context */
|
||||
// after fragment
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void method(boolean bp) {
|
||||
// method begins
|
||||
String /*egg*/ var = /*egg*/"var value"; // inside method
|
||||
myField += bp ?/*egg*/ var.length() : /*egg*/ this.hashCode(); /* inside method */
|
||||
/* method ends */
|
||||
}
|
||||
|
||||
public void context(boolean bp) {
|
||||
/* before fragment */
|
||||
method(bp);
|
||||
// after fragment
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void <caret>method(boolean bp) {
|
||||
String var = "var value";
|
||||
myField += bp ? var.length() : this.hashCode();
|
||||
}
|
||||
|
||||
public void context(boolean bp) {
|
||||
String var = "var value";
|
||||
myField += bp ? var.length() : this.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void method(boolean bp) {
|
||||
String var = "var value";
|
||||
myField += bp ? var.length() : this.hashCode();
|
||||
}
|
||||
|
||||
public void context(boolean bp) {
|
||||
method(bp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import javax.swing.JComponent;
|
||||
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void <caret>method(boolean methodPar) {
|
||||
String methodVar = "var value";
|
||||
myField += methodPar ? methodVar.length() : this.hashCode();
|
||||
|
||||
JComponent methodAnonymous = new JComponent() {
|
||||
private int myMethodAnonymousInt;
|
||||
};
|
||||
}
|
||||
|
||||
public void context(boolean contextPar) {
|
||||
String contextVar = "var value";
|
||||
myField += contextPar ? contextVar.length() : this.hashCode();
|
||||
|
||||
JComponent contextAnonymous = new JComponent() {
|
||||
private int myContextAnonymousInt;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import javax.swing.JComponent;
|
||||
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void method(boolean methodPar) {
|
||||
String methodVar = "var value";
|
||||
myField += methodPar ? methodVar.length() : this.hashCode();
|
||||
|
||||
JComponent methodAnonymous = new JComponent() {
|
||||
private int myMethodAnonymousInt;
|
||||
};
|
||||
}
|
||||
|
||||
public void context(boolean contextPar) {
|
||||
method(contextPar);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import javax.swing.JComponent;
|
||||
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void <caret>method() {
|
||||
class MethodLocal {
|
||||
private int myMethodLocalInt;
|
||||
public void methodLocalInc() {
|
||||
myMethodLocalInt++;
|
||||
}
|
||||
}
|
||||
|
||||
JComponent methodAnonymous = new JComponent() {
|
||||
private int myMethodAnonymousInt;
|
||||
public void methodAnonymousInc() {
|
||||
myMethodAnonymousInt++;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void context() {
|
||||
class ContextLocal {
|
||||
private int myContextLocalInt;
|
||||
public void contextLocalInc() {
|
||||
myContextLocalInt++;
|
||||
}
|
||||
}
|
||||
|
||||
JComponent contextAnonymous = new JComponent() {
|
||||
private int myContextAnonymousInt;
|
||||
public void contextAnonymousInc() {
|
||||
myContextAnonymousInt++;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import javax.swing.JComponent;
|
||||
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void method() {
|
||||
class MethodLocal {
|
||||
private int myMethodLocalInt;
|
||||
public void methodLocalInc() {
|
||||
myMethodLocalInt++;
|
||||
}
|
||||
}
|
||||
|
||||
JComponent methodAnonymous = new JComponent() {
|
||||
private int myMethodAnonymousInt;
|
||||
public void methodAnonymousInc() {
|
||||
myMethodAnonymousInt++;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void context() {
|
||||
method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void <caret>method(boolean bp) {
|
||||
String var="var value" ;
|
||||
myField +=
|
||||
bp ? var.
|
||||
length( ):this. hashCode () ;
|
||||
}
|
||||
|
||||
public void context(boolean bp) {
|
||||
String var
|
||||
=
|
||||
"var value"
|
||||
;myField
|
||||
+=bp?var . length ( ) :
|
||||
this .hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class IdentityComplete {
|
||||
private int myField;
|
||||
|
||||
public void method(boolean bp) {
|
||||
String var="var value" ;
|
||||
myField +=
|
||||
bp ? var.
|
||||
length( ):this. hashCode () ;
|
||||
}
|
||||
|
||||
public void context(boolean bp) {
|
||||
method(bp);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
public class Inheritance {}
|
||||
|
||||
class Base {
|
||||
void f<caret>oo(){
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
|
||||
class Child extends Base {
|
||||
void bar() {
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
public class Inheritance {}
|
||||
|
||||
class Base {
|
||||
void foo(){
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
|
||||
class Child extends Base {
|
||||
void bar() {
|
||||
foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
class LocationQuantity {
|
||||
public final int myInt = 3;
|
||||
|
||||
public int <caret>method(int p) {
|
||||
return myInt + p;
|
||||
}
|
||||
|
||||
public void sameClassContext() {
|
||||
int v = 1;
|
||||
v++;
|
||||
int v2 = myInt + v;
|
||||
Object o = new Object() {
|
||||
public void anonymousClassContext() {
|
||||
int av = myInt + 2;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public class Inner {
|
||||
private boolean myFlag;
|
||||
public int innerClassContext(int ip) {
|
||||
return myFlag ? myInt + ip : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DifferentClass {
|
||||
private int myInt;
|
||||
private void differentClassContext() {
|
||||
LocationQuantity lq = new LocationQuantity();
|
||||
int v = lq.myInt + myInt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
class LocationQuantity {
|
||||
public final int myInt = 3;
|
||||
|
||||
public int method(int p) {
|
||||
return myInt + p;
|
||||
}
|
||||
|
||||
public void sameClassContext() {
|
||||
int v = 1;
|
||||
v++;
|
||||
int v2 = method(v);
|
||||
Object o = new Object() {
|
||||
public void anonymousClassContext() {
|
||||
int av = method(2);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public class Inner {
|
||||
private boolean myFlag;
|
||||
public int innerClassContext(int ip) {
|
||||
return myFlag ? method(ip) : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DifferentClass {
|
||||
private int myInt;
|
||||
private void differentClassContext() {
|
||||
LocationQuantity lq = new LocationQuantity();
|
||||
int v = lq.method(myInt);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
private int myField;
|
||||
|
||||
public void <caret>method(int p) {
|
||||
p++;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
myField;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
private Mapping myMapping;
|
||||
|
||||
public void <caret>method() {
|
||||
Mapping m2 = myMapping;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping m2 = new Mapping();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
public void <caret>method() {
|
||||
Mapping m = new Mapping();
|
||||
Mapping m2 = m;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping m2 = new Mapping();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
private Mapping myMapping;
|
||||
|
||||
public void <caret>method(Mapping m) {
|
||||
m = null;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
this.myMapping = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
private Mapping myMapping;
|
||||
|
||||
public void <caret>method(Mapping m) {
|
||||
m = null;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
method(this.myMapping);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void <caret>method(boolean b, int i, char c, double d, int[] ia, String s) {
|
||||
myInt = b ? i + c - (int)d: ia.length + s.hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
myInt = true || false ? 5 + 'z' - (int)3.14 : new int[] { 0, 1 }.length + "abc".hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void method(boolean b, int i, char c, double d, int[] ia, String s) {
|
||||
myInt = b ? i + c - (int)d: ia.length + s.hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
method(true || false, 5, 'z', 3.14, new int[] { 0, 1 }, "abc");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void <caret>method(int p1, boolean p2) {
|
||||
myInt = p2 ? p1 : 0;
|
||||
if (!p2) {
|
||||
myInt *= p1;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean sayYes() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
myInt = sayYes() ? 15 / 5 : 0;
|
||||
if (!sayYes()) {
|
||||
myInt *= 15 / 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void <caret>method(int p1, boolean p2) {
|
||||
myInt = p2 ? p1 : 0;
|
||||
if (!p2) {
|
||||
myInt *= p1;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean sayYes() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
method(15 / 5, sayYes());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Mapping {
|
||||
public void <caret>method() {
|
||||
Mapping m2 = this;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping m2 = new Mapping();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Mapping1 {
|
||||
private int myInt;
|
||||
public void <caret>method() {
|
||||
int i = myInt;
|
||||
}
|
||||
public void context() {
|
||||
int i = myInt;
|
||||
}
|
||||
}
|
||||
|
||||
class Mapping2 {
|
||||
private int myInt;
|
||||
public void context() {
|
||||
int i = myInt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Mapping1 {
|
||||
private int myInt;
|
||||
public void method() {
|
||||
int i = myInt;
|
||||
}
|
||||
public void context() {
|
||||
method();
|
||||
}
|
||||
}
|
||||
|
||||
class Mapping2 {
|
||||
private int myInt;
|
||||
public void context() {
|
||||
int i = myInt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
private Mapping myMapping = new Mapping();
|
||||
public void <caret>method() {
|
||||
Mapping m = new Mapping();
|
||||
myInt += m.hashCode();
|
||||
}
|
||||
public void context() {
|
||||
myInt += myMapping.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void <caret>method(int p) {
|
||||
myInt = p + 1;
|
||||
}
|
||||
|
||||
public void context1() {
|
||||
myInt = myInt + 1;
|
||||
}
|
||||
|
||||
public void context2() {
|
||||
myInt = this.myInt + 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void method(int p) {
|
||||
myInt = p + 1;
|
||||
}
|
||||
|
||||
public void context1() {
|
||||
method(myInt);
|
||||
}
|
||||
|
||||
public void context2() {
|
||||
method(this.myInt);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
private Mapping myField;
|
||||
|
||||
public void <caret>method() {
|
||||
myInt = hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
myInt = myField.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void <caret>method() {
|
||||
int contextVar = 1;
|
||||
myInt += contextVar + 1;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
int contextVar = 1;
|
||||
myInt += contextVar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Mapping {
|
||||
private Mapping myMapping;
|
||||
|
||||
public void <caret>method() {
|
||||
Mapping m2 = myMapping;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping m = new Mapping();
|
||||
Mapping m2 = m;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
public void <caret>method() {
|
||||
Mapping methodVar = new Mapping();
|
||||
methodVar.hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping contextVar = new Mapping();
|
||||
contextVar.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
public void method() {
|
||||
Mapping methodVar = new Mapping();
|
||||
methodVar.hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
public void <caret>method(Mapping methodPar) {
|
||||
methodPar.hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping contextVar = new Mapping();
|
||||
contextVar.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
public void method(Mapping methodPar) {
|
||||
methodPar.hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping contextVar = new Mapping();
|
||||
method(contextVar);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
public void <caret>method() {
|
||||
Mapping m2 = this;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping m = new Mapping();
|
||||
Mapping m2 = m;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
public void <caret>method() {
|
||||
toString();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping m = new Mapping();
|
||||
m.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
public void method() {
|
||||
toString();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Mapping m = new Mapping();
|
||||
m.method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Mapping {
|
||||
private Mapping myMapping;
|
||||
|
||||
public void <caret>method() {
|
||||
Mapping m2 = myMapping;
|
||||
}
|
||||
|
||||
public void context(Mapping m) {
|
||||
Mapping m2 = m;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
public void <caret>method() {
|
||||
Mapping m = new Mapping();
|
||||
Mapping m2 = m;
|
||||
}
|
||||
|
||||
public void context(Mapping m) {
|
||||
Mapping m2 = m;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Mapping {
|
||||
public void <caret>method(Mapping methodMapping) {
|
||||
methodMapping.hashCode();
|
||||
}
|
||||
|
||||
public void context(Mapping contextMapping) {
|
||||
contextMapping.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Mapping {
|
||||
public void <caret>method(Mapping methodMapping) {
|
||||
methodMapping.hashCode();
|
||||
}
|
||||
|
||||
public void context(Mapping contextMapping) {
|
||||
method(contextMapping);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Mapping {
|
||||
public void <caret>method() {
|
||||
Mapping m2 = this;
|
||||
}
|
||||
|
||||
public void context(Mapping m) {
|
||||
Mapping m2 = m;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
private Mapping myField;
|
||||
|
||||
public void <caret>method() {
|
||||
myInt = myField.hashCode();
|
||||
}
|
||||
|
||||
public void context1() {
|
||||
myInt = hashCode();
|
||||
}
|
||||
|
||||
public void context2() {
|
||||
myInt = this.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
public void <caret>method() {
|
||||
Mapping m = new Mapping();
|
||||
myInt += m.hashCode();
|
||||
}
|
||||
public void context() {
|
||||
myInt += hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
private Mapping myField;
|
||||
|
||||
public void <caret>method(Mapping m) {
|
||||
myInt = m.hashCode();
|
||||
}
|
||||
|
||||
public void context1() {
|
||||
myInt = hashCode();
|
||||
}
|
||||
|
||||
public void context2() {
|
||||
myInt = this.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
private Mapping myField;
|
||||
|
||||
public void method(Mapping m) {
|
||||
myInt = m.hashCode();
|
||||
}
|
||||
|
||||
public void context1() {
|
||||
method(Mapping.this);
|
||||
}
|
||||
|
||||
public void context2() {
|
||||
method(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Mapping1 {
|
||||
private int myInt;
|
||||
public void <caret>method() {
|
||||
Object o = this;
|
||||
}
|
||||
public void context() {
|
||||
Object o = this;
|
||||
}
|
||||
}
|
||||
|
||||
class Mapping2 {
|
||||
private int myInt;
|
||||
public void context() {
|
||||
Object o = this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Mapping1 {
|
||||
private int myInt;
|
||||
public void method() {
|
||||
Object o = this;
|
||||
}
|
||||
public void context() {
|
||||
method();
|
||||
}
|
||||
}
|
||||
|
||||
class Mapping2 {
|
||||
private int myInt;
|
||||
public void context() {
|
||||
Object o = this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void <caret>method() {
|
||||
this.myInt++;
|
||||
Mapping.this.myInt--;
|
||||
myInt += hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
myInt++;
|
||||
this.myInt--;
|
||||
myInt += hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Mapping {
|
||||
private int myInt;
|
||||
|
||||
public void method() {
|
||||
this.myInt++;
|
||||
Mapping.this.myInt--;
|
||||
myInt += hashCode();
|
||||
}
|
||||
|
||||
public void context() {
|
||||
method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
class Post {
|
||||
private int myField;
|
||||
|
||||
public int <caret>method(int param, int varFree) {
|
||||
int varIncapsulated = 2;
|
||||
return varFree + varIncapsulated + param + myField + this.hashCode();
|
||||
}
|
||||
|
||||
public void contextVarFree(int param) {
|
||||
int varFree = 1;
|
||||
int varIncapsulated = 2;
|
||||
int var = varFree + varIncapsulated + param + myField + this.hashCode();
|
||||
int varPost = varFree;
|
||||
}
|
||||
|
||||
public void contextVarIncapsulated(int param) {
|
||||
int varFree = 1;
|
||||
int varIncapsulated = 2;
|
||||
int var = varFree + varIncapsulated + param + myField + this.hashCode();
|
||||
int varPost = varIncapsulated;
|
||||
}
|
||||
|
||||
public void contextParam(int param) {
|
||||
int varFree = 1;
|
||||
int varIncapsulated = 2;
|
||||
int var = varFree + varIncapsulated + param + myField + this.hashCode();
|
||||
int varPost = param;
|
||||
}
|
||||
|
||||
public void contextField(int param) {
|
||||
int varFree = 1;
|
||||
int varIncapsulated = 2;
|
||||
int var = varFree + varIncapsulated + param + myField + this.hashCode();
|
||||
int varPost = myField;
|
||||
}
|
||||
|
||||
public void contextThis(int param) {
|
||||
int varFree = 1;
|
||||
int varIncapsulated = 2;
|
||||
int var = varFree + varIncapsulated + param + myField + this.hashCode();
|
||||
int varPost = this.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
class Post {
|
||||
private int myField;
|
||||
|
||||
public int method(int param, int varFree) {
|
||||
int varIncapsulated = 2;
|
||||
return varFree + varIncapsulated + param + myField + this.hashCode();
|
||||
}
|
||||
|
||||
public void contextVarFree(int param) {
|
||||
int varFree = 1;
|
||||
int var = method(param, varFree);
|
||||
int varPost = varFree;
|
||||
}
|
||||
|
||||
public void contextVarIncapsulated(int param) {
|
||||
int varFree = 1;
|
||||
int varIncapsulated = 2;
|
||||
int var = varFree + varIncapsulated + param + myField + this.hashCode();
|
||||
int varPost = varIncapsulated;
|
||||
}
|
||||
|
||||
public void contextParam(int param) {
|
||||
int varFree = 1;
|
||||
int var = method(param, varFree);
|
||||
int varPost = param;
|
||||
}
|
||||
|
||||
public void contextField(int param) {
|
||||
int varFree = 1;
|
||||
int var = method(param, varFree);
|
||||
int varPost = myField;
|
||||
}
|
||||
|
||||
public void contextThis(int param) {
|
||||
int varFree = 1;
|
||||
int var = method(param, varFree);
|
||||
int varPost = this.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
static void <caret>main(Test t){
|
||||
if (true) t.foo();
|
||||
}
|
||||
|
||||
void foo(){}
|
||||
}
|
||||
|
||||
class Test1 {
|
||||
void bar(Test t) {
|
||||
if (true) {t.foo();}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
static void main(Test t){
|
||||
if (true) t.foo();
|
||||
}
|
||||
|
||||
void foo(){}
|
||||
}
|
||||
|
||||
class Test1 {
|
||||
void bar(Test t) {
|
||||
Test.main(t);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
void bar() {}
|
||||
|
||||
public void main() {
|
||||
bar();
|
||||
}
|
||||
}
|
||||
|
||||
class Test1 {
|
||||
void <caret>foo(Test t) {
|
||||
t.bar();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
void bar() {}
|
||||
|
||||
public void main() {
|
||||
Test1.foo(Test.this);
|
||||
}
|
||||
}
|
||||
|
||||
class Test1 {
|
||||
static void foo(Test t) {
|
||||
t.bar();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
class Return {
|
||||
private Return myReturn;
|
||||
public Return getReturn() {
|
||||
return myReturn;
|
||||
}
|
||||
private int myInt;
|
||||
|
||||
public Return <caret>method() {
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
return r.getReturn();
|
||||
}
|
||||
|
||||
public void contextLValue() {
|
||||
// Could be processed, but now it is not.
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
r.getReturn().myInt = 0;
|
||||
}
|
||||
|
||||
public void contextNoUsage() {
|
||||
// Could be processed, but now it is not.
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
}
|
||||
|
||||
public void contextRValue() {
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
Return r2 = r.getReturn();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
class Return {
|
||||
private Return myReturn;
|
||||
public Return getReturn() {
|
||||
return myReturn;
|
||||
}
|
||||
private int myInt;
|
||||
|
||||
public Return method() {
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
return r.getReturn();
|
||||
}
|
||||
|
||||
public void contextLValue() {
|
||||
// Could be processed, but now it is not.
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
r.getReturn().myInt = 0;
|
||||
}
|
||||
|
||||
public void contextNoUsage() {
|
||||
// Could be processed, but now it is not.
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
}
|
||||
|
||||
public void contextRValue() {
|
||||
Return r2 = method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class ReturnExpression {
|
||||
int <caret>bar(String s) {
|
||||
s = s + "";
|
||||
return s.length();
|
||||
}
|
||||
|
||||
void foo() {
|
||||
String s1 = "";
|
||||
s1 = s1 + "";
|
||||
System.out.println(s1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
class Return {
|
||||
private Return myReturn;
|
||||
private int myInt;
|
||||
|
||||
public Return <caret>method() {
|
||||
myReturn = new Return();
|
||||
myReturn.myInt++;
|
||||
return myReturn;
|
||||
}
|
||||
|
||||
public void contextLValue() {
|
||||
myReturn = new Return();
|
||||
myReturn.myInt++;
|
||||
myReturn = null;
|
||||
}
|
||||
|
||||
public void contextNoUsage() {
|
||||
myReturn = new Return();
|
||||
myReturn.myInt++;
|
||||
}
|
||||
|
||||
public void contextRValue() {
|
||||
myReturn = new Return();
|
||||
myReturn.myInt++;
|
||||
Return r = myReturn;
|
||||
}
|
||||
|
||||
public void contextRValueQualified() {
|
||||
myReturn = new Return();
|
||||
myReturn.myInt++;
|
||||
Return r = this.myReturn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
class Return {
|
||||
private Return myReturn;
|
||||
private int myInt;
|
||||
|
||||
public Return method() {
|
||||
myReturn = new Return();
|
||||
myReturn.myInt++;
|
||||
return myReturn;
|
||||
}
|
||||
|
||||
public void contextLValue() {
|
||||
myReturn = method();
|
||||
myReturn = null;
|
||||
}
|
||||
|
||||
public void contextNoUsage() {
|
||||
myReturn = method();
|
||||
}
|
||||
|
||||
public void contextRValue() {
|
||||
myReturn = method();
|
||||
Return r = myReturn;
|
||||
}
|
||||
|
||||
public void contextRValueQualified() {
|
||||
myReturn = method();
|
||||
Return r = this.myReturn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
class Return {
|
||||
private Return myReturn;
|
||||
private int myInt;
|
||||
|
||||
public Return <caret>method() {
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
return r;
|
||||
}
|
||||
|
||||
public void contextLValue() {
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
r = null;
|
||||
}
|
||||
|
||||
public void contextNoUsage() {
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
}
|
||||
|
||||
public void contextRValue() {
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
Return r2 = r;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
class Return {
|
||||
private Return myReturn;
|
||||
private int myInt;
|
||||
|
||||
public Return method() {
|
||||
Return r = new Return();
|
||||
r.myInt >>= 1;
|
||||
return r;
|
||||
}
|
||||
|
||||
public void contextLValue() {
|
||||
Return r = method();
|
||||
r = null;
|
||||
}
|
||||
|
||||
public void contextNoUsage() {
|
||||
Return r = method();
|
||||
}
|
||||
|
||||
public void contextRValue() {
|
||||
Return r = method();
|
||||
Return r2 = r;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
class Return {
|
||||
private Return myReturn;
|
||||
private int myInt;
|
||||
|
||||
public Return <caret>method(Return p) {
|
||||
p.myInt--;
|
||||
return p;
|
||||
}
|
||||
|
||||
public void contextLValue() {
|
||||
myReturn.myInt--;
|
||||
myReturn = null;
|
||||
}
|
||||
|
||||
public void contextNoUsage() {
|
||||
myReturn.myInt--;
|
||||
}
|
||||
|
||||
public void contextRValue() {
|
||||
myReturn.myInt--;
|
||||
Return r = myReturn;
|
||||
}
|
||||
|
||||
public void contextRValueQualified() {
|
||||
myReturn.myInt--;
|
||||
Return r = this.myReturn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
class Return {
|
||||
private Return myReturn;
|
||||
private int myInt;
|
||||
|
||||
public Return method(Return p) {
|
||||
p.myInt--;
|
||||
return p;
|
||||
}
|
||||
|
||||
public void contextLValue() {
|
||||
myReturn = method(myReturn);
|
||||
myReturn = null;
|
||||
}
|
||||
|
||||
public void contextNoUsage() {
|
||||
myReturn = method(myReturn);
|
||||
}
|
||||
|
||||
public void contextRValue() {
|
||||
myReturn = method(myReturn);
|
||||
Return r = myReturn;
|
||||
}
|
||||
|
||||
public void contextRValueQualified() {
|
||||
myReturn = method(myReturn);
|
||||
Return r = this.myReturn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class Return {
|
||||
private int myInt;
|
||||
|
||||
public Return <caret>method() {
|
||||
myInt++;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
myInt++;
|
||||
Return r = this;
|
||||
// Currently the statement below could be replaced, but it's not. Nobody has requested this.
|
||||
myInt++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class Return {
|
||||
private int myInt;
|
||||
|
||||
public Return method() {
|
||||
myInt++;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void context() {
|
||||
Return r = method();
|
||||
// Currently the statement below could be replaced, but it's not. Nobody has requested this.
|
||||
myInt++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class ReturnVariable {
|
||||
String <caret>bar(String s) {
|
||||
s = s + "";
|
||||
return s;
|
||||
}
|
||||
|
||||
void foo() {
|
||||
String s1 = "";
|
||||
s1 = s1 + "";
|
||||
System.out.println(s1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class ReturnVariable {
|
||||
String bar(String s) {
|
||||
s = s + "";
|
||||
return s;
|
||||
}
|
||||
|
||||
void foo() {
|
||||
String s1 = "";
|
||||
s1 = bar(s1);
|
||||
System.out.println(s1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class ReturnVoidTest {
|
||||
interface Thing {
|
||||
boolean thing();
|
||||
}
|
||||
|
||||
void dupeHolder() {
|
||||
if (false) return;
|
||||
}
|
||||
|
||||
void <caret>duplicator(final boolean thingReturn) {
|
||||
if (thingReturn ) return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class ReturnVoidTest {
|
||||
interface Thing {
|
||||
boolean thing();
|
||||
}
|
||||
|
||||
void dupeHolder() {
|
||||
duplicator(false);
|
||||
}
|
||||
|
||||
void duplicator(final boolean thingReturn) {
|
||||
if (thingReturn ) return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class StaticMethodReplacement {
|
||||
static void <caret>main(StaticMethodReplacement r) {
|
||||
r.bar();
|
||||
}
|
||||
|
||||
void bar(){}
|
||||
|
||||
void foo() {
|
||||
bar();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class StaticMethodReplacement {
|
||||
static void main(StaticMethodReplacement r) {
|
||||
r.bar();
|
||||
}
|
||||
|
||||
void bar(){}
|
||||
|
||||
void foo() {
|
||||
main(StaticMethodReplacement.this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class ThisReferenceTest {
|
||||
void foo(){}
|
||||
|
||||
void <caret>bar(){this.foo();}
|
||||
|
||||
static void main(ThisReferenceTest t){
|
||||
t.foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class ThisReferenceTest {
|
||||
void foo(){}
|
||||
|
||||
void bar(){this.foo();}
|
||||
|
||||
static void main(ThisReferenceTest t){
|
||||
t.bar();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
class I {}
|
||||
class I1 extends I {}
|
||||
|
||||
void <caret>foo(I i){
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
void bar(I1 i){
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
class I {}
|
||||
class I1 extends I {}
|
||||
|
||||
void foo(I i){
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
void bar(I1 i){
|
||||
foo(i);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class Test {
|
||||
class I {}
|
||||
class I1 extends I {}
|
||||
|
||||
void foo(I i){
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
void <caret>bar(I1 i){
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user