Forwarding to developers list.

On Tue, 15 Jul 2003 10:07 am, Adam Jack wrote:
> Hi.
>
> We have an ant task that "imports" a build file into this run. Recently it
> has started failing (on Gump), i.e. w/ latest ant code.
>
> Target.java: 316 is the next() below.
>
>       public void execute() throws BuildException {
>               if (testIfCondition() && testUnlessCondition()) {
>                   Iterator it = children.iterator();
>                   while (it.hasNext()) {
>                       Object o = it.next(); <<<--Thrown here
>
> In short, ant is complaining that the task is modifying the list of tasks
> for the current target.
>
> Since we import a script with "top level" tasks (not in targets), this
> change to the target's task list seems inevitable. As such, I can't
> understand why/how this code ever works/worked, yet it has -- for quite a
> while.
>
> All thoughts appreciated.
>
> regards
>
> Adam
> -----Original Message-----
> From: Adam Jack [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 14, 2003 5:57 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: ConcurrentModificationException
>
>
> Scary, 'cos this seems to be right after importing "core" and nothing more
> fancy.
>
> I've inserted the code below into CentipedeTask (in 3 places), and it seems
> that the tasks (without target) in the core xbuild.xml appear to get
> associate with the current task's target (i.e. CentipedeTask's target).
>
> What I just can't understand though, is why it ever works? This output
> below was from running centipede on antlibs and was w/o failure.
>
> Time to take this to ant user's list I think.
>
> regards
>
> Adam
> ---------------------------------------------------------------------------
>- -------------------------
>
> Buildfile: build.xml
> [centipede] Log Target Tasks (for crash debugging) Start of execute() :
> (#5)
> [centipede] 0) -> description - [EMAIL PROTECTED]
> [centipede] 1) -> taskdef - [EMAIL PROTECTED]
> [centipede] 2) -> centipede -
> [EMAIL PROTECTED]
> [centipede] 3) -> import - [EMAIL PROTECTED]
> [centipede] 4) -> patternset - [EMAIL PROTECTED]
>
> [centipede] Initializing Centipede [1.0.0.b.6.10000]...
> [centipede] Log Target Tasks (for crash debugging) Before import core() :
> (#5)
> [centipede] 0) -> description - [EMAIL PROTECTED]
> [centipede] 1) -> taskdef - [EMAIL PROTECTED]
> [centipede] 2) -> centipede -
> [EMAIL PROTECTED]
> [centipede] 3) -> import - [EMAIL PROTECTED]
> [centipede] 4) -> patternset - [EMAIL PROTECTED]
> [centipede] ...Centipede started.
>
> [centipede] Log Target Tasks (for crash debugging) After import core() :
> (#72)
> [centipede] 0) -> description - [EMAIL PROTECTED]
> [centipede] 1) -> taskdef - [EMAIL PROTECTED]
> [centipede] 2) -> centipede -
> [EMAIL PROTECTED]
> [centipede] 3) -> import - [EMAIL PROTECTED]
> [centipede] 4) -> patternset - [EMAIL PROTECTED]
> [centipede] 5) -> description - [EMAIL PROTECTED]
> [centipede] 6) -> tstamp - [EMAIL PROTECTED]
> [centipede] 7) -> buildnumber - [EMAIL PROTECTED]
> [centipede] 8) -> property - [EMAIL PROTECTED]
> [centipede] 9) -> property - [EMAIL PROTECTED]
> [centipede] 10) -> available - [EMAIL PROTECTED]
> [centipede] 11) -> echo - [EMAIL PROTECTED]
> [centipede] 12) -> path - [EMAIL PROTECTED]
> [centipede] 13) -> taskdef - [EMAIL PROTECTED]
> [centipede] 14) -> typedef - [EMAIL PROTECTED]
> [centipede] 15) -> taskdef - [EMAIL PROTECTED]
> [centipede] 16) -> xmlproperty - [EMAIL PROTECTED]
> [centipede] 17) -> xmlproperty - [EMAIL PROTECTED]
> [centipede] 18) -> xmlproperty - [EMAIL PROTECTED]
> [centipede] 19) -> xmlproperty - [EMAIL PROTECTED]
> [centipede] 20) -> property - [EMAIL PROTECTED]
> [centipede] 21) -> available - [EMAIL PROTECTED]
> [centipede] 22) -> property - [EMAIL PROTECTED]
> [centipede] 23) -> property - [EMAIL PROTECTED]
> [centipede] 24) -> property - [EMAIL PROTECTED]
> [centipede] 25) -> dirname - [EMAIL PROTECTED]
> [centipede] 26) -> property - [EMAIL PROTECTED]
> [centipede] 27) -> property - [EMAIL PROTECTED]
> [centipede] 28) -> property - [EMAIL PROTECTED]
> [centipede] 29) -> echo - [EMAIL PROTECTED]
> [centipede] 30) -> mkdir - [EMAIL PROTECTED]
> [centipede] 31) -> mkdir - [EMAIL PROTECTED]
> [centipede] 32) -> mkdir - [EMAIL PROTECTED]
> [centipede] 33) -> mkdir - [EMAIL PROTECTED]
> [centipede] 34) -> mkdir - [EMAIL PROTECTED]
> [centipede] 35) -> mkdir - [EMAIL PROTECTED]
> [centipede] 36) -> mkdir - [EMAIL PROTECTED]
> [centipede] 37) -> condition - [EMAIL PROTECTED]
> [centipede] 38) -> condition - [EMAIL PROTECTED]
> [centipede] 39) -> condition - [EMAIL PROTECTED]
> [centipede] 40) -> if - [EMAIL PROTECTED]
> [centipede] 41) -> condition - [EMAIL PROTECTED]
> [centipede] 42) -> condition - [EMAIL PROTECTED]
> [centipede] 43) -> condition - [EMAIL PROTECTED]
> [centipede] 44) -> condition - [EMAIL PROTECTED]
> [centipede] 45) -> condition - [EMAIL PROTECTED]
> [centipede] 46) -> condition - [EMAIL PROTECTED]
> [centipede] 47) -> condition - [EMAIL PROTECTED]
> [centipede] 48) -> condition - [EMAIL PROTECTED]
> [centipede] 49) -> condition - [EMAIL PROTECTED]
> [centipede] 50) -> if - [EMAIL PROTECTED]
> [centipede] 51) -> property - [EMAIL PROTECTED]
> [centipede] 52) -> property - [EMAIL PROTECTED]
> [centipede] 53) -> property - [EMAIL PROTECTED]
> [centipede] 54) -> property - [EMAIL PROTECTED]
> [centipede] 55) -> echo - [EMAIL PROTECTED]
> [centipede] 56) -> property - [EMAIL PROTECTED]
> [centipede] 57) -> property - [EMAIL PROTECTED]
> [centipede] 58) -> property - [EMAIL PROTECTED]
> [centipede] 59) -> property - [EMAIL PROTECTED]
> [centipede] 60) -> property - [EMAIL PROTECTED]
> [centipede] 61) -> property - [EMAIL PROTECTED]
> [centipede] 62) -> if - [EMAIL PROTECTED]
> [centipede] 63) -> property - [EMAIL PROTECTED]
> [centipede] 64) -> if - [EMAIL PROTECTED]
> [centipede] 65) -> property - [EMAIL PROTECTED]
> [centipede] 66) -> property - [EMAIL PROTECTED]
> [centipede] 67) -> property - [EMAIL PROTECTED]
> [centipede] 68) -> style - [EMAIL PROTECTED]
> [centipede] 69) -> import - [EMAIL PROTECTED]
> [centipede] 70) -> path - [EMAIL PROTECTED]
> [centipede] 71) -> echo - [EMAIL PROTECTED]
>
>
>
>
>       private void logTargetTasks(String where) {
>
>               Target target = getOwningTarget();
>
>               Task[] tasks = target.getTasks();
>
>               log(
>                       "******** Log Target Tasks (for crash debugging) "
>                               + where
>                               + " : "
>                               + target
>                               + " (#"
>                               + tasks.length
>                               + ")",
>                       Project.MSG_INFO);
>
>               for (int i = 0; i < tasks.length; ++i) {
>                       log(
>                               i + ") -> " + tasks[i].getTaskName() + " - " + 
> tasks[i],
>                               Project.MSG_VERBOSE);
>               }
>       }
> regards
>
> Adam
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Nick Chalko
> Sent: Monday, July 14, 2003 2:42 PM
> To: [EMAIL PROTECTED]
> Subject: Re: ConcurrentModificationException
>
>
> Here is the output from krysalis-antlibs/makeantlib
>
> ant -debug install
>
> Apache Ant version 1.6alpha compiled on July 14 2003
> Buildfile: build.xml
> Adding reference: ant.PropertyHelper ->
> [EMAIL PROTECTED]
> Detected Java version: 1.4 in: c:\j2sdk1.4.2\jre
> Detected OS: Windows 2000
> Adding reference: ant.ComponentHelper ->
> [EMAIL PROTECTED]
> Setting ro project property: ant.version -> Apache Ant version 1.6alpha
> compiled on July 14 2003
> Setting ro project property: ant.file ->
> c:\krysalis\krysalis-antlibs\makeantlib\build.xml
> Adding reference: ant.projectHelper ->
> [EMAIL PROTECTED]
> Adding reference: ant.parsing.context ->
> [EMAIL PROTECTED]
> Adding reference: ant.targets -> []
> parsing buildfile c:\krysalis\krysalis-antlibs\makeantlib\build.xml with
> URI = file:///C:/krysalis/krysalis-antlibs/makeantlib/build.xml
> Setting ro project property: ant.project.name -> makeantlib.antlib
> Adding reference: makeantlib.antlib -> [EMAIL PROTECTED]
> Setting ro project property: ant.file.makeantlib.antlib ->
> c:\krysalis\krysalis-antlibs\makeantlib\build.xml
> Project base dir set to: C:\krysalis\krysalis-antlibs\makeantlib
>  +Target:
>    +Task: taskdef
> Resource centipede loaded from parent loader
> Class org.krysalis.centipede.ant.ImportAntLibTask loaded from parent
> loader (parentFirst)
>  +Datatype importantlib org.krysalis.centipede.ant.ImportAntLibTask
> Class org.krysalis.centipede.ant.CentipedeTask loaded from parent loader
> (parentFirst)
>  +Datatype centipede org.krysalis.centipede.ant.CentipedeTask
>  +Datatype importcent org.krysalis.centipede.ant.ImportAntLibTask
> Class org.krysalis.centipede.ant.RuperDependTask loaded from parent
> loader (parentFirst)
>  +Datatype ruperDepend org.krysalis.centipede.ant.RuperDependTask
>  +Datatype importAntLib org.krysalis.centipede.ant.ImportAntLibTask
> Class org.krysalis.centipede.ant.OptionalClassLoader loaded from parent
> loader (parentFirst)
>  +Datatype optionalclassloader
> org.krysalis.centipede.ant.OptionalClassLoader
>    +Task: centipede
> Setting ro project property: centipede.version ->
> 1.0.0.ReleaseLevel.BETA.6.10000
> [centipede] Initializing Centipede [1.0.0.ReleaseLevel.BETA.6.10000]...
> [centipede] Loading Viprom...
> [centipede] ...Viprom ok.
> [centipede] Adding property interceptor ...
> [centipede] ...property interceptor ok.
> [centipede] Importing core xbuild...
> [centipede] Importing Centiopede core xbuild:
> [centipede] Local repositories:
> [centipede] Remote repositories:
> [centipede] checkforupdate=false
> Resource Updater created around
> [file://C:/krysalis/krysalis-antlibs/makeantlib] with
> copy-local-to-target [true] and build.sysclasspath [null]
> [centipede] Property "antlibs.dir" not set.
> [centipede] Added c:\tools\ant\tools\antlibs to local repositories.
> [centipede] Property "user.home"  set, but directory [C:\Documents and
> Settings\nchalko\lib\antlibs] not found.
> [centipede] Property "basedir"  set, but directory
> [C:\krysalis\krysalis-antlibs\makeantlib\tools\antlibs] not found.
> [centipede] Property "build.dir" not set.
> Import AntLib : core.antlib
> Find Locally (otherwise Download from Remote) : core.antlib
> Find Or
> Downloadfile://C:/krysalis/krysalis-antlibs/makeantlib/core.antlib] in
> Repository Set[ruper (Local:1, Remote:2)] (true).
> Find Or Download Resource
> [core[*unset*.*unset*][.antlib][file://C:/krysalis/krysalis-antlibs/makeant
>l ib/core.antlib]]
> (true, false).
> InstanceIdentifier to match :
> [core[*unset*.*unset*][.antlib][file://C:/krysalis/krysalis-antlibs/makeant
>l ib/core.antlib]]
> Locate Best
> [core[*unset*.*unset*][.antlib][file://C:/krysalis/krysalis-antlibs/makeant
>l ib/core.antlib]]
> in Repository [FlatRepository [file://c:/tools/ant/tools/antlibs]]
> Consider :core*(~true)
> [file://c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib]
> Candidate
> [core[0.0.1.ReleaseLevel.DEVELOPMENT][.antlib][file://c:/tools/ant/tools/an
>t libs/core-0.0.1-dev.antlib]]
> in repository [Repository (ant.home) : file://c:/tools/ant/tools/antlibs]
> Best Match In Repository :
> core[0.0.1.ReleaseLevel.DEVELOPMENT][.antlib][file://c:/tools/ant/tools/ant
>l ibs/core-0.0.1-dev.antlib]
> New Best Match :
> core[0.0.1.ReleaseLevel.DEVELOPMENT][.antlib][file://c:/tools/ant/tools/ant
>l ibs/core-0.0.1-dev.antlib]
> No Target Repository on ResourceUpdater.
> Selected Destination Repository [FlatRepository
> [file://c:/tools/ant/tools/antlibs]].
> Possibly Unarchive
> [file://c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib] Copy from
> [core[0.0.1.ReleaseLevel.DEVELOPMENT][.antlib][file://c:/tools/ant/tools/an
>t libs/core-0.0.1-dev.antlib]]
> to [file://c:/tools/ant/tools/antlibs] as
> [file://c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib].
> Found [file://c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib] matching
> [core[*unset*.*unset*][.antlib][file://C:/krysalis/krysalis-antlibs/makeant
>l ib/core.antlib]].
> Setting project property: core.antlib.dir ->
> c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib
> [centipede] set 'core.antlib.dir' to
> 'c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib'
> [centipede] import file :
> //c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib/xbuild.xml
> Importing file
> //c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib/xbuild.xml from
> c:\krysalis\krysalis-antlibs\makeantlib\build.xml
> parsing buildfile
> c:\tools\ant\tools\antlibs\core-0.0.1-dev.antlib\xbuild.xml with URI =
> file:///C:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib/xbuild.xml
> Setting ro project property: ant.file.core.antlib ->
> c:\tools\ant\tools\antlibs\core-0.0.1-dev.antlib\xbuild.xml
> Adding reference: core.classpath ->
> [EMAIL PROTECTED]
> Adding reference: centipede.classpath ->
> [EMAIL PROTECTED]
> [centipede] ...core xbuild ok.
> [centipede] ...Centipede started.
>
>
> BUILD FAILED
> java.util.ConcurrentModificationException
>         at
> java.util.AbstractList$Itr.checkForComodification(AbstractList.java:4
> 48)
>         at java.util.AbstractList$Itr.next(AbstractList.java:419)
>         at org.apache.tools.ant.Target.execute(Target.java:316)
>         at
> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
> 127)
>         at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
> a:117)
>         at org.apache.tools.ant.Main.runBuild(Main.java:637)
>         at org.apache.tools.ant.Main.startAnt(Main.java:217)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:162)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:85)
>
> Total time: 4 seconds
> java.util.ConcurrentModificationException
>         at
> java.util.AbstractList$Itr.checkForComodification(AbstractList.java:4
> 48)
>         at java.util.AbstractList$Itr.next(AbstractList.java:419)
>         at org.apache.tools.ant.Target.execute(Target.java:316)
>         at
> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:
> 127)
>         at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
> a:117)
>         at org.apache.tools.ant.Main.runBuild(Main.java:637)
>         at org.apache.tools.ant.Main.startAnt(Main.java:217)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:162)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:85)
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Parasoft
> Error proof Web apps, automate testing & more.
> Download & eval WebKing and get a free book.
> www.parasoft.com/bulletproofapps1
> _______________________________________________
> Krysalis-developers mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/krysalis-developers
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to