# US 6,732,108 B2 · Class file archives with reduced data volume

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 6,732,108 B2
- Document ID: US6732108B2
- Status: Granted
- Kind: B2
- Application number: 09/902,732
- Filed: 2001-07-12
- Published: 2003-02-13
- Granted: 2004-05-04
- Earliest claimed: 2001-07-12
- Assignees: International Business Machines Corporation
- Inventors: Michael Factor; Avi Teperman; Matt Greenwood
- Web page: https://patentgrep.com/patent/US6732108B2

## CPC

- G06F 9/445: Program loading or initiating (bootstrapping G06F9/4401; security arrangements for program loading or initiating G06F21/57)
- Y10S 707/99931: Database or file accessing
- Y10S 707/99937: Sorting
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

A method for packaging program resources includes collecting a set of the program resources that comprises a plurality of object files, which contain data structures having entries that are constants and methods that reference the entries. The data structures in at least some of the object files are combined into a common data pool, in which semantically-identical entries in different ones of the files are represented by a single consolidated entry, irrespective of whether the entries in the different files are syntactically identical. The set of the program resources is packaged together with the common data pool in a combined output file.

## Claims

### Claim 1

A method for packaging program resources, comprising:
collecting a set of the program resources that comprises a plurality of object files, which contain data structures having entries that are constants and methods that reference the entries;
combining the data structures in at least some of the object files into a common data pool, in which semantically-identical entries in different ones of the files are represented by a single consolidated entry, irrespective of whether the entries in the different files are syntactically identical; and
packaging the set of the program resources together with the common data pool in a combined output file.

### Claim 2 (depends on 1)

A method according to claim 1, wherein the object files comprise class files, and wherein the class files comprise respective constant pools containing the data structures.

### Claim 3 (depends on 2)

A method according to claim 2, wherein combining the data structures comprises consolidating substantially all of the data structures in the constant pools of all of the object files into the common pool, and removing substantially all of the data structures from all of the object files before packaging the object files in the combined output file.

### Claim 4 (depends on 1)

A method according to claim 1, wherein the object files comprise executable code, and wherein combining the data structures comprises scanning the code to identify the entries in the different files that are semantically identical.

### Claim 5 (depends on 4)

A method according to claim 4, wherein scanning the code comprises finding first and second ones of the entries in the different files that reference a common element in one of the files in the set, while the first and second entries themselves are different, first and second constants.

### Claim 6 (depends on 1)

A method according to claim 1, wherein combining the data structures comprises modifying the references to the semantically-identical entries so as to refer to the consolidated entry in the common data pool.

### Claim 7 (depends on 1)

A method according to claim 1, wherein packaging the set of the program resources comprises adding a program mechanism to the set which, when read by a computer receiving the packaged set of program resources, causes the computer to reconstruct the data structures in the object files from the common data pool.

### Claim 8 (depends on 1)

A method according to claim 1, wherein packaging the set of the program resources comprises compressing the resources in the output file.

### Claim 9

A method for generating an archive file, comprising:
assembling a set of program resources that comprise a plurality of class files containing methods and respective constant pools;
combining the constant pools of the class files into a global constant pool, in which semantically-identical entries in the constant pools of different ones of the class files are represented by a single consolidated entry, irrespective of whether the entries in the different class files are syntactically identical; and
packaging the set of the program resources together with the common data pool in the archive file.

### Claim 10 (depends on 9)

A method according to claim 9, wherein the class files comprise Java classes, and wherein the archive file comprises a Java Archive (JAR) file.

### Claim 11 (depends on 10)

A method according to claim 10, wherein packaging the set of the program resources comprises creating the JAR file in such a manner that a standard Java Virtual Machine can, substantially without modification, open the JAR file and invoke the methods in the class files that are packaged therein.

### Claim 12 (depends on 9)

A method according to claim 9, wherein combining the constant pools comprises consolidating substantially all of the constant pools of all of the class files into the global constant pool.

### Claim 13 (depends on 12)

A method according to claim 12, wherein consolidating substantially all of the constant pools comprises creating the global constant pool in one of the class files, and removing the constant pools from all of the other class files before packaging the class files in the archive file.

### Claim 14 (depends on 13)

A method according to claim 13, wherein assembling the set of program resources comprises collecting the program resources needed to run an applet, and wherein creating the global constant pool in one of the class files comprises specifying the one of the class files that is first invoked among the class files in order to run the applet, and creating the global constant pool in the specified class file.

### Claim 15 (depends on 9)

A method according to claim 9, wherein the class files comprise byte code, and wherein combining the constant pools comprises scanning the byte code to identify the entries in the constant pools of the different files that are semantically identical.

### Claim 16 (depends on 9)

A method according to claim 9, wherein packaging the set of the program resources comprises adding a program mechanism to the set which, when read by a computer receiving the packaged set of program resources, causes the computer to reconstruct the constant pools of the class files from the global constant pool.

### Claim 17 (depends on 9)

A method according to claim 9, and comprising compressing the archive file.

### Claim 18

A method for packaging program resources, comprising:
assembling a set of the program resources that comprises a plurality of class files containing methods and constant pools, which comprise data structures having entries that are constants;
consolidating at least a portion of the constant pools of the class files into a single, common pool;
adding to the set of resources a program mechanism which, when read by a computer receiving the class files with the single, common pool, causes the computer to reconstruct the constant pools in the class files from the common pool; and
packaging the set of the program resources, including the common pool and the program mechanism, in a combined output file,
wherein assembling the set of program resources comprises collecting the program resources needed to run an application, and wherein adding the program mechanism comprises providing the mechanism so that the computer will reconstruct the constant pools during a process of installation of the application on the computer.

### Claim 19

A method for packaging program resources, comprising:
assembling a set of the program resources that comprises a plurality of class files containing methods and constant pools, which comprise data structures having entries that are constants;
consolidating at least a portion of the constant pools of the class files into a single, common pool;
adding to the set of resources a program mechanism which, when read by a computer receiving the class files with the single, common pool, causes the computer to reconstruct the constant pools in the class files from the common pool; and
packaging the set of the program resources, including the common pool and the program mechanism, in a combined output file,
wherein assembling the set of program resources comprises collecting the program resources needed to run an applet, and wherein adding the program mechanism comprises providing the mechanism so that the computer will reconstruct the constant pools during a process of initializing the applet.

### Claim 20 (depends on 19)

A method according to claim 19, wherein adding the mechanism comprises adding the mechanism to one of the classes that is first to be loaded by the computer when it runs the applet.

### Claim 21 (depends on 20)

A method according to claim 20, wherein adding the mechanism comprises providing an initialization method in the class that is the first to be loaded, such that the initialization method engenders reconstruction of the constant pools.

### Claim 22 (depends on 21)

A method according to claim 21, wherein providing the initialization method comprises adding a wrapper class containing the initialization method to the program resources needed to run the applet, and configuring the set of the program resources so that the wrapper class is the first to be loaded.

### Claim 23 (depends on 19)

A method according to claim 19, wherein the class files comprise Java classes, and wherein the archive file comprises a Java Archive (JAR) file.

### Claim 24 (depends on 23)

A method according to claim 23, wherein adding the mechanism comprises providing the mechanism in the JAR file in such a manner as to enable a standard Java Virtual Machine, substantially without modification, to open the JAR file and invoke the methods in the class files that are packaged therein.

### Claim 25

Apparatus for packaging program resources, comprising an archive processor, which is arranged to collect a set of the program resources that comprises a plurality of object files, which contain data structures having entries that are constants and methods that reference the entries, to combine the data structures in at least some of the object files into a common data pool, in which semantically-identical entries in different ones of the files are represented by a single consolidated entry, irrespective of whether the entries in the different files are syntactically identical, and to package the set of the program resources together with the common data pool in a combined output file.

### Claim 26 (depends on 25)

Apparatus according to claim 25, wherein the object files comprise class files, and wherein the class files comprise respective constant pools containing the data structures.

### Claim 27 (depends on 26)

Apparatus according to claim 26, wherein the processor is arranged to consolidate substantially all of the data structures in the constant pools of all of the object files into the common pool, and to remove substantially all of the data structures from all of the object files before packaging the object files in the combined output file.

### Claim 28 (depends on 25)

Apparatus according to claim 25, wherein the object files comprise executable code, and wherein the processor is arranged to scan the code so as to identify the entries in the different files that are semantically identical.

### Claim 29 (depends on 28)

Apparatus according to claim 28, wherein the processor is arranged to identify semantically-identical entries by finding first and second ones of the entries in the different files that reference a common element in one of the files in the set, while the first and second entries themselves are different, first and second constants.

### Claim 30 (depends on 25)

Apparatus according to claim 25, wherein the processor is arranged to modify the references to the semantically-identical entries so as to refer to the consolidated entry in the common data pool.

### Claim 31 (depends on 25)

Apparatus according to claim 25, wherein the processor is arranged to add a program mechanism to the set which, when read by a computer receiving the packaged set of program resources, causes the computer to reconstruct the data structures in the object files from the common data pool.

### Claim 32 (depends on 25)

Apparatus according to claim 25, wherein the processor is arranged to compress the resources in the output file.

### Claim 33

Apparatus for generating an archive file, comprising an archive processor, which is arranged to assemble a set of program resources that comprise a plurality of class files containing methods and respective constant pools, to combine the constant pools of the class files into a global constant pool, in which semantically-identical entries in the constant pools of different ones of the class files are represented by a single consolidated entry, irrespective of whether the entries in the different class files are syntactically identical, and to package the set of the program resources together with the common data pool in the archive file.

### Claim 34 (depends on 33)

Apparatus according to claim 33, wherein the class files comprise Java classes, and wherein the archive file comprises a Java Archive (JAR) file.

### Claim 35 (depends on 34)

Apparatus according to claim 34, wherein the processor is arranged to create the JAR file in such a manner that a standard Java Virtual Machine can, substantially without modification, open the JAR file and invoke the methods in the class files that are packaged therein.

### Claim 36 (depends on 33)

Apparatus according to claim 33, wherein the processor is arranged to consolidate substantially all of the constant pools of all of the class files into the global constant pool.

### Claim 37 (depends on 36)

Apparatus according to claim 36, wherein the processor is arranged to create the global constant pool in one of the class files, and to remove the constant pools from all of the other class files before packaging the class files in the archive file.

### Claim 38 (depends on 37)

Apparatus according to claim 37, wherein the set of program resources comprises the program resources needed to run an applet, and wherein the processor is arranged to create the global constant pool in the one of the class files that is first invoked among the class files in order to run the applet.

### Claim 39 (depends on 33)

Apparatus according to claim 33, wherein the class files comprise byte code, and wherein the processor is arranged to scan the byte code to identify the entries in the constant pools of the different files that are semantically identical.

### Claim 40 (depends on 33)

Apparatus according to claim 33, wherein the processor is arranged to add a program mechanism to the set which, when read by a computer receiving the packaged set of program resources, causes the computer to reconstruct the constant pools of the class files from the global constant pool.

### Claim 41 (depends on 33)

Apparatus according to claim 33, wherein the processor is arranged to compress the archive file.

### Claim 42

Apparatus for packaging program resources, comprising an archive processor, which is arranged to assemble a set of the program resources that comprises a plurality of class files containing methods and constant pools, which comprise data structures having entries that are constants, to consolidate at least a portion of the constant pools of the class files into a single, common pool, to add to the set of resources of program mechanism which, when read by a computer receiving the class files with the single, common pool, causes the computer to reconstruct the constant pools in the class files from the common pool, and to package the set of the program resources, including the common pool and the program mechanism, in a combined output file,
wherein the set of program resources comprises the program resources needed to run an application, and wherein the processor is arranged to provide the mechanism so that the computer will reconstruct the constant pools during a process of installation of the application on the computer.

### Claim 43

Apparatus for packaging program resources, comprising an archive processor, which is arranged to assemble a set of the program resources that comprises a plurality of class files containing methods and constant pools, which comprise data structures having entries that are constants, to consolidate at least a portion of the constant pools of the class files into a single, common pool, to add to the set of resources of program mechanism which, when read by a computer receiving the class files with the single, common pool, causes the computer to reconstruct the constant pools in the class files from the common pool, and to package the set of the program resources, including the common pool and the program mechanism, in a combined output file,
wherein the set of program resources comprises the program resources needed to run an applet, and wherein the processor is arranged to provide the mechanism so that the computer will reconstruct the constant pools during a process of running the applet.

### Claim 44 (depends on 43)

Apparatus according to claim 43, wherein the processor is arranged to add the mechanism to one of the classes that is first to be loaded by the computer when it runs the applet.

### Claim 45 (depends on 44)

Apparatus according to claim 44, wherein the mechanism comprises an initialization method in the class that is the first to be loaded, such that the initialization method engenders reconstruction of the constant pools.

### Claim 46 (depends on 45)

Apparatus according to claim 45, wherein the processor is arranged to add a wrapper class containing the initialization method to the program resources needed to run the applet, and to configure the set of the program resources so that the wrapper class is the first to be loaded.

### Claim 47 (depends on 43)

Apparatus according to claim 43, wherein the class files comprise Java classes, and wherein the archive file comprises a Java Archive (JAR) file.

### Claim 48 (depends on 47)

Apparatus according to claim 47, wherein the mechanism is provided in the JAR file in such a manner as to enable a standard Java Virtual Machine, substantially without modification, to open the JAR file and invoke the methods in the class files that are packaged therein.

### Claim 49

A computer program product for packaging program resources, the product comprising a computer-readable medium in which program instructions are stored, which instructions, when read by a computer, cause the computer to collect a set of the program resources that comprises a plurality of object files, which contain data structures having entries that are constants and methods that reference the entries, to combine the data structures in at least some of the object files into a common data pool, in which semantically-identical entries in different ones of the files are represented by a single consolidated entry, irrespective of whether the entries in the different files are syntactically-identical, and to package the set of the program resources together with the common data pool in a combined output file.

### Claim 50 (depends on 49)

A product according to claim 49, wherein the object files comprise class files, and wherein the class files comprise respective constant pools containing the data structures.

### Claim 51 (depends on 50)

A product according to claim 50, wherein the instructions cause the computer to consolidate substantially all of the data structures in the constant pools of all of the object files into the common pool, and to remove substantially all of the data structures from all of the object files before packaging the object files in the combined output file.

### Claim 52 (depends on 49)

A product according to claim 49, wherein the object files comprise executable code, and wherein the instructions cause the computer to scan the code so as to identify the entries in the different files that are semantically identical.

### Claim 53 (depends on 52)

A product according to claim 52, wherein the instructions cause the computer to identify semantically-identical entries by finding first and second ones of the entries in the different files that reference a common element in one of the files in the set, while the first and second entries themselves are different, first and second constants.

### Claim 54 (depends on 49)

A product according to claim 49, wherein the instructions cause the computer to modify the references to the semantically-identical entries so as to refer to the consolidated entry in the common data pool.

### Claim 55 (depends on 49)

A product according to claim 49, wherein the instructions cause the computer to add a program mechanism to the set which, when read by a client computer receiving the packaged set of program resources, causes the client computer to reconstruct the data structures in the object files from the common data pool.

### Claim 56 (depends on 49)

A product according to claim 49, wherein the instructions cause the computer to compress the resources in the output file.

### Claim 57

A computer program product for generating an archive file, the product comprising a computer-readable medium in which program instructions are stored, which instructions, when read by a computer, cause the computer to assemble a set of program resources that comprise a plurality of class files containing methods and respective constant pools, to combine the constant pools of the class files into a global constant pool, in which semantically-identical entries in the constant pools of different ones of the class files are represented by a single consolidated entry, irrespective of whether the entries in the different class files are syntactically identical, and to package the set of the program resources together with the common data pool in the archive file.

### Claim 58 (depends on 57)

A product according to claim 57, wherein the class files comprise Java classes, and wherein the archive file comprises a Java Archive (JAR) file.

### Claim 59 (depends on 58)

A product according to claim 58, wherein the instructions cause the computer to create the JAR file in such a manner that a standard Java Virtual Machine can, substantially without modification, open the JAR file and invoke the methods in the class files that are packaged therein.

### Claim 60 (depends on 57)

A product according to claim 57, wherein the instructions cause the computer to consolidate substantially all of the constant pools of all of the class files into the global constant pool.

### Claim 61 (depends on 60)

A product according to claim 60, wherein the instructions cause the computer to create the global constant pool in one of the class files, and to remove the constant pools from all of the other class files before packaging the class files in the archive file.

### Claim 62 (depends on 61)

A product according to claim 61, wherein the set of program resources comprises the program resources needed to run an applet, and wherein the instructions cause the computer to create the global constant pool in the one of the class files that is first invoked among the class files in order to run the applet.

### Claim 63 (depends on 57)

A product according to claim 57, wherein the class files comprise byte code, and wherein the instructions cause the computer to scan the byte code to identify the entries in the constant pools of the different files that are semantically identical.

### Claim 64 (depends on 57)

A product according to claim 57, wherein the instructions cause the computer to add a program mechanism to the set which, when read by a client computer receiving the packaged set of program resources, causes the client computer to reconstruct the constant pools of the class files from the global constant pool.

### Claim 65 (depends on 57)

A product according to claim 57, wherein the instructions cause the computer to compress the archive file.

### Claim 66

A computer program product for packaging program resources, the product comprising a computer-readable medium in which program instructions are stored, which instructions, when read by a computer, cause the computer to assemble a set of the program resources that comprises a plurality of class files containing methods and constant pools, which comprise data structures having entries that are constants, to consolidate at least a portion of the constant pools of the class files into a single, common pool, to add to the set of resources a program mechanism which, when read by a client computer receiving the class files with the single, common pool, causes the client computer to reconstruct the constant pools in the class files from the common pool, and to package the set of program resources, including the common pool and the program mechanism, in a combined output file,
wherein the set of program resources comprises the program resources needed to run an application, and wherein the program instructions cause the computer to provide the mechanism so that the client computer will reconstruct the constant pools during a process of installation of the application on the computer.

### Claim 67

A computer program product for packaging program resources, the product comprising a computer-readable medium in which program instructions are stored, which instructions, when read by a computer, cause the computer to assemble a set of the program resources that comprises a plurality of class files containing methods and constant pools, which comprise data structures having entries that are constants, to consolidate at least a portion of the constant pools of the class files into a single, common pool, to add to the set of resources a program mechanism which, when read by a client computer receiving the class files with the single, common pool, causes the client computer to reconstruct the constant pools in the class files from the common pool, and to package the set of program resources, including the common pool and the program mechanism, in a combined output file,
wherein the set of program resources comprises the program resources needed to run an applet, and wherein the instructions cause the computer to provide the mechanism so that the client computer will reconstruct the constant pools during a process of running the applet.

### Claim 68 (depends on 67)

A product according to claim 67, wherein the instructions cause the computer to add the mechanism to one of the classes that is first to be loaded by the computer when it runs the applet.

### Claim 69 (depends on 68)

A product according to claim 68, wherein the mechanism comprises an initialization method in the class that is the first to be loaded, such that the initialization method engenders reconstruction of the constant pools.

### Claim 70 (depends on 69)

A product according to claim 69, wherein the instructions cause the computer to add a wrapper class containing the initialization method to the program resources needed to run the applet, and to configure the set of the program resources so that the wrapper class is the first to be loaded.

### Claim 71 (depends on 67)

A product according to claim 67, wherein the class files comprise Java classes, and wherein the archive file comprises a Java Archive (JAR) file.

### Claim 72 (depends on 71)

A product according to claim 71, wherein the mechanism is provided in the JAR file in such a manner as to enable a standard Java Virtual Machine, substantially without modification, to open the JAR file and invoke the methods in the class files that are packaged therein.
