Kelly.Ohair at Sun.COM
Mon Oct 12 09:12:06 PDT 2009
Mark Reinhold wrote:
>> Date: Sun, 11 Oct 2009 17:35:31 -0700
>> From: kelly.ohair at sun.com
>> 6888701: Change all template java source files to a .java.template file suffix
> Most of the files you are renaming in this change are in NIO, and the
> names of those files were carefully chosen so as to be invalid Java
> class names -- they all contain at least one dash character.
> This approach has the advantage that when you visit the files in an
> editor or IDE they're treated as Java source files without any further
> effort. This is a feature, not a bug as claimed in 6888701.
> I'd like to understand more about the complications in Makefile logic
> claimed in 6888701. If this is such a problem then why are we just
> now getting around to fixing it?
I have been trying to change some of the Makefiles to use the GNU make
functions and everything is easier when knowing that a file ending in
.java is really input for javac. Filtering is easier.
We have at least 3 conventions being used for processing java source files:
*-template.java, *X-*.java, and *.java.template. By far the easiest one
to deal with in build scripts (make and ant) is the *.template convention.
I'm just trying to normalize this to one convention that is the easiest
to deal with in build scripts and for IDEs.
I know these files have been around for ages, and if IDE's treated them as
valid java sources files back then, I suspect the newer IDE's might have
figured out by now that they are not java source files.
NetBeans will let you open any file, and when I open these files with the
*.java suffix, I get hundreds of error indicators, but when opened as
*.java.template files, they appear as normal files with no error indications.
NetBeans doesn't know what these files really are anyway.
The complications in the Makefiles is that every time you want a list of
java sources from a directory to compile, you have to have a special exclude
list to remove all these files: X-*.java *-X-*.java *-template.java
It's a pain, in make files or in ant scripts.
> - Mark
More information about the build-dev