diff --git a/make/common/Rules.gmk b/make/common/Rules.gmk
@@ -197,8 +197,8 @@ classes : $(CLASSES_INIT) .delete.classl
$(ECHO) "# Java sources to be compiled: (listed in file $(JAVA_SOURCE_LIST))"; \
$(CAT) $(JAVA_SOURCE_LIST); \
$(ECHO) "# Running javac:"; \
- $(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \
- $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \
+ $(ECHO) $(JAVAC_CMD) -Xprefer:source -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \
+ $(JAVAC_CMD) -Xprefer:source -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \
With some help from Jonathan Gibbons... The issue is that when jdk7 corba is built with a newly installed jdk6u12 which has a newer CorbaConnection interface (that requires a new method), the javac compiler is finding the CorbaConnection in the bootclasspath and is prefering that over the source file in the sourcepath due to it's newer timestamp.
Adding the jdk6 javac option -Xprefer:source fixes this, which tells javac to always prefer the source file found over any class file.
When corba is built (or jaxp or jaxws, or the jdk for that matter) the assumption (goal?) was that it was building the source in it's repository to the destination classes directory of that build. Any binding to the classes in the bootclasspath or classpath was assumed to be acceptable and acceptable. But when the sourcepath contains and alternative version, we need it to bind to the source version, not what is in the classpath or bootclasspath.
The jaxp and jaxws repositories use an ant script, and effectively there is one javac compilation, so all the source of the repository is built at one time, so the binding between sources happens naturally.
The jdk repository overrides the bootclasspath to be just the classes directory being created, so it never binds to the classes in the bootclasspath.
So this is a corba specific issue, due to it's use of makefiles where it builds parts of the corba repository in separate phases, and it's sources not being the prefered classes to bind with. The jdk6 option -Xprefer:source can fix this, and will probably be implemented unless a better solution comes up. Ultimately, the whole way the corba source or classes get into the jdk needs to change.