remove dependency with ast_java and JavaTypeNamespace: Variable
ast_java doesn't need to know about Type in JavaTypeNamespace.
This commit removes Type in Variable
Bug: 110967839
Test: ./runtests.sh
Test: m -j
Change-Id: Ideb434156c84c1e4003de16847bf8499bcd46b0a
diff --git a/ast_java.cpp b/ast_java.cpp
index cc332e9..c4b250c 100644
--- a/ast_java.cpp
+++ b/ast_java.cpp
@@ -100,19 +100,16 @@
to->Write("\"%s\"", this->value.c_str());
}
-Variable::Variable(const Type* t, const string& n)
- : type(t), name(n), dimension(0) {}
+Variable::Variable(const string& t, const string& n) : type(t), name(n), dimension(0) {}
-Variable::Variable(const Type* t, const string& n, int d)
- : type(t), name(n), dimension(d) {}
+Variable::Variable(const string& t, const string& n, int d) : type(t), name(n), dimension(d) {}
void Variable::WriteDeclaration(CodeWriter* to) const {
string dim;
for (int i = 0; i < this->dimension; i++) {
dim += "[]";
}
- to->Write("%s%s %s", this->type->JavaType().c_str(), dim.c_str(),
- this->name.c_str());
+ to->Write("%s%s %s", this->type.c_str(), dim.c_str(), this->name.c_str());
}
void Variable::Write(CodeWriter* to) const { to->Write("%s", name.c_str()); }