harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r693355 [3/4] - in /harmony/enhanced/classlib/branches/java6: ./ depends/build/ depends/build/platform/ depends/jars/ make/ modules/archive/src/main/native/zlib/unix/ modules/awt/src/main/native/gl/shared/ modules/awt/src/main/native/lcmm/s...
Date Tue, 09 Sep 2008 03:19:55 GMT
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/freebsd/OSResourcesMonitor.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/freebsd/OSResourcesMonitor.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/freebsd/OSResourcesMonitor.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/freebsd/OSResourcesMonitor.c Mon Sep  8 20:19:53 2008
@@ -37,7 +37,7 @@
 {
   unsigned long free;
   unsigned long total;
-  int len = sizeof(free);
+  size_t len = sizeof(free);
   
   if (sysctlbyname("vm.stats.vm.v_free_count", &free, &len, NULL, 0) == -1) {
     return FALSE;	

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c Mon Sep  8 20:19:53 2008
@@ -308,7 +308,11 @@
     // tmStruct->tm_isdst is set to 1 if DST is in effect
     strcpy(tzInfo, "GMT");
     tzInfo[3] = timezone > 0 ? '-' : '+';
+#if defined (FREEBSD)
+    h = labs(tmStruct->tm_gmtoff) / 3600;
+#else /* !FREEBSD */
     h = labs(timezone) / 3600;
+#endif /* FREEBSD */
     if (tmStruct->tm_isdst) {
         if (timezone > 0) {
             h--;
@@ -316,8 +320,12 @@
             h++;
         }
     }
+#if defined (FREEBSD)
+    m = (labs(tmStruct->tm_isdst) % 3600) / 60;
+#else /* !FREEBSD */
     m = (labs(timezone) % 3600) / 60;
-    tzInfo[4] = h / 10 + '0';
+#endif /* FREEBSD */
+   tzInfo[4] = h / 10 + '0';
     tzInfo[5] = h % 10 + '0';
     tzInfo[6] = m / 10 + '0';
     tzInfo[7] = m % 10 + '0';

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/InetAddressTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/InetAddressTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/InetAddressTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/InetAddressTest.java Mon Sep  8 20:19:53 2008
@@ -185,6 +185,7 @@
     /**
      * @tests java.net.InetAddress#getAllByName(java.lang.String)
      */
+    @SuppressWarnings("nls")
     public void test_getAllByNameLjava_lang_String() throws Exception {
         // Test for method java.net.InetAddress []
         // java.net.InetAddress.getAllByName(java.lang.String)
@@ -225,6 +226,14 @@
         assertEquals("Assert 2: No loopback address", 1, ia.length);
         assertTrue("Assert 3: getAllByName(\"\") not loopback",
                 ia[0].isLoopbackAddress());
+        
+        // Check that getting addresses by dotted string distinguish
+        // IPv4 and IPv6 subtypes.
+        InetAddress[] list = InetAddress.getAllByName("192.168.0.1");
+        for (InetAddress addr : list) {
+            assertFalse("Expected subclass returned",
+                    addr.getClass().equals(InetAddress.class));
+        }
     }
 
     /**

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/DateTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/DateTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/DateTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/DateTest.java Mon Sep  8 20:19:53 2008
@@ -449,6 +449,13 @@
 		} finally {
 			TimeZone.setDefault(tz);
 		}
+        
+        // Test for HARMONY-5468
+        TimeZone.setDefault(TimeZone.getTimeZone("MST"));
+        Date d2 = new Date(108, 7, 27);
+        assertTrue("Returned incorrect string: " + d2, d2.toString()
+                .startsWith("Wed Aug 27 00:00:00 MST")
+                && d2.toString().endsWith("2008"));
 	}
 
 	/**
@@ -461,6 +468,8 @@
 		assertTrue("Returned incorrect UTC value for epoch +1yr", Date.UTC(71,
 				0, 1, 0, 0, 0) == (long) 365 * 24 * 60 * 60 * 1000);
 	}
+	
+	static TimeZone defaultTimeZone = TimeZone.getDefault();
 
 	/**
 	 * Sets up the fixture, for example, open a network connection. This method
@@ -474,5 +483,6 @@
 	 * method is called after a test is executed.
 	 */
 	protected void tearDown() {
+		TimeZone.setDefault(defaultTimeZone);
 	}
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java Mon Sep  8 20:19:53 2008
@@ -55,6 +55,17 @@
         a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, aa, bb, cc, dd, ee, ff, gg, hh, ii, jj, kk, ll, mm,
     }
 
+    static enum HugeEnumCount {
+        NO1, NO2, NO3, NO4, NO5, NO6, NO7, NO8, NO9, NO10, NO11, NO12, NO13, NO14, NO15, NO16, NO17, NO18, NO19, NO20, 
+        NO21, NO22, NO23, NO24, NO25, NO26, NO27, NO28, NO29, NO30, NO31, NO32, NO33, NO34, NO35, NO36, NO37, NO38, NO39, NO40, 
+        NO41, NO42, NO43, NO44, NO45, NO46, NO47, NO48, NO49, NO50, NO51, NO52, NO53, NO54, NO55, NO56, NO57, NO58, NO59, NO60,
+        NO61, NO62, NO63, NO64, NO65, NO66, NO67, NO68, NO69, NO70, NO71, NO72, NO73, NO74, NO75, NO76, NO77, NO78, NO79, NO80,
+        NO81, NO82, NO83, NO84, NO85, NO86, NO87, NO88, NO89, NO90, NO91, NO92, NO93, NO94, NO95, NO96, NO97, NO98, NO99, NO100,
+        NO101, NO102, NO103, NO104, NO105, NO106, NO107, NO108, NO109, NO110, NO111, NO112, NO113, NO114, NO115, NO116, NO117, NO118, NO119, NO120,
+        NO121, NO122, NO123, NO124, NO125, NO126, NO127, NO128, NO129, NO130,
+    }
+
+
     /**
      * @tests java.util.EnumSet#noneOf(java.lang.Class)
      */
@@ -103,6 +114,30 @@
     }
     
     /**
+     * @tests java.util.HugeEnumSet#iterator()
+     */
+    public void test_iterator_HugeEnumSet() {
+        EnumSet<HugeEnumCount> set;
+        Object[] array;
+
+        // Test HugeEnumSet with 65 elements
+        // which is more than the bits of Long
+        set = EnumSet.range(HugeEnumCount.NO1, HugeEnumCount.NO65);
+        array = set.toArray();
+        for (HugeEnumCount count : set) {
+            assertEquals(count, (HugeEnumCount) array[count.ordinal()]);
+        }
+
+        // Test HugeEnumSet with 130 elements
+        // which is more than twice of the bits of Long
+        set = EnumSet.range(HugeEnumCount.NO1, HugeEnumCount.NO130);
+        array = set.toArray();
+        for (HugeEnumCount count : set) {
+            assertEquals(count, (HugeEnumCount) array[count.ordinal()]);
+        }
+    }
+
+    /**
      * @tests java.util.EnumSet#allOf(java.lang.Class)
      */
     @SuppressWarnings("unchecked")

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java Mon Sep  8 20:19:53 2008
@@ -249,6 +249,16 @@
 		assertTrue(testDir.canRead());
 	}
 
+    /**
+     * @test java.io.File#toURI()
+     */
+    public void test_toURI_UNC() throws Exception {
+        File f = new File("\\\\unchost\\[dir]\\file.txt");
+        assertNotNull(f.toURI());
+        assertEquals("incorrect URI for UNC path: " + f.toURI(), f.toURI(),
+                new URI("file:////unchost/%5Bdir%5D/file.txt"));
+    }
+
 	@Override
 	protected void setUp() throws Exception {
 		super.setUp();

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/BcBands.java Mon Sep  8 20:19:53 2008
@@ -20,6 +20,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.harmony.pack200.Codec;
@@ -396,6 +397,7 @@
         int i = 0;
         ArrayList orderedCodeAttributes = segment.getClassBands()
                 .getOrderedCodeAttributes();
+        int codeAttributeIndex = 0;
 
         // Exception table fields
         int[] handlerCount = segment.getClassBands().getCodeHandlerCount();
@@ -407,6 +409,9 @@
         int[][] handlerClassTypes = segment.getClassBands()
                 .getCodeHandlerClassRCN();
 
+        boolean allCodeHasFlags = segment.getSegmentHeader().getOptions().hasAllCodeFlags();
+        boolean[] codeHasFlags = segment.getClassBands().getCodeHasAttributes();
+
         for (int c = 0; c < classCount; c++) {
             int numberOfMethods = methodFlags[c].length;
             for (int m = 0; m < numberOfMethods; m++) {
@@ -459,8 +464,18 @@
                     }
                     methodAttributesList.add(indexForCodeAttr, codeAttr);
                     codeAttr.renumber(codeAttr.byteCodeOffsets);
-                    ArrayList currentAttributes = (ArrayList) orderedCodeAttributes
-                            .get(i);
+                    List currentAttributes;
+                    if (allCodeHasFlags) {
+                        currentAttributes = (List) orderedCodeAttributes.get(i);
+                    } else {
+                        if (codeHasFlags[i]) {
+                            currentAttributes = (List) orderedCodeAttributes
+                                    .get(codeAttributeIndex);
+                            codeAttributeIndex++;
+                        } else {
+                            currentAttributes = Collections.EMPTY_LIST;
+                        }
+                    }
                     for (int index = 0; index < currentAttributes.size(); index++) {
                         Attribute currentAttribute = (Attribute) currentAttributes
                                 .get(index);

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/ClassBands.java Mon Sep  8 20:19:53 2008
@@ -68,7 +68,7 @@
 
     private IcTuple[][] icLocal;
 
-    private ArrayList[] codeAttributes;
+    private List[] codeAttributes;
 
     private int[] codeHandlerCount;
 
@@ -114,6 +114,8 @@
 
     private int[][] codeHandlerClassRCN;
 
+    private boolean [] codeHasAttributes;
+
     /**
      * @param segment
      */
@@ -392,9 +394,6 @@
                         otherAttributes[k].remove(0);
                     }
                 }
-                if (deprecatedLayout.matches(flag)) {
-                    methodAttributes[i][j].add(new DeprecatedAttribute());
-                }
                 if (methodExceptionsLayout.matches(flag)) {
                     int n = numExceptions[methodExceptionsIndex];
                     int[] exceptions = methodExceptionsRS[methodExceptionsIndex];
@@ -407,6 +406,9 @@
                             exceptionClasses));
                     methodExceptionsIndex++;
                 }
