# HG changeset patch # User jjg # Date 1205440958 25200 # Node ID 68aea6dcb358e7456401afad8460765055bcf05d # Parent ff76730e430eb8c14cd62cef50f5e18b8c1ee121 6559315: Inconsistent non-standard Sun copyright in src/share/opensource/javac/doc/document.css Summary: Remove obsolete files Reviewed-by: mcimadamore diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/Makefile --- a/langtools/src/share/opensource/javac/Makefile Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ -# -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Sun designates this -# particular file as subject to the "Classpath" exception as provided -# by Sun in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, -# CA 95054 USA or visit www.sun.com if you need additional information or -# have any questions. -# - -# Simple Makefile for javac - -BUILD = build -BUILD_BOOTCLASSES = $(BUILD)/bootclasses -BUILD_CLASSES = $(BUILD)/classes -BUILD_JAVAC_SRCFILES = $(BUILD)/javac.srcfiles -GENSRCDIR = $(BUILD)/gensrc -DIST = dist -DIST_JAVAC = $(DIST) -ABS_DIST_JAVAC = $(shell cd $(DIST_JAVAC) ; pwd) -SRC_BIN = src/bin -SRC_CLASSES = src/share/classes - -#-------------------------------------------------------------------------------- -# -# version info for generated compiler - -JDK_VERSION = 1.7.0 -RELEASE=$(JDK_VERSION)-opensource -BUILD_NUMBER = b00 -USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`) -FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER) - -#-------------------------------------------------------------------------------- - -CAT = /bin/cat -CHMOD = /bin/chmod -CP = /bin/cp -MKDIR = /bin/mkdir -RM = /bin/rm -SED = /bin/sed - - -SYSTEM_UNAME := $(shell uname) - -# Platform settings specific to Solaris -ifeq ($(SYSTEM_UNAME), SunOS) - # Intrinsic unix command, with backslash-escaped character interpretation - # (not using -e will cause build failure when using /bin/bash) - # (using -e breaks something else) - ECHO = /usr/bin/echo - PLATFORM = solaris -endif - -# Platform settings specific to Linux -ifeq ($(SYSTEM_UNAME), Linux) - # Intrinsic unix command, with backslash-escaped character interpretation - ECHO = echo -e - PLATFORM = linux -endif - - -# Set BOOTDIR to specify the JDK used to build the compiler -ifdef BOOTDIR -JAR = $(BOOTDIR)/bin/jar -JAVA = $(BOOTDIR)/bin/java -JAVAC = $(BOOTDIR)/bin/javac -JAVADOC = $(BOOTDIR)/bin/javadoc -else -JAR = jar -JAVA = java -JAVAC = javac -JAVADOC = javadoc -endif - -ifndef JTREG -ifdef JTREG_HOME -JTREG = $(JTREG_HOME)/$(PLATFORM)/bin/jtreg -else -JTREG = jtreg -endif -endif - -ifndef JTREG_OPTS -JTREG_OPTS = -s -verbose:summary -endif - -ifndef JTREG_TESTS -JTREG_TESTS = test/tools/javac -endif - -# Set this to the baseline version of JDK used for the tests -# TESTJDKHOME = - -COMPILER_SOURCE_LEVEL = 1.5 - -#-------------------------------------------------------------------------------- -SCM_DIRS = -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -JAVAC_SRCS = $(shell find \ - $(SRC_CLASSES)/javax/annotation/processing \ - $(SRC_CLASSES)/javax/lang/model \ - $(SRC_CLASSES)/javax/tools \ - $(SRC_CLASSES)/com/sun/source \ - $(SRC_CLASSES)/com/sun/tools/javac \ - \( $(SCM_DIRS) -o -name \*-template.\* \) -prune -o -name \*.java -print ) - -JAVAC_RESOURCES = $(shell ls $(SRC_CLASSES)/com/sun/tools/javac/resources/*.properties | $(SED) -e 's/-template//' ) - - -#-------------------------------------------------------------------------------- - -default: build - -all: build docs - -clean: - $(RM) -rf $(BUILD) $(DIST) - -build: sanity $(DIST_JAVAC)/lib/javac.jar $(DIST_JAVAC)/bin/javac - - -# javac.jar - -$(DIST_JAVAC)/lib/javac.jar: \ - $(JAVAC_SRCS) \ - $(patsubst $(SRC_CLASSES)/%,$(BUILD_BOOTCLASSES)/%,$(JAVAC_RESOURCES)) \ - $(patsubst $(SRC_CLASSES)/%,$(BUILD_CLASSES)/%,$(JAVAC_RESOURCES)) - @$(ECHO) $(JAVAC_SRCS) > $(BUILD_JAVAC_SRCFILES) - $(JAVAC) -d $(BUILD_BOOTCLASSES) -source $(COMPILER_SOURCE_LEVEL) -g:source,lines @$(BUILD_JAVAC_SRCFILES) - $(JAVA) -cp $(BUILD_BOOTCLASSES) com.sun.tools.javac.Main \ - -d $(BUILD_CLASSES) -g:source,lines @$(BUILD_JAVAC_SRCFILES) - ( $(ECHO) "Main-Class: com.sun.tools.javac.Main" ; \ - $(ECHO) "Built-By: $$USER" ; \ - $(ECHO) "Built-At: `date`" ) > $(BUILD)/javac.MF - $(MKDIR) -p $(DIST_JAVAC)/lib - $(JAR) -cmf $(BUILD)/javac.MF $(DIST_JAVAC)/lib/javac.jar -C ${BUILD_CLASSES} . - - -# javac resources - -$(BUILD_BOOTCLASSES)/com/sun/tools/javac/resources/version.properties \ -$(BUILD_CLASSES)/com/sun/tools/javac/resources/version.properties: \ - $(SRC_CLASSES)/com/sun/tools/javac/resources/version-template.properties - $(MKDIR) -p $(@D) - $(SED) -e 's/$$(JDK_VERSION)/$(JDK_VERSION)/' \ - -e 's/$$(FULL_VERSION)/$(FULL_VERSION)/' \ - -e 's/$$(RELEASE)/$(RELEASE)/' \ - < $< > $@ - -$(BUILD_BOOTCLASSES)/com/sun/tools/javac/resources/%.properties: \ - $(SRC_CLASSES)/com/sun/tools/javac/resources/%.properties - $(MKDIR) -p $(@D) - $(CP) $^ $@ - -$(BUILD_CLASSES)/com/sun/tools/javac/resources/%.properties: \ - $(SRC_CLASSES)/com/sun/tools/javac/resources/%.properties - $(MKDIR) -p $(@D) - $(CP) $^ $@ - - -# javac wrapper script - -$(DIST_JAVAC)/bin/javac: $(SRC_BIN)/javac.sh - $(MKDIR) -p $(@D) - $(CP) $^ $@ - $(CHMOD) +x $@ - -# javadoc - -JLS3_URL = http://java.sun.com/docs/books/jls/ -JLS3_CITE = \ - The Java Language Specification, Third Edition -TAG_JLS3 = -tag 'jls3:a:See $(JLS3_CITE):' - -TAGS = $(IGNORED_TAGS:%=-tag %:X) $(TAG_JLS3) - -docs: - $(JAVADOC) -sourcepath $(SRC_CLASSES) -d $(DIST_JAVAC)/doc/api \ - $(TAGS) \ - -subpackages javax.annotation.processing:javax.lang.model:javax.tools:com.sun.source:com.sun.tools.javac - -#-------------------------------------------------------------------------------- - -test: test-sanity $(DIST_JAVAC)/lib/javac.jar - $(JTREG) $(JTREG_OPTS) -noshell \ - -jdk:$(TESTJDKHOME) \ - -Xbootclasspath/p:$(ABS_DIST_JAVAC)/lib/javac.jar \ - -w:$(BUILD)/jtreg/work \ - -r:$(BUILD)/jtreg/report \ - $(JTREG_TESTS) - -#-------------------------------------------------------------------------------- - -ifndef ERROR_FILE - ERROR_FILE = $(BUILD)/sanityCheckErrors.txt -endif - -presanity: - @$(RM) -f $(ERROR_FILE) - @$(MKDIR) -p `dirname $(ERROR_FILE)` - -###################################################### -# CLASSPATH cannot be set, unless you are insane. -###################################################### -sane-classpath: -ifdef CLASSPATH - @$(ECHO) "ERROR: Your CLASSPATH environment variable is set. This will \n" \ - " most likely cause the build to fail. Please unset it \n" \ - " and start your build again. \n" \ - "" >> $(ERROR_FILE) -endif - -###################################################### -# JAVA_HOME cannot be set, unless you are insane. -###################################################### -sane-java_home: -ifdef JAVA_HOME - @$(ECHO) "ERROR: Your JAVA_HOME environment variable is set. This will \n" \ - " most likely cause the build to fail. Please unset it \n" \ - " and start your build again. \n" \ - "" >> $(ERROR_FILE) -endif - - -###################################################### -# TESTJDKHOME needs to be set to run tests -###################################################### -sane-testjdk: -ifndef TESTJDKHOME - @$(ECHO) "ERROR: TESTJDKHOME needs to be set to the baseline version \n" \ - " version of JDK used to run the compiler tests.\n" \ - "" >> $(ERROR_FILE) -endif - - -sane-lastrule: - @if [ -r $(ERROR_FILE) ]; then \ - if [ "x$(INSANE)" = x ]; then \ - $(ECHO) "Exiting because of the above error(s). \n" \ - "">> $(ERROR_FILE); \ - fi ; \ - $(CAT) $(ERROR_FILE) ; \ - if [ "x$(INSANE)" = x ]; then \ - exit 1 ; \ - fi ; \ - fi - -sanity \ -build-sanity: presanity sane-classpath sane-java_home sane-lastrule - -test-sanity: presanity sane-classpath sane-java_home sane-testjdk sane-lastrule - - - - -#-------------------------------------------------------------------------------- - -.PHONY: all build clean default docs prep test \ - presanity sanity build-sanity test-sanity \ - sane-classpath sane-java_home sane-testjdk sane-lastrule diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/README-template.html --- a/langtools/src/share/opensource/javac/README-template.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,330 +0,0 @@ - - - - - - - - - - - OpenJDK: javac -- README - - - - - - - - - - - - - -
 
