This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 44213 - APH.getStandardPropertyEvaluator needs to listen to file existence (was: Broken reference to "junit")
Summary: APH.getStandardPropertyEvaluator needs to listen to file existence (was: Brok...
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 41537
  Show dependency tree
 
Reported: 2004-06-02 15:45 UTC by Milan Kubec
Modified: 2006-03-24 10:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kubec 2004-06-02 15:45:32 UTC
[dev-200406011800, JDK 1.4.2]
When I was opening various projects created in
previous versions of IDE I was getting message
about broken reference to "junit". The library was
not *explicitly* required by user. Don't know how
to reproduce.
Comment 1 David Konecny 2004-06-02 15:54:42 UTC
jpokorsky told me offline about one possibly related issue: his
private.properties file of opened project contained
user.properties.file pointing to incorrect userdir (userdir from some
older IDE session). I asked him to file it if reproducible.
Comment 2 Tomas Zezula 2004-06-03 16:17:41 UTC
It seems that this bug is not caused by Libraries.
Could someone reproduce it?
If so, could you attach the corrupted project (before fixing) and
userdir to this issue.
Comment 3 David Konecny 2004-06-04 11:56:47 UTC
Jesse, I found the cause. It is in
AntProjectHelper.getStandardPropertyEvaluator. There is XXX comment
for that. 

How to reproduce:
* open a project in IDE with userdir A and then close IDE
* delete the userdir A
* open the project in IDE with userdir B

What happens is that property user.properties.file is found but file
it points to does not exist. If you look at J2SEProject constructor
you will find that APH.getStandardPropertyEvaluator is called from
there. That means it is called before OpenHook get chance to update
the property according to current userdir.

Slightly modified problem experienced jpokorsky: in his case userdir A
was not deleted and properties were read from it even thought IDE is
running with userdir B.

I applied hotfix which solves first issue but second one can still happen.

Hotfix:
src/org/netbeans/spi/project/support/ant/AntProjectHelper.java
new revision: 1.11; previous revision: 1.10
Comment 4 Jesse Glick 2004-06-04 12:45:23 UTC
OK, should be fixable somehow.
Comment 5 Jesse Glick 2004-06-22 18:37:02 UTC
Have a fix prepared.
Comment 6 Jesse Glick 2004-06-22 23:25:17 UTC
Never mind, I read the description more carefully and the patch I have
applied will not solve this bug. My patch handles changes made to a
fixed build.properties on disk. The code does not yet handle the case
where the value of ${user.properties.file} is changed after the
evaluator is created.
Comment 7 Jesse Glick 2004-06-23 00:29:07 UTC
OK, have code to handle that case too, will try it.
Comment 8 Jesse Glick 2004-06-23 00:37:48 UTC
Yup, new patch seems to fix it.
Comment 9 Jesse Glick 2004-06-23 19:14:57 UTC
committed   * Up-To-Date  1.3        
ant/project/src/org/netbeans/spi/project/support/ant/ProjectProperties.java
committed   * Up-To-Date  1.18       
ant/project/src/org/netbeans/spi/project/support/ant/PropertyUtils.java
committed   * Up-To-Date  1.11       
ant/project/test/unit/src/org/netbeans/spi/project/support/ant/AntProjectHelperTest.java
Comment 10 Milan Kubec 2004-07-15 12:54:04 UTC
Verified in dev-200407131800.