import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.patterns.ConstantPoolSimulator;
import org.aspectj.weaver.patterns.FormalBinding;
import org.aspectj.weaver.patterns.Pointcut;
import org.aspectj.weaver.patterns.SimpleScope;
public void checkSerialize(Pointcut p) throws IOException {
ByteArrayOutputStream bo = new ByteArrayOutputStream();
- CompressingDataOutputStream out = new CompressingDataOutputStream(bo);
+ ConstantPoolSimulator cps = new ConstantPoolSimulator();
+ CompressingDataOutputStream out = new CompressingDataOutputStream(bo, cps);
p.write(out);
out.close();
ByteArrayInputStream bi = new ByteArrayInputStream(bo.toByteArray());
- VersionedDataInputStream in = new VersionedDataInputStream(bi);
+ VersionedDataInputStream in = new VersionedDataInputStream(bi, cps);
Pointcut newP = Pointcut.read(in, null);
assertEquals("write/read", p, newP);
import org.aspectj.weaver.ShadowMunger;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.VersionedDataInputStream;
+import org.aspectj.weaver.patterns.ConstantPoolSimulator;
import org.aspectj.weaver.patterns.Pointcut;
import org.aspectj.weaver.patterns.SimpleScope;
public void checkSerialize(Pointcut p) throws IOException {
ByteArrayOutputStream bo = new ByteArrayOutputStream();
- CompressingDataOutputStream out = new CompressingDataOutputStream(bo);
+ ConstantPoolSimulator cps = new ConstantPoolSimulator();
+ CompressingDataOutputStream out = new CompressingDataOutputStream(bo, cps);
p.write(out);
out.close();
ByteArrayInputStream bi = new ByteArrayInputStream(bo.toByteArray());
- VersionedDataInputStream in = new VersionedDataInputStream(bi);
+ VersionedDataInputStream in = new VersionedDataInputStream(bi, cps);
Pointcut newP = Pointcut.read(in, null);
assertEquals("write/read", p, newP);
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-
import junit.framework.TestCase;
import org.aspectj.weaver.BoundedReferenceType;
private TypePattern writeAndRead(TypePattern etp) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- CompressingDataOutputStream dos = new CompressingDataOutputStream(baos);
+ ConstantPoolSimulator cps = new ConstantPoolSimulator();
+ CompressingDataOutputStream dos = new CompressingDataOutputStream(baos, cps);
etp.write(dos);
dos.flush();
dos.close();
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- VersionedDataInputStream in = new VersionedDataInputStream(bais);
+ VersionedDataInputStream in = new VersionedDataInputStream(bais, cps);
in.setVersion(new WeaverVersionInfo());
TypePattern ret = TypePattern.read(in, null);
return ret;
System.out.println(attrs[i].getName());
if (attrs[i].getName().endsWith("WeaverState")) {
Unknown u = (Unknown) attrs[i];
- VersionedDataInputStream vdis = new VersionedDataInputStream(new ByteArrayInputStream(u.getBytes()));
+ VersionedDataInputStream vdis = new VersionedDataInputStream(new ByteArrayInputStream(u.getBytes()), null);
// WeaverStateInfo wsi =
WeaverStateInfo.read(vdis, null);
// System.out.println(wsi);