harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r645986 - in /harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200: ./ bytecode/
Date Tue, 08 Apr 2008 16:16:24 GMT
Author: sjanuary
Date: Tue Apr  8 09:15:51 2008
New Revision: 645986

URL: http://svn.apache.org/viewvc?rev=645986&view=rev
Log:
Pack200: Wrote some Javadoc and removed some debug code

Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttrDefinitionBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IMatcher.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcTuple.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/MetadataBandGroup.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/NewAttributeBands.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Pack200Exception.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentConstantPool.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Archive.java
Tue Apr  8 09:15:51 2008
@@ -30,9 +30,9 @@
 import java.util.zip.GZIPInputStream;
 
 /**
- * The Archive class is the main entry point to unpack200. An archive is
- * constructed with either two file names, a pack file and an output file name
- * or two input streams corresponding to the input and the output streams. Then
+ * Archive is the main entry point to unpack200. An archive is constructed with
+ * either two file names, a pack file and an output file name or two input
+ * streams corresponding to the input and the output streams. Then
  * <code>unpack()</code> is called, to unpack the pack200 archive.
  */
 public class Archive {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttrDefinitionBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttrDefinitionBands.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttrDefinitionBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttrDefinitionBands.java
Tue Apr  8 09:15:51 2008
@@ -20,7 +20,8 @@
 import java.io.InputStream;
 
 /**
- *
+ * Attribute definition bands are the set of bands used to define extra
+ * attributes transmitted in the archive.
  */
 public class AttrDefinitionBands extends BandSet {
 
@@ -32,7 +33,7 @@
 
     private AttributeLayoutMap attributeDefinitionMap;
 
-    private String[] cpUTF8;
+    private final String[] cpUTF8;
 
     public AttrDefinitionBands(Segment segment) {
         super(segment);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/AttributeLayout.java
Tue Apr  8 09:15:51 2008
@@ -16,7 +16,10 @@
  */
 package org.apache.harmony.pack200;
 
-
+/**
+ * AttributeLayout defines a layout that describes how an attribute will be
+ * transmitted.
+ */
 public class AttributeLayout implements IMatcher {
 
 	public static final String ACC_ABSTRACT = "ACC_ABSTRACT"; //$NON-NLS-1$
@@ -89,16 +92,16 @@
 	}
 
 
-    private int context;
+    private final int context;
 
-    private int index;
+    private final int index;
 
 	private final String layout;
 
 	private long mask;
 
-    private String name;
-    private boolean isDefault;
+    private final String name;
+    private final boolean isDefault;
     private int backwardsCallCount;
 
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
Tue Apr  8 09:15:51 2008
@@ -23,8 +23,59 @@
 import java.util.List;
 
 /**
- * TODO Comment -- quite a lot can be nicked from Codec, since this was created
- * from it
+ * A BHSD codec is a means of encoding integer values as a sequence of bytes or
+ * vice versa using a specified "BHSD" encoding mechanism. It uses a variable-length encoding
and a modified sign representation
+ * such that small numbers are represented as a single byte, whilst larger
+ * numbers take more bytes to encode. The number may be signed or unsigned; if
+ * it is unsigned, it can be weighted towards positive numbers or equally
+ * distributed using a one's complement. The Codec also supports delta coding,
+ * where a sequence of numbers is represented as a series of first-order
+ * differences. So a delta encoding of the integers [1..10] would be represented
+ * as a sequence of 10x1s. This allows the absolute value of a coded integer to
+ * fall outside of the 'small number' range, whilst still being encoded as a
+ * single byte.
+ *
+ * A BHSD codec is configured with four parameters:
+ * <dl>
+ * <dt>B</dt>
+ * <dd>The maximum number of bytes that each value is encoded as. B must be a
+ * value between [1..5]. For a pass-through coding (where each byte is encoded
+ * as itself, aka {@link #BYTE1}, B is 1 (each byte takes a maximum of 1 byte).</dd>
+ * <dt>H</dt>
+ * <dd>The radix of the integer. Values are defined as a sequence of values,
+ * where value <code>n</code> is multiplied by <code>H^<sup>n</sup></code>.
+ * So the number 1234 may be represented as the sequence 4 3 2 1 with a radix
+ * (H) of 10. Note that other permutations are also possible; 43 2 1 will also
+ * encode 1234. The co-parameter L is defined as 256-H. This is important
+ * because only the last value in a sequence may be &lt; L; all prior values
+ * must be &gt; L.</dd>
+ * <dt>S</dt>
+ * <dd>Whether the codec represents signed values (or not). This may have 3
+ * values; 0 (unsigned), 1 (signed, one's complement) or 2 (signed, two's
+ * complement)</dd>
+ * <dt>D</dt>
+ * <dd>Whether the codec represents a delta encoding. This may be 0 (no delta)
+ * or 1 (delta encoding). A delta encoding of 1 indicates that values are
+ * cumulative; a sequence of <code>1 1 1 1 1</code> will represent the
+ * sequence <code>1 2 3 4 5</code>. For this reason, the codec supports two
+ * variants of decode; one {@link #decode(InputStream, long) with} and one
+ * {@link #decode(InputStream) without} a <code>last</code> parameter. If the
+ * codec is a non-delta encoding, then the value is ignored if passed. If the
+ * codec is a delta encoding, it is a run-time error to call the value without
+ * the extra parameter, and the previous value should be returned. (It was
+ * designed this way to support multi-threaded access without requiring a new
+ * instance of the Codec to be cloned for each use.)
+ * <dt>
+ * </dl>
+ *
+ * Codecs are notated as (B,H,S,D) and either D or S,D may be omitted if zero.
+ * Thus {@link #BYTE1} is denoted (1,256,0,0) or (1,256). The
+ * {@link #toString()} method prints out the condensed form of the encoding.
+ * Often, the last character in the name ({@link #BYTE1}, {@link #UNSIGNED5})
+ * gives a clue as to the B value. Those that start with U ({@link #UDELTA5},
+ * {@link #UNSIGNED5}) are unsigned; otherwise, in most cases, they are signed.
+ * The presence of the word Delta ({@link #DELTA5}, {@link #UDELTA5})
+ * indicates a delta encoding is used.
  *
  */
 public final class BHSDCodec extends Codec {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BandSet.java
Tue Apr  8 09:15:51 2008
@@ -34,6 +34,9 @@
 import org.apache.harmony.pack200.bytecode.CPUTF8;
 import org.apache.harmony.pack200.bytecode.ClassConstantPool;
 
+/**
+ * Abstract superclass for a set of bands
+ */
 public abstract class BandSet {
 
     public abstract void unpack(InputStream inputStream) throws IOException, Pack200Exception;
@@ -55,8 +58,8 @@
      *            purposes)
      * @param in
      *            the InputStream to decode from
-     * @param defaultCodec
-     *            the default codec for this band
+     * @param codec
+     *            the default Codec for this band
      * @param count
      *            the number of elements to read
      * @return an array of decoded <code>int</code> values
@@ -314,8 +317,6 @@
                 index++;
             }
         }
-
-        segment.log(Segment.LOG_LEVEL_VERBOSE, "Parsed *" + name + " (" + result.length +
")");
         return result;
     }
 
@@ -331,18 +332,17 @@
      * @param in
      *            the input stream to read from
      * @param codec
-     *            the codec to use for decoding
+     *            the BHSDCodec to use for decoding
      * @param count
      *            the number of references to decode
      * @param reference
-     *            the array of values to use for the indexes; often
-     *            {@link #cpUTF8}
+     *            the array of values to use for the references
      *
      * @throws IOException
      *             if a problem occurs during reading from the underlying stream
      * @throws Pack200Exception
      *             if a problem occurs with an unexpected value or unsupported
-     *             codec
+     *             Codec
      */
     public String[] parseReferences(String name, InputStream in,
             BHSDCodec codec, int count, String[] reference) throws IOException,
@@ -364,18 +364,17 @@
      * @param in
      *            the input stream to read from
      * @param codec
-     *            the codec to use for decoding
-     * @param count
-     *            the number of references to decode
+     *            the BHSDCodec to use for decoding
+     * @param counts
+     *            the numbers of references to decode for each array entry
      * @param reference
-     *            the array of values to use for the indexes; often
-     *            {@link #cpUTF8}
+     *            the array of values to use for the references
      *
      * @throws IOException
      *             if a problem occurs during reading from the underlying stream
      * @throws Pack200Exception
      *             if a problem occurs with an unexpected value or unsupported
-     *             codec
+     *             Codec
      */
     public String[][] parseReferences(String name, InputStream in,
             BHSDCodec codec, int counts[], String[] reference)

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/BcBands.java
Tue Apr  8 09:15:51 2008
@@ -31,7 +31,7 @@
 import org.apache.harmony.pack200.bytecode.OperandManager;
 
 /**
- * Pack200 Bytecode bands
+ * Bytecode bands
  */
 public class BcBands extends BandSet {
 
@@ -66,7 +66,7 @@
     private int[][] bcEscByte;
 
     /**
-     * @param header
+     * @param segment
      */
     public BcBands(Segment segment) {
         super(segment);
@@ -289,7 +289,6 @@
             }
         }
         // other bytecode bands
-       segment.log(Segment.LOG_LEVEL_VERBOSE, "Parsed *bc_codes (" + bcParsed + ")");
         bcCaseCount = decodeBandInt("bc_case_count", in, Codec.UNSIGNED5, bcCaseCountCount);
         int bcCaseValueCount = 0;
         for (int i = 0; i < bcCaseCount.length; i++) {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/ClassBands.java
Tue Apr  8 09:15:51 2008
@@ -39,7 +39,7 @@
 import org.apache.harmony.pack200.bytecode.SourceFileAttribute;
 
 /**
- * Pack200 Class Bands
+ * Class Bands
  */
 public class ClassBands extends BandSet {
 

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java
Tue Apr  8 09:15:51 2008
@@ -20,78 +20,16 @@
 import java.io.InputStream;
 
 /**
- * A codec allows a sequence of bytes to be decoded into integer values (or vice
- * versa). It uses a variable-length encoding and a modified sign representation
- * such that small numbers are represented as a single byte, whilst larger
- * numbers take more bytes to encode. The number may be signed or unsigned; if
- * it is unsigned, it can be weighted towards positive numbers or equally
- * distributed using a one's complement. The codec also supports delta coding,
- * where a sequence of numbers is represented as a series of first-order
- * differences. So a delta encoding of the integers [1..10] would be represented
- * as a sequence of 10x1s. This allows the absolute value of a coded integer to
- * fall outside of the 'small number' range, whilst still being encoded as a
- * single byte.
+ * A Codec allows a sequence of bytes to be decoded into integer values (or vice
+ * versa).
  *
- * A codec is configured with four parameters:
- * <dl>
- * <dt>B</dt>
- * <dd>The maximum number of bytes that each value is encoded as. B must be a
- * value between [1..5]. For a pass-through coding (where each byte is encoded
- * as itself, aka {@link #BYTE1}, B is 1 (each byte takes a maximum of 1 byte).</dd>
- * <dt>H</dt>
- * <dd>The radix of the integer. Values are defined as a sequence of values,
- * where value <code>n</code> is multiplied by <code>H^<sup>n</sup></code>.
- * So the number 1234 may be represented as the sequence 4 3 2 1 with a radix
- * (H) of 10. Note that other permutations are also possible; 43 2 1 will also
- * encode 1234. The co-parameter L is defined as 256-H. This is important
- * because only the last value in a sequence may be &lt; L; all prior values
- * must be &gt; L.</dd>
- * <dt>S</dt>
- * <dd>Whether the codec represents signed values (or not). This may have 3
- * values; 0 (unsigned), 1 (signed, ones complement) or 2 (signed, but not sure
- * what the difference is) TODO Update documentation when I know what the
- * difference is</dd>
- * <dt>D</dt>
- * <dd>Whether the codec represents a delta encoding. This may be 0 (no delta)
- * or 1 (delta encoding). A delta encoding of 1 indicates that values are
- * cumulative; a sequence of <code>1 1 1 1 1</code> will represent the
- * sequence <code>1 2 3 4 5</code>. For this reason, the codec supports two
- * variants of decode; one {@link #decode(InputStream, long) with} and one
- * {@link #decode(InputStream) without} a <code>last</code> parameter. If the
- * codec is a non-delta encoding, then the value is ignored if passed. If the
- * codec is a delta encoding, it is a run-time error to call the value without
- * the extra parameter, and the previous value should be returned. (It was
- * designed this way to support multi-threaded access without requiring a new
- * instance of the Codec to be cloned for each use.)
- * <dt>
- * </dl>
- *
- * Codecs are notated as (B,H,S,D) and either D or S,D may be omitted if zero.
- * Thus {@link #BYTE1} is denoted (1,256,0,0) or (1,256). The
- * {@link #toString()} method prints out the condensed form of the encoding.
- * Often, the last character in the name ({@link #BYTE1}, {@link #UNSIGNED5})
- * gives a clue as to the B value. Those that start with U ({@link #UDELTA5},
- * {@link #UNSIGNED5}) are unsigned; otherwise, in most cases, they are signed.
- * The presence of the word Delta ({@link #DELTA5}, {@link #UDELTA5})
- * indicates a delta encoding is used.
- *
- * This codec is really quite cool for storing compressed information, and could
- * be used entirely separately from the Pack200 implementation for efficient
- * transfer of integer data if required.
- *
- * Note that all information is byte-oriented; for decoding float/double
- * information, the bit values are converted (not cast) into a long type. Note
- * that long values are used throughout even though most may be cast to ints;
- * this is primarily to avoid having to worry about signed values, even if it
- * would be more efficient to do so.
- *
- * There are a number of standard codecs ({@link #UDELTA5}, {@link #UNSIGNED5},
+ * There are a number of standard Codecs ({@link #UDELTA5}, {@link #UNSIGNED5},
  * {@link #BYTE1}, {@link #CHAR3}) that are used in the implementation of many
  * bands; but there are a variety of other ones, and indeed the specification
  * 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. {@link CodecEncoding#canonicalCodec})
+ * by the Pack200 specification, which allow a Codec to be referred to by
+ * canonical number. {@link CodecEncoding#getCodec(int, InputStream, Codec)})
  */
 public abstract class Codec {
     /**

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CodecEncoding.java
Tue Apr  8 09:15:51 2008
@@ -20,6 +20,9 @@
 import java.io.IOException;
 import java.io.InputStream;
 
+/**
+ * CodecEncoding is used to get the right Codec for a given meta-encoding
+ */
 public class CodecEncoding {
 
 	/**
@@ -87,11 +90,12 @@
 	 * Since the values from this are consumed and not repeated, the input stream
 	 * should be reused for subsequent encodings. This does not therefore close
 	 * the input stream.
+	 *
 	 * @param value the canonical encoding value
 	 * @param in the input stream to read additional byte headers from
 	 * @param defaultCodec TODO
 	 * @return the corresponding codec, or <code>null</code> if the default should
be used
-	 * @throws IOException
+	 *
 	 * @throws IOException if there is a problem reading from the input stream (which
 	 * in reality, is never, since the band_headers are likely stored in a byte array
 	 * and accessed via a ByteArrayInputStream. However, an EOFException could occur

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
Tue Apr  8 09:15:51 2008
@@ -31,6 +31,9 @@
 import org.apache.harmony.pack200.bytecode.CPUTF8;
 import org.apache.harmony.pack200.bytecode.ClassConstantPool;
 
+/**
+ * Constant Pool bands
+ */
 public class CpBands extends BandSet {
 
     public SegmentConstantPool getConstantPool() {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/FileBands.java
Tue Apr  8 09:15:51 2008
@@ -39,12 +39,12 @@
 
     private long[] fileSize;
 
-    private String[] cpUTF8;
+    private final String[] cpUTF8;
 
     private InputStream in;
 
     /**
-     * @param header
+     * @param segment
      */
     public FileBands(Segment segment) {
         super(segment);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IMatcher.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IMatcher.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IMatcher.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IMatcher.java
Tue Apr  8 09:15:51 2008
@@ -16,6 +16,9 @@
  */
 package org.apache.harmony.pack200;
 
+/**
+ * Interface for a class that can perform matching on flag values.
+ */
 public interface IMatcher {
 
 	public abstract boolean matches(long value);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcBands.java
Tue Apr  8 09:15:51 2008
@@ -26,9 +26,10 @@
 import org.apache.harmony.pack200.bytecode.ClassConstantPool;
 
 /**
- * Pack200 Inner Class Bands
+ * Inner Class Bands
  */
 public class IcBands extends BandSet {
+
     private IcTuple[] icAll;
 
     private final String[] cpUTF8;
@@ -36,7 +37,7 @@
     private final String[] cpClass;
 
     /**
-     * @param header
+     * @param segment
      */
     public IcBands(Segment segment) {
         super(segment);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcTuple.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcTuple.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcTuple.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/IcTuple.java
Tue Apr  8 09:15:51 2008
@@ -18,6 +18,14 @@
 
 import java.util.ArrayList;
 
+/**
+ * An IcTuple is the set of information that describes an inner class.
+ *
+ * C is the fully qualified class name<br>
+ * F is the flags<br>
+ * C2 is the outer class name, or null if it can be inferred from C<br>
+ * N is the inner class name, or null if it can be inferred from C<br>
+ */
 public class IcTuple {
 
     public IcTuple(String C, int F, String C2, String N) {
@@ -56,7 +64,6 @@
      * Answer true if the receiver is predicted;
      * answer false if the receiver is specified
      * explicitly in the outer and name fields.
-     * @return
      */
     public boolean predicted() {
         return predictOuter || predictSimple;
@@ -64,8 +71,6 @@
 
     /**
      * Break the receiver into components at $ boundaries.
-     *
-     * @return
      */
     public String[] innerBreakAtDollar(String className) {
         ArrayList resultList = new ArrayList();

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/MetadataBandGroup.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/MetadataBandGroup.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/MetadataBandGroup.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/MetadataBandGroup.java
Tue Apr  8 09:15:51 2008
@@ -36,12 +36,12 @@
 import org.apache.harmony.pack200.bytecode.RuntimeVisibleorInvisibleParameterAnnotationsAttribute.ParameterAnnotation;
 
 /**
- * Group of metadata bands, e.g. class_RVA_bands, method_AD_bands etc
+ * A group of metadata bands, such as class_RVA_bands, method_AD_bands etc.
  */
 public class MetadataBandGroup {
 
-    private String type;
-    private CpBands cpBands;
+    private final String type;
+    private final CpBands cpBands;
 
     public MetadataBandGroup(String type, CpBands cpBands) {
         this.type = type;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/NewAttributeBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/NewAttributeBands.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/NewAttributeBands.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/NewAttributeBands.java
Tue Apr  8 09:15:51 2008
@@ -104,7 +104,6 @@
 
     /**
      * Tokenise the layout into AttributeElements
-     * @return a List of AttributeElements
      * @throws IOException
      */
     private void parseLayout() throws IOException {
@@ -798,9 +797,8 @@
     }
 
     /**
-     * Returns the codec that should be used for the given layout element
+     * Returns the {@link BHSDCodec} that should be used for the given layout element
      * @param layoutElement
-     * @return
      */
     public BHSDCodec getCodec(String layoutElement) {
         if (layoutElement.indexOf("O") >= 0) { //$NON-NLS-1$

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Pack200Exception.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Pack200Exception.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Pack200Exception.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Pack200Exception.java
Tue Apr  8 09:15:51 2008
@@ -39,7 +39,7 @@
 	 * @param message
 	 *            the text message to display
 	 * @param cause
-	 *            the throwable that caused this problem
+	 *            the {@link Throwable} that caused this problem
 	 */
 	public Pack200Exception(String message, Throwable cause) {
 		super(message, cause);
@@ -49,7 +49,7 @@
 	 * Create a new Pack200 exception with the given message and cause
 	 *
 	 * @param cause
-	 *            the throwable that caused this problem
+	 *            the {@link Throwable} that caused this problem
 	 */
 	public Pack200Exception(Throwable cause) {
 		super(cause);

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/PopulationCodec.java
Tue Apr  8 09:15:51 2008
@@ -19,7 +19,14 @@
 import java.io.IOException;
 import java.io.InputStream;
 
+/**
+ * A PopulationCodec is a Codec that is well suited to encoding data that shows
+ * statistical or repetetive patterns, containign for example a few numbers
+ * which are repeated a lot throughout the set, but not necessarily
+ * sequentially.
+ */
 public class PopulationCodec extends Codec {
+
     private final Codec favouredCodec;
     private Codec tokenCodec;
     private final Codec unvafouredCodec;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/Segment.java
Tue Apr  8 09:15:51 2008
@@ -41,18 +41,13 @@
 import org.apache.harmony.pack200.bytecode.SourceFileAttribute;
 
 /**
- * A Pack200 archive consists of one (or more) segments. Each segment is
- * standalone, in the sense that every segment has the magic number header;
+ * A Pack200 archive consists of one or more segments. Each segment is
+ * stand-alone, in the sense that every segment has the magic number header;
  * thus, every segment is also a valid archive. However, it is possible to
  * combine (non-GZipped) archives into a single large archive by concatenation
  * alone. Thus all the hard work in unpacking an archive falls to understanding
  * a segment.
  *
- * This class implements the Pack200 specification by an entry point ({@link #parse(InputStream)})
- * which in turn delegates to a variety of other parse methods. Each parse
- * method corresponds (roughly) to the name of the bands in the Pack200
- * specification.
- *
  * The first component of a segment is the header; this contains (amongst other
  * things) the expected counts of constant pool entries, which in turn defines
  * how many values need to be read from the stream. Because values are variable
@@ -201,9 +196,7 @@
 
 		// add inner class attribute (if required)
 		boolean addInnerClassesAttr = false;
-        String debugClass = getClassBands().getClassThis()[classNum];
-        log(LOG_LEVEL_VERBOSE, "Building the class file for: " + debugClass);
-		IcTuple[] ic_local = getClassBands().getIcLocal()[classNum];
+        IcTuple[] ic_local = getClassBands().getIcLocal()[classNum];
 		boolean ic_local_sent = false;
 		if(ic_local != null) {
 		    ic_local_sent = true;
@@ -261,11 +254,6 @@
 		}
 		// sort CP according to cp_All
 		cp.resolve(this);
-		// print out entries
-		log(LOG_LEVEL_VERBOSE, "Constant pool looks like:");
-		for (i = 1; i <= cp.size(); i++) {
-			log(LOG_LEVEL_VERBOSE, String.valueOf(i) + ":" + String.valueOf(cp.get(i)));
-		}
 		// NOTE the indexOf is only valid after the cp.resolve()
 		// build up remainder of file
 		classFile.accessFlags = (int) classBands.getClassFlags()[classNum];
@@ -387,12 +375,10 @@
 	 *
 	 * @param out
 	 *            the JarOutputStream to write data to
-	 * @param in
-	 *            the same InputStream that was used to parse the segment
 	 * @throws IOException
-	 *             if an error occurs whilst reading or writing to the streams
+	 *             if an error occurs while reading or writing to the streams
 	 * @throws Pack200Exception
-	 *             if an error occurs whilst unpacking data
+	 *             if an error occurs while processing data
 	 */
 	public void writeJar(JarOutputStream out)
 			throws IOException, Pack200Exception {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentConstantPool.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentConstantPool.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentConstantPool.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentConstantPool.java
Tue Apr  8 09:15:51 2008
@@ -22,6 +22,10 @@
 import org.apache.harmony.pack200.bytecode.ClassConstantPool;
 import org.apache.harmony.pack200.bytecode.ConstantPoolEntry;
 
+/**
+ * SegmentConstantPool manages the constant pool used for re-creating class
+ * files.
+ */
 public class SegmentConstantPool {
 
     private final CpBands bands;

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java
Tue Apr  8 09:15:51 2008
@@ -21,6 +21,9 @@
 import java.io.IOException;
 import java.io.InputStream;
 
+/**
+ * SegmentHeader is the header band of a {@link Segment}
+ */
 public class SegmentHeader {
 
     private int archiveMajor;
@@ -83,7 +86,7 @@
      * get their inspiration from ...
      */
     private static final int[] magic = { 0xCA, 0xFE, 0xD0, 0x0D };
-    
+
     public SegmentHeader(Segment segment) {
 		this.segment = segment;
 	}

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentUtils.java
Tue Apr  8 09:15:51 2008
@@ -16,7 +16,9 @@
  */
 package org.apache.harmony.pack200;
 
-// TODO Write doc
+/**
+ * Utility class for unpack200
+ */
 public final class SegmentUtils {
 
 	public static int countArgs(String descriptor) {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java?rev=645986&r1=645985&r2=645986&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/pack200/bytecode/ByteCode.java
Tue Apr  8 09:15:51 2008
@@ -139,7 +139,6 @@
 		}
 	}
 
-
 	/**
 	 * Given an array of ints which correspond to bytes in the
 	 * operand of the bytecode, set the rewrite bytes of the
@@ -314,7 +313,7 @@
      * up to point to the absolute position in the CodeAttribute
      * array. This method sets the targets.
      *
-     * @param byteCodeTarget int index in array
+     * @param byteCodeTargets int index in array
      */
     public void setByteCodeTargets(int[] byteCodeTargets) {
         this.byteCodeTargets = byteCodeTargets;



Mime
View raw message