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 88868 - Form editor can introduce cyclic dependencies among projects
Summary: Form editor can introduce cyclic dependencies among projects
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-07 21:50 UTC by jeadorf
Modified: 2010-08-20 11:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Contains two sample projects which can be used for reproducing the problem (17.91 KB, application/x-compressed)
2006-11-09 13:47 UTC, jeadorf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jeadorf 2006-11-07 21:50:51 UTC
NetBeans 5.5 does not prevent projects from being cyclic dependent (A depends on
B and B depends on A). Of course, this can only happen accidentally. 

Then, when you compile one of these projects, the Ant engine enters an infinite
loop causing NetBeans to freeze. (init deps-jar init deps-jar ...)
Comment 1 novakm 2006-11-08 09:44:06 UTC
Reassigning to "Ant" for evaluation
Comment 2 Jesse Glick 2006-11-08 17:02:22 UTC
The GUI for various project types does attempt to prevent you from adding
project dependencies in such a way as to create a loop. Did you manually edit
configuration files so as to bypass this check? Detailed steps to reproduce the
problem from scratch are required for evaluation.

Also, what do you mean by "infinite loop" and "freeze"? Certainly if you submit
an Ant script which loops, it will run forever and consume a lot of CPU. But you
should be able to use Build | Stop Building to terminate it.
Comment 3 jeadorf 2006-11-09 13:47:24 UTC
Created attachment 35917 [details]
Contains two sample projects which can be used for reproducing the problem
Comment 4 jeadorf 2006-11-09 13:51:31 UTC
Firstly, thanks for the quick response.

Though I am not a native English speaker, I did my best in order
to report this issue in an understandable way. The problem I encountered
is definitely avoidable if you are careful.

I didn't change the configuration manually, nor did I make any
modifications to the settings which could seem to be related to this
problem.

Detailed description:

Project 'one' (depends on 'two')
    one.MyComponentOne    extends two.MyComponentTwo
   
Project 'two'
    two.MyComponentTwo     extends javax.swing.JComponent
    two.MyPanel           extends javax.swing.JPanel

Both projects have not been compiled yet, they are in a clean state.
Now I am (accidentally, not intentionally) adding 'MyComponentOne' to 'MyPanel'.

NetBeans correctly recognizes that project 'two' now depends on project 'one'
and adds 'one' to the library of 'two'. This is the point when
both projects are cyclic dependent. I think this mistake can be prevented
by testing on cyclic dependencies.

This time the IDE did not freeze.
The sample projects are in the attachment.

Keep on working on NetBeans, it is a great IDE!

Comment 5 Jesse Glick 2006-11-09 17:05:47 UTC
You were using the form editor, rather than the project Properties dialog, to
introduce the dependency. This is the critical information I was looking for.
Comment 6 jeadorf 2006-11-10 11:01:20 UTC
I see that there has been a misunderstanding, but I am glad we resolved it.
Comment 7 Tomas Pavek 2007-01-12 14:46:42 UTC
Will try to implement a check when adding a project dependency.