-

README

- -

Open JDK™ Java programming language compiler (javac)
- Version $(RELEASE) -

-

$(BUILD_DATE)

-
 
- - - - - -

Table of Contents

- - - -

Introduction

-

This bundle contains the source code for javac, a compiler for - the Java™ programming language. - Build files are provided for use with - NetBeans, - Apache Ant or - GNU make. - The bundle also contains a set of compiler tests, for use with the - jtreg test harness. - - -

Files and Directories

- When you install the compiler bundle, a directory named - compiler will be created, containing the following: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescription -
README.htmlThis file.
nbproject/project.xmlA NetBeans project file. -
src/share/classes/The source files for the compiler.
build.xmlA build file for building the compiler, suitable for - use with NetBeans and Apache Ant.
build.propertiesBuild properties, used by build.xml.
MakefileA Makefile for building the compiler, suitable for use - with GNU make.
test/tools/javac/Regression tests for the compiler, for use with the JDK regression - test harness, jtreg.
doc/Additional notes about the compiler.
- -

Specifications

-

The compiler is a program for compiling source code written in the Java - programming language into class files suitable for execution on a Java - virtual machine. It also provides API for annotation processing, - and invoking the compiler programmatically. -

These behaviors are governed by the following specifications: -

-

For more details on these specifications, see the - javac Guide. -

