Skip to content

Commit af3efea

Browse files
author
svorenova
committed
Renaming java files
1 parent 89a1132 commit af3efea

40 files changed

+69
-65
lines changed
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public abstract class AbstractGeneric<T>
2+
{
3+
4+
}
Binary file not shown.

unit/java_bytecode/java_bytecode_parse_generics/AbstractGenericClass.java

-4
This file was deleted.
Binary file not shown.

unit/java_bytecode/java_bytecode_parse_generics/Bar.java

-4
This file was deleted.

unit/java_bytecode/java_bytecode_parse_generics/BasicInterface.java

-4
This file was deleted.
Binary file not shown.

unit/java_bytecode/java_bytecode_parse_generics/BasicInterfaceCopy.java

-4
This file was deleted.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class DerivedGeneric extends SimpleGeneric<Foo>
1+
class DerivedGeneric extends Generic<Interface_Implementation>
22
{
33

44
}
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Generic<T>
2+
{
3+
public T t;
4+
5+
public static <T> Generic<T> makeGeneric(T value)
6+
{
7+
Generic<T> newST = new Generic<T>();
8+
newST.t = value;
9+
return newST;
10+
}
11+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
public class GenericFunctions
22
{
3-
public static <T> void processSimpleGeneric(SimpleGeneric<T> x) {
3+
public static <T> void processSimpleGeneric(Generic<T> x) {
44
assert(x.t==null);
55
}
66

77
// Test a wildcard generic bound by an interface
8-
public static <T extends BasicInterface> void processUpperBoundInterfaceGeneric(SimpleGeneric<T> x) {
8+
public static <T extends Interface> void processUpperBoundInterfaceGeneric(Generic<T> x) {
99
assert(x.t.getX() == 4);
1010
}
1111

1212
// Test a wild card generic bound by a class
13-
public static <T extends Foo> void processUpperBoundClassGeneric(SimpleGeneric<T> x) {
13+
public static <T extends Interface_Implementation> void processUpperBoundClassGeneric(Generic<T> x) {
1414
assert(x.t.getX() == 4);
1515
}
1616

1717
// Test a wild card generic bound by a class and an interface
18-
public static <T extends Foo & BasicInterface> void processDoubleUpperBoundClassGeneric(SimpleGeneric<T> x) {
18+
public static <T extends Interface_Implementation & Interface> void processDoubleUpperBoundClassGeneric(Generic<T> x) {
1919
assert(x.t.getX() == 4);
2020
}
2121

2222
// Test a wild card generic bound by two interfaces
23-
public static <T extends BasicInterface & BasicInterfaceCopy> void processDoubleUpperBoundInterfaceGeneric(SimpleGeneric<T> x) {
23+
public static <T extends Interface & Interface_Copy> void processDoubleUpperBoundInterfaceGeneric(Generic<T> x) {
2424
assert(x.t.getX() == 4);
2525
}
2626
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface Interface
2+
{
3+
int getX();
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface Interface_Copy
2+
{
3+
int getX();
4+
}
Binary file not shown.

unit/java_bytecode/java_bytecode_parse_generics/Foo.java renamed to unit/java_bytecode/java_bytecode_parse_generics/Interface_Implementation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Foo implements BasicInterface
1+
class Interface_Implementation implements Interface
22
{
33
public int x;
44

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Interface_Implementation_Derived extends Interface_Implementation
2+
{
3+
4+
}
Binary file not shown.

unit/java_bytecode/java_bytecode_parse_generics/Outer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ public class Outer<T>
22
{
33
private class Inner
44
{
5-
private final AbstractGenericClass<T> u;
5+
private final AbstractGeneric<T> u;
66

7-
Inner (AbstractGenericClass<T> t)
7+
Inner (AbstractGeneric<T> t)
88
{
99
this.u = t;
1010
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class RecursiveGeneric extends SimpleRecursiveGeneric<RecursiveGeneric>
1+
class RecursiveGeneric<T extends RecursiveGeneric<T>>
22
{
3-
3+
public T t;
44
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class RecursiveGeneric_Derived extends RecursiveGeneric<RecursiveGeneric_Derived>
2+
{
3+
4+
}
Binary file not shown.

unit/java_bytecode/java_bytecode_parse_generics/SimpleGeneric.java

-11
This file was deleted.
Binary file not shown.

unit/java_bytecode/java_bytecode_parse_generics/SimpleRecursiveGeneric.java

-4
This file was deleted.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,57 @@
11
public class WildcardGenericFunctions
22
{
33
// Test a wild card generic type
4-
public static void processSimpleGeneric(SimpleGeneric<?> x) {
4+
public static void processSimpleGeneric(Generic<?> x) {
55
assert(x.t.equals(null));
66
}
77

88
// Test a wildcard generic bound by an interface
9-
public static void processUpperBoundInterfaceGeneric(SimpleGeneric<? extends BasicInterface> x) {
9+
public static void processUpperBoundInterfaceGeneric(Generic<? extends
10+
Interface> x) {
1011
assert(x.t.getX() == 4);
1112
}
1213

1314
// Test a wild card generic bound by a class
14-
public static void processUpperBoundClassGeneric(SimpleGeneric<? extends Foo> x) {
15+
public static void processUpperBoundClassGeneric(Generic<? extends
16+
Interface_Implementation> x) {
1517
assert(x.t.getX() == 4);
1618
}
1719

18-
// It isn't legal to have an wild card with two upper bounds
20+
// It isn't legal to have a wild card with two upper bounds
1921
// Per language spec on intersection types
2022

21-
public static void processLowerBoundGeneric(SimpleGeneric<? super Foo> x, Foo assign) {
23+
public static void processLowerBoundGeneric(Generic<? super
24+
Interface_Implementation> x, Interface_Implementation assign) {
2225
x.t = assign;
2326
}
2427

2528
// It is not legal Java to specify both an upper and lower bound
26-
// public static void processBoundSuperClassGeneric(SimpleGeneric<? extends Object super Foo> x, Foo assign) {
29+
// public static void processBoundSuperClassGeneric(Generic<? extends Object super Interface_Implementation> x, Interface_Implementation assign) {
2730
// x.t = assign;
2831
// }
2932

3033
// Test a wild card generic bound by a class
31-
// public static void processBoundClassGenericDoubleBound(SimpleGeneric<? extends Foo & BasicInterface> x) {
34+
// public static void processBoundClassGenericDoubleBound(Generic<? extends Interface_Implementation & Interface> x) {
3235
// assert(x.t.getX() == 4);
3336
// }
3437

3538
public static void test()
3639
{
37-
SimpleGeneric<Foo> myGenericValue = new SimpleGeneric<Foo>();
40+
Generic<Interface_Implementation> myGenericValue = new Generic<Interface_Implementation>();
3841
myGenericValue.t = null;
3942
processSimpleGeneric(myGenericValue);
4043

41-
myGenericValue.t = new Foo();
44+
myGenericValue.t = new Interface_Implementation();
4245
myGenericValue.t.x = 4;
4346
processUpperBoundInterfaceGeneric(myGenericValue);
4447

45-
SimpleGeneric<Bar> anotherGenericValue = new SimpleGeneric<Bar>();
46-
anotherGenericValue.t = new Bar();
48+
Generic<Interface_Implementation_Derived> anotherGenericValue = new Generic<Interface_Implementation_Derived>();
49+
anotherGenericValue.t = new Interface_Implementation_Derived();
4750
anotherGenericValue.t.x = 4;
4851
processUpperBoundClassGeneric(anotherGenericValue);
4952

5053

51-
SimpleGeneric<Object> baseGenericValue = new SimpleGeneric<Object>();
52-
processLowerBoundGeneric(baseGenericValue, new Foo());
54+
Generic<Object> baseGenericValue = new Generic<Object>();
55+
processLowerBoundGeneric(baseGenericValue, new Interface_Implementation());
5356
}
5457
}
Binary file not shown.

unit/java_bytecode/java_bytecode_parse_generics/parse_generic_functions.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SCENARIO(
3131
THEN("There should be a symbol for processSimpleGeneric")
3232
{
3333
const std::string func_name=".processSimpleGeneric";
34-
const std::string func_descriptor=":(LSimpleGeneric;)V";
34+
const std::string func_descriptor = ":(LGeneric;)V";
3535
const std::string process_func_name=class_prefix+func_name+func_descriptor;
3636

3737
REQUIRE(new_symbol_table.has_symbol(process_func_name));
@@ -40,7 +40,7 @@ SCENARIO(
4040
THEN("There should be a symbol for processUpperBoundInterfaceGeneric")
4141
{
4242
const std::string func_name=".processUpperBoundInterfaceGeneric";
43-
const std::string func_descriptor=":(LSimpleGeneric;)V";
43+
const std::string func_descriptor = ":(LGeneric;)V";
4444
const std::string process_func_name=class_prefix+func_name+func_descriptor;
4545

4646
REQUIRE(new_symbol_table.has_symbol(process_func_name));
@@ -49,7 +49,7 @@ SCENARIO(
4949
THEN("There should be a symbol for processUpperBoundClassGeneric")
5050
{
5151
const std::string func_name=".processUpperBoundClassGeneric";
52-
const std::string func_descriptor=":(LSimpleGeneric;)V";
52+
const std::string func_descriptor = ":(LGeneric;)V";
5353
const std::string process_func_name=class_prefix+func_name+func_descriptor;
5454

5555
REQUIRE(new_symbol_table.has_symbol(process_func_name));
@@ -58,7 +58,7 @@ SCENARIO(
5858
THEN("There should be a symbol for processDoubleUpperBoundClassGeneric")
5959
{
6060
const std::string func_name=".processDoubleUpperBoundClassGeneric";
61-
const std::string func_descriptor=":(LSimpleGeneric;)V";
61+
const std::string func_descriptor = ":(LGeneric;)V";
6262
const std::string process_func_name=class_prefix+func_name+func_descriptor;
6363

6464
REQUIRE(new_symbol_table.has_symbol(process_func_name));
@@ -67,7 +67,7 @@ SCENARIO(
6767
THEN("There should be a symbol for processDoubleUpperBoundInterfaceGeneric")
6868
{
6969
const std::string func_name=".processDoubleUpperBoundInterfaceGeneric";
70-
const std::string func_descriptor=":(LSimpleGeneric;)V";
70+
const std::string func_descriptor = ":(LGeneric;)V";
7171
const std::string process_func_name=class_prefix+func_name+func_descriptor;
7272

7373
REQUIRE(new_symbol_table.has_symbol(process_func_name));

unit/java_bytecode/java_bytecode_parse_generics/parse_generic_wildcard_function.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SCENARIO(
3232
THEN("There should be a symbol for processSimpleGeneric")
3333
{
3434
const std::string func_name=".processSimpleGeneric";
35-
const std::string func_descriptor=":(LSimpleGeneric;)V";
35+
const std::string func_descriptor = ":(LGeneric;)V";
3636
const std::string process_func_name=class_prefix+func_name+func_descriptor;
3737

3838
REQUIRE(new_symbol_table.has_symbol(process_func_name));
@@ -41,7 +41,7 @@ SCENARIO(
4141
THEN("There should be a symbol for processUpperBoundInterfaceGeneric")
4242
{
4343
const std::string func_name=".processUpperBoundInterfaceGeneric";
44-
const std::string func_descriptor=":(LSimpleGeneric;)V";
44+
const std::string func_descriptor = ":(LGeneric;)V";
4545
const std::string process_func_name=class_prefix+func_name+func_descriptor;
4646

4747
REQUIRE(new_symbol_table.has_symbol(process_func_name));
@@ -50,7 +50,7 @@ SCENARIO(
5050
THEN("There should be a symbol for processUpperBoundClassGeneric")
5151
{
5252
const std::string func_name=".processUpperBoundClassGeneric";
53-
const std::string func_descriptor=":(LSimpleGeneric;)V";
53+
const std::string func_descriptor = ":(LGeneric;)V";
5454
const std::string process_func_name=class_prefix+func_name+func_descriptor;
5555

5656
REQUIRE(new_symbol_table.has_symbol(process_func_name));
@@ -59,7 +59,8 @@ SCENARIO(
5959
THEN("There should be a symbol for processLowerBoundGeneric")
6060
{
6161
const std::string func_name=".processLowerBoundGeneric";
62-
const std::string func_descriptor=":(LSimpleGeneric;LFoo;)V";
62+
const std::string func_descriptor =
63+
":(LGeneric;LInterface_Implementation;)V";
6364
const std::string process_func_name=class_prefix+func_name+func_descriptor;
6465

6566
REQUIRE(new_symbol_table.has_symbol(process_func_name));

unit/java_bytecode/java_bytecode_parse_generics/parse_signature_descriptor_mismatch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ SCENARIO(
4343
" descriptor")
4444
{
4545
const std::string func_name=".<init>";
46-
const std::string func_descriptor=":(LOuter;LAbstractGenericClass;)V";
46+
const std::string func_descriptor = ":(LOuter;LAbstractGeneric;)V";
4747
const std::string process_func_name=
4848
inner_prefix+func_name+func_descriptor;
4949
REQUIRE(new_symbol_table.has_symbol(process_func_name));

0 commit comments

Comments
 (0)