svn commit: r395512 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java

2006-04-19 Thread kevj
Author: kevj
Date: Wed Apr 19 23:51:49 2006
New Revision: 395512

URL: http://svn.apache.org/viewcvs?rev=395512&view=rev
Log:
use StringUtil.LINE_SEP

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java?rev=395512&r1=395511&r2=395512&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
 Wed Apr 19 23:51:49 2006
@@ -17,6 +17,9 @@
 
 package org.apache.tools.ant.taskdefs.compilers;
 
+//Java5 style
+//import static org.apache.tools.ant.util.StringUtils.LINE_SEP; 
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -30,6 +33,7 @@
 import org.apache.tools.ant.types.Commandline;
 import org.apache.tools.ant.types.Path;
 import org.apache.tools.ant.util.FileUtils;
+import org.apache.tools.ant.util.StringUtils;
 import org.apache.tools.ant.util.JavaEnvUtils;
 import org.apache.tools.ant.taskdefs.condition.Os;
 
@@ -68,7 +72,7 @@
 protected String memoryMaximumSize;
 
 protected File[] compileList;
-protected static final String lSep = System.getProperty("line.separator");
+//protected static final String lSep = 
System.getProperty("line.separator");
 protected Javac attributes;
 
 
@@ -399,12 +403,12 @@
 }
 niceSourceList.append(" to be compiled:");
 
-niceSourceList.append(lSep);
+niceSourceList.append(StringUtils.LINE_SEP);
 
 for (int i = 0; i < compileList.length; i++) {
 String arg = compileList[i].getAbsolutePath();
 cmd.createArgument().setValue(arg);
-niceSourceList.append("" + arg + lSep);
+niceSourceList.append("" + arg + StringUtils.LINE_SEP);
 }
 
 attributes.log(niceSourceList.toString(), Project.MSG_VERBOSE);



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



svn commit: r395510 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java

2006-04-19 Thread kevj
Author: kevj
Date: Wed Apr 19 23:44:38 2006
New Revision: 395510

URL: http://svn.apache.org/viewcvs?rev=395510&view=rev
Log:
fix bug#32738, implement quiet check for every message logged

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java?rev=395510&r1=395509&r2=395510&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Delete.java Wed Apr 
19 23:44:38 2006
@@ -490,7 +490,7 @@
 public void execute() throws BuildException {
 if (usedMatchingTask) {
 log("DEPRECATED - Use of the implicit FileSet is deprecated.  "
-+ "Use a nested fileset element instead.");
++ "Use a nested fileset element instead.", quiet ? 
Project.MSG_VERBOSE : verbosity);
 }
 
 if (file == null && dir == null && filesets.size() == 0 && rcs == 
null) {
@@ -510,7 +510,7 @@
 if (file.isDirectory()) {
 log("Directory " + file.getAbsolutePath()
 + " cannot be removed using the file attribute.  "
-+ "Use dir instead.");
++ "Use dir instead.", quiet ? Project.MSG_VERBOSE : 
verbosity);
 } else {
 log("Deleting: " + file.getAbsolutePath());
 
@@ -520,8 +520,7 @@
 }
 } else {
 log("Could not find file " + file.getAbsolutePath()
-+ " to delete.",
-Project.MSG_VERBOSE);
++ " to delete.", quiet ? Project.MSG_VERBOSE : verbosity);
 }
 }
 
@@ -545,7 +544,7 @@
 Resources filesetDirs = new Resources();
 filesetDirs.setProject(getProject());
 