- -

These specifications are controlled by the Java Community Process - (JCP.) All implementations of these specifications - must pass the appropriate test suites.

- -

Notice regarding JSR 199 and JSR 269: - This is an implementation of an early-draft - specification developed under the Java Community Process (JCP) - and is made available for testing and evaluation purposes only. - The code is not compatible with any specification of the JCP. - -

Building the compiler

- -

System Requirements

-

javac is written in the Java programming language. - As a general rule, it can normally be compiled using tools in the - latest released version of the JDK. - (That is, a development version of javac version 7 - can be built with JDK version 6, etc.) - To bootstrap the compiler, you should also have - a copy of the target JDK.

- -

You can build javac using - NetBeans, - Apache Ant, - or GNU make. -

- -

To run the compiler tests, you will need the - jtreg test harness. - -

Bootstrapping the compiler

- -

The source for the compiler is such that it can be compiled using the latest - publicly released version of the JDK.In practice, it is typically desirable - to compile it first using the latest publicly released version of the JDK, - and then again using itself, and the target platform on which it will be run. - This not only provides a good initial test of the newly built compiler, it - also means the compiler is built with the latest compiler sources, against - the target libraries. - -

Building with NetBeans

-

The installation directory for the compiler is set up as a free-form NetBeans project, - so to build the compiler using NetBeans, you just have to open the - project and build it in the normal way, for example, by using the operations - on the Build menu. -

