harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r592673 [3/10] - in /harmony/enhanced/classlib/branches/java6: depends/build/ depends/build/platform/ depends/manifests/icu4j_3.8/META-INF/ make/ modules/archive/ modules/archive/src/main/native/archive/unix/ modules/archive/src/main/native...
Date Wed, 07 Nov 2007 09:51:11 GMT
Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java Wed Nov  7 01:51:00 2007
@@ -20,11 +20,12 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
-import java.util.Arrays;
 
+import org.apache.harmony.pack200.IcBands.ICTuple;
 import org.apache.harmony.pack200.bytecode.CPClass;
 import org.apache.harmony.pack200.bytecode.ConstantValueAttribute;
 import org.apache.harmony.pack200.bytecode.ExceptionsAttribute;
+import org.apache.harmony.pack200.bytecode.SourceFileAttribute;
 
 /**
  * 
@@ -44,6 +45,12 @@
     private String[] classThis;
     
     private ArrayList[] classAttributes;
+    
+    private int[] classVersionMajor;
+    
+    private int[] classVersionMinor;
+    
+    private IcBands.ICTuple[][] icLocal;
 
     private int[] codeHandlerCount;
 
@@ -51,21 +58,15 @@
 
     private int[] codeMaxStack;
 
-    private int fieldAttrCount;
-
     private ArrayList[][] fieldAttributes;
 
     private String[][] fieldDescr;
 
     private long[][] fieldFlags;
 
-    private int methodAttrCount;
-
     private ArrayList[][] methodAttributes;
 
     private String[][] methodDescr;
-
-    private ExceptionsAttribute[][] methodExceptions;
     
     private long[][] methodFlags;
 
@@ -134,13 +135,7 @@
                 classFieldCount, cpBands.getCpDescriptor());
         fieldFlags = parseFlags("field_flags", in, classFieldCount,
                 Codec.UNSIGNED5, options.hasFieldFlagsHi());
-        for (int i = 0; i < fieldFlags.length; i++) {
-            for (int j = 0; j < fieldFlags[i].length; j++) {
-                long flag = fieldFlags[i][j];
-                if ((flag & (1 << 16)) != 0)
-                    fieldAttrCount++;
-            }
-        }
+        int fieldAttrCount = SegmentUtils.countBit16(fieldFlags);
         int[] fieldAttrCounts = decodeBandInt("field_attr_count", in, Codec.UNSIGNED5, fieldAttrCount);
         int[][] fieldAttrIndexes = decodeBandInt("field_attr_indexes", in, Codec.UNSIGNED5, fieldAttrCounts);
         int callCount = 0;
@@ -151,71 +146,63 @@
                 callCount += layout.numBackwardsCallables();
             }
         }
-        int[] fieldAttrCalls = decodeBandInt("field_attr_calls", in, Codec.UNSIGNED5, callCount);
-        AttributeLayout layout = attrMap.getAttributeLayout("ConstantValue",
-                AttributeLayout.CONTEXT_FIELD);
-        int constantCount = SegmentUtils.countMatches(fieldFlags, layout);        
-        if(constantCount > 0) {
-            int[] field_constantValue_KQ = decodeBandInt("field_ConstantValue_KQ", in, Codec.UNSIGNED5, constantCount);
-            int index = 0;
-            fieldAttributes = new ArrayList[classCount][];
-            for (int i = 0; i < classCount; i++) {
-                fieldAttributes[i] = new ArrayList[fieldFlags[i].length];
-                for (int j = 0; j < fieldFlags[i].length; j++) {
-                    fieldAttributes[i][j] = new ArrayList();
-                    long flag = fieldFlags[i][j];
-                    if (layout.matches(flag)) {
-                        // we've got a value to read
-                        long result = field_constantValue_KQ[index];
-                        String desc = fieldDescr[i][j];
-                        int colon = desc.indexOf(':');
-                        // String name = desc.substring(0, colon);
-                        String type = desc.substring(colon + 1);
-                        // TODO Got to get better at this ... in any case, it should
-                        // be e.g. KIB or KIH
-                        if (type.equals("B") || type.equals("H"))
-                            type = "I";
-                        Object value = layout.getValue(result, type, cpBands
-                                    .getConstantPool());
-                        fieldAttributes[i][j]
-                                .add(new ConstantValueAttribute(value));
-                        debug("Processed value " + value + " for ConstantValue");
-                        index++;
-                    }
-                }
+        int layoutsUsed = 0;
+        for (int i = 0; i < fieldFlags.length; i++) {
+            for (int j = 0; j < fieldFlags[i].length; j++) {
+                layoutsUsed |= fieldFlags[i][j]; 
             }
         }
+        for (int i = 0; i < 16; i++) {
+            if((layoutsUsed & 1<<i) != 0) {
+                AttributeLayout layout = attrMap.getAttributeLayout(i, AttributeLayout.CONTEXT_FIELD);
+                callCount += layout.numBackwardsCallables();
+            }
+        }
+        int[] fieldAttrCalls = decodeBandInt("field_attr_calls", in, Codec.UNSIGNED5, callCount);
 
-        layout = attrMap.getAttributeLayout(AttributeLayout.ATTRIBUTE_SIGNATURE,
+        AttributeLayout constantValueLayout = attrMap.getAttributeLayout("ConstantValue",
                 AttributeLayout.CONTEXT_FIELD);
-        int signatureCount = SegmentUtils.countMatches(fieldFlags, layout);
-        if (signatureCount > 0) {
-            int[] fieldSignatureRS = decodeBandInt("field_Signature_RS", in, Codec.UNSIGNED5, signatureCount);
-            int index = 0;
-            fieldAttributes = new ArrayList[classCount][];
-            for (int i = 0; i < classCount; i++) {
-                fieldAttributes[i] = new ArrayList[fieldFlags[i].length];
-                for (int j = 0; j < fieldFlags[i].length; j++) {
-                    fieldAttributes[i][j] = new ArrayList();
-                    long flag = fieldFlags[i][j];
-                    if (layout.matches(flag)) {
-                        // we've got a signature attribute
-                        long result = fieldSignatureRS[index];
-                        String desc = fieldDescr[i][j];
-                        int colon = desc.indexOf(':');
-                        // String name = desc.substring(0, colon);
-                        String type = desc.substring(colon + 1);
-                        // TODO Got to get better at this ... in any case, it should
-                        // be e.g. KIB or KIH
-                        if (type.equals("B") || type.equals("H"))
-                            type = "I";
-                        Object value = layout.getValue(result, type, cpBands
-                                .getConstantPool());
-                        fieldAttributes[i][j]
-                                .add(new ConstantValueAttribute(value));
-                        index++;
-                        debug("Found a signature attribute: " + result);
-                    }
+        int constantCount = SegmentUtils.countMatches(fieldFlags, constantValueLayout); 
+        int[] field_constantValue_KQ = decodeBandInt("field_ConstantValue_KQ", in, Codec.UNSIGNED5, constantCount);
+        int constantValueIndex = 0;
+        
+        AttributeLayout signatureLayout = attrMap.getAttributeLayout(AttributeLayout.ATTRIBUTE_SIGNATURE,
+                AttributeLayout.CONTEXT_FIELD);
+        int signatureCount = SegmentUtils.countMatches(fieldFlags, signatureLayout);
+        int[] fieldSignatureRS = decodeBandInt("field_Signature_RS", in, Codec.UNSIGNED5, signatureCount);
+        int signatureIndex = 0;
+        
+        fieldAttributes = new ArrayList[classCount][];
+        for (int i = 0; i < classCount; i++) {
+            fieldAttributes[i] = new ArrayList[fieldFlags[i].length];
+            for (int j = 0; j < fieldFlags[i].length; j++) {
+                fieldAttributes[i][j] = new ArrayList();
+                long flag = fieldFlags[i][j];
+                if (constantValueLayout.matches(flag)) {
+                    // we've got a value to read
+                    long result = field_constantValue_KQ[constantValueIndex];
+                    String desc = fieldDescr[i][j];
+                    int colon = desc.indexOf(':');
+                    String type = desc.substring(colon + 1);
+                    if (type.equals("B") || type.equals("S") || type.equals("C") || type.equals("Z"))
+                        type = "I";
+                    Object value = constantValueLayout.getValue(result, type,
+                            cpBands.getConstantPool());
+                    fieldAttributes[i][j]
+                            .add(new ConstantValueAttribute(value));
+                    constantValueIndex++;
+                }
+                if (signatureLayout.matches(flag)) {
+                    // we've got a signature attribute
+                    long result = fieldSignatureRS[signatureIndex];
+                    String desc = fieldDescr[i][j];
+                    int colon = desc.indexOf(':');
+                    String type = desc.substring(colon + 1);
+                    Object value = signatureLayout.getValue(result, type, cpBands
+                            .getConstantPool());
+                    fieldAttributes[i][j]
+                            .add(new ConstantValueAttribute(value));
+                    signatureIndex++;
                 }
             }
         }
@@ -228,13 +215,8 @@
                 classMethodCount, cpBands.getCpDescriptor());
         methodFlags = parseFlags("method_flags", in, classMethodCount,
                 Codec.UNSIGNED5, options.hasMethodFlagsHi());
-        for (int i = 0; i < classCount; i++) {
-            for (int j = 0; j < methodFlags[i].length; j++) {
-                long flag = methodFlags[i][j];
-                if ((flag & (1 << 16)) != 0)
-                    methodAttrCount++;
-            }
-        }
+       
+        int methodAttrCount = SegmentUtils.countBit16(methodFlags);
         int[] methodAttrCounts = decodeBandInt("method_attr_count", in, Codec.UNSIGNED5, methodAttrCount);
         int[][] methodAttrIndexes = decodeBandInt("method_attr_indexes", in, Codec.UNSIGNED5, methodAttrCounts);
         int callCount = 0;
@@ -246,6 +228,7 @@
             }
         }
         methodAttrCalls = decodeBandInt("code_attr_calls", in, Codec.UNSIGNED5, callCount);
+        
         // assign empty method attributes
         methodAttributes = new ArrayList[classCount][];
         for (int i = 0; i < classCount; i++) {
@@ -273,7 +256,6 @@
                     long result = methodSignatureRS[index];
                     String desc = methodDescr[i][j];
                     int colon = desc.indexOf(':');
-                    // String name = desc.substring(0, colon);
                     String type = desc.substring(colon + 1);
                     // TODO Got to get better at this ... in any case, it should
                     // be e.g. KIB or KIH
@@ -284,7 +266,6 @@
                     methodAttributes[i][j]
                             .add(new ConstantValueAttribute(value));
                     index++;
-                    debug("Found a signature attribute: " + result);
                 }
             }        
         }
@@ -299,13 +280,11 @@
             throws Pack200Exception, IOException {
         AttributeLayout layout = attrMap.getAttributeLayout("Exceptions",
                 AttributeLayout.CONTEXT_METHOD);
-        methodExceptions = new ExceptionsAttribute[classCount][];
         int count = SegmentUtils.countMatches(methodFlags, layout);
         int[] numExceptions = decodeBandInt("method_Exceptions_n", in, Codec.UNSIGNED5, count);
         String[][] methodExceptionsRS = parseReferences("method_Exceptions_RC", in, Codec.UNSIGNED5, numExceptions, cpBands.getCpClass());
         int index = 0;
         for (int i = 0; i < classCount; i++) {
-            methodExceptions[i] = new ExceptionsAttribute[methodFlags[i].length];
             for (int j = 0; j < methodFlags[i].length; j++) {
                 long flag = methodFlags[i][j];
                 if(layout.matches(flag)) {
@@ -315,8 +294,7 @@
                     for (int k = 0; k < n; k++) {
                         exceptionClasses[k] = new CPClass(exceptions[k]);
                     }
-                    methodExceptions[i][j] = new ExceptionsAttribute(exceptionClasses);
-                    methodAttributes[i][j].add(methodExceptions[i][j]);
+                    methodAttributes[i][j].add(new ExceptionsAttribute(exceptionClasses));
                     index ++;
                 }
             }
@@ -325,14 +303,12 @@
 
     private void parseClassAttrBands(InputStream in) throws IOException,
             Pack200Exception {
+        String[] cpUTF8 = cpBands.getCpUTF8();
+        String[] cpClass = cpBands.getCpClass();
+        
         classFlags = parseFlags("class_flags", in, classCount, Codec.UNSIGNED5,
                 options.hasClassFlagsHi());
-        int classAttrCount = 0;
-        for (int i = 0; i < classFlags.length; i++) {
-            long flag = classFlags[i];
-            if ((flag & (1 << 16)) != 0)
-                classAttrCount++;
-        }
+        int classAttrCount = SegmentUtils.countBit16(classFlags);
         int[] classAttrCounts = decodeBandInt("class_attr_count", in, Codec.UNSIGNED5, classAttrCount);
         int[][] classAttrIndexes = decodeBandInt("class_attr_indexes", in, Codec.UNSIGNED5, classAttrCounts);
         int callCount = 0;
@@ -402,39 +378,99 @@
                 "class_file_version_minor_H", in, Codec.UNSIGNED5, versionCount);
         int[] classFileVersionMajorH = decodeBandInt(
                 "class_file_version_major_H", in, Codec.UNSIGNED5, versionCount);
-        
+        if(versionCount > 0) {
+            classVersionMajor = new int[classCount];
+            classVersionMinor = new int[classCount];
+        }
+        int defaultVersionMajor = header.getDefaultClassMajorVersion();
+        int defaultVersionMinor = header.getDefaultClassMinorVersion();
         
         // Now process the attribute bands we have parsed
         int sourceFileIndex = 0;
         int enclosingMethodIndex = 0;
         int signatureIndex = 0;
         int innerClassIndex = 0;
+        int innerClassC2NIndex = 0;
         int versionIndex = 0;
         classAttributes = new ArrayList[classCount];
+        icLocal = new IcBands.ICTuple[classCount][];
         for (int i = 0; i < classCount; i++) {
             classAttributes[i] = new ArrayList();
             long flag = classFlags[i];
+            
             if (sourceFileLayout.matches(flag)) {
                 long result = classSourceFile[sourceFileIndex];
-                // we've got a value to read
-                // TODO File this as a sourcefile attribute and don't generate
-                // everything below
-                Object value = sourceFileLayout.getValue(result, cpBands
+                String value = (String) sourceFileLayout.getValue(result, cpBands
                         .getConstantPool());
-                debug("Processed value " + value + " for SourceFile");
+                if(value == null) {
+                    // Remove package prefix
+                    String className = classThis[i].substring(classThis[i].lastIndexOf('/') + 1);
+                    className = className.substring(className.lastIndexOf('.') + 1);
+                    
+                    // Remove mangled nested class names
+                    char[] chars = className.toCharArray();
+                    int index = -1;
+                    for (int j = 0; j < chars.length; j++) {
+                        if(chars[j] <= 0x2D) {
+                            index = j;
+                            break;
+                        }                        
+                    }
+                    if(index > -1) {
+                        className = className.substring(0, index);
+                    }
+                    // Add .java to the end
+                    value = className + ".java";
+                }
+                classAttributes[i].add(new SourceFileAttribute(value));
                 sourceFileIndex++;
             }
             if(enclosingMethodLayout.matches(flag)) {
-               // TODO
+//                long result = 
             }
             if(signatureLayout.matches(flag)) {
-//              TODO
+                long result = classSignature[signatureIndex];
+                Object value = signatureLayout.getValue(result, cpBands
+                        .getConstantPool());
+                classAttributes[i].add(new ConstantValueAttribute(value));
+                signatureIndex++;
             }
             if(innerClassLayout.matches(flag)) {
-                // TODO
+                // Just create the tuples for now because the attributes are
+                // decided at the end when creating class constant pools
+                icLocal[i] = new IcBands.ICTuple[classInnerClassesN[innerClassIndex]];
+                for (int j = 0; j < icLocal[i].length; j++) {
+                    IcBands.ICTuple icTuple = new IcBands.ICTuple();
+                    icTuple.C = cpClass[classInnerClassesRC[innerClassIndex][j]];
+                    icTuple.F = classInnerClassesF[innerClassIndex][j];
+                    if(icTuple.F != 0) {
+                        icTuple.C2 = cpClass[classInnerClassesOuterRCN[innerClassC2NIndex]];
+                        icTuple.N = cpUTF8[classInnerClassesNameRUN[innerClassC2NIndex]];
+                        innerClassC2NIndex++;
+                    } else {
+                        // Get from icBands
+                        IcBands icBands = segment.getIcBands();
+                        ICTuple[] icAll = icBands.getIcTuples();
+                        for (int k = 0; k < icAll.length; k++) {
+                            if(icAll[k].C.equals(icTuple.C)) {
+                                icTuple.C2 = icAll[k].C2;
+                                icTuple.N = icAll[k].N;
+                                break;
+                            }
+                        }
+                    }
+                    icLocal[i][j] = icTuple;
+                }
+                innerClassIndex++;           
             }
             if(versionLayout.matches(flag)) {
-                // TODO
+                classVersionMajor[i] = classFileVersionMajorH[versionIndex];
+                classVersionMinor[i] = classFileVersionMinorH[versionIndex];
+                versionIndex++;
+            } else if(classVersionMajor != null) {
+                // Fill in with defaults
+                classVersionMajor[i] = defaultVersionMajor;
+                classVersionMinor[i] = defaultVersionMinor;
             }
         }
     }
@@ -505,12 +541,7 @@
 
     private void parseCodeAttrBands(InputStream in, int codeFlagsCount) throws IOException, Pack200Exception {
         long[] codeFlags = parseFlags("code_flags", in, codeFlagsCount, Codec.UNSIGNED5, segment.getSegmentHeader().getOptions().hasCodeFlagsHi());
-        int codeAttrCount = 0;
-        for (int i = 0; i < codeFlagsCount; i++) {
-            long flag = codeFlags[i];
-            if ((flag & (1 << 16)) != 0)
-                codeAttrCount++;
-        }
+        int codeAttrCount = SegmentUtils.countBit16(codeFlags);
         int[] codeAttrCounts = decodeBandInt("code_attr_count", in, Codec.UNSIGNED5, codeAttrCount);
         int[][] codeAttrIndexes = decodeBandInt("code_attr_indexes", in, Codec.UNSIGNED5, codeAttrCounts);
         int callCount = 0;
@@ -731,10 +762,6 @@
         return codeMaxStack;
     }
 
-    public int getFieldAttrCount() {
-        return fieldAttrCount;
-    }
-
     public ArrayList[][] getFieldAttributes() {
         return fieldAttributes;
     }
@@ -755,12 +782,30 @@
         return methodDescr;
     }
 
-    public ExceptionsAttribute[][] getMethodExceptions() {
-        return methodExceptions;
-    }
-
     public long[][] getMethodFlags() {
         return methodFlags;
+    }
+
+    /**
+     * Returns null if all classes should use the default major and minor
+     * version or an array of integers containing the major version numberss to
+     * use for each class in the segment
+     * 
+     * @return Class file major version numbers, or null if none specified
+     */
+    public int[] getClassVersionMajor() {
+        return classVersionMajor;
+    }
+
+    /**
+     * Returns null if all classes should use the default major and minor
+     * version or an array of integers containing the minor version numberss to
+     * use for each class in the segment
+     * 
+     * @return Class file minor version numbers, or null if none specified
+     */
+    public int[] getClassVersionMinor() {
+        return classVersionMinor;
     }
 
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java Wed Nov  7 01:51:00 2007
@@ -91,8 +91,7 @@
  * assumes that other combinations of values can result in more specific and
  * efficient formats. There are also a sequence of canonical encodings defined
  * by the Pack200 specification, which allow a codec to be referred to by
