Takashi Okamoto wrote:

> I have following error when compile jakarta-log4j by ant-1.3 with Kaffe.
> 
> --------------
> BUILD FAILED
> 
> java.lang.OutOfMemoryError
>         at java.lang.StringBuffer.ensureCapacity(StringBuffer.java:162)
>         at java.lang.StringBuffer.setLength(StringBuffer.java:264)
>         at 
>org.apache.tools.ant.util.SourceFileScanner.restrict(SourceFileScanner.java:128)
>         at 
>org.apache.tools.ant.util.SourceFileScanner.restrictAsFiles(SourceFileScanner.java:174)
>         at org.apache.tools.ant.taskdefs.Javac.scanDir(Javac.java:488)
>         at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:434)
>         at org.apache.tools.ant.Target.execute(Target.java:153)
>         at org.apache.tools.ant.Project.runTarget(Project.java:902)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:540)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:514)
>         at org.apache.tools.ant.Main.runBuild(Main.java:421)
>         at org.apache.tools.ant.Main.main(Main.java:149)
> 
> Total time: 27 seconds
> --------------
> 
> I looked for the cause.  Maybe following code has problem.
> 
> [libraries/javalib/java/lang/StringBuffer.java]

What's the value of newLength passed by
org.apache.tools.ant.util.SourceFileScanner.restrict() ?

> New buffer should be created when StringBuffer has real string already
> (isStringized is true)

I agree

> and new buffer length (newLength) is larger
> than obsoleted buffer length (buffer.length). 

No, _OR_ new buffer length ...
But this case is handle by ensureCapacity(x, false) so:
 
    boolean newBuf = ensureCapacity(newLength, isStringized);

Could you test that with Ant ?
-- 
Edouard G. Parmelan
http://egp.free.fr

Reply via email to