import java.io.InputStream;
import java.util.Arrays;
+import org.simantics.acorn.exception.IllegalAcornStateException;
import org.simantics.acorn.internal.ClusterChange;
import org.simantics.acorn.internal.ClusterStream;
import org.simantics.acorn.internal.ClusterSupport2;
import org.simantics.acorn.internal.DebugPolicy;
import org.simantics.db.Resource;
+import org.simantics.db.common.utils.Logger;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.ExternalValueException;
import org.simantics.db.exception.ValidationException;
-import org.simantics.db.impl.ClusterBase;
import org.simantics.db.impl.ClusterI;
import org.simantics.db.impl.ClusterSupport;
import org.simantics.db.impl.ClusterTraitsBase;
}
}
@Override
- public byte[] getValue(int resourceKey, ClusterSupport support)
- throws DatabaseException {
+ public byte[] getValue(int resourceKey, ClusterSupport support) throws DatabaseException {
if (DEBUG)
System.out.println("ClusterSmall.getValue " + resourceKey);
int resourceIndex = ClusterTraitsBase.getResourceIndexFromResourceKeyNoThrow(resourceKey);
return resourceTable.getUsedSize();
}
- public int getNumberOfResources() {
-
- if(proxy) throw new IllegalStateException();
+ public int getNumberOfResources() throws IllegalAcornStateException {
+ if(proxy)
+ throw new IllegalAcornStateException("proxy == true for " + clusterId);
return resourceTable.getUsedSize();
-
}
@Override
});
return "ClusterSmall[" + getClusterUID() + " - " + getClusterId() + " - " + getNumberOfResources() + " - " + foreignTable.getResourceHashMap().size() + " - " + set.size() + "]";
} catch (DatabaseException e) {
- return "ClusterSmall[" + getNumberOfResources() + "]";
+ try {
+ return "ClusterSmall[" + getNumberOfResources() + "]";
+ } catch (IllegalAcornStateException e1) {
+ Logger.defaultLogError(e1);
+ e1.printStackTrace();
+ return "An exception occured!!";
+ }
}
}