Commit 54df6cf5 authored by Lukáš Marek's avatar Lukáš Marek

Applied patch for ArrayClassInfo by Andreas

parent 1b048692
......@@ -13,6 +13,8 @@ public class ArrayClassInfo extends AbstractClassInfo {
private int arrayDimensions;
private ClassInfo arrayComponentInfo;
private static final FieldInfo[] NO_FIELDS = new FieldInfo[0];
public ArrayClassInfo(int classId, String classSignature,
String classGenericStr, NetReference classLoaderNR,
ClassInfo superClassInfo, int arrayDimensions,
......@@ -72,8 +74,14 @@ public class ArrayClassInfo extends AbstractClassInfo {
}
public String getName() {
// TODO Auto-generated method stub
throw new DiSLREServerFatalException("Not implemented");
String componentName = arrayComponentInfo.getName();
StringBuffer buffer = new StringBuffer(arrayDimensions + componentName.length());
for (int i = 0; i < arrayDimensions; i++)
buffer.append('[');
buffer.append(componentName);
return buffer.toString();
}
public String getCanonicalName() {
......@@ -92,13 +100,11 @@ public class ArrayClassInfo extends AbstractClassInfo {
}
public FieldInfo[] getFields() {
// TODO Auto-generated method stub
throw new DiSLREServerFatalException("Not implemented");
return NO_FIELDS;
}
public FieldInfo getField(String fieldName) throws NoSuchFieldException {
// TODO Auto-generated method stub
throw new DiSLREServerFatalException("Not implemented");
throw new NoSuchFieldException("Arrays do not have fields");
}
public MethodInfo[] getMethods() {
......@@ -124,14 +130,12 @@ public class ArrayClassInfo extends AbstractClassInfo {
}
public FieldInfo[] getDeclaredFields() {
// TODO Auto-generated method stub
throw new DiSLREServerFatalException("Not implemented");
return NO_FIELDS;
}
public FieldInfo getDeclaredField(String fieldName)
throws NoSuchFieldException {
// TODO Auto-generated method stub
throw new DiSLREServerFatalException("Not implemented");
throw new NoSuchFieldException("Arrays do not have fields");
}
public MethodInfo[] getDeclaredMethods() {
......
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