From cad41dcda5ce81127234513678dedc7833227c92 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 19 May 2010 15:13:29 +0000 Subject: [PATCH] 312839: smaller class files --- .../org/aspectj/weaver/bcel/PatternWeaveTestCase.java | 6 ++++-- .../org/aspectj/weaver/bcel/PointcutResidueTestCase.java | 6 ++++-- .../weaver/patterns/WildTypePatternResolutionTestCase.java | 6 +++--- .../testsrc/org/aspectj/weaver/tools/ReadingAttributes.java | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/PatternWeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/PatternWeaveTestCase.java index 4f25936b2..2d9af5395 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/PatternWeaveTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/PatternWeaveTestCase.java @@ -22,6 +22,7 @@ import org.aspectj.weaver.CompressingDataOutputStream; 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; @@ -106,12 +107,13 @@ public class PatternWeaveTestCase extends WeaveTestCase { 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); diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/PointcutResidueTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/PointcutResidueTestCase.java index f0432ffa3..99083a92e 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/PointcutResidueTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/PointcutResidueTestCase.java @@ -27,6 +27,7 @@ import org.aspectj.weaver.ResolvedType; 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; @@ -172,12 +173,13 @@ public class PointcutResidueTestCase extends WeaveTestCase { 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); diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java index d0b4c2551..e4039d063 100644 --- a/weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java @@ -14,7 +14,6 @@ package org.aspectj.weaver.patterns; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; - import junit.framework.TestCase; import org.aspectj.weaver.BoundedReferenceType; @@ -389,12 +388,13 @@ public class WildTypePatternResolutionTestCase extends TestCase { 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; diff --git a/weaver/testsrc/org/aspectj/weaver/tools/ReadingAttributes.java b/weaver/testsrc/org/aspectj/weaver/tools/ReadingAttributes.java index aff9ba313..180331c93 100644 --- a/weaver/testsrc/org/aspectj/weaver/tools/ReadingAttributes.java +++ b/weaver/testsrc/org/aspectj/weaver/tools/ReadingAttributes.java @@ -36,7 +36,7 @@ public class ReadingAttributes extends TestCase { 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); -- 2.39.5