To run the tests, you will have to edit properties in the - build.properties file, to specify where you have installed - the jtreg harness and, possibly, a different version of - JDK to use when running the tests. - -

Building with Apache Ant

-

To build the compiler, go to the compiler installation directory, and run "ant".

-
-        % cd install-dir
-        % ant       
-        
-

To run the tests, you will have to edit properties in the - build.properties file, to specify where you have installed - the jtreg harness and, possibly, a different version of - JDK to use when running the tests. Then, you can run the tests using the - "test" target. - -

Building with GNU make

-

To build the compiler, go to the compiler installation directory, and type "make".

- You should not have CLASSPATH and JAVAHOME environment variables set when you - do this. -
-        % cd install-dir
-        % make      
-        
-

To run the tests, you will have to specify where you have installed - the jtreg harness and, possibly, a different version of - JDK to use when running the tests. Then, you can run the tests using the - "test" target. You can specify the values by giving them on the command - line when you run make or by editing the values into the Makefile. - -

What gets built?

-

Whichever build tool you use, the results are put in the dist - subdirectory of your installation directory. The following files will be built. - - - - - - - - - - - - - -
NameDescription -
dist/lib/javac.jarThis is an executable jar file containing the compiler.
dist/bin/javacThis is a simple shell script to invoke the compiler.
- -

Notes

- -

Property files: - It is possible to compile the resource property files into equivalent - class files, for a minor performance improvement. For simplicity, that - feature is not included here.

- -

The launcher: - JDK uses a program informally called "the launcher" which is used as - a wrapper for all JDK tools, including java, - javac, javadoc, and so on. The program is a deployed - as a platform-dependent binary, thus obviating the need for a shell - script to invoke the tools. Again for simplicity, and because that program - is not normally considered part of javac, that program is - not included here.

Running the compiler -

Once you have built the compiler, you can run it in a number of ways. -

- -

Testing the compiler with jtreg

-

This bundle contains a large test suite of unit and regression tests - used to test javac. They are part of the JDK Regression Test - Suite, which uses the - jtreg test harness. - This harness is - designed to run both API-style tests, and command-line tests, such as - found in the tests for javac.

- -

The simplest way to run the tests is to prepend the newly created - copy of javac.jar to the bootstrap class path of a - compatible version of JDK (meaning, it must accept the class file - versions of newly compiled classes.) To do this, you can use - the -Xbootclasspath/p:<path> option - for jtreg. This option is similar to the equivalent - option for the java command. - -

Note:Some of the tests, written as shell tests, do not yet - support this mode of operation. You should use the - -noshell to disable these tests for the time being. - This restriction will be lifted in the near future. - -

