Skip to content

Unit test cleanup #1534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Nov 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public abstract class AbstractGeneric<T>
{

}
Binary file not shown.

This file was deleted.

Binary file not shown.
4 changes: 0 additions & 4 deletions unit/java_bytecode/java_bytecode_parse_generics/Bar.java

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
public class BoundedGenericInnerClasses
{
class Inner<E>
{
E elem;
}

class BoundedInner<NUM extends java.lang.Number>
{
NUM elem;
}

BoundedInner<Integer> belem;

class DoubleBoundedInner<T extends java.lang.Number & Interface>
{
T elem;
}

class TwoElementInner<K, V>
{
K k;
V v;
}
}
Binary file not shown.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class DerivedGenericInst extends Generic<Interface_Implementation>
{

}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class DerivedGenericUninst<T> extends Generic<T>
{

}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
public class FunctionsWithGenerics
{

class Inner
{
public Generic<Integer> x;
}

public static Generic<Integer> processReturnSame(Generic<Integer> x)
{
return x;
}

public static Generic<Integer> processReturnDifferent(Generic<String> s)
{
Generic<Integer> x = new Generic<Integer>();
return x;
}

public static Generic<Integer> processReturnMultipleSame(Generic<Integer> x, Generic<Integer> y)
{
return x;
}

public static Generic<Integer> processReturnMultipleDifferent(Generic<String> s, Generic<Boolean> b)
{
Generic<Integer> x = new Generic<Integer>();
return x;
}

public Generic<Integer> returnInnerField(Inner inner)
{
return inner.x;
}

}
Binary file not shown.
12 changes: 12 additions & 0 deletions unit/java_bytecode/java_bytecode_parse_generics/Generic.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Generic<T>
{
public T t;
public Generic<Integer> g;

public static <T> Generic<T> makeGeneric(T value)
{
Generic<T> newST = new Generic<T>();
newST.t = value;
return newST;
}
}
Binary file modified unit/java_bytecode/java_bytecode_parse_generics/GenericArray.class
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class GenericArray<T>
{
public T [] t;
Copy link
Contributor

@chrisr-diffblue chrisr-diffblue Oct 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it also worth adding a test for something like a field of type SomeClass<T>[] ?

public Integer [] Ia;
public int [] ia;
Generic<T>[] t2;
Generic<Integer>[] t3;
}
Binary file not shown.
Binary file not shown.
109 changes: 0 additions & 109 deletions unit/java_bytecode/java_bytecode_parse_generics/GenericClass.java

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
public class GenericClassWithGenericInnerClasses<T>
{
class InnerClass
{
}

class GenericInnerClass<V>
{
V field;

class DoublyNestedInnerClass
{

}

class DoublyNestedInnerGenericClass<U>
{
T field;
}
}

class SameGenericParamInnerClass<T>
{
T field;
}

class TwoParamInnerClass<K, L>
{
K k;
L l;
}

InnerClass field;

GenericInnerClass<Interface_Implementation> field2;
GenericInnerClass<T> field3;

GenericInnerClass<Interface_Implementation>.DoublyNestedInnerClass field4;
GenericInnerClass<T>.DoublyNestedInnerClass field5;

GenericInnerClass<Interface_Implementation>.DoublyNestedInnerGenericClass<Interface_Implementation> field6;
GenericInnerClass<T>.DoublyNestedInnerGenericClass<T> field7;

TwoParamInnerClass<Interface_Implementation,Interface_Implementation> field8;
TwoParamInnerClass<Interface_Implementation,T> field9;
TwoParamInnerClass<T,T> field10;

void method(InnerClass input)
{

}

void method2(InnerClass input, InnerClass input2)
{

}


void method3(GenericInnerClass<Interface_Implementation> input)
{

}

void method4(GenericInnerClass<T> input)
{

}

void method5(GenericInnerClass<Interface_Implementation>.DoublyNestedInnerClass input)
{

}

void method6(GenericInnerClass<T>.DoublyNestedInnerClass input)
{

}

void method7(GenericInnerClass<Interface_Implementation>.DoublyNestedInnerGenericClass<Interface_Implementation> input)
{

}

void method8(GenericInnerClass<T>.DoublyNestedInnerGenericClass<T> input)
{

}

void method9(TwoParamInnerClass<Interface_Implementation,Interface_Implementation> input)
{

}

void method10(TwoParamInnerClass<Interface_Implementation,T> input)
{

}

void method11(TwoParamInnerClass<T,T> input)
{

}

InnerClass ret_method1()
{
return null;
}

GenericInnerClass<Interface_Implementation> ret_method2()
{
return null;
}

GenericInnerClass<T> ret_method3()
{
return null;
}

GenericInnerClass<Interface_Implementation>.DoublyNestedInnerClass ret_method4()
{
return null;
}
GenericInnerClass<T>.DoublyNestedInnerClass ret_method5()
{
return null;
}
GenericInnerClass<Interface_Implementation>.DoublyNestedInnerGenericClass<Interface_Implementation> ret_method6()
{
return null;
}
GenericInnerClass<T>.DoublyNestedInnerGenericClass<T> ret_method7()
{
return null;
}
TwoParamInnerClass<Interface_Implementation,Interface_Implementation> ret_method8()
{
return null;
}
TwoParamInnerClass<Interface_Implementation,T> ret_method9()
{
return null;
}
TwoParamInnerClass<T,T> ret_method10()
{
return null;
}
}
Binary file not shown.
Loading