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 60094 - Allow open project with "invalid platform"
Summary: Allow open project with "invalid platform"
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 60577 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-16 05:57 UTC by Martin Krauskopf
Modified: 2005-10-21 10:50 UTC (History)
0 users

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 Martin Krauskopf 2005-06-16 05:57:44 UTC
I know we will have a "resolve broken reference" dialog, but in the current
state the project(opened in previous IDE session) is not opened at all when it
has set an invalid platform. It should:

1) behave the samy way like if you set the Invalid Platform in project
properties (most of ant targets are not executable which can be easily solved by
setting valid platform)

2) switch to default platform with some warning message for the user

I could take a look at it (don't know yet how difficult to solve it is, probably
not much :) )
Comment 1 Jesse Glick 2005-06-16 12:40:11 UTC
Probably not easy, but a special case of the general problem that changing the
platform at runtime has to be possible and reliable.
Comment 2 Jesse Glick 2005-07-29 20:06:57 UTC
*** Issue 60577 has been marked as a duplicate of this issue. ***
Comment 3 Petr Adamek 2005-08-30 17:46:49 UTC
I am using NetBeans IDE Dev (Build 200508291800). There is possible to open
Module Suite that uses undefined Netbeans Platform, but with this exception on
the console:

java.io.IOException: Cannot examine dir
/home/petr/TestSuite1/${nbplatform.NetBeans_Platform_Dev_(Build_200508181800).netbeans.dest.dir}
        at
org.netbeans.modules.apisupport.project.universe.ModuleList.createModuleListFromBinaries(ModuleList.java:510)
...

Any attempt to open some module from this Module Suite fails, of course (with
lots of exceptions on the console). The problem is that user doesn't see any
warning or error message and it is bit confusing when you cannot open module and
you don't know why. (I spent lot of time before I found where is the problem.)

I think that clear solution is to display warning when opening both the Module
Suite and any module from this Module Suite (and allow to fix Module Suite
properties by "resolve broken reference" dialog or by adding required platform
in platform manager).
Comment 4 Jesse Glick 2005-08-30 21:20:47 UTC
There is issue #61227 for adding the Broken References dialog for NBM projects
but we do not have time for it in 4.2. In the meantime, probably fix would be to
quietly reset platform to default platform.
Comment 5 Martin Krauskopf 2005-08-31 09:09:20 UTC
This should be done soon. It is very confusing when (just broken) project is
normally opened in IDE instance and then after you exit the IDE and start it
again the project "disappear".

> probably fix would be to quietly reset platform to default platform.

This is exactly how Module's customizer (Properties) behave since yesterday. 


So just replacing code snipets:

String platformS = baseEval.getProperty("nbplatform.active");
if (platformS != null) {
    providers.add(PropertyUtils.fixedPr......
}

with:

String platformS = baseEval.getProperty("nbplatform.active");
if (platformS == null) {
    Util.err.log("log some warning");
    platformS = "default";
}
providers.add(PropertyUtils.fixedPr......

should be very easy and solve, at least somehow, the problem.

P2 -> this must be done until 4.2 (feel free to comment and reassign or, better
;), fix this)
Comment 6 Jesse Glick 2005-08-31 19:08:51 UTC
That's the wrong place to fix it, but I think I have a working patch anyway.
Comment 7 Jesse Glick 2005-08-31 20:26:52 UTC
committed     Up-To-Date  1.105      
apisupport/project/src/org/netbeans/modules/apisupport/project/NbModuleProject.java
Comment 8 pzajac 2005-10-21 10:50:32 UTC
verified