Note:Four additional tests are ignored, using the jtreg - @ignore tag, because of problems caused by bugs that have not yet - been addressed. - -

You can run the compiler tests with a command such as the following:

- -
    % jtreg -jdk:jdk -Xbootclasspath/p:my-javac.jar -verbose -noshell test/tools/javac
- -

Depending on the verbose options used, some amount of detail of the result - of each test is written to the console. In addition, an HTML report about the - entire test run is written to a report directory, and a results file is written for - each test, in a "work" directory. The location of these directories can be - specified on the jtreg command line; the actual locations used - are reported to the console at the conclusion of the test run. - -

For more information on jtreg, use the - the -help option for command-line help, or - the -onlineHelp option for the built-in online help. - Both of these options may optionally be followed by search - keywords

- -

jtreg can also be run from Ant. See - jtreg -onlineHelp ant for details.

- -

Both build.xml and Makefile contain "test" targets for running the tests. - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/build.properties --- a/langtools/src/share/opensource/javac/build.properties Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -build.jdk.version = 1.7.0 -build.release = ${build.jdk.version}-opensource -build.number = b00 -build.user.release.suffix = ${user.name}_${build.fullversion.time} -build.full.version = ${build.release}-${build.user.release.suffix}-${build.number} - -# Set jtreg.home to jtreg installation directory -# jtreg.home = - -# Set test.jdk.home to baseline JDK used to run the tests -# test.jdk.home = - -compiler.source.level = 1.5 diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/build.xml --- a/langtools/src/share/opensource/javac/build.xml Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/document.css --- a/langtools/src/share/opensource/javac/doc/document.css Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -/* - * Copyright � 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - */ - -body { background-color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; - border-top-width: 0px; border-right-width: 0px; - border-bottom-width: 0px; border-left-width: 0px} -h1 { font-family: Arial, Helvetica, sans-serif} -h2 { font-family: Arial, Helvetica, sans-serif; padding-top: 25px} -h3 { font-family: Arial, Helvetica, sans-serif} -h4 { font-family: Arial, Helvetica, sans-serif} -li { font-family: Arial, Helvetica, sans-serif} -table { font-family: Arial, Helvetica, sans-serif; - background-color: #FFFFFF; - margin-top: 0px; padding-top: 0px; - border-top-width: 0px; border-right-width: 0px; - border-bottom-width: 0px; border-left-width: 0px; - margin-bottom: 10px; margin-left: 0px; - padding-bottom: 5px; padding-left: 5px} -td { vertical-align: top; font-family: Arial, Helvetica, sans-serif} -td h1 { text-align: center} -td h2 { text-align: center; padding-top: 0px} -td h4 { text-align: center} -th { font-family: Arial, Helvetica, sans-serif; text-align: left; - padding-top: 10px; padding-right: 10px; padding-bottom: 0px; - padding-left: 10px; white-space: nowrap} - -.sun-darkblue { font-family: Arial, Helvetica, sans-serif ; - color: #FFFFFF; background-color: #666699} -.sun-lightblue { background-color: #9999CC} -.nav-link { font-family: Arial, Helvetica, sans-serif; font-size: x-small} -code { font-family: Courier, serif} diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/Context.html --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/Context.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ - - - - - - - - - com.sun.tools.javac.comp.Enter - - - -

com.sun.tools.javac.util.Context

- -

Contexts provides a way to share data between the different parts of - the compiler.

- -

They provide support for an abstract context, modelled loosely after - ThreadLocal but using a user-provided context instead of the current - thread.

- -

Within the compiler, a single Context is used for each - invocation of the compiler. The context is then used to ensure a - single copy of each compiler phase exists per compiler invocation.

- -

The context can be used to assist in extending the compiler by - extending its components. To do that, the extended component must - be registered before the base component. We break initialization - cycles by (1) registering a factory for the component rather than - the component itself, and (2) a convention for a pattern of usage - in which each base component registers itself by calling an - instance method that is overridden in extended components. A base - phase supporting extension would look something like this:

