Commit 336caab5 authored by Lubomir Bulej's avatar Lubomir Bulej

ArrayShadowClass: make the class package private and final.

ArrayShadowClass: reorder constructor parameters to consistently pass ASM Type after net reference.
ObjectShadowClass: make the class final.
PrimitiveShadowClass: make the class package private and final.
ShadowClassTable: reflect the changes in constructor parameter order.
parent c903fbc8
......@@ -7,7 +7,7 @@ import org.objectweb.asm.Type;
import ch.usi.dag.dislreserver.DiSLREServerFatalException;
public class ArrayShadowClass extends ShadowClass {
final class ArrayShadowClass extends ShadowClass {
private final Type __type;
......@@ -19,9 +19,9 @@ public class ArrayShadowClass extends ShadowClass {
//
ArrayShadowClass (
final long netReference, final ShadowObject classLoader,
final ShadowClass superClass, final ShadowClass componentClass,
final Type type
final long netReference, final Type type,
final ShadowObject classLoader, final ShadowClass superClass,
final ShadowClass componentClass
) {
super (netReference, classLoader);
......
......@@ -16,7 +16,7 @@ import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.dislreserver.DiSLREServerFatalException;
class ObjectShadowClass extends ShadowClass {
final class ObjectShadowClass extends ShadowClass {
// TODO ! is this implementation of methods really working ??
......
......@@ -3,14 +3,15 @@ package ch.usi.dag.dislreserver.shadow;
import org.objectweb.asm.Type;
public class PrimitiveShadowClass extends ShadowClass {
final class PrimitiveShadowClass extends ShadowClass {
private final Type __type;
//
PrimitiveShadowClass (
final long netReference, final ShadowObject classLoader, final Type type
final long netReference, final Type type,
final ShadowObject classLoader
) {
super (netReference, classLoader);
__type = type;
......
......@@ -73,6 +73,7 @@ public final class ShadowClassTable {
}
}
//
static ShadowClass newInstance (
final long classNetReference, final Type type,
......@@ -92,7 +93,8 @@ public final class ShadowClassTable {
ShadowClass result = shadowClasses.get (classId);
if (result == null) {
result = __createShadowClass (
classNetReference, type, superClass, classLoader
classNetReference, type, superClass,
classLoader
);
final ShadowClass previous = shadowClasses.putIfAbsent (classId, result);
......@@ -133,12 +135,12 @@ public final class ShadowClassTable {
//
if (type.getSort () < Type.ARRAY) {
// Primitive type should return null as classloader.
return new PrimitiveShadowClass (netReference, classLoader, type);
return new PrimitiveShadowClass (netReference, type, classLoader);
} else if (type.getSort () == Type.ARRAY) {
// TODO unknown array component type
// Array types have the same class loader as their component type.
return new ArrayShadowClass (netReference, classLoader, superClass, null, type);
return new ArrayShadowClass (netReference, type, classLoader, superClass, null);
} else if (type.getSort () == Type.OBJECT) {
if (classLoader == null) {
......
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