Skip to content

Commit f30f8f4

Browse files
author
dlsmith
committed
Renamed "*Type" AST classes "*TypeName" in anticipation of a new "Type" class hierarchy; fixed tests so that they will succeed after Retroweaver processes them.
git-svn-id: file:///tmp/test-svn/trunk@3804 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent 8ef464a commit f30f8f4

File tree

85 files changed

+788
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+788
-831
lines changed

dynamicjava/build.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@
320320
description="Compile all source files (after generating the source)">
321321
</target>
322322

323-
<target name="do-compile" depends="assert-15, resolve-java15-tools">
323+
<target name="do-compile" depends="assert-15">
324324
<echo message="Compiling src directory to classes/base and classes/test" />
325325
<mkdir dir="classes/base" />
326326
<mkdir dir="classes/test" />
@@ -334,6 +334,7 @@
334334
<fileset refid="libs" />
335335
<pathelement location="lib/buildlib/junit.jar" />
336336
<pathelement location="classes/base" />
337+
<pathelement location="testFiles/classes" />
337338
</classpath>
338339
<compilerarg value="-Xlint" />
339340
<!-- Ignore serial warnings, because they occur for every Throwable definition (among others) -->
@@ -414,6 +415,7 @@
414415
<pathelement location="classes/test-14" />
415416
<pathelement location="classes/base-14" />
416417
<pathelement location="classes/lib-14" />
418+
<pathelement location="testFiles/classes" />
417419
</path>
418420
</pathconvert>
419421
<!-- Note: "verifyrefs" is called "refclasspath" in the documentation, but that name is incorrect -->
@@ -442,6 +444,7 @@
442444
<pathelement location="classes/test" />
443445
<pathelement location="classes/base" />
444446
<pathelement location="classes/lib" />
447+
<pathelement location="testFiles/classes" />
445448
</classpath>
446449
<formatter type="brief" usefile="false" />
447450
<batchtest>
@@ -462,6 +465,7 @@
462465
<pathelement location="classes/test-14" />
463466
<pathelement location="classes/base-14" />
464467
<pathelement location="classes/lib-14" />
468+
<pathelement location="testFiles/classes" />
465469
</classpath>
466470
<formatter type="brief" usefile="false" />
467471
<batchtest>
@@ -479,6 +483,7 @@
479483
<pathelement location="classes/test-14" />
480484
<pathelement location="classes/base-14" />
481485
<pathelement location="classes/lib-14" />
486+
<pathelement location="testFiles/classes" />
482487
</classpath>
483488
<formatter type="brief" usefile="false" />
484489
<batchtest>
@@ -602,6 +607,7 @@
602607
<classpath>
603608
<fileset refid="libs" />
604609
<pathelement location="lib/buildlib/junit.jar" />
610+
<pathelement location="testFiles/classes" />
605611
</classpath>
606612
<link href="http://java.sun.com/j2se/1.5/docs/api" />
607613
<link href="http://junit.org/junit/javadoc/3.8.1" />