- -
-   public class Phase {
-       protected static final Context.Key<Phase> phaseKey =
- 	   new Context.Key<Phase>();
- 
-       public static Phase instance(Context context) {
- 	   Phase instance = context.get(phaseKey);
- 	   if (instance == null)
- 	       // the phase has not been overridden
- 	       instance = new Phase(context);
- 	   return instance;
-       }
- 
-       protected Phase(Context context) {
- 	   context.put(phaseKey, this);
- 	   // other intitialization follows...
-       }
-   }
-        
- -

In the compiler, we simply use Phase.instance(context) to get - the reference to the phase. But in extensions of the compiler, we - must register extensions of the phases to replace the base phase, - and this must be done before any reference to the phase is accessed - using Phase.instance(). An extended phase might be declared thus:

- -
-   public class NewPhase extends Phase {
-       protected NewPhase(Context context) {
- 	   super(context);
-       }
-       public static void preRegister(final Context context) {
-           context.put(phaseKey, new Context.Factory<Phase>() {
- 	       public Phase make() {
- 		   return new NewPhase(context);
- 	       }
-           });
-       }
-   }
-        
- -

And is registered early in the extended compiler like this:

- -
-       NewPhase.preRegister(context);
-        
- - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/Enter.html --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/Enter.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ - - - - - - - - - com.sun.tools.javac.comp.Enter - - - -

com.sun.tools.javac.comp.Enter

- - This enters symbols for all encountered definitions into - the symbol table. The pass consists of two phases, organized as - follows: - -
    -
  1. In the first phase, all class symbols are entered into their - enclosing scope, descending recursively down the tree for classes - which are members of other classes. The class symbols are given a - MemberEnter object as completer.

  2. - -

    In addition, - if any package-info.java files are found, - containing package annotations, then the TopLevel tree node for - the package-info.java file is put on the "to do" as well. -

    - -
  3. In the second phase, classes are completed using - MemberEnter.complete(). Completion might occur on demand, but - any classes that are not completed that way will be eventually - completed by processing the `uncompleted' queue. Completion - entails -

    • (1) determination of a class's parameters, supertype and - interfaces, as well as
    • (2) entering all symbols defined in the - class into its scope, with the exception of class symbols which - have been entered in phase 1.
    • -
    - (2) depends on (1) having been - completed for a class and all its superclasses and enclosing - classes. That's why, after doing (1), we put classes in a - `halfcompleted' queue. Only when we have performed (1) for a class - and all it's superclasses and enclosing classes, we proceed to - (2).

  4. -
- -

Whereas the first phase is organized as a sweep through all - compiled syntax trees, the second phase is demand. Members of a - class are entered when the contents of a class are first - accessed. This is accomplished by installing completer objects in - class symbols for compiled classes which invoke the member-enter - phase for the corresponding class tree.

- -

Classes migrate from one phase to the next via queues:

- -
-    class enter -> (Enter.uncompleted)         --> member enter (1)
- 		-> (MemberEnter.halfcompleted) --> member enter (2)
- 		-> (Todo)	               --> attribute
- 						(only for toplevel classes)
-        
- - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/JavaCompiler.html --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/JavaCompiler.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ - - - - - - - - - JavaCompiler - - - -

com.sun.tools.javac.main.JavaCompiler

-

- JavaCompiler provides (and enforces) a use-once method to compile a list of source files. - It invokes the various phases of the compiler to cause those source files to be compiled. -

- - - - - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/Main.html --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/Main.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ - - - - - - - - - Main - - - -

com.sun.tools.javac.main.Main

- -

- The normal main entry point is - com.sun.tools.javac.main.Main, - with a public API entry point at - com.sun.tools.javac.Main which just calls down to com.sun.tools.javac.main.Main. -

- -

The various parts of the compiler share common information by means of a - Context. - Every invocation of the compiler must have its own Context. - -

