DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15390>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15390

regexp factories rely on undefined behaviour of runtime system

           Summary: regexp factories rely on undefined behaviour of runtime
                    system
           Product: Ant
           Version: 1.5.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


There is bug in implementation of regexp factory
(org.apache.tools.ant.util.regexp.RegexpMatcherFactory and Regexp factory). It
is incorrect to do a Class.forName for classes which are part of the Ant
distribution and expect it to throw every possible linkage error. JLS ss. 12.3 
says:

"For example, an implementation may choose to resolve each symbolic reference in
a class or interface individually, only when it is used (lazy or late
resolution), or to resolve them all at once while the class is being verified
(static resolution). This means that the resolution process may continue, in
some implementations, after a class or interface has been initialized."

If the runtime system is "lazy" the factory will always succeed on the first
class (Jdk14RegexpRegexp) although the actual JDK1.4 classes are not present.
This is what we are experiencing in NetBeans because we by default start the IDE
with "-J-Xverify:none" (turn off class verification) to achieve faster startup.

Please consider the attached patch which fixes this problem. It is trivial, it
tests for presence of concrete regexp classes. Thank you.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to