+                if (deprecatedLayout.matches(flag)) {
+                    methodAttributes[i][j].add(new DeprecatedAttribute());
+                }
                 if (methodSignatureLayout.matches(flag)) {
                     // We've got a signature attribute
                     long result = methodSignatureRS[methodSignatureIndex];
@@ -685,7 +687,7 @@
                     }
 
                     IcTuple icTuple = new IcTuple(icTupleC, icTupleF,
-                            icTupleC2, icTupleN, icTupleCIndex, icTupleC2Index, icTupleNIndex);
+                            icTupleC2, icTupleN, icTupleCIndex, icTupleC2Index, icTupleNIndex, j);
                     icLocal[i][j] = icTuple;
                 }
                 innerClassIndex++;
@@ -718,10 +720,19 @@
         int codeCount = SegmentUtils.countMatches(methodFlags, layout);
         int[] codeHeaders = decodeBandInt("code_headers", in, Codec.BYTE1,
                 codeCount);
+
+        boolean allCodeHasFlags = segment.getSegmentHeader().getOptions().hasAllCodeFlags();
+        if(!allCodeHasFlags) {
+            codeHasAttributes = new boolean[codeCount];
+        }
         int codeSpecialHeader = 0;
         for (int i = 0; i < codeCount; i++) {
-            if (codeHeaders[i] == 0)
+            if (codeHeaders[i] == 0) {
                 codeSpecialHeader++;
+                if(!allCodeHasFlags) {
+                    codeHasAttributes[i] = true;
+                }
+            }
         }
         int[] codeMaxStackSpecials = decodeBandInt("code_max_stack", in,
                 Codec.UNSIGNED5, codeSpecialHeader);
@@ -768,10 +779,9 @@
         codeHandlerClassRCN = decodeBandInt(
                 "code_handler_class_RCN", in, Codec.UNSIGNED5, codeHandlerCount);
 
-        int codeFlagsCount = segment.getSegmentHeader().getOptions()
-                .hasAllCodeFlags() ? codeCount : codeSpecialHeader;
+        int codeFlagsCount = allCodeHasFlags ? codeCount : codeSpecialHeader;
 
-        codeAttributes = new ArrayList[codeFlagsCount];
+        codeAttributes = new List[codeFlagsCount];
         for (int i = 0; i < codeAttributes.length; i++) {
             codeAttributes[i] = new ArrayList();
         }
@@ -841,23 +851,6 @@
                 "code_LocalVariableTable_slot", in, Codec.UNSIGNED5,
                 localVariableTableN);
 
-        // Fix up localVariableTableTypeRS - for some reason,
-        // native signatures end up in DOMAINNORMALASCIIZ
-        // while nonnatives end up in DOMAINSIGNATUREASCIIZ.
-        // TODO: is this the right thing to do?
-        for (int x = 0; x < localVariableTableTypeRS.length; x++) {
-            for (int y = 0; y < localVariableTableTypeRS[x].length; y++) {
-                CPUTF8 element = localVariableTableTypeRS[x][y];
-                // TODO: come up with a better test for native vs nonnative
-                // signatures?
-//                if (element.underlyingString().length() > 2) {
-//                    element.setDomain(ClassConstantPool.DOMAIN_SIGNATUREASCIIZ);
-//                } else {
-//                    element.setDomain(ClassConstantPool.DOMAIN_NORMALASCIIZ);
-//                }
-            }
-        }
-
         int lengthLocalVariableTypeTableNBand = SegmentUtils.countMatches(
                 codeFlags, localVariableTypeTableLayout);
         int[] localVariableTypeTableN = decodeBandInt(
@@ -1406,4 +1399,8 @@
         return icLocal;
     }
 
+    public boolean[] getCodeHasAttributes() {
+        return codeHasAttributes;
+    }
+
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/CpBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/CpBands.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/CpBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/CpBands.java Mon Sep  8 20:19:53 2008
@@ -20,6 +20,7 @@
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.harmony.pack200.Codec;
 import org.apache.harmony.pack200.Pack200Exception;
@@ -73,19 +74,21 @@
     private int[] cpStringInts;
     private String[] cpUTF8;
 
-    private final HashMap stringsToCPUTF8 = new HashMap();
-    private final HashMap stringsToCPStrings = new HashMap();
-    private final HashMap longsToCPLongs = new HashMap();
-    private final HashMap integersToCPIntegers = new HashMap();
-    private final HashMap floatsToCPFloats = new HashMap();
-    private final HashMap stringsToCPClass = new HashMap();
-    private final HashMap doublesToCPDoubles = new HashMap();
-    private final HashMap descriptorsToCPNameAndTypes = new HashMap();
-
-    private HashMap mapClass = new HashMap();
-    private HashMap mapDescriptor = new HashMap();
-    private HashMap mapUTF8 = new HashMap();
-    private HashMap mapSignature = new HashMap();
+    private final Map stringsToCPUTF8 = new HashMap();
+    private final Map stringsToCPStrings = new HashMap();
+    private final Map longsToCPLongs = new HashMap();
+    private final Map integersToCPIntegers = new HashMap();
+    private final Map floatsToCPFloats = new HashMap();
+    private final Map stringsToCPClass = new HashMap();
+    private final Map doublesToCPDoubles = new HashMap();
+    private final Map descriptorsToCPNameAndTypes = new HashMap();
+
+    private Map mapClass;
+    private Map mapDescriptor;
+    private Map mapUTF8;
+
+// TODO: Not used
+//    private Map mapSignature;
 
     private int intOffset;
     private int floatOffset;
@@ -151,6 +154,7 @@
         int cpClassCount = header.getCpClassCount();
         cpClassInts = decodeBandInt("cp_Class", in, Codec.UDELTA5, cpClassCount);
         cpClass = new String[cpClassCount];
