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 50943 - Modules enabled based on OS type
Summary: Modules enabled based on OS type
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
Depends on:
Blocks: 50408 60090
  Show dependency tree
Reported: 2004-10-28 11:57 UTC by Martin Grebac
Modified: 2008-12-23 08:43 UTC (History)
5 users (show)

See Also:
Exception Reporter:

Proposed fix (6.17 KB, patch)
2005-06-17 11:58 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Grebac 2004-10-28 11:57:29 UTC
I've seen the work on 46833, and would like to use
the os.required thing in extbrowser module (see
50408). However, there are issues that make things
more difficult.

I'd like to create 4 modules for specific os:

 windows (not os2)
 unix (not mac)

I believe this is not possible in current version
of the modules api. Would it be possible to
enhance the functionality somehow so that above is
Comment 1 Jaroslav Tulach 2004-10-28 13:01:05 UTC
OS2 is right now considered windows? I doubt that it is correct.
Adding os2 is ok. Not sure what to do for mac. New token
UnixAndNotMac? Not too nice. KdeOrGnome?
Comment 2 Martin Grebac 2004-10-28 13:19:48 UTC
ad os2 - yes, it's considered windows - and several people already had
problems with this:



Mac is not that crucial for me, I could live with it (even though some
solution would be good). Option for OS2-only is more important. We're
using dll lib, and I'd be happy to remove all the "isWindows() &&
notOs2()" calls from my code and make the browser support more
specific to the platform.

UnixAndNotMac and WindowsAndNotOs2 is fine for me (not nice, though
;O) ). 

Or something like 'StrictUnix', 'StrictWindows' ? 
Comment 3 Jaroslav Tulach 2004-10-28 13:59:17 UTC
I fixed the OS/2 part (hopefully as I have no way to test it):

