[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Subclipse-users] delete of empty fileset trigger an arrayIndex out of bound

From: Gilles Scokart <gscokart_at_gmail.com>
Date: 2007-01-17 13:37:42 CET

I have an ant task that delete some files based on a fileset :

                <svn username="${svn.user}" password="${svn.passwd}">
                        <delete>
                                <fileset dir="${local.repository}/share">
                                        <date datetime="${too_old}" when="before" pattern="dd/MM/yyyy
HH:mm" checkdirs="true"/>
                                </fileset>
                        </delete>
                        <commit dir="${local.repository}/share" message="Clean of files
older than ${too_old}"/>
                </svn>

When there is nothing to delete (I think it's the reason), I got an
ArrayIndexOutOfBoundsException :

java.lang.ArrayIndexOutOfBoundsException: 0
        at org.apache.tools.ant.Task.perform(Task.java:373)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at org.tigris.subversion.svnclientadapter.SVNBaseDir.getRootDir(SVNBaseDir.java:133)
        at org.tigris.subversion.svnclientadapter.SVNBaseDir.getBaseDir(SVNBaseDir.java:111)
        at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.remove(AbstractJhlClientAdapter.java:650)
        at org.tigris.subversion.svnant.commands.Delete.deleteFileSet(Unknown Source)
        at org.tigris.subversion.svnant.commands.Delete.execute(Unknown Source)
        at org.tigris.subversion.svnant.commands.SvnCommand.executeCommand(Unknown
Source)
        at org.tigris.subversion.svnant.SvnTask.execute(Unknown Source)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        ... 10 more
--- Nested Exception ---
java.lang.ArrayIndexOutOfBoundsException: 0
        at org.tigris.subversion.svnclientadapter.SVNBaseDir.getRootDir(SVNBaseDir.java:133)
        at org.tigris.subversion.svnclientadapter.SVNBaseDir.getBaseDir(SVNBaseDir.java:111)
        at org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.remove(AbstractJhlClientAdapter.java:650)
        at org.tigris.subversion.svnant.commands.Delete.deleteFileSet(Unknown Source)
        at org.tigris.subversion.svnant.commands.Delete.execute(Unknown Source)
        at org.tigris.subversion.svnant.commands.SvnCommand.executeCommand(Unknown
Source)
        at org.tigris.subversion.svnant.SvnTask.execute(Unknown Source)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Looking at SVNBaseDir.getRootDir , this will happen when the File[]
parameter is empty.

PS: I didn't subscribe to the mailing list. I just wanted to report
you the bug. Feel free to create the issue if you consider it is
indeed a bug.

Thanks for this very usefull tool anyway.

Gilles Scokart

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: users-help@subclipse.tigris.org
Received on Wed Jan 17 13:37:49 2007

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.