- com.sun.tools.javac.main.Main does command line processing to determine the list of files to be compiled, and any applicable options. There are four types of options: -

- - If there are files to be compiled, Main invokes - JavaCompiler (more...) - After JavaCompiler completes, the list of class symbols that was returned is discarded. -

- -

- Any and all exceptions are caught and handled, and a return code is - determined. Finally, the compiler exits. -

- - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/ToDo.html --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/ToDo.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ - - - - - - - - - JavaCompiler's "to do" list - - - -

com.sun.tools.javac.main.JavaCompiler's "to do" list

- -

- After the source files have been parsed, and their symbols entered - in the symbol table, the top level classes and some other items end - up on JavaCompiler's "to do" list. -

- -

- For each entry on the "to do" list, JavaCompiler - processes it as follows: -

- - - -

Issues

- The "to do" list is mostly organized by top level classes, and not by - compilation units. This means that if a compilation unit contains several - classes, it is possible for code to be generated for some of the classes - in the file, at which point at error may be detected for one of the - remaining classes, preventing code from being generated for that and any - subsequent classes. This means that the compilation unit will be partially - compiled, with some but not all of the class files being generated. - (Bug 5011101) - - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/contents.html --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/contents.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ - - - - - - - - - com.sun.tools.javac.comp.Enter - - - Packages
-
- Classes
- Context
- Enter
- JavaCompiler
- Main
- ToDo
- diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/index.html --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/index.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ - - - - - - javac life cycle - - - - - - <body> - <p>This page uses frames, but your browser doesn't support them.</p> - </body> - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/packages.html --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/packages.html Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ - - - - - - - - Packages - - - - -

javac Packages

- -

With the exception of a publicly supported entry point at - com.sun.tools.javac.Main, - javac is organized as a set of packages under - com.sun.tools.javac. -

- - - - - - - - - - -
Sub-packageDescription -
code - Classes to represent the internal semantics of a Java program -- - types, symbols, etc. - -
comp - Classes that analyse and annotate the parse tree with semantic - details, such as determining the types and symbols referred to by identifiers. - -
jvm - Back end classes to read and write class files. - -
main - Top-level driver classes. The standard entry point to the compiler is - com.sun.tools.javac.main.Main (more...) - -
parser - Classes to read a Java source file and create a corresponding parse tree. - -
resources - Resource classes for messages generated by the compiler. Two of the - three classes are automagically generated by a "property file compiler" - from a property source file; the third is automagically generated during - the build to contain build version information. - -
tree - Classes representing an annotated syntax tree for a Java program. - The top level node, representing the contents of a source file is - Tree.TopLevel. - -
util - Utility classes used throughout the compiler, providing support for - diagnostics, access to the file system, and javac's collection classes. - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/doc/javac_lifecycle/style.css --- a/langtools/src/share/opensource/javac/doc/javac_lifecycle/style.css Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -body { color: black; background-color: #eeffee } -body.contents { background-color: #ddffdd } - -li { margin-top:10px } -p.note { font-size:smaller } - -.code { font-family:monospace } - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/nbproject/project.xml --- a/langtools/src/share/opensource/javac/nbproject/project.xml Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ - - - - - - org.netbeans.modules.ant.freeform - - - - openjdk-javac - - - - - java - src/share/classes - - - - - build - - - clean - - - docs - - - clean - build - - - xtest - - - - - - - src/share/classes - - - build.properties - - - build.xml - - - - - - - - - - - - - src/share/classes - 1.5 - - - - diff -r ff76730e430e -r 68aea6dcb358 langtools/src/share/opensource/javac/src/bin/javac.sh --- a/langtools/src/share/opensource/javac/src/bin/javac.sh Wed Mar 12 13:06:00 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Sun designates this -# particular file as subject to the "Classpath" exception as provided -# by Sun in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, -# CA 95054 USA or visit www.sun.com if you need additional information or -# have any questions. -# - -mydir="`dirname $0`" - -java -jar "${mydir}"/../lib/javac.jar "$@"