cvs -q ci -m "OS/2 should not be treated as windows"
Checking in src/org/netbeans/core/modules/;
/cvs/core/src/org/netbeans/core/modules/,v  <--
new revision: 1.78; previous revision: 1.77
Comment 4 lkishalmi 2004-10-28 14:37:21 UTC
I'm sorry it was me to create such a mix due to #44136.
In short due to this issue the OS/2 is treated like Windows at this
time. I've also found that extbrowser (#44136), and some other modules
which are using external non-java stuff has broken on OS/2 due to this
change. (However without this NB4.0 even won't start on OS/2.)
I've also created a new patch which treats OS/2 as OS/2, but it
required a couple of minor changes in the filesystem module. Radek has
told me that some generalization in the filesystem module would be
more appreciated. I've started it, unfortunately it affects not only
one module inside the openide.

Anyway I'll test your modifications against OS/2.
Comment 5 lkishalmi 2004-10-28 14:47:58 UTC
Yes, it works (quite trivial solution).
But, it should be removed if the issue #44136 will be resolved.
However extbrowser module works perfectly with OS/2 (if it is treated
as OS/2.)

Shall I create a dependency on issue #44136?
Comment 6 Jaroslav Tulach 2004-10-28 16:56:35 UTC
I reported separete issue 50954, when fixed, I'll rollback revision: 1.78
Comment 7 Jaroslav Tulach 2004-11-02 15:56:28 UTC
OS2 is not windows anymore. Please update the list of platform you
want to have. I suggest to use PlainUnix for Unix - MacOSX.
Comment 8 Martin Grebac 2004-11-03 21:37:03 UTC
I think I'm OK with these. Thanks.
Comment 9 Martin Grebac 2004-11-25 11:00:07 UTC
Just curious - are you (and when) planning to implement this? Thanks.
Comment 10 Jaroslav Tulach 2004-11-25 13:50:31 UTC
When needed. Let me know two weeks in advance. I still have not been
told the list of all new tokens to support. Is it:


Confirm and let me know the desired integration date.
Comment 11 Martin Grebac 2004-11-25 13:58:20 UTC
I'm OK with those two as I wrote above. Desired integration date is
two weeks ago ;O). I'm working on the code right now, so I'd like to
test it, but I do plan to integrate this to F, so it's not the highest
Comment 12 Jaroslav Tulach 2004-11-25 14:23:16 UTC
I have not got the integration date. If you need it for promoF, it is
not two weeks ago! If you want to test your code, patch is enough but
that is not integration date. I am not going to integrate or work on
feature that is not used.
Comment 13 Martin Grebac 2004-11-25 14:45:10 UTC
Aha, let's hope that netbeans will not be the feature that is not
used. In current state, I'm OK with the patch. Do you need to know
integration date for a patch, too, or can you just send it to me? I
don't want to touch your code or guess how you will fix it later on.
Comment 14 Jaroslav Tulach 2004-11-25 15:28:39 UTC
I have still not got to the point to be able to understand your
reasoning. If we care about NetBeans, we should try to make them
better. This issue is not going to make them better alone, it needs
also work from you. You are not going to deliver that work sooner than
in promotion F. Why you want me to work on this patch now and not do
something else that would make NetBeans 4.1 better?
Comment 15 Jaroslav Tulach 2004-11-25 15:37:51 UTC
After call with Martin we concluded to put it into the promotion F.
Comment 16 Jaroslav Tulach 2005-06-17 11:58:00 UTC
Created attachment 22767 [details]
Proposed fix
Comment 17 Jaroslav Tulach 2005-06-17 11:59:13 UTC
reviewers, is this change acceptable? I'll document it in openide/modules and also 
increase version of openide/module module. 
Comment 18 Jesse Glick 2005-06-20 18:09:49 UTC
I.e. to add PlainUnix and OS2 as OS types you can require? OK with me...
Comment 19 Jesse Glick 2005-06-20 18:12:40 UTC
....but please also patch NbModuleProperties (issue #60090).
Comment 20 Jaroslav Tulach 2005-07-03 13:39:51 UTC
I'd like to integrate. However I do not know what is with the issue 60090. It 
is fixed and moreover does not provide any information what is wrong. Sorry. 
Comment 21 Martin Krauskopf 2005-07-04 14:14:01 UTC
> However I do not know what is with the issue 60090. It is fixed
> and moreover does not provide any information what is wrong.

We list OS tokens to the user in the module's customizer. So if you add some
token you should also add it into the SingleModuleProperties class in the
apisupport module so the user is able to specify them through the UI. This is
what Jesse probably meant.
But of course the better solution would be if the list of those OS tokens would
be accessible via some API, e.g. by some static method in some Utilities instead
of hardcoded. So please provide them in such a manner, I'll adjust the
apisupport module appropriately then. (or suggest where such a method should be
and I'll do so....). Thanks
Comment 22 Jaroslav Tulach 2005-07-07 09:47:56 UTC
Integrated. I've modified the SingleModuleProperties for now, I do not want to 
create API in org.openide.modules for that. Maybe in core, but still, it might 
be better to just reuse the test for PlatformDependencySatisfiedTest in 
apisupport. We could modify it and subclass in apisupport and verify that all 
required tokens are really supported (e.g. support for copy-based programming 
cvs ci -m "#50943: Adding PlainUnix and OS2 into the list of supported OS"    
openide/modules/apichanges.xml openide/modules/  
Checking in core/startup/src/org/netbeans/core/startup/;  
/cvs/core/startup/src/org/netbeans/core/startup/,v  <--  
new revision: 1.5; previous revision: 1.4  
Checking in  
new revision: 1.5; previous revision: 1.4  
Checking in openide/modules/apichanges.xml;  
/cvs/openide/modules/apichanges.xml,v  <--  apichanges.xml  
new revision: 1.4; previous revision: 1.3  
Checking in openide/modules/;  
/cvs/openide/modules/,v  <--  
new revision: 1.7; previous revision: 1.6  
Checking in openide/modules/src/org/openide/modules/doc-files/api.html;  
/cvs/openide/modules/src/org/openide/modules/doc-files/api.html,v  <--   
new revision: 1.4; previous revision: 1.3  
Checking in  
new revision: 1.4; previous revision: 1.3  
Comment 23 Martin Grebac 2005-10-23 19:01:34 UTC