harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r632326 [2/2] - in /harmony/enhanced/classlib/trunk/modules/pack200/src: main/java/org/apache/harmony/pack200/ main/java/org/apache/harmony/pack200/bytecode/ main/java/org/apache/harmony/pack200/bytecode/forms/ test/java/org/apache/harmony/...
Date Fri, 29 Feb 2008 14:25:03 GMT
Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/forms/StringRefForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/forms/StringRefForm.java?rev=632326&r1=632325&r2=632326&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/forms/StringRefForm.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/forms/StringRefForm.java
Fri Feb 29 06:24:57 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.harmony.pack200.bytecode.forms;
 
+import org.apache.harmony.pack200.CpBands;
 import org.apache.harmony.pack200.Pack200Exception;
 import org.apache.harmony.pack200.SegmentConstantPool;
 import org.apache.harmony.pack200.bytecode.ByteCode;
@@ -60,7 +61,7 @@
         SegmentConstantPool globalPool = operandManager.globalConstantPool();
         ClassFileEntry[] nested = null;
         nested = new ClassFileEntry[] {
-                new CPString((String)globalPool.getValue(getPoolID(), offset))
+                ((CPString)globalPool.getValue(getPoolID(), offset))
                 };
         byteCode.setNested(nested);
         if(widened) {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ClassFileEntryTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ClassFileEntryTest.java?rev=632326&r1=632325&r2=632326&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ClassFileEntryTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ClassFileEntryTest.java
Fri Feb 29 06:24:57 2008
@@ -29,10 +29,11 @@
 import org.apache.harmony.pack200.bytecode.SourceFileAttribute;
 
 public class ClassFileEntryTest extends TestCase {
+
 	public void testUTF8() {
-		CPUTF8 u1 = new CPUTF8(new String("thing"), ClassConstantPool.DOMAIN_UNDEFINED); //$NON-NLS-1$
-		CPUTF8 u2 = new CPUTF8(new String("thing"), ClassConstantPool.DOMAIN_UNDEFINED); //$NON-NLS-1$
-		CPUTF8 u3 = new CPUTF8(new String("otherthing"), ClassConstantPool.DOMAIN_UNDEFINED); //$NON-NLS-1$
+		CPUTF8 u1 = new CPUTF8(new String("thing"), ClassConstantPool.DOMAIN_NORMALASCIIZ); //$NON-NLS-1$
+		CPUTF8 u2 = new CPUTF8(new String("thing"), ClassConstantPool.DOMAIN_NORMALASCIIZ); //$NON-NLS-1$
+		CPUTF8 u3 = new CPUTF8(new String("otherthing"), ClassConstantPool.DOMAIN_NORMALASCIIZ);
//$NON-NLS-1$
 		checkEquality(u1, u2, "thing", u3);
 	}
 	private void checkEquality(Object equal1, Object equal2, String toString, Object unequal)
{
@@ -45,9 +46,9 @@
 		assertFalse(unequal.equals(equal2));
 	}
 	public void testSourceAttribute() {
-		SourceFileAttribute sfa1 = new SourceFileAttribute(new String("Thing.java")); //$NON-NLS-1$
-		SourceFileAttribute sfa2 = new SourceFileAttribute(new String("Thing.java")); //$NON-NLS-1$
-		SourceFileAttribute sfa3 = new SourceFileAttribute(new String("OtherThing.java")); //$NON-NLS-1$
+		SourceFileAttribute sfa1 = new SourceFileAttribute(new CPUTF8(new String("Thing.java"),
ClassConstantPool.DOMAIN_NORMALASCIIZ)); //$NON-NLS-1$
+		SourceFileAttribute sfa2 = new SourceFileAttribute(new CPUTF8(new String("Thing.java"),
ClassConstantPool.DOMAIN_NORMALASCIIZ)); //$NON-NLS-1$
+		SourceFileAttribute sfa3 = new SourceFileAttribute(new CPUTF8(new String("OtherThing.java"),
ClassConstantPool.DOMAIN_NORMALASCIIZ)); //$NON-NLS-1$
 		checkEquality(sfa1,sfa2,"Thing.java",sfa3); //$NON-NLS-1$
 	}
 	public void testCPInteger() {
@@ -75,16 +76,16 @@
 		checkEquality(cp1,cp2,"3",cp3); //$NON-NLS-1$
 	}
 	public void testCPString() {
-		CPString cp1 = new CPString(new String("3"));
-		CPString cp2 = new CPString(new String("3"));
-		CPString cp3 = new CPString(new String("5"));
+		CPString cp1 = new CPString(new CPUTF8(new String("3"), ClassConstantPool.DOMAIN_NORMALASCIIZ));
+		CPString cp2 = new CPString(new CPUTF8(new String("3"), ClassConstantPool.DOMAIN_NORMALASCIIZ));
+		CPString cp3 = new CPString(new CPUTF8(new String("5"), ClassConstantPool.DOMAIN_NORMALASCIIZ));
 		checkEquality(cp1,cp2,"3",cp3); //$NON-NLS-1$
 	}
 	public void testCPField() {
-		CPMember cp1 = new CPMember("Name:I", 0, null);
-		CPMember cp2 = new CPMember("Name:I", 0, null);
-		CPMember cp3 = new CPMember("Name:Z", 0, null);
-		CPMember cp4 = new CPMember("GName:I", 0, null);
+		CPMember cp1 = new CPMember(new CPUTF8("Name", ClassConstantPool.DOMAIN_NORMALASCIIZ),
new CPUTF8("I", ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+		CPMember cp2 = new CPMember(new CPUTF8("Name", ClassConstantPool.DOMAIN_NORMALASCIIZ),
new CPUTF8("I", ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+		CPMember cp3 = new CPMember(new CPUTF8("Name", ClassConstantPool.DOMAIN_NORMALASCIIZ),
new CPUTF8("Z", ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
+		CPMember cp4 = new CPMember(new CPUTF8("GName", ClassConstantPool.DOMAIN_NORMALASCIIZ),
new CPUTF8("I", ClassConstantPool.DOMAIN_NORMALASCIIZ), 0, null);
 		checkEquality(cp1,cp2,"Name",cp3); //$NON-NLS-1$
 		checkEquality(cp1,cp2,"I",cp4); //$NON-NLS-1$
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java?rev=632326&r1=632325&r2=632326&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/bytecode/ConstantPoolTest.java
Fri Feb 29 06:24:57 2008
@@ -18,6 +18,7 @@
 
 import junit.framework.TestCase;
 
+import org.apache.harmony.pack200.CpBands;
 import org.apache.harmony.pack200.bytecode.CPMember;
 import org.apache.harmony.pack200.bytecode.CPUTF8;
 import org.apache.harmony.pack200.bytecode.ClassConstantPool;
@@ -36,10 +37,10 @@
 		assertEquals(1,pool.size());
 	}
 	public void testDuplicateField() {
-		CPMember cp1 = new CPMember("name:I",0,null);
+		CPMember cp1 = new CPMember(new CPUTF8("name", ClassConstantPool.DOMAIN_NORMALASCIIZ),
new CPUTF8("I", ClassConstantPool.DOMAIN_NORMALASCIIZ),0,null);
 		pool.add(cp1);
 		assertEquals(2,pool.size());
-		CPMember cp2 = new CPMember("name:I",0,null);
+		CPMember cp2 = new CPMember(new CPUTF8("name", ClassConstantPool.DOMAIN_NORMALASCIIZ),
new CPUTF8("I", ClassConstantPool.DOMAIN_NORMALASCIIZ),0,null);
 		pool.add(cp2);
 		assertEquals(2,pool.size());
 	}



Mime
View raw message