-for (int i = 0; i < filesets.size(); i++) {
+for (int i = 0, size = filesets.size(); i < size; i++) {
 FileSet fs = (FileSet) filesets.get(i);
 if (fs.getProject() == null) {
 log("Deleting fileset with no project specified;"
@@ -617,7 +616,7 @@
 throw (e instanceof BuildException)
 ? (BuildException) e : new BuildException(e);
 }
-log(e.getMessage(), quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);
+log(e.getMessage(), quiet ? Project.MSG_VERBOSE : verbosity);
 }
 
 /**
@@ -666,7 +665,7 @@
 if (f.isDirectory()) {
 removeDir(f);
 } else {
-log("Deleting " + f.getAbsolutePath(), verbosity);
+log("Deleting " + f.getAbsolutePath(), quiet ? 
Project.MSG_VERBOSE : verbosity);
 if (!delete(f)) {
 handle("Unable to delete file " + f.getAbsolutePath());
 }
@@ -688,10 +687,11 @@
 protected void removeFiles(File d, String[] files, String[] dirs) {
 if (files.length > 0) {
 log("Deleting " + files.length + " files from "
-+ d.getAbsolutePath());
++ d.getAbsolutePath(), quiet ? Project.MSG_VERBOSE : 
verbosity);
 for (int j = 0; j < files.length; j++) {
 File f = new File(d, files[j]);
-log("Deleting " + f.getAbsolutePath(), verbosity);
+log("Deleting " + f.getAbsolutePath(), 
+quiet ? Project.MSG_VERBOSE : verbosity);
 if (!delete(f)) {
 handle("Unable to delete file " + f.getAbsolutePath());
 }
@@ -704,7 +704,8 @@
 File currDir = new File(d, dirs[j]);
 String[] dirFiles = currDir.list();
 if (dirFiles == null || dirFiles.length == 0) {
-log("Deleting " + currDir.getAbsolutePath(), verbosity);
+log("Deleting " + currDir.getAbsolutePath(), 
+quiet ? Project.MSG_VERBOSE : verbosity);
 if (!delete(currDir)) {
 handle("Unable to delete directory "
 + currDir.getAbsolutePath());
@@ -715,9 +716,11 @@
 }
 
 if (dirCount > 0) {
-log("Deleted " + dirCount + " director"
-+ (dirCount == 1 ? "y" : "ies")
-+ " from " + d.getAbsolutePath());
+log("Deleted "
+ + dirCount
+ + " director" + (dirCount == 1 ? "y" : "ies")
+ + " form " + d.getAbsolutePath(), 
+ quiet ? Project.MSG_VERBOSE : verbosity);
 }
 }
 }



-
To unsubscribe, e-mail: [EM

DO NOT REPLY [Bug 32884] - [PATCH] PathConvert on Windows should process forward and back slashes equivalently

2006-04-19 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32884


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEEDINFO|ASSIGNED




--- Additional Comments From [EMAIL PROTECTED]  2006-04-20 06:25 ---
The prefix is not removed on windows, because of:

- the file paths are returned in windows format, something like
C:\MyProjects\ProjectX\lib\somelib.jar

- the paths specified to search files and as the prefix usually I use something
like  ${basedir}/lib.

And when strings are compared, they do not match, because they use different
slashes. So prefix is not removed.
In my patch I added replace, making all slashes uniform.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



Re: AW: Adding a methof to StringUtils

2006-04-19 Thread Antoine Levy-Lambert
Matt Benson wrote:
>
> Kev: I've asked some stuff about FileUtils before...
> historically it was thought it might be pluggable,
> hence all the instance methods.  But that never
> happened so the static methods crept in.  I think it
> was Martijn who really pushed in the FileUtils
> singleton.  Most places in Ant's code don't
> instantiate their own FileUtils anymore, and if they
> do they shouldn't; they should use the singleton.
>
> -Matt
>   

Hello Kev,

if you want to do some optimization work for copy,
can you have a look at this bug report :
http://issues.apache.org/bugzilla/show_bug.cgi?id=30094

Using nio for copy operations to network drives under Windows brings a
huge performance improvement.
I used it on Windows 2000 or 2003 and JDK 1.4, with as target some
drives automounted from a NAS box.

With NIO the copy speed is at least 4 times as big.

This type of progress dwarfs logging optimization.

Of course, this is mainly to be used (or only) in the case when one
copies 100% of the content of a file to another location,
no filtering takes place.

Regards,

Antoine

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



Re: AW: Adding a methof to StringUtils

2006-04-19 Thread Matt Benson


--- Kev Jackson <[EMAIL PROTECTED]> wrote:

> Dominique Devienne wrote:
> 
> >>The point about building the strings when they
> aren't used (because
> >>logging verbosity is set too low) still stands
> though - this is less
> >>than efficient
> >>
> >>
> >
> >The point, which Matt already raised, is that you
> can't know the level
> >at which the logger and the listeners are set.
> There is nothing ATM in
> >the Ant codebase to tip off the project as to the
> min log level of all
> >logger+listener to implement your optimization.
> This could be can be
> >added though, and would be useful IMHO, but that's
> a separate thread.
> >
> >  
> >
> I know, that was why I didn't want to wrap the log
> code in if(verbosity 
>  >= Project.MSG_INFO) conditionals - it's sort of a
> catch-22 situation, 
> you don't want to log the message (or even bother
> building it) if it 
> won't be used, but that can't be determined, so you
> must build the 
> message just in case - I agree a mechanism for you
> to retrieve the 
> minimum logging level of the entire project would be
> useful in this 
> situation
> 
> >The StringBuffer optimization is well known. I've
> either read about it
> >in Effective Java or the "K&R" of Java,
> The.Java.Prog.Lang.
> >  
> >
> I think it was in Effective Java, but as Alexey
> showed previously, 
> Java1.4+ actually perform this operation for you,
> letting you be as lazy 
> as you like with String concatenation (now that's
> progress!).  I have to 
> stop beating up the junior devs here whenever I see
> sqlString = "Select 
> " + field + " from " + table + " where " + field + "
> = value"; as we are 
> on 1.4 internally so it doesn't degrade performance
> anymore.  Still I'd 
> prefer to be able to do something like "yada yada
> ${var1} yada yada 
> ${var2}" like the property expansion that is already
> in Ant - I 
> personally think it's much cleaner than "yada yada "
> + var1 + "yada 
> yada" + var2., even the Java5 printf isn't as nice
> as it could be for 
> constructing messages (although it's a long way
> forward).
> 
> >I think what you propose to do would clutter the
> code, and make it
> >ugly frankly ;-) I'd probably -1 it unless you can
> show hard evidence
> >of it's usefulness.
> >  
> >
> If it came to it I'd -1 it too!  I don't like any of
> the solutions I 
> could come up with yesterday, the one I showed was
> the 'least worst' 
> that I could think of, with a semi-upgrade path to
> Java5 style varargs 
> (use an object array).  I was mainly throwing the
> idea out to see what 
> peoples reactions were - overall I don't think it's
> the right way to 
> solve the problem - the real problem is that the
> level of logging cannot 
> currently be determined and so any optimization (for
> memory or 
> performance) is actually changing the behaviour of
> the code - which it 
> shouldn't do.
> 
> The delete task was just an example - I was looking
> at it to fix 'delete 
> task won't be quiet' bug in bugzilla, and I was also
> thinking about the 
> problem with AppFuse, (which does use Delete a
> little, but not as much 
> as Copy and other tasks), so it seemed like a handy
> guinea pig as I had 
> the code open at the time.
> 
> I was also looking at Copy and saw that
> ResourceUtils.copyResource is a 
> static method, but FileUtils.copyFile is not even
> though it delegates to 
> copyResource, this means that in Copy there must be
> an instantiated 
> fileUtils object, just to perform the copy,
> unfortunately the FileUtils 
> interface/API is public so changing it would break
> bwc, but I'd like to 
> add a static method for copyFile so that Copy wont
> need to instantiate 
> FileUtils.

Kev: I've asked some stuff about FileUtils before...
historically it was thought it might be pluggable,
hence all the instance methods.  But that never
happened so the static methods crept in.  I think it
was Martijn who really pushed in the FileUtils
singleton.  Most places in Ant's code don't
instantiate their own FileUtils anymore, and if they
do they shouldn't; they should use the singleton.

-Matt
> 
> Thanks everyone for feedback
> Kev
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: AW: Adding a methof to StringUtils

2006-04-19 Thread Kev Jackson

Dominique Devienne wrote:


The point about building the strings when they aren't used (because
logging verbosity is set too low) still stands though - this is less
than efficient
   



The point, which Matt already raised, is that you can't know the level
at which the logger and the listeners are set. There is nothing ATM in
the Ant codebase to tip off the project as to the min log level of all
logger+listener to implement your optimization. This could be can be
added though, and would be useful IMHO, but that's a separate thread.

 

I know, that was why I didn't want to wrap the log code in if(verbosity 
>= Project.MSG_INFO) conditionals - it's sort of a catch-22 situation, 
you don't want to log the message (or even bother building it) if it 
won't be used, but that can't be determined, so you must build the 
message just in case - I agree a mechanism for you to retrieve the 
minimum logging level of the entire project would be useful in this 
situation



The StringBuffer optimization is well known. I've either read about it
in Effective Java or the "K&R" of Java, The.Java.Prog.Lang.
 

I think it was in Effective Java, but as Alexey showed previously, 
Java1.4+ actually perform this operation for you, letting you be as lazy 
as you like with String concatenation (now that's progress!).  I have to 
stop beating up the junior devs here whenever I see sqlString = "Select 
" + field + " from " + table + " where " + field + " = value"; as we are 
on 1.4 internally so it doesn't degrade performance anymore.  Still I'd 
prefer to be able to do something like "yada yada ${var1} yada yada 
${var2}" like the property expansion that is already in Ant - I 
personally think it's much cleaner than "yada yada " + var1 + "yada 
yada" + var2., even the Java5 printf isn't as nice as it could be for 
constructing messages (although it's a long way forward).



I think what you propose to do would clutter the code, and make it
ugly frankly ;-) I'd probably -1 it unless you can show hard evidence
of it's usefulness.
 

If it came to it I'd -1 it too!  I don't like any of the solutions I 
could come up with yesterday, the one I showed was the 'least worst' 
that I could think of, with a semi-upgrade path to Java5 style varargs 
(use an object array).  I was mainly throwing the idea out to see what 
peoples reactions were - overall I don't think it's the right way to 
solve the problem - the real problem is that the level of logging cannot 
currently be determined and so any optimization (for memory or 
performance) is actually changing the behaviour of the code - which it 
shouldn't do.


The delete task was just an example - I was looking at it to fix 'delete 
task won't be quiet' bug in bugzilla, and I was also thinking about the 
problem with AppFuse, (which does use Delete a little, but not as much 
as Copy and other tasks), so it seemed like a handy guinea pig as I had 
the code open at the time.


I was also looking at Copy and saw that ResourceUtils.copyResource is a 
static method, but FileUtils.copyFile is not even though it delegates to 
copyResource, this means that in Copy there must be an instantiated 
fileUtils object, just to perform the copy, unfortunately the FileUtils 
interface/API is public so changing it would break bwc, but I'd like to 
add a static method for copyFile so that Copy wont need to instantiate 
FileUtils.


Thanks everyone for feedback
Kev

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



Re: [VOTE] removal of dependency to xslp

2006-04-19 Thread Conor MacNeill
> 
> [X] Yes
> 
> [ ] No
> 

Conor


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



Re: [VOTE] removal of the test task based upon the org.apache.testlet framework

2006-04-19 Thread Conor MacNeill
> 
> [X] Yes
> 
> [ ] No
> 

Conor


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



Re: [VOTE] removal of Visual for Java based tasks

2006-04-19 Thread Conor MacNeill
> 
> [X] Yes
> 
> [ ] No
> 


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



Re: [VOTE] removal of icontract based task in ant

2006-04-19 Thread Conor MacNeill
> [X] Yes
> 
> [ ] No
> 


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



DO NOT REPLY [Bug 32884] - [PATCH] PathConvert on Windows should process forward and back slashes equivalently

2006-04-19 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32884





--- Additional Comments From [EMAIL PROTECTED]  2006-04-19 22:31 ---
(In reply to comment #2)
> this would be better with a concrete example of what doesn't work

In my case, running under Windows and using forward slashes:

  
   
   

   
  

  ${test.path}

The prefix isn't removed. Using backslashes in both the prefix and the path
works, but I'm used to being able to use forward slashes in Ant under any 
platform.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



svn commit: r395400 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java

2006-04-19 Thread stevel
Author: stevel
Date: Wed Apr 19 14:42:01 2006
New Revision: 395400

URL: http://svn.apache.org/viewcvs?rev=395400&view=rev
Log:
javadocs

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java?rev=395400&r1=395399&r2=395400&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java
 Wed Apr 19 14:42:01 2006
@@ -84,7 +84,7 @@
 
 /**
  * Sets the file or dir mode for this resource.
- * @param integer representation of Unix permission mask.
+ * @param mode integer representation of Unix permission mask.
  */
 public void setMode(int mode) {
 checkAttributesAllowed();



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



DO NOT REPLY [Bug 39359] New: - Problems with OSD-5 filespecs and return codes on OpenVMS

2006-04-19 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39359

   Summary: Problems with OSD-5 filespecs and return codes on
OpenVMS
   Product: Ant
   Version: 1.7Alpha (nightly)
  Platform: HP
OS/Version: OpenVMS
Status: NEW
  Severity: normal
  Priority: P2
 Component: Core tasks
AssignedTo: dev@ant.apache.org
ReportedBy: [EMAIL PROTECTED]


We're currently looking into some problems with filespecs and return codes on 
OpenVMS.  These are two areas where OpenVMS is very different from Unix-like 
operating systems.  

Filespecs on OpenVMS have a different format than standard Unix filespecs.  A 
conversion routine to convert between the Unix-style and OpenVMS-style formats 
is already in FileUtils.java, but it is out of date since it assumes (older) 
ODS-2 style OpenVMS filespecs, and the current format is ODS-5 style.  We 
propose to update this routine to support the conversion of ODS-5 style 
OpenVMS filespecs to/from Unix-style filespecs.

In addition, OpenVMS normally returns a 1 for success from functions and 
system calls, for failures it returns a value which is a predefined error code 
> 1.  However, Java assumes that the return value is the number of errors 
encountered, which means that 0 is successful.  We're proposing changes to 
Execute.java to control which return style is used (conditionally on OpenVMS 
systems) by checking the value of a logical name on OpenVMS (like an 
environment variable).

Also in Execute.java, some changes to the way certain DCL commands are built 
will enable tasks like  to work properly.  At this time, if the 
argument to  is an image represented by a Unix-style filespec, the 
 will fail. 

As an example, a test suite that reproduces these problems is 

Test: org.apache.tools.ant.taskdefs.SignJarTest
[test-junit] Tests run: 32, Failures: 2, Errors: 19, Time elapsed: 284.826 sec 

With your permission we will post the entire test results (from OpenVMS) 
before and after and the patches here to this bug report.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



RE: AW: Adding a methof to StringUtils

2006-04-19 Thread Matt Benson
--- "Burgess, Benjamin" <[EMAIL PROTECTED]>
wrote:

> A good description of this comes from the JavaDocs
> for Log4j here:
> 
>
http://logging.apache.org/log4j/docs/api/org/apache/log4j/Category.html#
> isDebugEnabled()
> 
> So actually, you would only wrap the debug log
> statement in an
> if(log.isDebug()) if the message itself is more than
> a simple String
> (ie. Contains concatenation or creates an object).
> 

It might be useful to remember this... the main
problem in Ant, though, is that a Project doesn't
currently know at what level it is being logged.  Only
its listeners know that.

-Matt

> Ben
[SNIP]

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: AW: Adding a methof to StringUtils

2006-04-19 Thread Burgess, Benjamin
A good description of this comes from the JavaDocs for Log4j here:

http://logging.apache.org/log4j/docs/api/org/apache/log4j/Category.html#
isDebugEnabled()

So actually, you would only wrap the debug log statement in an
if(log.isDebug()) if the message itself is more than a simple String
(ie. Contains concatenation or creates an object).

Ben

-Original Message-
From: Steve Loughran [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 19, 2006 8:49 AM
To: Ant Developers List
Subject: Re: AW: Adding a methof to StringUtils

Kev Jackson wrote:
> [EMAIL PROTECTED] wrote:
> 
>>> As I've been hacking away today, I've been swapping a load of "" +
"" 
>>> + "" style code over to use StringBuffers.  I thought that perhaps 
>>> there's a potential use of a static method in StringUtils to 
>>> construct these strings from an array
>>>   
>>
>>
>> For a significant performance boost we had to refactor the whole (or
a
>> major part) of the codebase in this manner. So I think a performance
>> test would be good. How much is the improvement on ?
>>
>>
>>  
>>
> It's less to do with speed performance and more to do with memory 
> performance.  "a" + "b" + "c" creates "a" + "bc" <- intermediate
String, 
> and then "abc"
> 
> I'd love to do a performance/memory test of some kind, perhaps I'll
use 
> the new NetBeans (it's supposed to have a good view of the heap being 
> used).  Any suggestions on tools to help evaluate changes would be
helpful.
> 
> We also have a problem with logging in general where the Strings are 
> concatenated :
> log("a" + toFile + " b " + dir + etc, verbosity);
> 
> This will produce a lot of temp Strings, send the result to log and 
> crucially, if the verbosity is too low, won't even use it - that's a 
> waste of memory in every sense of the word.  I'd like to fix this, the

> appendMessage method I proposed is only a bandaid for now.
> 
> Essentially we don't want to perform any operations, or produce any 
> temporary values if they aren't going to be used, but I can't see a
way 
> of doing this without something like
> 
> if (verbosity >= Project.MSG_INFO) {
>  log(msg + e + msg2);
> }
> 
> but this is subverting the log method that uses the verbosity 
> internally, and adding conditions to the construction of log messages
is 
> not nice.


This is the pattern you encounter with log4j/commons-logging a lot

if(log.isDebug() {
  log.debug("something);
}

skipping the entire concat and log process would speed things up. Too 
bad the log interface spews everything out and then it gets discarded 
later. I think in the Ant1.8+ timeframe we could think about tuning how 
we log to let tasks find out more about how they get logged and feed 
that back in to string creation.

Regarding the change, I thought for a moment you were in Java5 varargs 
code. Whatever changes are used they should ideally prepare ant for a 
world where varargs logging is possible, some years down the line, or 
much closer in third party java5+ only tasks.

-steve

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



**
This message, including any attachments, contains confidential information 
intended for a specific individual and purpose, and is protected by law.  If 
you are not the intended recipient, please contact sender immediately by reply 
e-mail and destroy all copies.  You are hereby notified that any disclosure, 
copying, or distribution of this message, or the taking of any action based on 
it, is strictly prohibited.
TIAA-CREF
**


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



svn commit: r395318 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java

2006-04-19 Thread peterreilly
Author: peterreilly
Date: Wed Apr 19 10:33:46 2006
New Revision: 395318

URL: http://svn.apache.org/viewcvs?rev=395318&view=rev
Log:
Support for mustang (todo.. use same defines as Javac.java

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java?rev=395318&r1=395317&r2=395318&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
 Wed Apr 19 10:33:46 2006
@@ -63,6 +63,7 @@
 public static CompilerAdapter getCompiler(String compilerType, Task task)
 throws BuildException {
 boolean isClassicCompilerSupported = true;
+System.out.println("GetCompiler: compilerType is " + compilerType);
 //as new versions of java come out, add them to this test
 if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
 && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
@@ -93,7 +94,8 @@
 if (compilerType.equalsIgnoreCase("modern")
 || compilerType.equalsIgnoreCase("javac1.3")
 || compilerType.equalsIgnoreCase("javac1.4")
-|| compilerType.equalsIgnoreCase("javac1.5")) {
+|| compilerType.equalsIgnoreCase("javac1.5")
+|| compilerType.equalsIgnoreCase("javac1.6")) {
 // does the modern compiler exist?
 if (doesModernCompilerExist()) {
 return new Javac13();



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



DO NOT REPLY [Bug 39357] - ant-trax.jar includes Xalan2Executor from the junit package

2006-04-19 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39357


[EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||dev@ant.apache.org
 AssignedTo|dev@ant.apache.org  |[EMAIL PROTECTED]




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.
You are on the CC list for the bug, or are watching someone who is.

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



DO NOT REPLY [Bug 39357] New: - ant-trax.jar includes Xalan2Executor from the junit package

2006-04-19 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39357

   Summary: ant-trax.jar includes Xalan2Executor from the junit
package
   Product: Ant
   Version: 1.6.5
  Platform: All
OS/Version: All
Status: NEW
  Keywords: ErrorMessage
  Severity: normal
  Priority: P2
 Component: Optional Tasks
AssignedTo: dev@ant.apache.org
ReportedBy: [EMAIL PROTECTED]


The ant-trax.jar contains the class
org.apache.tools.ant.taskdefs.optional.junit.Xalan2Executor. This causes
problems when attempting to taskdef the junitreport task
(org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator) where
junit.jar and ant-junit.jar are not in the ANT_HOME/lib directory. Basically you
get a NoClassDefFound error on Xalan2Executor since the classloaders don't 
match.

As far as I was able to tell Xalan2Executor is not actually used by the ant-trax
classes.

Right now my workaround is to remove ant-trax.jar from the ANT_HOME/lib
directory since I don't use trax.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



svn commit: r395304 - in /ant/core/trunk/src/main/org/apache/tools/ant: launch/Launcher.java launch/Locator.java taskdefs/ManifestClassPath.java util/FileUtils.java

2006-04-19 Thread peterreilly
Author: peterreilly
Date: Wed Apr 19 09:31:30 2006
New Revision: 395304

URL: http://svn.apache.org/viewcvs?rev=395304&view=rev
Log:
change name of Locator.encodeUri to Locator.encodeURI


Modified:
ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java
ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java
ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java?rev=395304&r1=395303&r2=395304&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java Wed Apr 
19 09:31:30 2006
@@ -131,7 +131,7 @@
 }
 
 try {
-libPathURLs.add(new 
URL(Locator.encodeUri(element.toURL().toString(;
+libPathURLs.add(new 
URL(Locator.encodeURI(element.toURL().toString(;
 } catch (UnsupportedEncodingException ex) {
 throw new MalformedURLException(ex.toString());
 }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?rev=395304&r1=395303&r2=395304&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Wed Apr 19 
09:31:30 2006
@@ -253,7 +253,7 @@
  * @throws UnsupportedEncodingException if UTF-8 is not available
  * @since Ant 1.7
  */
-public static String encodeUri(String path) throws 
UnsupportedEncodingException {
+public static String encodeURI(String path) throws 
UnsupportedEncodingException {
 int i = 0;
 int len = path.length();
 int ch = 0;
@@ -409,9 +409,9 @@
  * FileUtils.toURI() cannot be used by Locator.java
  * Implemented this way.
  * File.toURL() adds file: and changes '\' to '/' for 
dos OSes
- * encodeUri converts characters like ' ' and '#' to 
%DD
+ * encodeURI converts characters like ' ' and '#' to 
%DD
  */
-urls[0] = new 
URL(encodeUri(location.toURL().toString()));
+urls[0] = new 
URL(encodeURI(location.toURL().toString()));
 } catch (UnsupportedEncodingException ex) {
 throw new MalformedURLException(ex.toString());
 }
@@ -435,7 +435,7 @@
 for (int i = 0; i < matches.length; ++i) {
 try {
 // See comments above.
-urls[i] = new URL(encodeUri(matches[i].toURL().toString()));
+urls[i] = new URL(encodeURI(matches[i].toURL().toString()));
 } catch (UnsupportedEncodingException ex) {
 throw new MalformedURLException(ex.toString());
 }

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java?rev=395304&r1=395303&r2=395304&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java 
(original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ManifestClassPath.java 
Wed Apr 19 09:31:30 2006
@@ -129,7 +129,7 @@
 relPath = relPath + '/';
 }
 try {
-relPath = Locator.encodeUri(relPath);
+relPath = Locator.encodeURI(relPath);
 } catch (UnsupportedEncodingException exc) {
 throw new BuildException(exc);
 }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java?rev=395304&r1=395303&r2=395304&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Wed Apr 19 
09:31:30 2006
@@ -1073,7 +1073,7 @@
 }
 path = path.replace('\\', '/');
 try {
-sb.append(Locator.encodeUri(path));
+sb.append(Locator.encodeURI(path));
 } catch (UnsupportedEncodingException exc) {
 throw new BuildException(exc);
 }



--

Re: svn commit: r395206 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

2006-04-19 Thread Antoine Levy-Lambert

Peter Reilly wrote:

Hi Antoine,
Thanks for checking.
I had made a mistake!
I had forgot to commit the other file that I changed - Launcher.java
(assuming that it only had changes with printf statements!).
Can you test now?

  

Hello Peter,

I have tweaked docs.xml to work with a classpath set with the -lib 
option (by removing classpath setup).


This works now. :-)

$ $ANT_HOME/bin/ant -f docs.test.xml -lib 
c:/opt/velocity-1.4/velocity\#dep-1.4.jar -lib 
c:/opt/velocity-1.4/build/li\#b/jdom-b9.jar

Buildfile: docs.test.xml

anakia:

  [anakia] Transforming into: C:\dev\asf\ant-core\docs


fixcrlf:


docs:



BUILD SUCCESSFUL

Total time: 7 seconds

Thanks for developing, ;-)

Antonie


I have tested by moving ant-contib.jar into ~/# and running
with ant --execdebug -f x.xml -lib ~/#
where x.xml was:

  

  
  
Hello world
  

  


Peter
  




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



RE: # character causes problem parsing -lib paths

2006-04-19 Thread Matt Benson
--- [EMAIL PROTECTED] wrote:

> Hi Peter,
> 
>  >I have made a change to ant SVN to fix this.
> 
> So if I wanted to get a version of Ant with it fixed
> I could check it
> out from SVN? 
> 
> Is there any bug fix release schedule for Ant? I'm
> wondering because
> there has not been a new release for some time.

We have recently begun discussing a release of Ant
1.7.  Any user who wants to try out SVN HEAD, or a
release candidate when one is available, would only be
protecting his own future productivity by aiding the
effort of testing Ant in the wild.

-Matt
> 
> cheers
> 
> paul
> 
> >-Original Message-
> >From: ext Peter Reilly
> [mailto:[EMAIL PROTECTED] 
> >Sent: 19 April 2006 03:52
> >To: Ant Developers List
> >Subject: Re: # character causes problem parsing
> -lib paths
> >
> >I have just checked.
> >This is a problem - the ant launcher code does some
> conversion 
> >of file names to URLs. The '#' character is not
> converted The 
> >only work-around (at the moment) is to use symbolic
> links.
> >I have made a change to ant SVN to fix this.
> >
> >Peter
> >
> >On 4/19/06, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> >>
> >> Hello,
> >>
> >> I have found that if I specify a -lib option with
> a path 
> >that contains 
> >> a hash "#" character, it cannot find the
> libraries. Without the # 
> >> character in the path they can be picked up fine.
> >>
> >> This is not easily avoided in our environment, as
> we use Synergy for 
> >> SCM, which defaults to using # in the path when
> checking out 
> >projects.
> >> This can be changed, but that is not desirable.
> >>
> >> Is this a known bug? Does anyone know of any
> workarounds?
> >>
> >> Many thanks
> >>
> >> paul
> >>
> >>
> >
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: # character causes problem parsing -lib paths

2006-04-19 Thread Paul.Mackay
Hi Peter,

 >I have made a change to ant SVN to fix this.

So if I wanted to get a version of Ant with it fixed I could check it
out from SVN? 

Is there any bug fix release schedule for Ant? I'm wondering because
there has not been a new release for some time.

cheers

paul

>-Original Message-
>From: ext Peter Reilly [mailto:[EMAIL PROTECTED] 
>Sent: 19 April 2006 03:52
>To: Ant Developers List
>Subject: Re: # character causes problem parsing -lib paths
>
>I have just checked.
>This is a problem - the ant launcher code does some conversion 
>of file names to URLs. The '#' character is not converted The 
>only work-around (at the moment) is to use symbolic links.
>I have made a change to ant SVN to fix this.
>
>Peter
>
>On 4/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> I have found that if I specify a -lib option with a path 
>that contains 
>> a hash "#" character, it cannot find the libraries. Without the # 
>> character in the path they can be picked up fine.
>>
>> This is not easily avoided in our environment, as we use Synergy for 
>> SCM, which defaults to using # in the path when checking out 
>projects.
>> This can be changed, but that is not desirable.
>>
>> Is this a known bug? Does anyone know of any workarounds?
>>
>> Many thanks
>>
>> paul
>>
>>
>

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



Re: AW: Adding a methof to StringUtils

2006-04-19 Thread Matt Benson
--- Dominique Devienne <[EMAIL PROTECTED]> wrote:

> > The point about building the strings when they
> aren't used (because
> > logging verbosity is set too low) still stands
> though - this is less
> > than efficient
> 
> The point, which Matt already raised, is that you
> can't know the level
> at which the logger and the listeners are set. There

Actually, I think that was Jan.  :)

> is nothing ATM in
> the Ant codebase to tip off the project as to the
> min log level of all
> logger+listener to implement your optimization. This
> could be can be
> added though, and would be useful IMHO, but that's a
> separate thread.
> 
> The StringBuffer optimization is well known. I've
> either read about it
> in Effective Java or the "K&R" of Java,
> The.Java.Prog.Lang.
> 
> I think what you propose to do would clutter the
> code, and make it
> ugly frankly ;-) I'd probably -1 it unless you can
> show hard evidence
> of it's usefulness.
> 
> If  is causing problem, replacing it by a
> custom task which is
> streamlined and doesn't need to buffer all files to
> delete beforehand
> for example. --DD
> 

I had tried to make  do as little buffering as
possible.  The original resourceCollection-enabled
version was reported by Alexey to present a major
slowdown for existing large fileset deletions, but I
refactored the fileset handling to try to avoid this. 
At present I can see where more speed could possibly
be coaxed out here, but it would cost memory which is
apparently already a problem.  Any relevant profiling
results would be of interest to me.

-Matt

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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: svn commit: r395206 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

2006-04-19 Thread Peter Reilly
Hi Antoine,
Thanks for checking.
I had made a mistake!
I had forgot to commit the other file that I changed - Launcher.java
(assuming that it only had changes with printf statements!).
Can you test now?

I have tested by moving ant-contib.jar into ~/# and running
with ant --execdebug -f x.xml -lib ~/#
where x.xml was:

  

  
  
Hello world
  

  


Peter

On 4/19/06, Antoine Levy-Lambert <[EMAIL PROTECTED]> wrote:
>
>
>
> Antoine Levy-Lambert wrote:
> > results :
> >
> > ant -f docs.xml -lib c:/opt/velocity\#1.4/velocity-dep-1.4.jar -lib
> > c:/opt/velocity\#1.4/build/lib/jdom-b9.jar
> >
> > I wonder whether the lines 146 to 181 in Locator.java which I copied
> > from a bug report of Jesse are good.
> >
> >
> If I remove the lines 146 to 181 in Locator.java,
> (meaning if Locator#fromURI(String uri) is implemented without
> reflection, using ant's own code)
> there is no exception, but the Anakia task is not found. :-(
>
> It sounds like we need to setup special testcases concerning locating
> directories or files containing the # sign.
>
> Peter : were you able to test something like that under UNIX ? Or is it
> impossible ?
>
> I would also try simply running a java program with java -cp something
> someclass with a classpath containing hash signs
> to see whether this works.
>
> Regards,
>
> Antoine
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


svn commit: r395248 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java

2006-04-19 Thread peterreilly
Author: peterreilly
Date: Wed Apr 19 07:11:26 2006
New Revision: 395248

URL: http://svn.apache.org/viewcvs?rev=395248&view=rev
Log:
compete toUri code for launcher

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java?rev=395248&r1=395247&r2=395248&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Launcher.java Wed Apr 
19 07:11:26 2006
@@ -19,6 +19,7 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.net.MalformedURLException;
+import java.io.UnsupportedEncodingException;
 import java.io.File;
 import java.util.StringTokenizer;
 import java.util.List;
@@ -129,7 +130,11 @@
 }
 }
 
-libPathURLs.add(element.toURL());
+try {
+libPathURLs.add(new 
URL(Locator.encodeUri(element.toURL().toString(;
+} catch (UnsupportedEncodingException ex) {
+throw new MalformedURLException(ex.toString());
+}
 }
 }
 



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



DO NOT REPLY [Bug 39183] - Make source attribute of javac mandatory

2006-04-19 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39183





--- Additional Comments From [EMAIL PROTECTED]  2006-04-19 13:57 ---
(In reply to comment #8)
> To Matt re. adding verbosity to builds for users who "choose to ignore the
> documentation's boldface warning" - I doubt most people ever read the manual
> very carefully (or at all). They see someone using  somewhere, they 
> copy
> it, it seems to work, done. I can't imagine any case where you would
> intentionally omit the 'source' attr except out of pure laziness.

Guilty.  ;)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



AW: Ant Website error? or feature?

2006-04-19 Thread Jan.Materne
Was reported in Feb this year [1].
I fixed the manual in HEAD [2], but the site shows the 1.6.5 manual (and didnt 
want to change that ;-)


Jan

[1] http://marc.theaimsgroup.com/?l=ant-user&m=114119660927996&w=2 
[2] http://marc.theaimsgroup.com/?l=ant-dev&m=114119647516675&w=2

>-Ursprüngliche Nachricht-
>Von: Erik Hatcher [mailto:[EMAIL PROTECTED] 
>Gesendet: Mittwoch, 19. April 2006 14:53
>An: Ant Dev
>Betreff: Fwd: Ant Website error? or feature?
>
>Passing on a private Ant documentation related issue.  I'm 
>guessing the only solution is to add a target="..." to the top 
>browser window to such hyperlinks.  Or eventually move away 
>from using frames.
>
>   Erik
>
>
>
>Begin forwarded message:
>
>> From: Steve Meredith <[EMAIL PROTECTED]>
>> Date: April 19, 2006 8:11:47 AM EDT
>> To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
>> Subject: Ant Website error? or feature?
>>
>> Hi
>>
>> Just to let you know that If I visit
>>
>> http://ant.apache.org/
>>
>> then click on [manual] from the menu taking me to
>>
>> http://ant.apache.org/manual/index.html
>>
>> and accidentally click on [apache ant] link in the first sentence I 
>> get sent to
>>
>> http://ant.apache.org/manual/index.html
>>
>> but inside a sub-window...and so on, and so on...
>>
>> How do I remove the "cascading" affect?  Or is this meant to happen?
>>
>> I emailed this question to someone before (can't remember who ) but 
>> got "fobbed off" with a "why would you want to do that" response 
>> (shame).
>>
>> So, in the interest of possible site improvement, I picked three 
>> emails addresses 'out of the hat' just to let someone know who might 
>> want to make a change -or is it a feature ;-)
>>
>> Kind Regards
>>
>> Steve
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED] For 
>additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: svn commit: r395206 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

2006-04-19 Thread Antoine Levy-Lambert


Antoine Levy-Lambert wrote:
> results :
>
> ant -f docs.xml -lib c:/opt/velocity\#1.4/velocity-dep-1.4.jar -lib
> c:/opt/velocity\#1.4/build/lib/jdom-b9.jar
>
> I wonder whether the lines 146 to 181 in Locator.java which I copied
> from a bug report of Jesse are good.
>
>   
If I remove the lines 146 to 181 in Locator.java,
(meaning if Locator#fromURI(String uri) is implemented without
reflection, using ant's own code)
there is no exception, but the Anakia task is not found. :-(

It sounds like we need to setup special testcases concerning locating
directories or files containing the # sign.

Peter : were you able to test something like that under UNIX ? Or is it
impossible ?

I would also try simply running a java program with java -cp something
someclass with a classpath containing hash signs
to see whether this works.

Regards,

Antoine


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



Re: AW: Adding a methof to StringUtils

2006-04-19 Thread Dominique Devienne
> The point about building the strings when they aren't used (because
> logging verbosity is set too low) still stands though - this is less
> than efficient

The point, which Matt already raised, is that you can't know the level
at which the logger and the listeners are set. There is nothing ATM in
the Ant codebase to tip off the project as to the min log level of all
logger+listener to implement your optimization. This could be can be
added though, and would be useful IMHO, but that's a separate thread.

The StringBuffer optimization is well known. I've either read about it
in Effective Java or the "K&R" of Java, The.Java.Prog.Lang.

I think what you propose to do would clutter the code, and make it
ugly frankly ;-) I'd probably -1 it unless you can show hard evidence
of it's usefulness.

If  is causing problem, replacing it by a custom task which is
streamlined and doesn't need to buffer all files to delete beforehand
for example. --DD

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



Fwd: Ant Website error? or feature?

2006-04-19 Thread Erik Hatcher
Passing on a private Ant documentation related issue.  I'm guessing  
the only solution is to add a target="..." to the top browser window  
to such hyperlinks.  Or eventually move away from using frames.


Erik



Begin forwarded message:


From: Steve Meredith <[EMAIL PROTECTED]>
Date: April 19, 2006 8:11:47 AM EDT
To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Ant Website error? or feature?

Hi

Just to let you know that If I visit

http://ant.apache.org/

then click on [manual] from the menu taking me to

http://ant.apache.org/manual/index.html

and accidentally click on [apache ant] link in the first sentence I  
get sent to


http://ant.apache.org/manual/index.html

but inside a sub-window...and so on, and so on...

How do I remove the "cascading" affect?  Or is this meant to happen?

I emailed this question to someone before (can't remember who ) but  
got "fobbed off" with a "why would you want to do that" response  
(shame).


So, in the interest of possible site improvement, I picked three  
emails addresses 'out of the hat' just to let someone know who  
might want to make a change -or is it a feature ;-)


Kind Regards

Steve



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



Re: AW: Adding a methof to StringUtils

2006-04-19 Thread Steve Loughran

Kev Jackson wrote:

[EMAIL PROTECTED] wrote:

As I've been hacking away today, I've been swapping a load of "" + "" 
+ "" style code over to use StringBuffers.  I thought that perhaps 
there's a potential use of a static method in StringUtils to 
construct these strings from an array
  



For a significant performance boost we had to refactor the whole (or a
major part) of the codebase in this manner. So I think a performance
test would be good. How much is the improvement on ?


 

It's less to do with speed performance and more to do with memory 
performance.  "a" + "b" + "c" creates "a" + "bc" <- intermediate String, 
and then "abc"


I'd love to do a performance/memory test of some kind, perhaps I'll use 
the new NetBeans (it's supposed to have a good view of the heap being 
used).  Any suggestions on tools to help evaluate changes would be helpful.


We also have a problem with logging in general where the Strings are 
concatenated :

log("a" + toFile + " b " + dir + etc, verbosity);

This will produce a lot of temp Strings, send the result to log and 
crucially, if the verbosity is too low, won't even use it - that's a 
waste of memory in every sense of the word.  I'd like to fix this, the 
appendMessage method I proposed is only a bandaid for now.


Essentially we don't want to perform any operations, or produce any 
temporary values if they aren't going to be used, but I can't see a way 
of doing this without something like


if (verbosity >= Project.MSG_INFO) {
 log(msg + e + msg2);
}

but this is subverting the log method that uses the verbosity 
internally, and adding conditions to the construction of log messages is 
not nice.



This is the pattern you encounter with log4j/commons-logging a lot

if(log.isDebug() {
 log.debug("something);
}

skipping the entire concat and log process would speed things up. Too 
bad the log interface spews everything out and then it gets discarded 
later. I think in the Ant1.8+ timeframe we could think about tuning how 
we log to let tasks find out more about how they get logged and feed 
that back in to string creation.


Regarding the change, I thought for a moment you were in Java5 varargs 
code. Whatever changes are used they should ideally prepare ant for a 
world where varargs logging is possible, some years down the line, or 
much closer in third party java5+ only tasks.


-steve

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



Re: svn commit: r395206 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

2006-04-19 Thread Antoine Levy-Lambert
Hello Peter,

First of all your code change is very clean and looks like a
simplification. :-)



I have tried on Windows2000 with JDK 1.5

results :

ant -f docs.xml -lib c:/opt/velocity\#1.4/velocity-dep-1.4.jar -lib
c:/opt/velocity\#1.4/build/lib/jdom-b9.jar
java.lang.IllegalArgumentException: URI has a fragment component

at java.io.File.(File.java:342)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)

at org.apache.tools.ant.launch.Launcher.run(Launcher.java:267)

at org.apache.tools.ant.launch.Launcher.main(Launcher.java:99)

I wonder whether the lines 146 to 181 in Locator.java which I copied
from a bug report of Jesse are good.





Antoine


Peter Reilly wrote:
> Hi,
> Can someone on a windows system check that this works there?
>
> i.e. the -lib option to ant
>
> Peter
>
>
> On 4/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>   
>> Author: peterreilly
>> Date: Wed Apr 19 03:50:02 2006
>> New Revision: 395206
>>
>> URL: http://svn.apache.org/viewcvs?rev=395206&view=rev
>> Log:
>> escape none URL characters
>>
>> Modified:
>> ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
>>
>> Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
>> URL:
>> http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?rev=395206&r1=395205&r2=395206&view=diff
>>
>> ==
>> --- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
>> (original)
>> +++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Wed
>> Apr 19 03:50:02 2006
>> @@ -401,7 +401,20 @@
>>  String path = location.getPath();
>>  for (int i = 0; i < extensions.length; ++i) {
>>  if (path.toLowerCase().endsWith(extensions[i])) {
>> -urls[0] = location.toURL();
>> +try {
>> +/**
>> + * File.toURL() does not encode characters like
>> #.
>> + * File.toURI() has been introduced in java 1.4,
>> so
>> + * ANT cannot use it (except by reflection)
>> + * FileUtils.toURI() cannot be used by
>> Locator.java
>> + * Implemented this way.
>> + * File.toURL() adds file: and changes '\' to '/'
>> for dos OSes
>> + * encodeUri converts characters like ' ' and '#'
>> to %DD
>> + */
>> +urls[0] = new URL(encodeUri(location.toURL
>> ().toString()));
>> +} catch (UnsupportedEncodingException ex) {
>> +throw new MalformedURLException(ex.toString());
>> +}
>>  break;
>>  }
>>  }
>> @@ -420,7 +433,12 @@
>>  });
>>  urls = new URL[matches.length];
>>  for (int i = 0; i < matches.length; ++i) {
>> -urls[i] = matches[i].toURL();
>> +try {
>> +// See comments above.
>> +urls[i] = new
>> URL(encodeUri(matches[i].toURL().toString()));
>> +} catch (UnsupportedEncodingException ex) {
>> +throw new MalformedURLException(ex.toString());
>> +}
>>  }
>>  return urls;
>>  }
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>> 
>
>   


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



svn commit: r395230 - /ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java

2006-04-19 Thread bodewig
Author: bodewig
Date: Wed Apr 19 05:31:09 2006
New Revision: 395230

URL: http://svn.apache.org/viewcvs?rev=395230&view=rev
Log:
2006

Modified:
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java

Modified: 
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java?rev=395230&r1=395229&r2=395230&view=diff
==
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java 
(original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java 
Wed Apr 19 05:31:09 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000, 2002, 2004-2005 The Apache Software Foundation
+ * Copyright 2000, 2002, 2004-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.



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



Re: svn commit: r395206 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

2006-04-19 Thread Peter Reilly
Hi,
Can someone on a windows system check that this works there?

i.e. the -lib option to ant

Peter


On 4/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Author: peterreilly
> Date: Wed Apr 19 03:50:02 2006
> New Revision: 395206
>
> URL: http://svn.apache.org/viewcvs?rev=395206&view=rev
> Log:
> escape none URL characters
>
> Modified:
> ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
>
> Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
> URL:
> http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?rev=395206&r1=395205&r2=395206&view=diff
>
> ==
> --- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
> (original)
> +++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Wed
> Apr 19 03:50:02 2006
> @@ -401,7 +401,20 @@
>  String path = location.getPath();
>  for (int i = 0; i < extensions.length; ++i) {
>  if (path.toLowerCase().endsWith(extensions[i])) {
> -urls[0] = location.toURL();
> +try {
> +/**
> + * File.toURL() does not encode characters like
> #.
> + * File.toURI() has been introduced in java 1.4,
> so
> + * ANT cannot use it (except by reflection)
> + * FileUtils.toURI() cannot be used by
> Locator.java
> + * Implemented this way.
> + * File.toURL() adds file: and changes '\' to '/'
> for dos OSes
> + * encodeUri converts characters like ' ' and '#'
> to %DD
> + */
> +urls[0] = new URL(encodeUri(location.toURL
> ().toString()));
> +} catch (UnsupportedEncodingException ex) {
> +throw new MalformedURLException(ex.toString());
> +}
>  break;
>  }
>  }
> @@ -420,7 +433,12 @@
>  });
>  urls = new URL[matches.length];
>  for (int i = 0; i < matches.length; ++i) {
> -urls[i] = matches[i].toURL();
> +try {
> +// See comments above.
> +urls[i] = new
> URL(encodeUri(matches[i].toURL().toString()));
> +} catch (UnsupportedEncodingException ex) {
> +throw new MalformedURLException(ex.toString());
> +}
>  }
>  return urls;
>  }
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: AW: Adding a methof to StringUtils

2006-04-19 Thread Kev Jackson



javap -c AAA

public java.lang.String concat(java.lang.String, java.lang.String, 
java.lang.String);
 Code:
  0:   new #2; //class java/lang/StringBuilder
  3:   dup
  4:   invokespecial   #3; //Method java/lang/StringBuilder."":()V
  7:   aload_1
  8:   invokevirtual   #4; //Method 
java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
  11:  aload_2
  12:  invokevirtual   #4; //Method 
java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
  15:  aload_3
  16:  invokevirtual   #4; //Method 
java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
  19:  invokevirtual   #5; //Method 
java/lang/StringBuilder.toString:()Ljava/lang/String;
  22:  areturn

 


[snip 1.4 output]
Thanks for showing me this, it's time I re-read the JVM spec I suppose 
as it's obviously been updated!


It is strange though that by making changes to an explicit StringBuffer 
instead of using String concatenation, the memory usage of the AppFuse 
build was reduced enough to avoid an OutOfMemory error.


The point about building the strings when they aren't used (because 
logging verbosity is set too low) still stands though - this is less 
than efficient


Thanks
Kev

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



Re: # character causes problem parsing -lib paths

2006-04-19 Thread Peter Reilly
I have just checked.
This is a problem - the ant launcher code does some
conversion of file names to URLs. The '#' character
is not converted
The only work-around (at the moment) is to use symbolic links.
I have made a change to ant SVN to fix this.

Peter

On 4/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have found that if I specify a -lib option with a path that contains a
> hash "#" character, it cannot find the libraries. Without the #
> character in the path they can be picked up fine.
>
> This is not easily avoided in our environment, as we use Synergy for
> SCM, which defaults to using # in the path when checking out projects.
> This can be changed, but that is not desirable.
>
> Is this a known bug? Does anyone know of any workarounds?
>
> Many thanks
>
> paul
>
>


svn commit: r395206 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

2006-04-19 Thread peterreilly
Author: peterreilly
Date: Wed Apr 19 03:50:02 2006
New Revision: 395206

URL: http://svn.apache.org/viewcvs?rev=395206&view=rev
Log:
escape none URL characters

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?rev=395206&r1=395205&r2=395206&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Wed Apr 19 
03:50:02 2006
@@ -401,7 +401,20 @@
 String path = location.getPath();
 for (int i = 0; i < extensions.length; ++i) {
 if (path.toLowerCase().endsWith(extensions[i])) {
-urls[0] = location.toURL();
+try {
+/**
+ * File.toURL() does not encode characters like #.
+ * File.toURI() has been introduced in java 1.4, so
+ * ANT cannot use it (except by reflection)
+ * FileUtils.toURI() cannot be used by Locator.java
+ * Implemented this way.
+ * File.toURL() adds file: and changes '\' to '/' for 
dos OSes
+ * encodeUri converts characters like ' ' and '#' to 
%DD
+ */
+urls[0] = new 
URL(encodeUri(location.toURL().toString()));
+} catch (UnsupportedEncodingException ex) {
+throw new MalformedURLException(ex.toString());
+}
 break;
 }
 }
@@ -420,7 +433,12 @@
 });
 urls = new URL[matches.length];
 for (int i = 0; i < matches.length; ++i) {
-urls[i] = matches[i].toURL();
+try {
+// See comments above.
+urls[i] = new URL(encodeUri(matches[i].toURL().toString()));
+} catch (UnsupportedEncodingException ex) {
+throw new MalformedURLException(ex.toString());
+}
 }
 return urls;
 }



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



AW: Adding a methof to StringUtils

2006-04-19 Thread Jan.Materne
>Please, don't.
>
>Modern compilers already implement string addition using StringBuffer
>(1.4 already have this optimization, I don't remember about 
>earlier versions).
>
>And 1.5 compiler can do it using StringBuilder which is faster.


Mmh  so we should do the performance tests on a ??? 1.4/1.5 and implement 
the improvement in a 1.2-way?




>Essentially we don't want to perform any operations, or 
>produce any temporary values if they aren't going to be used, 
>but I can't see a way of doing this without something like
>
>if (verbosity >= Project.MSG_INFO) {
>  log(msg + e + msg2);
>}
>
>but this is subverting the log method that uses the verbosity 
>internally, and adding conditions to the construction of log 
>messages is not nice.


log(Object[] messageFragments, int loglevel) {
if (verbosity >= loglevel) { StringBuffer.


but . if I´m right, that the project doesnt know the loglevel?


Jan

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



Re[2]: AW: Adding a methof to StringUtils

2006-04-19 Thread Alexey Panchenko
Kev Jackson wrote:

> It's less to do with speed performance and more to do with memory
> performance.  "a" + "b" + "c" creates "a" + "bc" <- intermediate String, 
> and then "abc"

Many years ago - yes, but not now.


java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

public class AAA {
  public String concat(String a, String b, String c) {
return a + b + c;
  }
}

javac AAA.java

javap -c AAA

public java.lang.String concat(java.lang.String, java.lang.String, 
java.lang.String);
  Code:
   0:   new #2; //class java/lang/StringBuilder
   3:   dup
   4:   invokespecial   #3; //Method java/lang/StringBuilder."":()V
   7:   aload_1
   8:   invokevirtual   #4; //Method 
java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   11:  aload_2
   12:  invokevirtual   #4; //Method 
java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   15:  aload_3
   16:  invokevirtual   #4; //Method 
java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
   19:  invokevirtual   #5; //Method 
java/lang/StringBuilder.toString:()Ljava/lang/String;
   22:  areturn

javac -source 1.4 -target 1.4 AAA.java

javap -c AAA

public java.lang.String concat(java.lang.String, java.lang.String, 
java.lang.String);
  Code:
   0:   new #2; //class java/lang/StringBuffer
   3:   dup
   4:   invokespecial   #3; //Method java/lang/StringBuffer."":()V
   7:   aload_1
   8:   invokevirtual   #4; //Method 
java/lang/StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
   11:  aload_2
   12:  invokevirtual   #4; //Method 
java/lang/StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
   15:  aload_3
   16:  invokevirtual   #4; //Method 
java/lang/StringBuffer.append:(Ljava/lang/String;)Ljava/lang/StringBuffer;
   19:  invokevirtual   #5; //Method 
java/lang/StringBuffer.toString:()Ljava/lang/String;
   22:  areturn

-- 
Best regards,
 Alexeymailto:[EMAIL PROTECTED]


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



Re: Adding a methof to StringUtils

2006-04-19 Thread Alexey Panchenko
Kev Jackson wrote:

> As I've been hacking away today, I've been swapping a load of "" + "" +
> "" style code over to use StringBuffers.  I thought that perhaps there's 
> a potential use of a static method in StringUtils to construct these 
> strings from an array

Please, don't.

Modern compilers already implement string addition using StringBuffer
(1.4 already have this optimization, I don't remember about earlier
versions).

And 1.5 compiler can do it using StringBuilder which is faster.

if (dirCount >> 0) {
>   String[] args = {"Deleted ", ""+dirCount, " director", (dirCount == 1 
> ? "y" : "ies"), " from ", d.getAbsolutePath()};
>   log(StringUtils.messageAppender(args), quiet ? Project.MSG_VERBOSE : 
> verbosity);
> }

The effects of this are
- the compiler can't optimized string addition
- the code is difficult to read

-- 
Best regards,
 Alexeymailto:[EMAIL PROTECTED]


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



Re: AW: Adding a methof to StringUtils

2006-04-19 Thread Kev Jackson

[EMAIL PROTECTED] wrote:

As I've been hacking away today, I've been swapping a load of 
"" + "" + "" style code over to use StringBuffers.  I thought 
that perhaps there's a potential use of a static method in 
StringUtils to construct these strings from an array
   




For a significant performance boost we had to refactor the whole (or a
major part) of the codebase in this manner. So I think a performance
test would be good. How much is the improvement on ?


 

It's less to do with speed performance and more to do with memory 
performance.  "a" + "b" + "c" creates "a" + "bc" <- intermediate String, 
and then "abc"


I'd love to do a performance/memory test of some kind, perhaps I'll use 
the new NetBeans (it's supposed to have a good view of the heap being 
used).  Any suggestions on tools to help evaluate changes would be helpful.


We also have a problem with logging in general where the Strings are 
concatenated :

log("a" + toFile + " b " + dir + etc, verbosity);

This will produce a lot of temp Strings, send the result to log and 
crucially, if the verbosity is too low, won't even use it - that's a 
waste of memory in every sense of the word.  I'd like to fix this, the 
appendMessage method I proposed is only a bandaid for now.


Essentially we don't want to perform any operations, or produce any 
temporary values if they aren't going to be used, but I can't see a way 
of doing this without something like


if (verbosity >= Project.MSG_INFO) {
 log(msg + e + msg2);
}

but this is subverting the log method that uses the verbosity 
internally, and adding conditions to the construction of log messages is 
not nice.




This does not create a log message - it just concatenates the given
arguments.
Would be something like toString(Object[]) better?

 

yes the name I chose was horrible (I'm severely lacking creativity today 
obviously :)



You specify the args-param as "message fragments", so I would name the
paramter 'fragments' ;-)
   public static String toString(final Object[] fragments)

...

 


that would make more sense yes


mmmh  alternativly you could overload the Task.log() method...
  Task.log(Object[] messageFragments, int loglevel)

 


Thanks for the comments
Kev

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



AW: Adding a methof to StringUtils

2006-04-19 Thread Jan.Materne
>As I've been hacking away today, I've been swapping a load of 
>"" + "" + "" style code over to use StringBuffers.  I thought 
>that perhaps there's a potential use of a static method in 
>StringUtils to construct these strings from an array


For a significant performance boost we had to refactor the whole (or a
major part) of the codebase in this manner. So I think a performance
test would be good. How much is the improvement on ?



>StringUtils.messageAppender
>  /**
> * Creates log messages using a StringBuffer
> * Example:
> * 
> * String[] args = {"1", "2", "3"}
> * log(StringUtils.messageAppender(args), Project.MSG_VERBOSE);
> * 
> * @param args the message fragments
> * @return the message
> * @since ant 1.7
> */
>public static String messageAppender(final Object[] args) {
>StringBuffer sb = new StringBuffer();
>for (int i = 0; i < args.length; i++) {
>sb.append(args[i]);
>}
>return sb.toString();
>}


This does not create a log message - it just concatenates the given
arguments.
Would be something like toString(Object[]) better?

You specify the args-param as "message fragments", so I would name the
paramter 'fragments' ;-)
public static String toString(final Object[] fragments)

...


mmmh  alternativly you could overload the Task.log() method...
   Task.log(Object[] messageFragments, int loglevel)



Jan

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



Adding a methof to StringUtils

2006-04-19 Thread Kev Jackson

Hi,

As I've been hacking away today, I've been swapping a load of "" + "" + 
"" style code over to use StringBuffers.  I thought that perhaps there's 
a potential use of a static method in StringUtils to construct these 
strings from an array


StringUtils.messageAppender
 /**
* Creates log messages using a StringBuffer
* Example:
* 
* String[] args = {"1", "2", "3"}
* log(StringUtils.messageAppender(args), Project.MSG_VERBOSE);
* 
* @param args the message fragments
* @return the message
* @since ant 1.7
*/
   public static String messageAppender(final Object[] args) {
   StringBuffer sb = new StringBuffer();
   for (int i = 0; i < args.length; i++) {
   sb.append(args[i]);
   }
   return sb.toString();
   }

In use Delete.java

if (dirCount > 0) {
 String[] args = {"Deleted ", ""+dirCount, " director", (dirCount == 1 
? "y" : "ies"), " from ", d.getAbsolutePath()};
 log(StringUtils.messageAppender(args), quiet ? Project.MSG_VERBOSE : 
verbosity);

}

Before I go ahead and commit any of this, what do people think (thumbs 
up/down on the idea of doing something about the string concatenation in 
logging, thumbs up/down to this static methof of StringUtils)?


Thanks
Kev

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



svn commit: r395169 - /ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java

2006-04-19 Thread kevj
Author: kevj
Date: Wed Apr 19 01:20:47 2006
New Revision: 395169

URL: http://svn.apache.org/viewcvs?rev=395169&view=rev
Log:
2 more tests for bug#32738

Modified:
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java

Modified: 
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java?rev=395169&r1=395168&r2=395169&view=diff
==
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java 
(original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/DeleteTest.java 
Wed Apr 19 01:20:47 2006
@@ -73,4 +73,10 @@
 public void test13() {
 executeTarget("test13");
 }
+public void test14() {
+executeTarget("test14");
+}
+public void test15() {
+executeTarget("test15");
+}
 }



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



svn commit: r395168 - /ant/core/trunk/src/etc/testcases/taskdefs/delete.xml

2006-04-19 Thread kevj
Author: kevj
Date: Wed Apr 19 01:19:38 2006
New Revision: 395168

URL: http://svn.apache.org/viewcvs?rev=395168&view=rev
Log:
2 more tests for bug#32738

Modified:
ant/core/trunk/src/etc/testcases/taskdefs/delete.xml

Modified: ant/core/trunk/src/etc/testcases/taskdefs/delete.xml
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/etc/testcases/taskdefs/delete.xml?rev=395168&r1=395167&r2=395168&view=diff
==
--- ant/core/trunk/src/etc/testcases/taskdefs/delete.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/delete.xml Wed Apr 19 01:19:38 
2006
@@ -129,6 +129,20 @@
 
   
 
+  
+   
+   
+   
+   
+  
+
+  
+   
+   
+   
+   
+  
+
   
 
 



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



DO NOT REPLY [Bug 39345] New: - rpm tasks destroys PATH for determination of rpmbuild executable

2006-04-19 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39345

   Summary: rpm tasks destroys PATH for determination of rpmbuild
executable
   Product: Ant
   Version: 1.6.5
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: major
  Priority: P2
 Component: Optional Tasks
AssignedTo: dev@ant.apache.org
ReportedBy: [EMAIL PROTECTED]


Hi,
while testing my build process including building a rpm archive, I wondered, why
the build of the rpm fails, if run by cron, but not when run manually. The
assistance of an linux guru shows, that building a rpm in our case must use the
rpmbuild executable, while using the rpm executable does not fit. A look into
the source of the rpm task shows, that the determination of the rpmbuild
executable is done by splitting the environment's PATH variable and trying to
open the file on each part. Before splitting the path parts, the start of the
environment variable PATH= gets cut off (planned!) but there is the mistake,
which destroys the first path element. If rpmbuild is inside this path it is not
found and the rpm task tries to to use its fallback (rpm).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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



DO NOT REPLY [Bug 38732] - rmic task doesn't work with -Xnew and JDK 6.0

2006-04-19 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38732





--- Additional Comments From [EMAIL PROTECTED]  2006-04-19 07:22 ---
Created an attachment (id=18133)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18133&action=view)
Extract from build.xml

Attached my rmic task - nothing complicated at all

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

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