tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BugRat Mail System <>
Subject BugRat Report #15 has been filed.
Date Thu, 03 Aug 2000 00:40:58 GMT
Bug report #15 has just been filed.

You can view the report at the following URL:


REPORT #15 Details.

Project: Ant
Category: Bug Report
SubCategory: New Bug Report
Class: swbug
State: received
Priority: medium
Severity: serious
Confidence: public
   Release: 1.1
   JVM Release: Any
   Operating System: Any
   OS Release: Any
   Platform: Any

Infinite loop with empty properties file

This bug didn't exist before (I have had an empty file in my
home directory for a while). With Ant 1.1, ant goes into an infinite loop if
it encounters an empty properties file. To reproduce: (empty):

<project name="test" default="main" basedir=".">
<target name="main">
  <property file=".foo"/>

Run ant on test.xml.

Looking at the code, Property.resolveProperties has a loop while(more) and
when there are no properties, more is never false since you never enter the
inner while. Seems like just a check for props.size() == 0 at the begining
will do, but not knowing what resolveProperties does I don't know if it
handles all cases. (Outer loop has no purpose since you can't break out of
inner loop until the enumeration is empty. After the inner loop runs once,
if "more" is still true, how would "more" ever become false? Seems like e =
props.keys() should move inside the loop. Even if you do that, as a rule I
hate any code that goes into an infinite loop upon bad input. What if the
properties is such that everything can never be completely resolved?
Shouldn't we signal an error instead of looping forever trying to resolve

View raw message