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 61044 - Add org.openide.util.Utilities.isMac()
Summary: Add org.openide.util.Utilities.isMac()
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: _ rkubacki
Depends on:
Reported: 2005-07-15 15:23 UTC by _ rkubacki
Modified: 2008-12-22 11:48 UTC (History)
1 user (show)

See Also:
Exception Reporter:

suggested patch (4.27 KB, patch)
2007-01-04 07:42 UTC, _ rkubacki
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ rkubacki 2005-07-15 15:23:49 UTC
It seems that 60 usages for these calls are enough to have a helper method.
Need to count the benefit.
Comment 1 _ rkubacki 2007-01-04 07:42:36 UTC
Created attachment 37031 [details]
suggested patch
Comment 2 _ rkubacki 2007-01-04 07:44:32 UTC
Also I am going to fix usages:

M autoupdate/src/org/netbeans/modules/autoupdate/
M core/options/src/org/netbeans/modules/options/
M core/output2/src/org/netbeans/core/output2/
M core/output2/src/org/netbeans/core/output2/ui/
M core/src/org/netbeans/beaninfo/editors/
M core/src/org/netbeans/beaninfo/editors/
M core/src/org/netbeans/core/
M core/src/org/netbeans/core/ui/
M core/startup/src/org/netbeans/core/startup/
M core/startup/src/org/netbeans/core/startup/
M core/windows/src/org/netbeans/core/windows/
M core/windows/src/org/netbeans/core/windows/view/
M core/windows/src/org/netbeans/core/windows/view/ui/
M core/windows/src/org/netbeans/core/windows/view/ui/
M db/derby/src/org/netbeans/modules/derby/
M editor/src/org/netbeans/modules/editor/
M editor/src/org/netbeans/modules/editor/options/
M extbrowser/src/org/netbeans/modules/extbrowser/
M extbrowser/src/org/netbeans/modules/extbrowser/
M extbrowser/src/org/netbeans/modules/extbrowser/
M extbrowser/src/org/netbeans/modules/extbrowser/
M extbrowser/src/org/netbeans/modules/extbrowser/
M extbrowser/src/org/netbeans/modules/extbrowser/
M form/src/org/netbeans/modules/form/
M ide/launcher/upgrade/src/org/netbeans/license/
M java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/
M java/platform/src/org/netbeans/modules/java/platform/
M openide/awt/src/org/openide/awt/
M openide/awt/src/org/openide/awt/
M openide/awt/test/unit/src/org/openide/awt/
M openide/dialogs/src/org/openide/
M openide/explorer/src/org/openide/explorer/view/
M openide/explorer/src/org/openide/explorer/view/
M openide/fs/src/org/openide/filesystems/
M openide/fs/src/org/openide/filesystems/
M openide/loaders/src/org/openide/awt/
M openide/util/src/org/openide/util/
Comment 3 _ rkubacki 2007-01-04 07:45:30 UTC
Comment 4 Milos Kleint 2007-01-04 07:57:13 UTC
looks cool
Comment 5 Tomas Hurka 2007-01-04 09:16:32 UTC
Would not be better to evaluate all these usages first to see if they are really necessary? 
I randomly choose 


and it looks like both can be avoided.
Comment 6 Jaroslav Tulach 2007-01-04 10:01:09 UTC
Add a test to UtilitiesTest, otherwise ok.
Comment 7 _ rkubacki 2007-01-04 10:28:45 UTC
thanks for comments.

re Derby: I do not know what is the purpose of this property so let Andrei
comment it.

re deriveFont (in WD and couple of other places): if you are really sure that it
is OK to delete these hacks that we introduced to avoid JVM crashes I can do it. 

Still there remains other usages that are valid - L&F related code + mnemonic
handling, browser integration and some other platform related stuff
Comment 8 Andrei Badea 2007-01-04 13:46:41 UTC
re Derby: the property is a workaround for a Derby issue on certain J2SE
versions on Mac OS X. Cf. If you see a way
to avoid it  please let me know, I don't see any.
Comment 9 Tomas Hurka 2007-01-04 14:23:11 UTC
re Derby: please read carefully the FAQ you mentioned:
The underlying JVM issue is fixed in Mac OS X 10.4 (Tiger) with J2SE 1.4.2, but remains a problem on Mac 
OS X 10.3 with Java 1.4.2 Update 2 and Mac OS X 10.4 with J2SE 5.0 Release 1. It has been fixed in more 
recent releases of the J2SE 5.0 JVM. 
FYI: Current release is J2SE 5.0 Release 4.
So I will give it a try and if it works, remove workaround in the trunk.
Comment 10 Tomas Hurka 2007-01-04 14:27:23 UTC
re deriveFont (in WD and couple of other places) - see issue #49973. There is a jar with test case, which 
demonstrates the bug. This jar works for me. So again I advice to test it and if it works, remove 
workaround from the trunk.
Comment 11 Andrei Badea 2007-01-04 14:47:47 UTC
Please don't remove anything, just file an issue. I'm not sure I like the fact
that removing this property would still expose the problem on certain
combinations of Derby and J2SE. BTW I assume that if an user for some reason
wants to use J2SE 5.0 Release 1 you would just tell him to upgrade, right?
Comment 12 Andrei Badea 2007-01-04 14:50:10 UTC
Ah sorry, I thought you offered to remove it yourself.
Comment 13 Tomas Hurka 2007-01-04 15:34:25 UTC
re: Derby
I do not see any reason to use J2SE 5.0 Release 1. Moreover upgading to J2SE 5.0 Release 4 is 
automatically offered by build-in Mac OS X autoupdate, so almost everybody has it already. Note also that 
the change will be done in NetBeans 6.0, which will be released in more than half a year.
Also note thate the problem is fixed on Derby side in version
Comment 14 Andrei Badea 2007-01-04 16:31:06 UTC
OK, I am convinced.
Comment 15 _ rkubacki 2007-01-11 14:24:03 UTC
I'm going to commit including test + file separate issues about deriveFont()
Comment 16 _ rkubacki 2007-01-11 16:01:36 UTC
Commited - unfortunately my IDE did not displayed commit messages and I cannot
find it in my mail too.