ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 52096] Add an option to <javac> to suppress creation of package-info.class
Date Fri, 28 Oct 2011 14:39:55 GMT

Jesse Glick <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #8 from Jesse Glick <> 2011-10-28 14:39:55 UTC ---
A fix for the originally stated problem would be for lookForPackageInfos to
read the actual "package com.apache.test1;" line in, as javac
itself would. One reason the code does not already do this is out of concern
over handling of non-ASCII characters in the package name and potential
interaction with the filesystem. But I suppose it would work to just read using the same encoding being passed to javac.

Additionally, it is just easier to strip off a path prefix than to parse a
general source file including comments, annotations, and/or import statements.
In practice, it is overwhelmingly likely that the package statement is on a
line by itself, and that there is not something that looks like a package
statement inside a block comment. There must be exactly one package statement
in a, so it would almost always suffice to look for lines of
the form


and use \1 if exactly one such is found, falling back to the current logic
otherwise. This would only be fooled by pathological cases such as

package fake;

or the use of \uXXXX escapes.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message