Commit 11532eb8 authored by Lionel Seinturier's avatar Lionel Seinturier

Refactoring towards removing the unified class framework.

parent f48a858b
......@@ -61,16 +61,16 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
mv.visitln(" Object ret = null;");
}
else {
UClass rtype = proxym.getReturnType();
if( rtype.cl.isPrimitive() ) {
Class<?> rtype = proxym.method.getReturnType();
if( rtype.isPrimitive() ) {
mv.visitln(" Object proceed = ijp.proceed();");
mv.visit (" ");
mv.visit (rtypename);
mv.visit (" ret = (proceed==null) ? ");
String nul = ClassHelper.getNullValue(rtype.cl);
String nul = ClassHelper.getNullValue(rtype);
mv.visit (nul);
mv.visit (" : (");
UClass boxed = rtype.box();
Class<?> boxed = ClassHelper.box(rtype);
mv.visit (boxed.getName());
mv.visitln(")proceed;");
}
......
......@@ -106,14 +106,14 @@ extends AbstractInterceptorSourceCodeGenerator {
UCMethod proxym = proxymethods[i];
String proxymname = proxym.getName();
UClass[] paramtypes = proxym.getParameterTypes();
Class<?>[] paramtypes = proxym.method.getParameterTypes();
bv.visit(" ");
bv.visit(proxyclname);
bv.visit(".class.getMethod(\"");
bv.visit(proxymname);
bv.visit("\"");
for (UClass paramtype : paramtypes) {
for (Class<?> paramtype : paramtypes) {
String paramtypename = paramtype.getName();
bv.visit(",");
bv.visit(paramtypename);
......@@ -301,7 +301,7 @@ extends AbstractInterceptorSourceCodeGenerator {
* instance and directly call the delegate.
*/
String proxymname = proxym.getName();
UClass[] ptypes = proxym.getParameterTypes();
Class<?>[] ptypes = proxym.method.getParameterTypes();
String rtypename = proxym.getGenericReturnType();
String[] tpnames = proxym.getTypeParameterNames();
......@@ -390,8 +390,8 @@ extends AbstractInterceptorSourceCodeGenerator {
mv.visitln(" catch( Throwable t ) {");
// Handle exceptions thrown by the method
UClass[] excepts = proxym.getExceptionTypes();
for (UClass except : excepts) {
Class<?>[] excepts = proxym.method.getExceptionTypes();
for (Class<?> except : excepts) {
mv.visit (" if( t instanceof ");
mv.visit (except.getName());
mv.visitln(" ) {");
......
......@@ -208,9 +208,9 @@ extends AbstractProxyClassGenerator {
// OneWay method
if( oneWayMeth != null ) {
UClass rtype = proxym.getReturnType();
Class<?> rtype = proxym.method.getReturnType();
if( ! rtype.getName().equals("void") ) {
String msg =
final String msg =
"@OneWay annotated method "+proxym.toString()+" in "+
proxycl.getName()+" should return void";
throw new TinfiRuntimeException(msg);
......
......@@ -197,7 +197,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
* TODO iterate on setter methods to retrieve @Reference annotations
* TODO iterate on inherited classes to retrieve @Reference annotations
*/
Map<String,UClass> refmap = new HashMap<String,UClass>();
Map<String,Class<?>> refmap = new HashMap<String,Class<?>>();
Map<String,Boolean> refcontingencymap = new HashMap<String,Boolean>();
Map<String,Boolean> refcardinalitymap = new HashMap<String,Boolean>();
UClass uclist = jc.create(List.class.getName());
......@@ -221,10 +221,10 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
throw new IOException(msg);
}
UClass fieldtype = field.getType();
boolean isMultiple = uclist.cl.isAssignableFrom(fieldtype.cl);
Class<?> fieldtype = field.field.getType();
boolean isMultiple = uclist.cl.isAssignableFrom(fieldtype);
refcardinalitymap.put(name,isMultiple);
UClass reftype = null;
Class<?> reftype = null;
if(isMultiple) {
/*
* gt is expected to be of the form "type<generic>".
......@@ -240,7 +240,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
}
String reftypename =
strs[1].substring(0,strs[1].length()-1); // remove trailing >
reftype = jc.create(reftypename);
reftype = jc.create(reftypename).cl;
}
else {
reftype = fieldtype;
......@@ -264,7 +264,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
i++;
}
for (String name : refmap.keySet()) {
UClass service = refmap.get(name);
Class<?> service = refmap.get(name);
String signature = service.getName();
boolean isOptional = ! refcontingencymap.get(name);
boolean isCollection = refcardinalitymap.get(name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment