`
`|
`
`uopip]
`
`Juniper Ex. 1017-p. 1
`Juniper v Finjan
`
`
`
`The Java™
`Virtual Machine
`
`Second Edition
`
`Tim Lindholm
`Frank Yellin
`
`▼▼
`ADDISON -WESLEY
`An imprint of Addison Wesley Longman, Inc,
`Reading, Massachusetts • Harlow, England • Menlo Park, California
`Berkeley, California • Doe Mills, Ontario • Sydney
`Bonn • Amsterdam • Tokyo • Mexico City
`
`Juniper Ex. 1017-p. 2
`Juniper v Finjan
`
`
`
`To Lucy, Beatrice, and Arnold
`
`-TL
`
`To Mark FY
`
`Copyright © 1997-1999 Sun Microsystems, Inc.
`901 San Antonio Road, Palo Alto, California 94303 U.S.A.
`All rights reserved.
`Duke™ designed by Joe Palrang.
`RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the United States Government is sub
`ject to the restrictions set forth in DEARS 252.227-7013 (e)(S)(ii) and FAR 52.227-19.
`The release described in this manual may be protected by one or more U.S. patents, foreign patents, or pend
`ing applications.
`Sun Microsystems, Inc. (SUN) hereby grants to you a fully paid, nonexclusive, nontransferable, perpetual,
`worldwide limited license (without the right to sublicense) under SUN’s intellectual property rights that are
`essential to practice this specification. This license allows and is limited to the creation and distribution of
`clean room implementations of this specification that: (i) include a complete implementation of the current
`version of this specification without subsetting or supersetting; (ii) Implement all the interfaces and function
`ality of the required packages of the Java® 2 Platform, Standard Edition, as defined by SUN, without subset
`ting or supersetting; (iii) do not add any additional packages, classes, or interfaces to the java.* or javax.*
`packages or their subpackages; (iv) pass all test suites relating to the most recent published version of the
`specification of the Java® 2 Platform, Standard Edition, that are available from SUN six (6) months prior to
`any beta release of the clean room implementation or upgrade thereto; (v) do not derive from SUN source
`code or binary materials; and (vi) do not include any SUN source code or binary materials without an appro
`priate and separate license from SUN.
`Sun, Sun Microsystems, Sun Microsystems Computer Corporation, the Sun logo, the Sun Microsystems
`Computer Corporation logo, Solaris, Java, JavaSoft, JavaScript, HotJava, JDK, and all lava-based trademarks
`or logos are trademarks or registered trademarks of Sun Microsystems, Inc. UNIX® is a registered trademark
`in the United States and other countries, exclusively licensed through X/Open Company, Ltd. All other prod
`uct names mentioned herein are the trademarks of their respective owners.
`THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
`EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
`MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT.
`THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL
`ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE
`CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION. SUN MICRO
`SYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/
`OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME.
`Library of Congress Cataloging-in-Publication Data
`Lindholm, Tim
`The Java virtual machine specification / Tim Lindholm, Frank
`Tallin, -- 2nd ed.
`p. cm.
`Includes bibliographical references and index.
`ISBN 0-201-43294-3
`1. Java (Computer program language) 2. Internet (Computer
`network) 3. Virtual computer systems. I. Yellin, Frank.
`II, Title.
`QA76.73.J38L56 1999
`005.13'3--dc21
`
`99-18470
`CIP
`
`Text printed on recycled and acid-free paper
`123456789 -MA- 03 02 01 00 99
`First printing, April 1999
`
`Juniper Ex. 1017-p. 3
`Juniper v Finjan
`
`
`
`EXCEPTIONS
`
`39
`
`The element type of an array may be any type, whether primitive or reference.
`In particular, arrays with an interface type as the component type are supported;
`the elements of such an array may have as their value a null reference or instances
`of any class type that implements the interface. Arrays with an abstract class
`type as the component type are supported; the elements of such an array may have
`as their value a null reference or instances of any subclass of this abstract class
`that is not itself abstract.
`
`2.15.2 Array Variables
`A variable of array type holds a reference to an object. Declaring a variable of array
`type does not create an array object or allocate any space for array components. It
`creates only the variable itself, which can contain a reference to an array.
`Because an array’s length is not part of its type, a single variable of array type
`may contain references to arrays of different lengths. Once an array object is cre
`ated, its length never changes. To make an array variable refer to an array of dif
`ferent length, a reference to a different array must be assigned to the variable.
`If an array variable v has type A [], where A is a reference type, then v can
`hold a reference to any array type B[], provided B can be assigned to A (§2.6.7).
`
`2.15.3 Array Creation
`An array is created by an array creation expression or an array initializer.
`
`2.15.4 Array Access
`A component of an array is accessed using an array access expression. Arrays may
`be indexed by i nt values; short, byte, or char values may also be used as they
`are subjected to unary numeric promotion (§2.6.10) and become i nt values.
`All arrays are 0-origin. An array with length n can be indexed by the integers
`0 through n - l. All array accesses are checked at run time; an attempt to use an
`index that is less than zero or greater than or equal to the length of the array causes
`an ArraylndexOutOfBoundsExcepti on to be thrown.
`
`2.16 Exceptions
`
`When a program violates the semantic constraints of the Java programming lan
`guage, the Java virtual machine signals this error to the program as an exception. An
`
`Juniper Ex. 1017-p. 4
`Juniper v Finjan
`
`
`
`40
`
`JAVA PROGRAMMING LANGUAGE CONCEPTS
`
`EXCEPTIONS
`
`41
`
`example of such a violation is an attempt to index outside the bounds of an array.
`The Java programming language specifies that an exception will be thrown when
`semantic constraints are violated and will cause a nonlocal transfer of control from
`the point where the exception occurred to a point that can be specified by the pro
`grammer, An exception is said to be thrown from the point where it occurred and is
`said to be caught at the point to which control is transferred. A method invocation
`that completes because an exception causes transfer of control to a point outside the
`method is said to complete abruptly.
`Programs can also throw exceptions explicitly, using throw statements. This
`provides an alternative to the old-fashioned style of handling error conditions by
`returning distinguished error values, such as the integer value -1, where a negative
`value would not normally be expected.
`Every exception is represented by an instance of the class Throwabl e or one of
`its subclasses; such an object can be used to carry information from the point at
`which an exception occurs to the handler that catches it. Handlers are established by
`catch clauses of try statements. During the process of throwing an exception, the
`Java virtual machine abruptly completes, one by one, any expressions, statements,
`method and constructor invocations, static initializers, and field initialization expres
`sions that have begun but not completed execution in the current thread. This pro
`cess continues until a handler is found that indicates that it handles the thrown
`exception by naming the class of the exception or a superclass of the class of the
`exception. If no such handler is found, then the method uncaughtExcepti on is
`invoked for the Th readGroup that is the parent of the current thread.
`In the Java programming language the exception mechanism is integrated
`with the synchronization model (§2.19) so that locks are properly released as
`synchronized statements and so that invocations of synchronized methods
`complete abruptly.
`The specific exceptions covered in this section are that subset of the pre
`defined exceptions that can be thrown directly by the operation of the Java virtual
`machine. Additional exceptions can be thrown by class library or user code; these
`exceptions are not covered here. See The Javam Language Specification for infor
`mation on all predefined exceptions.
`
`2.16.1 The Causes of Exceptions
`An exception is thrown for one of three reasons:
`
`1. An abnormal execution condition was synchronously detected by the Java vir
`tual machine. These exceptions are not thrown at an arbitrary point in the pro
`gram, but rather at a point where they are specified as a possible result of an
`expression evaluation or statement execution, such as:
`• When an operation violates the normal semantics of the Java programming
`language, for example indexing outside the bounds of an array.
`• When an error occurs in loading or linking part of the program.
`• When some limit on a resource is exceeded, for example when too much
`memory is used. .
`2. A throw statement was executed.
`3. An asynchronous exception occurred because:
`• The stop method of class Thread or ThreadGroup was invoked, or
`• An internal error occurred in the virtual machine implementation.
`Exceptions are represented by instances of the class Throwabl e and instances
`of its subclasses. These classes are, collectively, the exception classes.
`
`2.16.2 Handling an Exception
`When an exception is thrown, control is transferred from the code that caused the
`exception to the nearest dynamically enclosing catch clause of a try statement that
`handles the exception.
`A statement or expression is dynamically enclosed by a catch clause if it
`appears within the try block of the try statement of which the catch clause is a
`part, or if the caller of the statement or expression is dynamically enclosed by the
`catch clause.
`The caller of a statement or expression depends on where it occurs:
`
`• If within a method, then the caller is the method invocation expression
`that was executed to cause the method to be invoked.
`® If within a constructor or the initializer for an instance variable, then the
`caller is the class instance creation expression or the method invocation of
`newlnstance that was executed to cause an object to be created.
`
`Juniper Ex. 1017-p. 5
`Juniper v Finjan
`
`