dynamicjava/src/koala/dynamicjava/classinfo/TreeClassInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ private class MembersVisitor extends VisitorObject<Void> {
510510
// Add a reference to the outer instance
511511
FieldDeclaration fd;
512512
fd = new FieldDeclaration(Modifier.PUBLIC,
513-
new ReferenceType(dc.getName()),
513+
new ReferenceTypeName(dc.getName()),
514514
"this$" + getNestingLevel(),
515515
null);
516516
fd.acceptVisitor(this);
@@ -528,7 +528,7 @@ private class MembersVisitor extends VisitorObject<Void> {
528528
cd = new ConstructorDeclaration(Modifier.PUBLIC,
529529
classTree.getName(),
530530
new LinkedList<FormalParameter>(),
531-
new LinkedList<ReferenceType>(),
531+
new LinkedList<ReferenceTypeName>(),
532532
ci,
533533
new LinkedList<Node>());
534534
cd.acceptVisitor(this);
@@ -584,7 +584,7 @@ public Void visit(ConstructorDeclaration node) {
584584
ClassInfo dc = getDeclaringClass();
585585
if (!classTree.hasProperty(TREE_VISITED)) {
586586
if (dc != null && !Modifier.isStatic(getModifiers())) {
587-
ReferenceType t = new ReferenceType(dc.getName());
587+
ReferenceTypeName t = new ReferenceTypeName(dc.getName());
588588
node.getParameters().add(0,
589589
new FormalParameter(false, t, "param$0"));
590590
}

dynamicjava/src/koala/dynamicjava/classinfo/TypeVisitor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,31 +63,31 @@ public TypeVisitor(ClassFinder cf, ClassInfo ctx) {
6363
}
6464

6565
/**
66-
* Visits a PrimitiveType
66+
* Visits a PrimitiveTypeName
6767
* @param node the node to visit
6868
* @return the representation of the visited type
6969
*/
70-
public ClassInfo visit(PrimitiveType node) {
70+
public ClassInfo visit(PrimitiveTypeName node) {
7171
return new JavaClassInfo(node.getValue());
7272
}
7373

7474
/**
75-
* Visits a ReferenceType
75+
* Visits a ReferenceTypeName
7676
* @param node the node to visit
7777
* @return the representation of the visited type
7878
* @exception NoClassDefFoundError if the class cannot be loaded
7979
*/
80-
public ClassInfo visit(ReferenceType node) {
80+
public ClassInfo visit(ReferenceTypeName node) {
8181
return lookupClass(node.getRepresentation(), context);
8282
}
8383

8484
/**
85-
* Visits a ArrayType
85+
* Visits a ArrayTypeName
8686
* @param node the node to visit
8787
* @return the representation of the visited type
8888
* @exception NoClassDefFoundError if the class cannot be loaded
8989
*/
90-
public ClassInfo visit(ArrayType node) {
90+
public ClassInfo visit(ArrayTypeName node) {
9191
ClassInfo ci = node.getElementType().acceptVisitor(this);
9292
return ci.getArrayType();
9393
}

dynamicjava/src/koala/dynamicjava/interpreter/AbstractTypeChecker.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,8 @@ public Class<?> visit(InnerAllocation node) {
953953

954954
// Check the type to declare
955955
Node type = node.getCreationType();
956-
if (type instanceof ReferenceType) {
957-
ReferenceType rt = (ReferenceType)type;
956+
if (type instanceof ReferenceTypeName) {
957+
ReferenceTypeName rt = (ReferenceTypeName)type;
958958
rt.setRepresentation(ec.getName() + "$" + rt.getRepresentation());
959959
} else {
960960
throw new ExecutionError("allocation.type", node);
@@ -1049,7 +1049,7 @@ public Class<?> visit(ArrayAllocation node) {
10491049
}
10501050
}
10511051

1052-
// Type-check the type of the array
1052+
// TypeName-check the type of the array
10531053
Class<?> c = node.getCreationType().acceptVisitor(this);
10541054

10551055
// Visits the initializer if one
@@ -1113,20 +1113,20 @@ public Class<?> visit(ArrayAccess node) {
11131113
}
11141114

11151115
/**
1116-
* Visits a PrimitiveType
1116+
* Visits a PrimitiveTypeName
11171117
* @param node the node to visit
11181118
*/
1119-
public Class<?> visit(PrimitiveType node) {
1119+
public Class<?> visit(PrimitiveTypeName node) {
11201120
Class<?> c = node.getValue();
11211121
node.setProperty(NodeProperties.TYPE, c);
11221122
return c;
11231123
}
11241124

11251125
/**
1126-
* Visits a ReferenceType
1126+
* Visits a ReferenceTypeName
11271127
* @param node the node to visit
11281128
*/
1129-
public Class<?> visit(ReferenceType node) {
1129+
public Class<?> visit(ReferenceTypeName node) {
11301130
checkGenericReferenceType(node);
11311131
Class<?> c = null;
11321132
try {
@@ -1143,17 +1143,17 @@ public Class<?> visit(ReferenceType node) {
11431143

11441144
/**
11451145
* If java earlier than 1.5, checks if the node is a
1146-
* GenericReferenceType
1146+
* GenericReferenceTypeName
11471147
* @param node unused
11481148
*/
1149-
protected abstract void checkGenericReferenceType(ReferenceType node);
1149+
protected abstract void checkGenericReferenceType(ReferenceTypeName node);
11501150

11511151

11521152
/**
1153-
* Visits an ArrayType
1153+
* Visits an ArrayTypeName
11541154
* @param node the node to visit
11551155
*/
1156-
public Class<?> visit(ArrayType node) {
1156+
public Class<?> visit(ArrayTypeName node) {
11571157
Node eType = node.getElementType();
11581158
Class<?> c = eType.acceptVisitor(this);
11591159
Class<?> ac = Array.newInstance(c, 0).getClass();
@@ -2866,30 +2866,30 @@ private void checkList(List<? extends Node> l) {
28662866
* @param refType the reference class
28672867
* @return the corresponding primitive type
28682868
*/
2869-
protected static PrimitiveType _correspondingPrimType(Class<?> refClass) {
2869+
protected static PrimitiveTypeName _correspondingPrimType(Class<?> refClass) {
28702870
if (refClass == Boolean.class) {
2871-
return new BooleanType();
2871+
return new BooleanTypeName();
28722872
}
28732873
else if (refClass == Byte.class) {
2874-
return new ByteType();
2874+
return new ByteTypeName();
28752875
}
28762876
else if (refClass == Character.class) {
2877-
return new CharType();
2877+
return new CharTypeName();
28782878
}
28792879
else if (refClass == Short.class) {
2880-
return new ShortType();
2880+
return new ShortTypeName();
28812881
}
28822882
else if (refClass == Integer.class) {
2883-
return new IntType();
2883+
return new IntTypeName();
28842884
}
28852885
else if (refClass == Long.class) {
2886-
return new LongType();
2886+
return new LongTypeName();
28872887
}
28882888
else if (refClass == Float.class) {
2889-
return new FloatType();
2889+
return new FloatTypeName();
28902890
}
28912891
else if (refClass == Double.class) {
2892-
return new DoubleType();
2892+
return new DoubleTypeName();
28932893
}
28942894
else {
28952895
throw new RuntimeException("No corresponding primitive type for reference class " +

0 commit comments

Comments
 (0)