- if(e == null) throw new Error("should never happen");
- if(e instanceof CPRefEnt) {
- CPRefEnt ce = (CPRefEnt) e;
- if(e0s[i] == 0 || e0s[i] >= usedSlots) throw new ClassGen.ClassReadExn("invalid cp index");
- ce.e0 = entriesByIndex[e0s[i]];
- if(ce.e0 == null) throw new ClassGen.ClassReadExn("invalid cp index");
- if(ce.tag != 7 && ce.tag != 8) {
- if(e1s[i] == 0 || e1s[i] >= usedSlots) throw new ClassGen.ClassReadExn("invalid cp index");
- ce.e1 = entriesByIndex[e1s[i]];
- if(ce.e1 == null) throw new ClassGen.ClassReadExn("invalid cp index");
- }
- switch(ce.tag) {
- case 7:
- case 8:
- if(!(ce.e0 instanceof Utf8Ent)) throw new ClassGen.ClassReadExn("expected a utf8 ent");
- break;
- case 9:
- case 10:
- case 11:
- if(!(ce.e1 instanceof CPRefEnt) || ((CPRefEnt)ce.e1).tag != 7)
- throw new ClassGen.ClassReadExn("expected a type ent");
- if(!(ce.e2 instanceof CPRefEnt) || ((CPRefEnt)ce.e2).tag != 12)
- throw new ClassGen.ClassReadExn("expected a name and type ent");
- break;
- case 12:
- if(!(ce.e1 instanceof Utf8Ent)) throw new ClassGen.ClassReadExn("expected a utf8 ent");
- if(!(ce.e2 instanceof Utf8Ent)) throw new ClassGen.ClassReadExn("expected a utf8 ent");
- }
- } else if(e instanceof LongEnt) {