+        mapClass = new HashMap(cpClassCount);
         for (int i = 0; i < cpClassCount; i++) {
             cpClass[i] = cpUTF8[cpClassInts[i]];
             mapClass.put(cpClass[i], new Integer(i));
@@ -184,6 +188,7 @@
         String[] cpDescriptorTypes = getReferences(cpDescriptorTypeInts,
                 cpSignature);
         cpDescriptor = new String[cpDescriptorCount];
+        mapDescriptor = new HashMap(cpDescriptorCount);
         for (int i = 0; i < cpDescriptorCount; i++) {
             cpDescriptor[i] = cpDescriptorNames[i] + ":" + cpDescriptorTypes[i]; //$NON-NLS-1$
             mapDescriptor.put(cpDescriptor[i], new Integer(i));
@@ -401,6 +406,7 @@
             Pack200Exception {
         int cpUTF8Count = header.getCpUTF8Count();
         cpUTF8 = new String[cpUTF8Count];
+        mapUTF8 = new HashMap(cpUTF8Count+1);
         cpUTF8[0] = ""; //$NON-NLS-1$
         mapUTF8.put("", new Integer(0));
         int[] prefix = decodeBandInt("cpUTF8Prefix", in, Codec.DELTA5,
@@ -547,9 +553,10 @@
             if(index != null) {
             	return cpUTF8Value(index.intValue());
             }
-            if(searchForIndex) {
-            	index = (Integer)mapSignature.get(string);
-            }
+// TODO: mapSignature is not filled anywhere
+//            if(searchForIndex) {
+//            	index = (Integer)mapSignature.get(string);
+//            }
             if(index != null) {
             	return cpSignatureValue(index.intValue());
             }
@@ -643,22 +650,7 @@
         if (cpNameAndType == null) {
             int nameIndex = cpDescriptorNameInts[index];
             int descriptorIndex = cpDescriptorTypeInts[index];
-            String descriptorString = cpSignature[descriptorIndex];
 
-            // For some reason, descriptors which have just plain
-            // native types are stored in DOMAIN_NORMALASCIIZ rather
-            // than in DOMAIN_SIGNATUREASCIIZ. This might indicate
-            // that DOMAIN_SIGNATUREASCIIZ is poorly named.
-            boolean nativeDescriptor = true;
-            for (int i = 0; i < descriptorString.length(); i++) {
-                char currentChar = descriptorString.charAt(i);
-                if (Character.isLetter(currentChar)) {
-                    if (currentChar == 'L') {
-                        nativeDescriptor = false;
-                    }
-                    break;
-                }
-            }
             CPUTF8 name = cpUTF8Value(nameIndex);
             CPUTF8 descriptorU = cpSignatureValue(descriptorIndex);
             cpNameAndType = new CPNameAndType(name, descriptorU, index + descrOffset);
@@ -712,20 +704,7 @@
             int colon = descriptor.indexOf(':');
             String nameString = descriptor.substring(0, colon);
             String descriptorString = descriptor.substring(colon + 1);
-            // For some reason, descriptors which have just plain
-            // native types are stored in DOMAIN_NORMALASCIIZ rather
-            // than in DOMAIN_SIGNATUREASCIIZ. This might indicate
-            // that DOMAIN_SIGNATUREASCIIZ is poorly named.
-            boolean nativeDescriptor = true;
-            for (int i = 0; i < descriptorString.length(); i++) {
-                char currentChar = descriptorString.charAt(i);
-                if (Character.isLetter(currentChar)) {
-                    if (currentChar == 'L') {
-                        nativeDescriptor = false;
-                    }
-                    break;
-                }
-            }
+
             CPUTF8 name = cpUTF8Value(nameString, true);
             CPUTF8 descriptorU = cpUTF8Value(descriptorString, true);
             cpNameAndType = new CPNameAndType(name, descriptorU, -1 + descrOffset);

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcBands.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcBands.java Mon Sep  8 20:19:53 2008
@@ -19,14 +19,19 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.harmony.pack200.Codec;
 import org.apache.harmony.pack200.Pack200Exception;
 import org.apache.harmony.unpack200.bytecode.CPClass;
 import org.apache.harmony.unpack200.bytecode.ClassConstantPool;
+import org.apache.harmony.unpack200.bytecode.ConstantPoolEntry;
 
 /**
  * Inner Class Bands
@@ -39,6 +44,9 @@
 
     private final String[] cpClass;
 
+    private Map thisClassToTuple;
+    private Map outerClassToTuples;
+
     /**
      * @param segment
      */
@@ -101,12 +109,43 @@
                 nIndex = icNameInts[index] - 1;
                 index++;
             }
-            icAll[i] = new IcTuple(icTupleC, icTupleF, icTupleC2, icTupleN, cIndex, c2Index, nIndex);
+            icAll[i] = new IcTuple(icTupleC, icTupleF, icTupleC2, icTupleN, cIndex, c2Index, nIndex, i);
         }
     }
 
     public void unpack() throws IOException, Pack200Exception {
-
+    	IcTuple[] allTuples = getIcTuples();
+    	thisClassToTuple = new HashMap(allTuples.length);
+    	outerClassToTuples = new HashMap(allTuples.length);
+    	for(int index = 0; index < allTuples.length; index++) {
+
+    		IcTuple tuple = allTuples[index];
+
+    		// generate mapping thisClassString -> IcTuple
+    		//  presumably this relation is 1:1
+    		//
+    		Object result = thisClassToTuple.put(tuple.thisClassString(), tuple);
+    		if (result != null) {
+    			throw new Error("Collision detected in <thisClassString, IcTuple> mapping. " +
+    					"There are at least two inner clases with the same name.");
+    		}
+
+    		// generate mapping outerClassString -> IcTuple
+    		//  this relation is 1:M
+
+            // If it's not anon and the outer is not anon, it could be relevant
+    		if (!tuple.isAnonymous() && !tuple.outerIsAnonymous()) {
+
+    			// add tuple to corresponding bucket
+    			String key = tuple.outerClassString();
+    			List bucket = (List)outerClassToTuples.get(key);
+    			if (bucket == null) {
+    				bucket = new ArrayList();
+    				outerClassToTuples.put(key, bucket);
+    			}
+    			bucket.add(tuple);
+    		}
+    	}
     }
 
 
@@ -127,38 +166,32 @@
     public IcTuple[] getRelevantIcTuples(String className, ClassConstantPool cp) {
         Set relevantTuplesContains = new HashSet();
         List relevantTuples = new ArrayList();
-        IcTuple[] allTuples = getIcTuples();
-        int allTuplesSize = allTuples.length;
-        for (int index = 0; index < allTuplesSize; index++) {
-            if (allTuples[index].shouldAddToRelevantForClassName(className)) {
-                relevantTuplesContains.add(allTuples[index]);
-                relevantTuples.add(allTuples[index]);
-            }
-        }
 
-        List classPoolClasses = cp.allClasses();
-        boolean changed = true;
+        List relevantCandidates = (List) outerClassToTuples.get(className);
+		if (relevantCandidates != null) {
+			for (int index = 0; index < relevantCandidates.size(); index++) {
+				IcTuple tuple = (IcTuple) relevantCandidates.get(index);
+				relevantTuplesContains.add(tuple);
+				relevantTuples.add(tuple);
+			}
+		}
+
+        List entries = cp.entries();
+
         // For every class constant in both ic_this_class and cp,
         // add it to ic_relevant. Repeat until no more
         // changes to ic_relevant.
 
-        while (changed) {
-            changed = false;
-            for (int allTupleIndex = 0; allTupleIndex < allTuplesSize; allTupleIndex++) {
-                for(int cpcIndex = 0; cpcIndex < classPoolClasses.size(); cpcIndex++) {
-                    CPClass classInPool = (CPClass) classPoolClasses.get(cpcIndex);
-                    String poolClassName = classInPool.name;
-                    if (poolClassName.equals(allTuples[allTupleIndex]
-                            .thisClassString())) {
-                        // If the tuple isn't already in there, then add it
-                        if (relevantTuplesContains.add(allTuples[allTupleIndex])) {
-                            relevantTuples.add(allTuples[allTupleIndex]);
-                            changed = true;
-                        }
-                    }
-                }
-            }
-        }
+		for (int eIndex = 0; eIndex < entries.size(); eIndex++) {
+			ConstantPoolEntry entry = (ConstantPoolEntry) entries.get(eIndex);
+			if (entry instanceof CPClass) {
+				CPClass clazz = (CPClass) entry;
+				IcTuple relevant = (IcTuple) thisClassToTuple.get(clazz.name);
+				if (relevant != null && relevantTuplesContains.add(relevant)) {
+					relevantTuples.add(relevant);
+				}
+			}
+		}
 
         // Not part of spec: fix up by adding to relevantTuples the parents
         // of inner classes which are themselves inner classes.
@@ -166,49 +199,51 @@
         // added
         // as well.
 
-        boolean changedFixup = true;
-        ArrayList tuplesToAdd = new ArrayList();
-        while (changedFixup) {
-            changedFixup = false;
-            for (int index = 0; index < relevantTuples.size(); index++) {
-                IcTuple aRelevantTuple = (IcTuple) relevantTuples.get(index);
-                for (int allTupleIndex = 0; allTupleIndex < allTuplesSize; allTupleIndex++) {
-                    if (aRelevantTuple.outerClassString().equals(
-                            allTuples[allTupleIndex].thisClassString())) {
-                        if (!aRelevantTuple.outerIsAnonymous()) {
-                            tuplesToAdd.add(allTuples[allTupleIndex]);
-                        }
-                    }
-                }
-            }
-            if (tuplesToAdd.size() > 0) {
-                for(int index = 0; index < tuplesToAdd.size(); index++) {
-                    IcTuple tuple = (IcTuple) tuplesToAdd.get(index);
-                    if (relevantTuplesContains.add(tuple)) {
-                        changedFixup = true;
-                        relevantTuples.add(tuple);
-                    }
-                }
-                tuplesToAdd = new ArrayList();
-            }
-        }
+		ArrayList tuplesToScan = new ArrayList(relevantTuples);
+		ArrayList tuplesToAdd = new ArrayList();
+
+		while (tuplesToScan.size() > 0) {
+
+			tuplesToAdd.clear();
+			for (int index = 0; index < tuplesToScan.size(); index++) {
+				IcTuple aRelevantTuple = (IcTuple) tuplesToScan.get(index);
+				IcTuple relevant = (IcTuple) thisClassToTuple
+						.get(aRelevantTuple.outerClassString());
+				if (relevant != null && !aRelevantTuple.outerIsAnonymous()) {
+					tuplesToAdd.add(relevant);
+				}
+			}
+
+			tuplesToScan.clear();
+			for (int index = 0; index < tuplesToAdd.size(); index++) {
+				IcTuple tuple = (IcTuple) tuplesToAdd.get(index);
+				if (relevantTuplesContains.add(tuple)) {
+					relevantTuples.add(tuple);
+					tuplesToScan.add(tuple);
+				}
+			}
+
+		}
+
         // End not part of the spec. Ugh.
 
         // Now order the result as a subsequence of ic_all
-        IcTuple[] orderedRelevantTuples = new IcTuple[relevantTuples.size()];
-        int orderedRelevantIndex = 0;
-        for (int index = 0; index < allTuplesSize; index++) {
-            if (relevantTuplesContains.contains(allTuples[index])) {
-                orderedRelevantTuples[orderedRelevantIndex] = allTuples[index];
-                orderedRelevantIndex++;
-            }
-        }
-        if (orderedRelevantIndex != orderedRelevantTuples.length) {
-            // This should never happen. If it does, we have a
-            // logic error in the ordering code.
-            throw new Error("Missing a tuple when ordering them");
-        }
-        return orderedRelevantTuples;
+		Collections.sort(relevantTuples, new Comparator() {
+
+			public int compare(Object arg0, Object arg1) {
+				Integer index1 = new Integer(((IcTuple)arg0).getTupleIndex());
+				Integer index2 = new Integer(((IcTuple)arg1).getTupleIndex());
+				return index1.compareTo(index2);
+			}
+
+		});
+
+		IcTuple[] relevantTuplesArray = new IcTuple[relevantTuples.size()];
+		for(int i = 0; i < relevantTuplesArray.length; i++) {
+			relevantTuplesArray[i] = (IcTuple)relevantTuples.get(i);
+		}
+
+        return relevantTuplesArray;
     }
 
 }
\ No newline at end of file

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcTuple.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcTuple.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcTuple.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/IcTuple.java Mon Sep  8 20:19:53 2008
@@ -31,6 +31,7 @@
     private final int cIndex;
     private final int c2Index;
     private final int nIndex;
+    private final int tIndex;
 
     /**
      *
@@ -42,7 +43,7 @@
      * @param c2Index the index of C2 in cpClass, or -1 if C2 is null
      * @param nIndex the index of N in cpUTF8, or -1 if N is null
      */
-    public IcTuple(String C, int F, String C2, String N, int cIndex, int c2Index, int nIndex) {
+    public IcTuple(String C, int F, String C2, String N, int cIndex, int c2Index, int nIndex, int tIndex) {
         this.C = C;
         this.F = F;
         this.C2 = C2;
@@ -50,6 +51,7 @@
         this.cIndex = cIndex;
         this.c2Index = c2Index;
         this.nIndex = nIndex;
+        this.tIndex = tIndex;
         if (null == N) {
             predictSimple = true;
         }
@@ -60,7 +62,7 @@
     }
 
     public IcTuple(String C, int F, int cIndex) {
-        this(C, F, null, null, cIndex, -1, -1);
+        this(C, F, null, null, cIndex, -1, -1, -1);
     }
 
     public static final int NESTED_CLASS_FLAG = 0x00010000;
@@ -176,22 +178,6 @@
         return false;
     }
 
-    public boolean shouldAddToRelevantForClassName(String className) {
-        // If the outerClassString of the tuple doesn't match the
-        // class name of the class we're looking through, don't
-        // consider it relevant.
-        if (!outerClassString().equals(className)) {
-            return false;
-        }
-        // If it's not anon and the outer is not anon, it's relevant
-        if (!isAnonymous() && !outerIsAnonymous()) {
-            return true;
-        }
-
-        // Otherwise it's not relevant.
-        return false;
-    }
-
     private void initializeClassStrings() {
         if (initialized) {
             return;
@@ -344,6 +330,10 @@
         return N;
     }
 
+    public int getTupleIndex() {
+    	return tIndex;
+    }
+
     public String realOuterClassString() {
         int firstDollarPosition = cachedOuterClassString.indexOf('$');
         if (firstDollarPosition <= 0) {

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/NewAttributeBands.java Mon Sep  8 20:19:53 2008
@@ -20,6 +20,7 @@
 import java.io.InputStream;
 import java.io.StringReader;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import org.apache.harmony.pack200.BHSDCodec;
@@ -82,7 +83,7 @@
 
         List attributes = new ArrayList(occurrenceCount);
         for (int i = 0; i < occurrenceCount; i++) {
-            attributes.add(getOneAttribute(i, attributeLayoutElements));
+        	attributes.add(getOneAttribute(i, attributeLayoutElements));
         }
         return attributes;
     }
@@ -137,49 +138,67 @@
                     .get(i);
             if (element instanceof Callable) {
                 Callable callable = (Callable) element;
+                if(i == 0) {
+                	callable.setFirstCallable(true);
+                }
                 List body = callable.body; // Look for calls in the body
                 for(int iIndex = 0; iIndex < body.size(); iIndex++) {
-                    LayoutElement layoutElement = (LayoutElement) body.get(iIndex);
-                    if (layoutElement instanceof Call) {
-                        // Set the callable for each call
-                        Call call = (Call) layoutElement;
-                        int index = call.callableIndex;
-                        if (index == 0) { // Calls the parent callable
-                            backwardsCalls++;
-                            call.setCallable(callable);
-                        } else if (index > 0) { // Forwards call
-                            for (int k = i; k < attributeLayoutElements.size(); k++) {
-                                AttributeLayoutElement el = (AttributeLayoutElement) attributeLayoutElements
-                                        .get(k);
-                                if (el instanceof Callable) {
-                                    index--;
-                                    if (index == 0) {
-                                        call.setCallable((Callable) el);
-                                        break;
-                                    }
-                                }
-                            }
-                        } else { // Backwards call
-                            backwardsCalls++;
-                            for (int k = i; k >= 0; k--) {
-                                AttributeLayoutElement el = (AttributeLayoutElement) attributeLayoutElements
-                                        .get(k);
-                                if (el instanceof Callable) {
-                                    index++;
-                                    if (index == 0) {
-                                        call.setCallable((Callable) el);
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-                    }
+                    LayoutElement layoutElement = (LayoutElement) body
+							.get(iIndex);
+					// Set the callable for each call
+					backwardsCalls += resolveCallsForElement(i, callable,
+							layoutElement);
                 }
             }
         }
         backwardsCallCount = backwardsCalls;
     }
 
+	private int resolveCallsForElement(int i,
+			Callable currentCallable, LayoutElement layoutElement) {
+		int backwardsCalls = 0;
+		if (layoutElement instanceof Call) {
+            Call call = (Call) layoutElement;
+			int index = call.callableIndex;
+			if (index == 0) { // Calls the parent callable
+			    backwardsCalls++;
+			    call.setCallable(currentCallable);
+			} else if (index > 0) { // Forwards call
+			    for (int k = i + 1; k < attributeLayoutElements.size(); k++) {
+			        AttributeLayoutElement el = (AttributeLayoutElement) attributeLayoutElements
+			                .get(k);
+			        if (el instanceof Callable) {
+			            index--;
+			            if (index == 0) {
+			                call.setCallable((Callable) el);
+			                break;
+			            }
+			        }
+			    }
+			} else { // Backwards call
+			    backwardsCalls++;
+			    for (int k = i; k >= 0; k--) {
+			        AttributeLayoutElement el = (AttributeLayoutElement) attributeLayoutElements
+			                .get(k);
+			        if (el instanceof Callable) {
+			            index++;
+			            if (index == 0) {
+			                call.setCallable((Callable) el);
+			                break;
+			            }
+			        }
+			    }
+			}
+		} else if (layoutElement instanceof Replication) {
+			List children = ((Replication)layoutElement).layoutElements;
+			for (Iterator iterator = children.iterator(); iterator.hasNext();) {
+				LayoutElement object = (LayoutElement) iterator.next();
+				backwardsCalls += resolveCallsForElement(i, currentCallable, object);
+			}
+		}
+		return backwardsCalls;
+	}
+
     private AttributeLayoutElement readNextAttributeElement(StringReader stream)
             throws IOException {
         int nextChar = stream.read();
@@ -196,7 +215,7 @@
 
     private LayoutElement readNextLayoutElement(StringReader stream)
             throws IOException {
-        int nextChar = stream.read();
+        char nextChar = (char)stream.read();
         if (nextChar == -1) {
             return null;
         }
@@ -206,10 +225,10 @@
         case 'H':
         case 'I':
         case 'V':
-            return new Integral(new String(new char[] { (char) nextChar }));
+            return new Integral(new String(new char[] { nextChar }));
         case 'S':
         case 'F':
-            return new Integral(new String(new char[] { (char) nextChar,
+            return new Integral(new String(new char[] { nextChar,
                     (char) stream.read() }));
         case 'P':
             stream.mark(1);
@@ -247,7 +266,7 @@
                 unionCases.add(c);
             }
             stream.read(); // '('
-            stream.read(); // '('
+            stream.read(); // ')'
             stream.read(); // '['
             List body = null;
             stream.mark(1);
@@ -260,7 +279,7 @@
 
             // Call
         case '(':
-            int number = readNumber(stream);
+            int number = readNumber(stream).intValue();
             stream.read(); // ')'
             return new Call(number);
             // Reference
@@ -291,12 +310,19 @@
         if (next == ')') {
             stream.reset();
             return null;
+        } else {
+            stream.reset();
+            stream.read(); // '('
         }
         List tags = new ArrayList();
-        while (next != ')') {
-            tags.add(new Integer(readNumber(stream)));
-            next = (char) stream.read();
-        }
+        Integer nextTag;
+        do {
+        	nextTag = readNumber(stream);
+            if(nextTag != null) {
+            	tags.add(nextTag);
+                stream.read(); // ',' or ')'
+            }
+        } while (nextTag != null);
         stream.read(); // '['
         stream.mark(1);
         next = (char) stream.read();
@@ -619,7 +645,7 @@
 
         public Reference(String tag) {
             this.tag = tag;
-            length = getLength(tag.charAt(tag.length()));
+            length = getLength(tag.charAt(tag.length() - 1));
         }
 
         public void readBands(InputStream in, int count) throws IOException,
@@ -700,6 +726,8 @@
 
         private boolean isBackwardsCallable;
 
+		private boolean isFirstCallable;
+
         public Callable(List body) throws IOException {
             this.body = body;
         }
@@ -732,7 +760,11 @@
 
         public void readBands(InputStream in, int count) throws IOException,
                 Pack200Exception {
-            count += this.count;
+        	if(isFirstCallable) {
+        		count += this.count;
+        	} else {
+        		count = this.count;
+        	}
             for(int i = 0; i < body.size(); i++) {
                 LayoutElement element = (LayoutElement) body.get(i);
                 element.readBands(in, count);
@@ -740,12 +772,14 @@
         }
 
         public void addToAttribute(int n, NewAttribute attribute) {
-            // Ignore n because bands also contain element parts from calls
-            for(int i = 0; i < body.size(); i++) {
-                LayoutElement element = (LayoutElement) body.get(i);
-                element.addToAttribute(index, attribute);
-            }
-            index++;
+        	if(isFirstCallable) {
+	            // Ignore n because bands also contain element parts from calls
+	            for(int i = 0; i < body.size(); i++) {
+	                LayoutElement element = (LayoutElement) body.get(i);
+	                element.addToAttribute(index, attribute);
+	            }
+	            index++;
+        	}
         }
 
         public boolean isBackwardsCallable() {
@@ -758,6 +792,10 @@
         public void setBackwardsCallable() {
             this.isBackwardsCallable = true;
         }
+
+		public void setFirstCallable(boolean isFirstCallable) {
+			this.isFirstCallable = isFirstCallable;
+		}
     }
 
     /**
@@ -884,7 +922,7 @@
      * @return
      * @throws IOException
      */
-    private int readNumber(StringReader stream) throws IOException {
+    private Integer readNumber(StringReader stream) throws IOException {
         stream.mark(1);
         char first = (char) stream.read();
         boolean negative = first == '-';
@@ -898,12 +936,15 @@
             length++;
         }
         stream.reset();
+        if(length == 0) {
+        	return null;
+        }
         char[] digits = new char[length];
         int read = stream.read(digits);
         if (read != digits.length) {
             throw new IOException("Error reading from the input stream");
         }
-        return Integer.parseInt((negative ? "-" : "") + new String(digits));
+        return new Integer(Integer.parseInt((negative ? "-" : "") + new String(digits)));
     }
 
     /**

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/Segment.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/Segment.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/Segment.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/Segment.java Mon Sep  8 20:19:53 2008
@@ -25,7 +25,9 @@
 import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
 import java.util.zip.GZIPInputStream;
@@ -236,15 +238,16 @@
         InnerClassesAttribute innerClassesAttribute = new InnerClassesAttribute(
                 "InnerClasses");
         IcTuple[] ic_relevant = getIcBands().getRelevantIcTuples(fullName, cp);
-        IcTuple[] ic_stored = computeIcStored(ic_local, ic_relevant);
-        for (int index = 0; index < ic_stored.length; index++) {
-            int innerClassIndex = ic_stored[index].thisClassIndex();
-            int outerClassIndex = ic_stored[index].outerClassIndex();
-            int simpleClassNameIndex = ic_stored[index].simpleClassNameIndex();
-
-            String innerClassString = ic_stored[index].thisClassString();
-            String outerClassString = ic_stored[index].outerClassString();
-            String simpleClassName = ic_stored[index].simpleClassName();
+        List ic_stored = computeIcStored(ic_local, ic_relevant);
+        for (int index = 0; index < ic_stored.size(); index++) {
+        	IcTuple icStored = (IcTuple)ic_stored.get(index);
+            int innerClassIndex = icStored.thisClassIndex();
+            int outerClassIndex = icStored.outerClassIndex();
+            int simpleClassNameIndex = icStored.simpleClassNameIndex();
+
+            String innerClassString = icStored.thisClassString();
+            String outerClassString = icStored.outerClassString();
+            String simpleClassName = icStored.simpleClassName();
 
             CPClass innerClass = null;
             CPUTF8 innerName = null;
@@ -253,18 +256,18 @@
             innerClass = innerClassIndex != -1 ? cpBands
                     .cpClassValue(innerClassIndex) : cpBands
                     .cpClassValue(innerClassString);
-            if (!ic_stored[index].isAnonymous()) {
+            if (!icStored.isAnonymous()) {
                 innerName = simpleClassNameIndex != -1 ? cpBands.cpUTF8Value(
                         simpleClassNameIndex) : cpBands
                         .cpUTF8Value(simpleClassName);
             }
 
-            if (ic_stored[index].isMember()) {
+            if (icStored.isMember()) {
                 outerClass = outerClassIndex != -1 ? cpBands
                         .cpClassValue(outerClassIndex) : cpBands
                         .cpClassValue(outerClassString);
             }
-            int flags = ic_stored[index].F;
+            int flags = icStored.F;
             innerClassesAttribute.addInnerClassesEntry(innerClass, outerClass,
                     innerName, flags);
             addInnerClassesAttr = true;
@@ -318,44 +321,43 @@
      *            IcTuple[] array of local transmitted tuples
      * @param ic_relevant
      *            IcTuple[] array of relevant tuples
-     * @return IcTuple[] array of tuples to be stored. If ic_local is null or
+     * @return List of tuples to be stored. If ic_local is null or
      *         empty, the values returned may not be correct. The caller will
      *         have to determine if this is the case.
      */
-    private IcTuple[] computeIcStored(IcTuple[] ic_local, IcTuple[] ic_relevant) {
-        List result = new ArrayList(ic_relevant.length);
-        List resultCopy = new ArrayList(ic_relevant.length);
-        List localList = new ArrayList(ic_relevant.length);
-        List relevantList = new ArrayList(ic_relevant.length);
-        if (ic_local != null) {
-            // If ic_local is null, this code doesn't get
-            // executed - which means the list ends up being
-            // ic_relevant.
-            for (int index = 0; index < ic_local.length; index++) {
-                result.add(ic_local[index]);
-                resultCopy.add(ic_local[index]);
-                localList.add(ic_local[index]);
-            }
-        }
-        for (int index = 0; index < ic_relevant.length; index++) {
-            result.add(ic_relevant[index]);
-            resultCopy.add(ic_relevant[index]);
-            relevantList.add(ic_relevant[index]);
-        }
+    private List computeIcStored(IcTuple[] ic_local, IcTuple[] ic_relevant) {
+    	List result = new ArrayList(ic_relevant.length);
+    	List duplicates = new ArrayList(ic_relevant.length);
+    	Set isInResult = new HashSet(ic_relevant.length);
+
+    	// need to compute:
+    	//   result = ic_local XOR ic_relevant
+
+    	// add ic_local
+    	if (ic_local != null) {
+    		for(int index = 0; index < ic_local.length; index++) {
+    			if (isInResult.add(ic_local[index])) {
+    				result.add(ic_local[index]);
+    			}
+    		}
+    	}
+
+    	// add ic_relevant
+		for(int index = 0; index < ic_relevant.length; index++) {
+			if (isInResult.add(ic_relevant[index])) {
+				result.add(ic_relevant[index]);
+			} else {
+				duplicates.add(ic_relevant[index]);
+			}
+		}
+
+		// eliminate "duplicates"
+		for(int index = 0; index < duplicates.size(); index++) {
+			IcTuple tuple = (IcTuple)duplicates.get(index);
+			result.remove(tuple);
+		}
 
-        // Since we're removing while iterating, iterate over
-        // a copy.
-        for(int i = 0; i < resultCopy.size(); i++) {
-            IcTuple tuple = (IcTuple) resultCopy.get(i);
-            if (localList.contains(tuple) && relevantList.contains(tuple)) {
-                while (result.remove(tuple));
-            }
-        }
-        IcTuple[] resultArray = new IcTuple[result.size()];
-        for (int index = 0; index < resultArray.length; index++) {
-            resultArray[index] = (IcTuple) result.get(index);
-        }
-        return resultArray;
+        return result;
     }
 
     /**

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/ClassConstantPool.java Mon Sep  8 20:19:53 2008
@@ -17,6 +17,7 @@
 package org.apache.harmony.unpack200.bytecode;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -48,6 +49,9 @@
     private boolean resolved;
 
     public ClassFileEntry add(ClassFileEntry entry) {
+        if (entry instanceof ByteCode) {
+            return null;
+        }
         if (entry instanceof ConstantPoolEntry) {
             if (entriesContainsSet.add(entry)) {
                 entries.add(entry);
@@ -202,24 +206,8 @@
         entries.addAll(cpClassesNotInCpAll);
     }
 
-    /**
-     * Answer the collection of CPClasses currently held by the ClassPoolSet.
-     * This is used to calculate relevant classes when generating the set of
-     * relevant inner classes (ic_relevant())
-     *
-     * @return ArrayList collection of all classes.
-     *
-     * NOTE: when this list is answered, the classes may not yet be resolved.
-     */
-    public List allClasses() {
-        List classesList = new ArrayList(entries.size());
-        for(int i = 0; i < entries.size(); i++) {
-            ConstantPoolEntry entry = (ConstantPoolEntry) entries.get(i);
-            if (entry instanceof CPClass) {
-                classesList.add(entry);
-            }
-        }
-        return classesList;
+    public List entries() {
+    	return Collections.unmodifiableList(entries);
     }
 
     protected void sortClassPool() {
@@ -243,7 +231,7 @@
 
         // copy over and rebuild the cache
         //
-        indexCache = new HashMap();
+        indexCache = new HashMap(entries.size());
         int index = 0;
 
         entries.clear();

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/NewAttribute.java Mon Sep  8 20:19:53 2008
@@ -159,6 +159,27 @@
         this.pool = pool;
     }
 
+    protected ClassFileEntry[] getNestedClassFileEntries() {
+    	int total = 1;
+    	for(int iter = 0; iter < body.size(); iter++) {
+            Object element = body.get(iter);
+            if (element instanceof ClassFileEntry) {
+                total++;
+            }
+        }
+    	ClassFileEntry[] nested = new ClassFileEntry[total];
+    	nested[0] = getAttributeName();
+    	int i = 1;
+    	for(int iter = 0; iter < body.size(); iter++) {
+            Object element = body.get(iter);
+            if (element instanceof ClassFileEntry) {
+            	nested[i] = (ClassFileEntry) element;
+                i++;
+            }
+        }
+    	return nested;
+    }
+
     private static class BCOffset extends BCValue {
 
         private final int offset;

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/ByteCodeForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/ByteCodeForm.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/ByteCodeForm.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/unpack200/bytecode/forms/ByteCodeForm.java Mon Sep  8 20:19:53 2008
@@ -59,9 +59,9 @@
 
     protected static final boolean WIDENED = true;
 
-    protected static final Map byteCodes = new HashMap();
+    protected static final ByteCodeForm[] byteCodeArray = new ByteCodeForm[256];
+    protected static final Map byteCodesByName = new HashMap(256);
     static {
-        final ByteCodeForm[] byteCodeArray = new ByteCodeForm[256];
         byteCodeArray[0] = new NoArgumentForm(0, "nop");
         byteCodeArray[1] = new NoArgumentForm(1, "aconst_null");
         byteCodeArray[2] = new NoArgumentForm(2, "iconst_m1");
@@ -391,8 +391,7 @@
         for (int i = 0; i < byteCodeArray.length; i++) {
             final ByteCodeForm byteCode = byteCodeArray[i];
             if (byteCode != null) {
-                byteCodes.put(new Integer(i), byteCode);
-                byteCodes.put(byteCode.getName(), byteCode);
+                byteCodesByName.put(byteCode.getName(), byteCode);
             }
         }
     }
@@ -478,11 +477,11 @@
     }
 
     public static ByteCodeForm get(int opcode) {
-        return (ByteCodeForm) byteCodes.get(new Integer(opcode));
+        return (ByteCodeForm) byteCodeArray[opcode];
     }
 
     public static ByteCodeForm get(String name) {
-        return (ByteCodeForm) byteCodes.get(name);
+        return (ByteCodeForm) byteCodesByName.get(name);
     }
 
     public String toString() {

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ArchiveTest.java Mon Sep  8 20:19:53 2008
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.util.Enumeration;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
@@ -69,41 +70,41 @@
         archive.unpack();
         JarFile jarFile = new JarFile(file);
         file.deleteOnExit();
-        JarEntry entry = jarFile
-                .getJarEntry("bin/test/org/apache/harmony/sql/tests/javax/sql/rowset/BaseRowSetTest$BaseRowSetImpl.class");
-        assertNotNull(entry);
-        try {
-        Process process2 = Runtime
-                .getRuntime()
-                .exec(
-                        "javap -c -verbose -classpath "
-                                + file.getName()
-                                + " bin/test/org.apache.harmony.sql.tests.javax.sql.rowset.BaseRowSetTest$BaseRowSetImpl",
-                        new String[] {}, file.getParentFile());
-
-            BufferedReader reader1 = new BufferedReader(new InputStreamReader(
-                    process2.getInputStream()));
-            InputStream javapCompareFile = Archive.class
-                    .getResourceAsStream("/org/apache/harmony/pack200/tests/sqlJavap.out");
+
+        JarFile jarFile2 = new JarFile(new File(Archive.class.getResource(
+                "/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
+
+        Enumeration entries = jarFile.entries();
+        Enumeration entries2 = jarFile2.entries();
+        while(entries.hasMoreElements() && entries2.hasMoreElements()) {
+
+            JarEntry entry = (JarEntry) entries.nextElement();
+            assertNotNull(entry);
+            String name = entry.getName();
+
+            JarEntry entry2 = (JarEntry) entries2.nextElement();
+            assertNotNull(entry2);
+            String name2 = entry2.getName();
+
+            assertEquals(name, name2);
+
+            InputStream ours = jarFile.getInputStream(entry);
+            InputStream expected = jarFile2.getInputStream(entry2);
+
+            BufferedReader reader1 = new BufferedReader(new InputStreamReader(ours));
             BufferedReader reader2 = new BufferedReader(new InputStreamReader(
-                    javapCompareFile));
+                    expected));
             String line1 = reader1.readLine();
             String line2 = reader2.readLine();
             int i = 1;
             while (line1 != null || line2 != null) {
-                assertEquals(line2, line1);
+                assertEquals("Unpacked class files differ for " + name, line2, line1);
                 line1 = reader1.readLine();
                 line2 = reader2.readLine();
                 i++;
             }
             reader1.close();
             reader2.close();
-        } catch (IOException e) {
-            if(e.getMessage().startsWith("Unable to start program")) {
-                System.out.println("Warning: org.apache.harmony.unpack200.tests.ArchiveTest.testWithSql() was not completed as javap could not be found");
-            } else {
-                throw e;
-            }
         }
     }
 
@@ -184,7 +185,7 @@
         } catch (IOException e) {
             e.printStackTrace();
         }
-//        file.delete();
+        file.delete();
     }
 
 }
\ No newline at end of file

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/BcBandsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/BcBandsTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/BcBandsTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/BcBandsTest.java Mon Sep  8 20:19:53 2008
@@ -146,6 +146,14 @@
             return new int[totalMethods];
         }
 
+        public boolean[] getCodeHasAttributes() {
+            int totalMethods = 0;
+            for (int i = 0; i < numClasses; i++) {
+                totalMethods += numMethods[i];
+            }
+            return new boolean[totalMethods];
+        }
+
         public String[][] getMethodDescr() {
             String[][] descr = new String[numClasses][];
             for (int i = 0; i < descr.length; i++) {

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ICTupleTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ICTupleTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ICTupleTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ICTupleTest.java Mon Sep  8 20:19:53 2008
@@ -25,39 +25,39 @@
     public void testPredictedClassTupleParsing() {
         IcTuple tuple = new IcTuple(
                 "orw/SimpleHelloWorld$SimpleHelloWorldInner", 0, null, null,
-                -1, -1, -1);
+                -1, -1, -1, -1);
         assertEquals("SimpleHelloWorldInner", tuple.simpleClassName());
         assertEquals("orw/SimpleHelloWorld", tuple.outerClassString());
 
         tuple = new IcTuple("java/util/AbstractList$2$Local", 0, null, null,
-                -1, -1, -1);
+                -1, -1, -1, -1);
         assertEquals("Local", tuple.simpleClassName());
         assertEquals("java/util/AbstractList$2", tuple.outerClassString());
 
         tuple = new IcTuple("java/util/AbstractList#2#Local", 0, null, null,
-                -1, -1, -1);
+                -1, -1, -1, -1);
         assertEquals("Local", tuple.simpleClassName());
         assertEquals("java/util/AbstractList$2", tuple.outerClassString());
 
         tuple = new IcTuple("java/util/AbstractList$1", 0, null, null, -1, -1,
-                -1);
+                -1, -1);
         assertEquals("1", tuple.simpleClassName());
         assertEquals("java/util/AbstractList", tuple.outerClassString());
     }
 
     public void testExplicitClassTupleParsing() {
         IcTuple tuple = new IcTuple("Foo$$2$Local", IcTuple.NESTED_CLASS_FLAG,
-                null, "$2$Local", -1, -1, -1);
+                null, "$2$Local", -1, -1, -1, -1);
         assertEquals("$2$Local", tuple.simpleClassName());
         assertEquals("Foo$$2", tuple.outerClassString());
 
         tuple = new IcTuple("Red$Herring", IcTuple.NESTED_CLASS_FLAG,
-                "Red$Herring", null, -1, -1, -1);
+                "Red$Herring", null, -1, -1, -1, -1);
         assertEquals("Herring", tuple.simpleClassName());
         assertEquals("Red$Herring", tuple.outerClassString());
 
         tuple = new IcTuple("X$1$Q", IcTuple.NESTED_CLASS_FLAG, "X$1", "Q", -1,
-                -1, -1);
+                -1, -1, -1);
         assertEquals("Q", tuple.simpleClassName());
         assertEquals("X$1", tuple.outerClassString());
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/SegmentTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/SegmentTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/SegmentTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/SegmentTest.java Mon Sep  8 20:19:53 2008
@@ -87,55 +87,33 @@
         out = null;
         JarFile jarFile = new JarFile(file);
         file.deleteOnExit();
+
         JarEntry entry = jarFile
                 .getJarEntry("org/apache/harmony/archive/tests/internal/pack200/HelloWorld.class");
         assertNotNull(entry);
-        
-        try {
-            Process process = Runtime
-                    .getRuntime()
-                    .exec(
-                            "java -cp "
-                                    + file.getName()
-                                    + " org.apache.harmony.archive.tests.internal.pack200.HelloWorld",
-                            new String[] {}, file.getParentFile());
-            BufferedReader reader = new BufferedReader(new InputStreamReader(
-                    process.getInputStream()));
-            String line = reader.readLine();
-            assertEquals("Hello world", line);
-            reader.close();
-    
-            Process process2 = Runtime
-                    .getRuntime()
-                    .exec(
-                            "javap -c -verbose -classpath "
-                                    + file.getName()
-                                    + " org.apache.harmony.archive.tests.internal.pack200.HelloWorld",
-                            new String[] {}, file.getParentFile());
-            BufferedReader reader1 = new BufferedReader(new InputStreamReader(process2
-                    .getInputStream()));
-            InputStream javapCompareFile = Segment.class
-                    .getResourceAsStream("/org/apache/harmony/pack200/tests/HelloWorldJavap.out");
-            BufferedReader reader2 = new BufferedReader(new InputStreamReader(
-                    javapCompareFile));
-            String line1 = reader1.readLine();
-            String line2 = reader2.readLine();
-            int i = 1;
-            while (line1 != null || line2 != null) {
-                assertEquals(line2, line1);
-                line1 = reader1.readLine();
-                line2 = reader2.readLine();
-                i++;
-            }
-            reader1.close();
-            reader2.close();
-        } catch (IOException e) {
-            if (e.getMessage().startsWith("Unable to start program")) {
-                System.out.println("Warning: org.apache.harmony.unpack200.tests.SegmentTest.testHelloWorld() was not completed as java or javap could not be found");
-            } else {
-                throw e;
-            }
+        InputStream ours = jarFile.getInputStream(entry);
+
+        JarFile jarFile2 = new JarFile(new File(Segment.class.getResource(
+                "/org/apache/harmony/pack200/tests/hw.jar").toURI()));
+        JarEntry entry2 = jarFile2
+                .getJarEntry("org/apache/harmony/archive/tests/internal/pack200/HelloWorld.class");
+        assertNotNull(entry2);
+
+        InputStream expected = jarFile2.getInputStream(entry2);
+
+        BufferedReader reader1 = new BufferedReader(new InputStreamReader(ours));
+        BufferedReader reader2 = new BufferedReader(new InputStreamReader(expected));
+        String line1 = reader1.readLine();
+        String line2 = reader2.readLine();
+        int i = 1;
+        while (line1 != null || line2 != null) {
+            assertEquals("Unpacked class files differ", line2, line1);
+            line1 = reader1.readLine();
+            line2 = reader2.readLine();
+            i++;
         }
+        reader1.close();
+        reader2.close();
     }
 
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ConstantPoolTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ConstantPoolTest.java?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ConstantPoolTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/bytecode/ConstantPoolTest.java Mon Sep  8 20:19:53 2008
@@ -61,9 +61,9 @@
         assertTrue(pool.indexOf(u1) > 0);
     }
 
-    public void testAllClasses() {
+    public void testEntries() {
         pool.add(new CPClass(new CPUTF8("RandomClass", 1), 10));
         pool.add(new CPClass(new CPUTF8("RandomClass2", 2), 20));
-        assertEquals(2, pool.allClasses().size());
+        assertEquals(2, pool.entries().size());
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml Mon Sep  8 20:19:53 2008
@@ -95,7 +95,7 @@
 
     <!-- Build the portlib native components -->
     <target name="build-native"
-        depends="-build-native,-build-native-sig,-build-native-thread,-build-native-thrstub,-build-native-port" />
+        depends="-build-native,-build-native-thread,-build-native-thrstub,-build-native-port" />
     <target name="-build-native">
        <!-- Build common lib -->
         <make dir="${hy.portlib.src.main.native}/common/${hy.os.family}" />
@@ -104,19 +104,6 @@
         <make dir="${hy.portlib.src.main.native}/pool/${hy.os.family}" />
     </target>
 
-    <target name="-build-native-sig" unless="hy.skip.sig">
-        <!-- Build sig dll -->
-        <make dir="${hy.portlib.src.main.native}/sig/${hy.os.family}" />
-
-        <copy todir="${hy.jdk}/jre/bin" overwrite="yes">
-            <fileset dir="${hy.portlib.src.main.native}/sig">
-                <include name="*${shlib.suffix}*" />
-                <include name="*${progdb.suffix}*" if="is.windows" />
-                <exclude name="*${manifest.suffix}"/>
-            </fileset>
-        </copy>
-    </target>
-
     <target name="-build-native-thread" unless="hy.skip.thr">
         <!-- Build thread dll -->
         <make dir="${hy.portlib.src.main.native}/thread/${hy.os.family}" />
@@ -179,7 +166,6 @@
 
     <!-- Clean natives -->
     <target name="clean-native" depends="-clean-native-tests">
-        <make dir="${hy.portlib.src.main.native}/sig/${hy.os.family}" target="clean" />
         <make dir="${hy.portlib.src.main.native}/thread/${hy.os.family}" target="clean" />
         <make dir="${hy.portlib.src.main.native}/thrstub/${hy.os.family}" target="clean" />
         <make dir="${hy.portlib.src.main.native}/port/${hy.os.family}" target="clean" />

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyerror.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyerror.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyerror.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyerror.c Mon Sep  8 20:19:53 2008
@@ -317,6 +317,7 @@
     {
       portLibrary->str_printf (portLibrary, ptBuffers->errorMessageBuffer,
                                ptBuffers->errorMessageBufferSize,
+                               "%s",
                                errorMessage);
       ptBuffers->errorMessageBuffer[ptBuffers->errorMessageBufferSize - 1] =
         '\0';

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyexit.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyexit.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyexit.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyexit.c Mon Sep  8 20:19:53 2008
@@ -24,11 +24,6 @@
 
 #include "hyport.h"
 
-#if !defined(HY_NO_SIG)
-extern void VMCALL hysig_chain_at_shutdown_and_exit (struct HyPortLibrary
-                                                     *portLibrary);
-#endif /* HY_NO_SIG */
-
 /**
  * Block until the portlibary has been exited and return the error code.
  *
@@ -55,14 +50,6 @@
 void VMCALL
 hyexit_shutdown_and_exit (struct HyPortLibrary *portLibrary, I_32 exitCode)
 {
-
-#if !defined(HY_NO_SIG)
-#if !defined(WIN32)
-  hysig_chain_at_shutdown_and_exit (portLibrary);
-#endif
-#endif /* HY_NO_SIG */
-
-
   exit ((int) exitCode);
 }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyport.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyport.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyport.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyport.c Mon Sep  8 20:19:53 2008
@@ -77,9 +77,6 @@
   THREAD_ACCESS_FROM_PORT(portLibrary);
 
 #endif /* HY_NO_THR */
-#if !defined(HY_NO_SIG)
-  portLibrary->sig_shutdown (portLibrary);
-#endif /* HY_NO_SIG */
   portLibrary->shmem_shutdown (portLibrary);
   portLibrary->shsem_shutdown (portLibrary);
 
@@ -361,14 +358,6 @@
       goto cleanup;
     }
 
-#if !defined(HY_NO_SIG)
-  rc = portLibrary->sig_startup (portLibrary);
-  if (0 != rc)
-    {
-      goto cleanup;
-    }
-#endif /* HY_NO_SIG */
-
   return rc;
 
 cleanup:

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyportcontrol.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyportcontrol.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyportcontrol.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hyportcontrol.c Mon Sep  8 20:19:53 2008
@@ -52,22 +52,5 @@
       return 0;
     }
 
-#if defined(WIN32) && !defined(HY_NO_SIG)
-  if (!strcmp ("SIG_INTERNAL_HANDLER", key))
-    {
-      /* used by optimized code to implement fast signal handling on Windows */
-      extern int structuredExceptionHandler (struct HyPortLibrary
-                                             *portLibrary,
-                                             hysig_handler_fn handler,
-                                             void *handler_arg, U_32 flags,
-                                             EXCEPTION_POINTERS *
-                                             exceptionInfo);
-      *(int (**)
-        (struct HyPortLibrary *, hysig_handler_fn, void *, U_32,
-         EXCEPTION_POINTERS *)) value = structuredExceptionHandler;
-      return 0;
-    }
-#endif
-
   return 1;
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hystr.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hystr.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hystr.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/hystr.c Mon Sep  8 20:19:53 2008
@@ -865,7 +865,7 @@
             {
               result[index] = *format;
             }
-          *format++;
+          format++;
           index++;
         }
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/portpriv.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/portpriv.h?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/portpriv.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/shared/portpriv.h Mon Sep  8 20:19:53 2008
@@ -583,46 +583,6 @@
   hysysinfo_get_env
 PROTOTYPE ((struct HyPortLibrary * portLibrary, char *envVar,
             char *infoString, UDATA bufSize));
-#if !defined(HY_NO_SIG)
-/* HySourceHySignal*/
-struct HyPortLibrary;
-extern HY_CFUNC I_32 VMCALL
-  hysig_startup PROTOTYPE ((struct HyPortLibrary * portLibrary));
-struct HyPortLibrary;
-extern HY_CFUNC U_32 VMCALL
-  hysig_get_options PROTOTYPE ((struct HyPortLibrary * portLibrary));
-struct HyPortLibrary;
-extern HY_CFUNC I_32 VMCALL
-  hysig_can_protect
-PROTOTYPE ((struct HyPortLibrary * portLibrary, U_32 flags));
-struct HyPortLibrary;
-extern HY_CFUNC void VMCALL
-  hysig_shutdown PROTOTYPE ((struct HyPortLibrary * portLibrary));
-struct HyPortLibrary;
-extern HY_CFUNC U_32 VMCALL
-  hysig_info_count
-PROTOTYPE ((struct HyPortLibrary * portLibrary, void *info, U_32 category));
-struct HyPortLibrary;
-extern HY_CFUNC I_32 VMCALL
-  hysig_set_options
-PROTOTYPE ((struct HyPortLibrary * portLibrary, U_32 options));
-struct HyPortLibrary;
-extern HY_CFUNC I_32 VMCALL
-  hysig_protect
-PROTOTYPE ((struct HyPortLibrary * portLibrary, hysig_protected_fn fn,
-            void *fn_arg, hysig_handler_fn handler, void *handler_arg,
-            U_32 flags, UDATA * result));
-struct HyPortLibrary;
-extern HY_CFUNC U_32 VMCALL
-  hysig_set_async_signal_handler
-PROTOTYPE ((struct HyPortLibrary * portLibrary, hysig_handler_fn handler,
-            void *handler_arg, U_32 flags));
-struct HyPortLibrary;
-extern HY_CFUNC U_32 VMCALL
-  hysig_info
-PROTOTYPE ((struct HyPortLibrary * portLibrary, void *info, U_32 category,
-            I_32 index, const char **name, void **value));
-#endif /* HY_NO_SIG */
 /* HySourceHySL*/
 struct HyPortLibrary;
 extern HY_CFUNC UDATA VMCALL
@@ -1307,17 +1267,6 @@
   hyipcmutex_acquire,           /* ipcmutex_acquire */
   hyipcmutex_release,           /* ipcmutex_release */
   hyport_control,               /* port_control */
-#if !defined(HY_NO_SIG)
-  hysig_startup,                /* sig_startup */
-  hysig_shutdown,               /* sig_shutdown */
-  hysig_protect,                /* sig_protect */
-  hysig_can_protect,            /* sig_can_protect */
-  hysig_set_async_signal_handler,       /* sig_set_async_signal_handler */
-  hysig_info,                   /* sig_info */
-  hysig_info_count,             /* sig_info_count */
-  hysig_set_options,            /* sig_set_options */
-  hysig_get_options,            /* sig_get_options */
-#else
   NULL,                /* sig_startup */
   NULL,               /* sig_shutdown */
   NULL,                /* sig_protect */
@@ -1327,7 +1276,6 @@
   NULL,             /* sig_info_count */
   NULL,            /* sig_set_options */
   NULL,            /* sig_get_options */
-#endif /* HY_NO_SIG */
   NULL,                         /* attached_thread */
   hysysinfo_DLPAR_enabled,      /* sysinfo_DLPAR_enabled */
   hysysinfo_DLPAR_max_CPUs,     /* sysinfo_DLPAR_max_CPUs */

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyosdump.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyosdump.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyosdump.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyosdump.c Mon Sep  8 20:19:53 2008
@@ -87,9 +87,6 @@
         }
 
       /* Ensure we get default action (core) - reset primary&app handlers */
-#if !defined(HY_NO_SIG)
-      HYJSIG_SIGNAL (SIGABRT, SIG_DFL);
-#endif /* HY_NO_SIG */
       signal (SIGABRT, SIG_DFL);
 
 #if defined(LINUX)

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysl.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysl.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysl.c Mon Sep  8 20:19:53 2008
@@ -59,12 +59,13 @@
 
 #define CDEV_CURRENT_FUNCTION _prototypes_private
 #if (defined(HYVM_USE_MBTOWC))
-static void convertWithMBTOWC (struct HyPortLibrary *portLibrary, char *error,
+static void convertWithMBTOWC (struct HyPortLibrary *portLibrary, const char *error,
                                char *errBuf, UDATA bufLen);
 #endif /* HYVM_USE_MBTOWC */
 
 #if (defined(HYVM_USE_ICONV))
-static void convertWithIConv (struct HyPortLibrary *portLibrary, char *error,
+static void convertWithIConv (struct HyPortLibrary *portLibrary,
+                              const char *error,
                               char *errBuf, UDATA bufLen);
 #endif /* HYVM_USE_ICONV */
 
@@ -209,7 +210,7 @@
 static void
 getDLError (struct HyPortLibrary *portLibrary, char *errBuf, UDATA bufLen)
 {
-  char *error;
+  const char *error;
 
   if (bufLen == 0)
     {
@@ -246,7 +247,7 @@
 #define CDEV_CURRENT_FUNCTION convertWithIConv
 #if (defined(HYVM_USE_ICONV))
 static void
-convertWithIConv (struct HyPortLibrary *portLibrary, char *error,
+convertWithIConv (struct HyPortLibrary *portLibrary, const char *error,
                   char *errBuf, UDATA bufLen)
 {
   iconv_t converter;
@@ -291,10 +292,11 @@
 #define CDEV_CURRENT_FUNCTION convertWithMBTOWC
 #if (defined(HYVM_USE_MBTOWC))
 static void
-convertWithMBTOWC (struct HyPortLibrary *portLibrary, char *error,
+convertWithMBTOWC (struct HyPortLibrary *portLibrary, const char *error,
                    char *errBuf, UDATA bufLen)
 {
-  char *out, *end, *walk;
+  char *out, *end;
+  const char* walk;
   wchar_t ch;
   int ret;
   out = errBuf;

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysock.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysock.c?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysock.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysock.c Mon Sep  8 20:19:53 2008
@@ -4564,9 +4564,8 @@
                         sizeof (struct in6_addr);
                       interfaces[currentAdapterIndex].
                         addresses[currentIPAddressIndex].scope =
-                        &(((struct sockaddr_in6 *) (&currentIfReq->
-                                                    ifr_addr))->
-                          sin6_scope_id);
+                        ((struct sockaddr_in6 *) (&currentIfReq->
+                                                  ifr_addr))->sin6_scope_id;
                       currentIPAddressIndex++;
                     }
 #endif
@@ -4820,9 +4819,8 @@
                         sizeof (struct in6_addr);
                       interfaces[currentAdapterIndex].
                         addresses[currentIPAddressIndex].scope =
-                        &(((struct sockaddr_in6 *) (&ifc.ifc_req[counter].
-                                                    ifr_addr))->
-                          sin6_scope_id);
+                        ((struct sockaddr_in6 *) (&ifc.ifc_req[counter].
+                                                  ifr_addr))->sin6_scope_id;
                       currentIPAddressIndex++;
                     }
 #endif

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/makefile?rev=693355&r1=693354&r2=693355&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/makefile Mon Sep  8 20:19:53 2008
@@ -31,10 +31,6 @@
 	$(SHAREDSUB)hystr.o $(SHAREDSUB)hystrftime.o $(SHAREDSUB)hystsl.o \
 	hysysinfo.o hytime.o $(SHAREDSUB)hytlshelpers.o hytty.o
 
-ifeq ($(HY_NO_SIG),false)
-BUILDFILES += hysignal.o $(HY_PLATFORM)/hysignal_context.o
-endif
-
 ifeq ($(HY_PORTLIB_STUBS),true)
 BUILDFILES += stubs/hycpu.o stubs/hyipcmutex.o stubs/hyshmem.o \
               stubs/hyshsem.o stubs/hyvmem.o



Mime
View raw message