- * canonical number. TODO Add links to canonical numbers when this has been
- * done.
+ * canonical number. {@link CodecEncoding#canonicalCodec}) 
  */
 public abstract class Codec {
 	/**

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java Wed Nov  7 01:51:00 2007
@@ -19,7 +19,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.Arrays;
 
 /**
  * Parses the file band headers (not including the actual bits themselves).
@@ -28,7 +27,6 @@
  * remaining in the stream with BYTE1 compression. A decent implementation
  * will probably just stream the bytes out to the reconstituted Jar rather
  * than caching them.
- * 
  */
 public class FileBands extends BandSet {
 
@@ -94,9 +92,8 @@
         fileBits = new byte[numberOfFiles][];
         for (int i = 0; i < numberOfFiles; i++) {
             int size = (int) fileSize[i];
-            // TODO This buggers up if file_size > 2^32. Probably an array is
-            // not the right choice, and
-            // we should just serialize the bugger here?
+            // TODO This breaks if file_size > 2^32. Probably an array is
+            // not the right choice, and we should just serialize it here?
             fileBits[i] = new byte[size];
             for (int j = 0; j < size; j++) {
                 fileBits[i][j] = (byte) Codec.BYTE1.decode(in);

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java Wed Nov  7 01:51:00 2007
@@ -21,17 +21,20 @@
 import java.io.OutputStream;
 
 /**
- *
+ * Pack200 Inner Class Bands
  */
 public class IcBands extends BandSet {
     
-    private int[] icFlags;
+    public static class ICTuple {
 
-    private Object icName;
+        public String C; // this class
+        public int F; // flags
+        public String C2; // outer class
+        public String N; // name
 
-    private String[] icOuterClass;
+    }
 
-    private String[] icThisClass;
+    private ICTuple[] icAll;
 
     private String[] cpUTF8;
 
@@ -59,19 +62,35 @@
      */
     public void unpack(InputStream in) throws IOException,
             Pack200Exception {
+        // Read IC bands
         int innerClassCount = header.getInnerClassCount();
-        icThisClass = parseReferences("ic_this_class", in, Codec.UDELTA5,
+        String[] icThisClass = parseReferences("ic_this_class", in, Codec.UDELTA5,
                 innerClassCount, cpClass);
-        icFlags = decodeBandInt("ic_flags", in, Codec.UNSIGNED5, innerClassCount);
-        int outerClasses = 0;
-        for (int i = 0; i < innerClassCount; i++) {
-            if ((icFlags[i] & 1 << 16) != 0)
-                outerClasses++;
-        }
-        icOuterClass = parseReferences("ic_outer_class", in, Codec.DELTA5,
+        int[] icFlags = decodeBandInt("ic_flags", in, Codec.UNSIGNED5, innerClassCount);
+        int outerClasses = SegmentUtils.countBit16(icFlags);
+        String[] icOuterClass = parseReferences("ic_outer_class", in, Codec.DELTA5,
                 outerClasses, cpClass);
-        icName = parseReferences("ic_name", in, Codec.DELTA5, outerClasses,
+        String[] icName = parseReferences("ic_name", in, Codec.DELTA5, outerClasses,
                 cpUTF8);
+        
+        // Construct IC tuples
+        icAll = new ICTuple[icThisClass.length];
+        int index = 0;
+        for (int i = 0; i < icThisClass.length; i++) {
+            icAll[i] = new ICTuple();
+            icAll[i].C = icThisClass[i];
+            icAll[i].F = icFlags[i];
+            if((icFlags[i] & 1<<16) != 0) {
+                icAll[i].C2 = icOuterClass[index];
+                icAll[i].N = icName[index];
+                index++;
+            }
+        }
+    }
+
+    public ICTuple[] getIcTuples() {
+        return icAll;
     }
 
-}
+  
+}
\ No newline at end of file

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java Wed Nov  7 01:51:00 2007
@@ -18,7 +18,6 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Arrays;
 
 public class PopulationCodec extends Codec {
 	private Codec favouredCodec;
@@ -53,7 +52,7 @@
 
 	
 	public long[] decode(int n, InputStream in) throws IOException, Pack200Exception {
-		long favoured[] =new long[n]; // there must be <= n  values, but probably a lot less
+		long favoured[] = new long[n]; // there must be <= n  values, but probably a lot less
 		long result[];
 		// read table of favorites first
 		long smallest = Long.MAX_VALUE;
@@ -90,8 +89,8 @@
 			}
 		}
 		// read favorites
-		result = tokenCodec.decode(n, in);
-		// read unfavorites
+		result = tokenCodec.decode(n, in);		
+        // read unfavorites
         last = 0;
         for(int i = 0; i < n; i++) {
             int index = (int) result[i];

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java Wed Nov  7 01:51:00 2007
@@ -18,6 +18,7 @@
 
 // TODO Write doc
 public final class SegmentUtils {
+    
 	public static int countArgs(String descriptor) {
 		int bra = descriptor.indexOf("(");
 		int ket = descriptor.indexOf(")");
@@ -50,6 +51,35 @@
 		}
 		return count;
 	}
+    
+    public static int countBit16(int[] flags) {
+        int count = 0;
+        for (int i = 0; i < flags.length; i++) {
+            if ((flags[i] & (1 << 16)) != 0)
+                count++;
+        }
+        return count;
+    }
+    
+    public static int countBit16(long[] flags) {
+        int count = 0;
+        for (int i = 0; i < flags.length; i++) {
+            if ((flags[i] & (1 << 16)) != 0)
+                count++;
+        }
+        return count;
+    }
+    
+    public static int countBit16(long[][] flags) {
+        int count = 0;
+        for (int i = 0; i < flags.length; i++) {
+            for (int j = 0; j < flags[i].length; j++) {
+                if ((flags[i][j] & (1 << 16)) != 0)
+                    count++;
+            }            
+        }
+        return count;
+    }
 
 	public static int countMatches(long[][] flags, IMatcher matcher) {
 		int count = 0;

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutTest.java?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/AttributeLayoutTest.java Wed Nov  7 01:51:00 2007
@@ -19,11 +19,13 @@
 import junit.framework.TestCase;
 
 import org.apache.harmony.pack200.AttributeLayout;
+import org.apache.harmony.pack200.Codec;
 import org.apache.harmony.pack200.Pack200Exception;
 import org.apache.harmony.pack200.Segment;
 import org.apache.harmony.pack200.SegmentConstantPool;
 
 public class AttributeLayoutTest extends TestCase {
+
 	public class TestSegment extends Segment {
 		public SegmentConstantPool getConstantPool() {
 			final Object[][] data = new Object[][] {
@@ -41,6 +43,7 @@
 			};
 		}
 	}
+
 	public void testBadData() {
 		assertTrue(throwsException(null,AttributeLayout.CONTEXT_CLASS,""));
 		assertTrue(throwsException("",AttributeLayout.CONTEXT_CLASS,""));
@@ -51,6 +54,7 @@
 		assertTrue(throwsException("name",-1,""));
 		assertTrue(throwsException("name",1234,""));
 	}
+
 	public void testLayoutRU() throws Pack200Exception {
 		AttributeLayout layout = new AttributeLayout("RU",AttributeLayout.CONTEXT_CLASS,"RU", 1);
 		Segment segment = new TestSegment();
@@ -58,6 +62,7 @@
 		assertEquals("Zero",layout.getValue(0, segment.getConstantPool()));
 		assertEquals("One",layout.getValue(1, segment.getConstantPool()));
 	}
+
 	public void testLayoutRUN() throws Pack200Exception {
 		AttributeLayout layout = new AttributeLayout("RUN",AttributeLayout.CONTEXT_CLASS,"RUN", 1);
 		Segment segment = new TestSegment();
@@ -65,6 +70,7 @@
 		assertEquals("Zero",layout.getValue(1, segment.getConstantPool()));
 		assertEquals("One",layout.getValue(2, segment.getConstantPool()));
 	}
+
 	public void testLayoutRS() throws Pack200Exception {
 		AttributeLayout layout = new AttributeLayout("RS",AttributeLayout.CONTEXT_CLASS,"RS", 1);
 		Segment segment = new TestSegment();
@@ -72,13 +78,30 @@
 		assertEquals("Ein",layout.getValue(0, segment.getConstantPool()));
 		assertEquals("Zwei",layout.getValue(1, segment.getConstantPool()));
 	}
-	public void testLayoutRSN() throws Pack200Exception {
+
+    public void testLayoutRSN() throws Pack200Exception {
 		AttributeLayout layout = new AttributeLayout("RSN",AttributeLayout.CONTEXT_CLASS,"RSN", 1);
 		Segment segment = new TestSegment();
 		assertNull(layout.getValue(0, segment.getConstantPool()));
 		assertEquals("Ein",layout.getValue(1, segment.getConstantPool()));
 		assertEquals("Zwei",layout.getValue(2, segment.getConstantPool()));
 	}
+
+    public void testGetCodec() throws Pack200Exception {
+        AttributeLayout layout = new AttributeLayout("O", AttributeLayout.CONTEXT_CLASS, "HOBS", 1);
+        assertEquals(Codec.BRANCH5, layout.getCodec());
+        layout = new AttributeLayout("P", AttributeLayout.CONTEXT_METHOD, "PIN", 1);
+        assertEquals(Codec.BCI5, layout.getCodec());
+        layout = new AttributeLayout("S", AttributeLayout.CONTEXT_FIELD, "HS", 1);
+        assertEquals(Codec.SIGNED5, layout.getCodec());
+        layout = new AttributeLayout("RS", AttributeLayout.CONTEXT_CODE, "RRRS", 1);
+        assertEquals(Codec.UNSIGNED5, layout.getCodec());
+        layout = new AttributeLayout("KS", AttributeLayout.CONTEXT_CLASS, "RKS", 1);
+        assertEquals(Codec.UNSIGNED5, layout.getCodec());
+        layout = new AttributeLayout("B", AttributeLayout.CONTEXT_CLASS, "TRKSB", 1);
+        assertEquals(Codec.BYTE1, layout.getCodec());
+    }
+
 	public boolean throwsException(String name, int context, String layout) {
 		try {
 			new AttributeLayout(name,context,layout,-1);

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=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/build.xml Wed Nov  7 01:51:00 2007
@@ -128,6 +128,12 @@
                 <exclude name="*${manifest.suffix}"/>
             </fileset>
         </copy>
+        <!-- Copy link exports file on z/OS -->
+        <copy todir="${hy.hdk}/lib" overwrite="yes">
+            <fileset dir="${hy.portlib.src.main.native}/thread/${hy.os.family}">
+                <include name="*${linklib.suffix}" if="is.zos" />
+            </fileset>
+        </copy>
     </target>
 
     <target name="-build-native-thrstub" if="hy.skip.thr">
@@ -140,6 +146,10 @@
                 <include name="*${progdb.suffix}*" if="is.windows" />
                 <exclude name="*${manifest.suffix}"/>
             </fileset>
+            <!-- Copy link exports file on z/OS -->
+            <fileset dir="${hy.portlib.src.main.native}/thrstub/${hy.os.family}">
+                <include name="*${linklib.suffix}" if="is.zos" />
+            </fileset>
         </copy>
     </target>
 
@@ -154,7 +164,12 @@
                 <exclude name="*${manifest.suffix}"/>
             </fileset>
         </copy>
-
+        <!-- Copy link exports file on z/OS -->
+        <copy todir="${hy.hdk}/lib" overwrite="yes">
+            <fileset dir="${hy.portlib.src.main.native}/port/${hy.os.family}">
+                <include name="*${linklib.suffix}" if="is.zos" />
+            </fileset>
+        </copy>
     </target>
 
     <!-- Clean natives -->

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hycomp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hycomp.h?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hycomp.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/shared/hycomp.h Wed Nov  7 01:51:00 2007
@@ -197,6 +197,48 @@
 
 #endif /* defined(WIN32) */
 
+#if defined(ZOS)
+
+#define HY_BIG_ENDIAN
+
+#define DATA_TYPES_DEFINED
+typedef unsigned int   BOOLEAN;
+#if defined (HYS390X)
+typedef unsigned long U_64;
+typedef long I_64;
+#else
+typedef signed long long	I_64;
+typedef unsigned long long	U_64;
+#endif
+
+typedef double				SYS_FLOAT;
+
+#define HYCONST64(x) x##LL
+
+#define NO_LVALUE_CASTING
+#define PLATFORM_LINE_DELIMITER	"\012"
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_STR "/"
+#define PATH_SEPARATOR_STR ":"
+#define LIBPATH_ENV_VAR "LIBPATH"
+
+#define VA_PTR(valist) (&valist[0])
+
+typedef struct {
+#if !defined(HYS390X)
+	char stuff[16];
+#endif
+	char *ada;
+	void (*rawFnAddress)();
+} HyFunctionDescriptor_T;
+
+#define TOC_UNWRAP_ADDRESS(wrappedPointer) (((HyFunctionDescriptor_T *) (wrappedPointer))->rawFnAddress)
+
+#define PLATFORM_DLL_EXTENSION ".so"
+
+#endif /* ZOS */
+
+
 #if !defined(VMCALL)
 #define VMCALL
 #define VMAPICALL

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/unix/hysock.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/unix/hysock.h?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/unix/hysock.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/include/unix/hysock.h Wed Nov  7 01:51:00 2007
@@ -28,11 +28,24 @@
 #include <stdio.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+
+#if !defined(ZOS)
 #include <netinet/tcp.h>
+#else /* !defined(ZOS) */
+#include <netinet/tcp_var.h>
+#endif /* !defined(ZOS) */
+
 #include <netdb.h>
 #include <sys/time.h>
 #include <stdlib.h>
+
+#if !defined(ZOS)
 #include <sys/socketvar.h>
+#else /* !defined(ZOS) */
+#include <arpa/inet.h>
+#include <xti.h>
+#endif /* !defined(ZOS) */
+
 #include "hysocket.h"
 #include "hycomp.h"
 #include "hyport.h"

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyerrorhelpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyerrorhelpers.c?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyerrorhelpers.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyerrorhelpers.c Wed Nov  7 01:51:00 2007
@@ -76,8 +76,13 @@
     }
 
   /* Copy from OS to ptBuffers */
+#if !defined(ZOS)
   strerror_r(errorCode,
              ptBuffers->errorMessageBuffer, ptBuffers->errorMessageBufferSize);
+#else
+  /* Do not have strerror_r on z/OS so use port library function instead */
+  portLibrary->str_printf(portLibrary, ptBuffers->errorMessageBuffer, ptBuffers->errorMessageBufferSize, strerror(errorCode));
+#endif /* ZOS */
   ptBuffers->errorMessageBuffer[ptBuffers->errorMessageBufferSize - 1] = '\0';
   return ptBuffers->errorMessageBuffer;
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyipcmutex.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyipcmutex.c?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyipcmutex.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyipcmutex.c Wed Nov  7 01:51:00 2007
@@ -40,7 +40,7 @@
 #include <errno.h>
 #include "hyport.h"
 
-#if defined(_SEM_SEMUN_UNDEFINED) || defined(AIX)
+#if defined(_SEM_SEMUN_UNDEFINED) || defined(AIX) || defined(ZOS)
 /* arg for semctl semaphore system calls. */
 union semun
 {

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysharedhelper.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysharedhelper.c?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysharedhelper.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hysharedhelper.c Wed Nov  7 01:51:00 2007
@@ -25,7 +25,9 @@
 #define SUCCESS 0
 #define FAILED -1
 
+#if !defined(ZOS)
 #define __errno2() 0
+#endif
 
 static void changeDirectoryPermission (struct HyPortLibrary *portLibrary,
                                        const char *pathname);

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyshsem.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyshsem.h?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyshsem.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/port/unix/hyshsem.h Wed Nov  7 01:51:00 2007
@@ -19,7 +19,7 @@
 #define hyshsem_h
 #include <sys/types.h>
 #include <errno.h>
-#if defined(_SEM_SEMUN_UNDEFINED) || defined(AIX)
+#if defined(_SEM_SEMUN_UNDEFINED) || defined(AIX) || defined(ZOS)
 /* according to X/OPEN we have to define it ourselves */
 union semun
 {
@@ -54,5 +54,7 @@
 #define HYSHSEM_SEMFLAGS_GROUP (IPC_CREAT | IPC_EXCL | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)
 #define HYSHSEM_SEMMARKER 769
 /* for zOS we have a function to get extended error code - useful for debugging */
+#if !defined(ZOS)
 #define __errno2() 0
+#endif /* ZOS */
 #endif /* hyshsem_h */

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=592673&r1=592672&r2=592673&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 Wed Nov  7 01:51:00 2007
@@ -33,13 +33,19 @@
 
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/poll.h>
 #include <sys/socket.h>
 #include <netinet/in.h>         /* for struct in_addr */
 #include <arpa/inet.h>          /* for inet_addr */
 #include <sys/ioctl.h>
 #include <net/if.h>             /* for struct ifconf */
 
+#if !defined(ZOS)
+#include <sys/poll.h>
+#else
+/* On zOS this header file has a different location */
+#include <poll.h>
+#endif
+
 #if defined(LINUX)
 #define IPV6_FLOWINFO_SEND      33
 #if defined(HARDHAT)
@@ -2196,6 +2202,8 @@
                  U_32 * addr)
 {
   I_32 rc = 0;
+
+#if !defined(ZOS)
   struct in_addr in;
   if (inet_aton(addrStr, &in) == 0)
     {
@@ -2206,6 +2214,23 @@
     {
       *addr = in.s_addr;
     }
+
+#else
+  /* on zOS we do not have inet_aton so revert to the previous inet_addr implementation */
+  U_32 val;
+
+  val = inet_addr (addrStr);
+  if (val == -1)
+    {
+      HYSOCKDEBUGPRINT ("<inet_addr failed>\n");
+      rc = HYPORT_ERROR_SOCKET_ADDRNOTAVAIL;
+    }
+  else
+    {
+      *addr = val;
+  }
+#endif
+
   return rc;
 }
 

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=592673&r1=592672&r2=592673&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 Wed Nov  7 01:51:00 2007
@@ -20,7 +20,6 @@
 include $(HY_HDK)/build/make/defines.mk
 
 INCLUDES += -DHYPORT_LIBRARY_DEFINE -I$(HY_PLATFORM)
-CFLAGS += -fpic
 
 BUILDFILES = \
 	$(SHAREDSUB)port_copyright.o hycpu.o $(SHAREDSUB)hyerror.o \

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/sig/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/sig/unix/makefile?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/sig/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/sig/unix/makefile Wed Nov  7 01:51:00 2007
@@ -19,7 +19,6 @@
 
 include $(HY_HDK)/build/make/defines.mk
 
-CFLAGS += -fpic
 BUILDFILES = $(SHAREDSUB)hysig_copyright.o hysiglinux.o hysigunix.o
 MDLLIBFILES =
 DLLNAME = ../libhysig$(HY_SHLIB_SUFFIX)

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/unix/makefile?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thread/unix/makefile Wed Nov  7 01:51:00 2007
@@ -19,8 +19,6 @@
 
 include $(HY_HDK)/build/make/defines.mk
 
-CFLAGS += -fpic
-
 BUILDFILES = \
 	$(SHAREDSUB)thread_copyright.o $(HY_ARCH)/thrhelp.o $(HY_ARCH)/thrspinlock.o \
 	$(SHAREDSUB)hythread.o $(SHAREDSUB)hythreadinspect.o linuxonexit.o priority.o \

Modified: harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thrstub/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thrstub/unix/makefile?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thrstub/unix/makefile (original)
+++ harmony/enhanced/classlib/branches/java6/modules/portlib/src/main/native/thrstub/unix/makefile Wed Nov  7 01:51:00 2007
@@ -19,8 +19,6 @@
 
 include $(HY_HDK)/build/make/defines.mk
 
-CFLAGS += -fpic
-
 BUILDFILES = $(SHAREDSUB)hythread.o
 
 DLLNAME = ../libhythr$(HY_SHLIB_SUFFIX)

Modified: harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/prefs/build.xml Wed Nov  7 01:51:00 2007
@@ -69,6 +69,10 @@
                 <include name="*${progdb.suffix}*" if="is.windows" />
                 <exclude name="*${manifest.suffix}"/>
             </fileset>
+            <!-- Copy link exports file on z/OS -->
+            <fileset dir="${hy.prefs.src.main.native}/prefs/${hy.os.family}">
+                <include name="*${linklib.suffix}*" if="is.zos" />
+            </fileset>
         </copy>
     </target>
 

Modified: harmony/enhanced/classlib/branches/java6/modules/print/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/print/build.xml?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/print/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/print/build.xml Wed Nov  7 01:51:00 2007
@@ -112,6 +112,12 @@
                 <exclude name="*${manifest.suffix}"/>
             </fileset>
         </copy>
+        <!-- Copy link exports file on z/OS -->
+        <copy todir="${hy.hdk}/lib" overwrite="yes">
+            <fileset dir="${hy.print.src.main.native}/print/${hy.os.family}">
+                <include name="*${linklib.suffix}" if="is.zos" />
+            </fileset>
+        </copy>
     </target>
 
     <target name="copy-resources">

Modified: harmony/enhanced/classlib/branches/java6/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/Matcher2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/Matcher2Test.java?rev=592673&r1=592672&r2=592673&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/Matcher2Test.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/Matcher2Test.java Wed Nov  7 01:51:00 2007
@@ -16,203 +16,206 @@
 
 package org.apache.harmony.tests.java.util.regex;
 
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
 import junit.framework.TestCase;
-import java.util.regex.*;
 
 /**
  * Tests Matcher methods
- * 
  */
+@SuppressWarnings("nls")
 public class Matcher2Test extends TestCase {
-	public void test_toString() {
-		Pattern p = Pattern.compile("foo");
-		Matcher m = p.matcher("bar");
-		assertNotNull(m.toString());
-	}
+    public void test_toString() {
+        Pattern p = Pattern.compile("foo");
+        Matcher m = p.matcher("bar");
+        assertNotNull(m.toString());
+    }
 
-	public void testErrorConditions() throws PatternSyntaxException {
+    public void testErrorConditions() throws PatternSyntaxException {
         // Test match cursors in absence of a match
-		Pattern p = Pattern.compile("foo");
-		Matcher m = p.matcher("bar");
-		assertFalse(m.matches());
-
-		try {
-			m.start();
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.end();
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.group();
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.start(1);
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.end(1);
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.group(1);
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-		
-               // regression test for HARMONY-2418
-		try {
-			m.usePattern(null);
-			fail("IllegalArgumentException expected");
-		} catch (IllegalArgumentException e) {
-                 // PASSED
-		}
+        Pattern p = Pattern.compile("foo");
+        Matcher m = p.matcher("bar");
+        assertFalse(m.matches());
+
+        try {
+            m.start();
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.end();
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.group();
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.start(1);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.end(1);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.group(1);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        // regression test for HARMONY-2418
+        try {
+            m.usePattern(null);
+            fail("IllegalArgumentException expected");
+        } catch (IllegalArgumentException e) {
+            // PASSED
+        }
     }
 
     public void testErrorConditions2() throws PatternSyntaxException {
-		// Test match cursors in absence of a match
+        // Test match cursors in absence of a match
         Pattern p = Pattern.compile("(foo[0-9])(bar[a-z])");
         Matcher m = p.matcher("foo1barzfoo2baryfoozbar5");
 
-		assertTrue(m.find());
-		assertEquals(0, m.start());
-		assertEquals(8, m.end());
-		assertEquals(0, m.start(1));
-		assertEquals(4, m.end(1));
-		assertEquals(4, m.start(2));
-		assertEquals(8, m.end(2));
-
-		try {
-			m.start(3);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.end(3);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.group(3);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.start(-1);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.end(-1);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.group(-1);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		assertTrue(m.find());
-		assertEquals(8, m.start());
-		assertEquals(16, m.end());
-		assertEquals(8, m.start(1));
-		assertEquals(12, m.end(1));
-		assertEquals(12, m.start(2));
-		assertEquals(16, m.end(2));
-
-		try {
-			m.start(3);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.end(3);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.group(3);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.start(-1);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.end(-1);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		try {
-			m.group(-1);
-			fail("IndexOutOfBoundsException expected");
-		} catch (IndexOutOfBoundsException e) {
-		}
-
-		assertFalse(m.find());
-
-		try {
-			m.start(3);
-            fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.end(3);
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.group(3);
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.start(-1);
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.end(-1);
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-
-		try {
-			m.group(-1);
-			fail("IllegalStateException expected");
-		} catch (IllegalStateException e) {
-		}
-	}
-    
+        assertTrue(m.find());
+        assertEquals(0, m.start());
+        assertEquals(8, m.end());
+        assertEquals(0, m.start(1));
+        assertEquals(4, m.end(1));
+        assertEquals(4, m.start(2));
+        assertEquals(8, m.end(2));
+
+        try {
+            m.start(3);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.end(3);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.group(3);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.start(-1);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.end(-1);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.group(-1);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        assertTrue(m.find());
+        assertEquals(8, m.start());
+        assertEquals(16, m.end());
+        assertEquals(8, m.start(1));
+        assertEquals(12, m.end(1));
+        assertEquals(12, m.start(2));
+        assertEquals(16, m.end(2));
+
+        try {
+            m.start(3);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.end(3);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.group(3);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.start(-1);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.end(-1);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        try {
+            m.group(-1);
+            fail("IndexOutOfBoundsException expected");
+        } catch (IndexOutOfBoundsException e) {
+        }
+
+        assertFalse(m.find());
+
+        try {
+            m.start(3);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.end(3);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.group(3);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.start(-1);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.end(-1);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+
+        try {
+            m.group(-1);
+            fail("IllegalStateException expected");
+        } catch (IllegalStateException e) {
+        }
+    }
+
     /*
      * Regression test for HARMONY-997
      */
@@ -229,4 +232,3 @@
         }
     }
 }
-



Mime
View raw message