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()
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: _ rkubacki
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2005-07-15 15:23 UTC by _ rkubacki
Modified: 2008-12-22 11:48 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
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/ResultsPanel.java
M core/options/src/org/netbeans/modules/options/OptionsDisplayerImpl.java
M core/output2/src/org/netbeans/core/output2/Controller.java
M core/output2/src/org/netbeans/core/output2/ui/AbstractOutputWindow.java
M core/src/org/netbeans/beaninfo/editors/FontEditor.java
M core/src/org/netbeans/beaninfo/editors/ObjectEditor.java
M core/src/org/netbeans/core/NbSheet.java
M core/src/org/netbeans/core/ui/ProductInformationPanel.java
M core/startup/src/org/netbeans/core/startup/Main.java
M core/startup/src/org/netbeans/core/startup/NbInstaller.java
M
core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/ToolbarTabDisplayerUI.java
M core/windows/src/org/netbeans/core/windows/Constants.java
M core/windows/src/org/netbeans/core/windows/view/EditorView.java
M core/windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java
M core/windows/src/org/netbeans/core/windows/view/ui/MainWindow.java
M db/derby/src/org/netbeans/modules/derby/RegisterDerby.java
M
editor/completion/src/org/netbeans/modules/editor/completion/PatchedHtmlRenderer.java
M
editor/settings/storage/src/org/netbeans/modules/editor/settings/storage/KeyMapsStorage.java
M editor/src/org/netbeans/modules/editor/NbEditorSettingsInitializer.java
M editor/src/org/netbeans/modules/editor/options/BaseOptions.java
M extbrowser/src/org/netbeans/modules/extbrowser/DelegatingWebBrowserImpl.java
M extbrowser/src/org/netbeans/modules/extbrowser/ExtWebBrowser.java
M extbrowser/src/org/netbeans/modules/extbrowser/FirefoxBrowser.java
M extbrowser/src/org/netbeans/modules/extbrowser/MozillaBrowser.java
M extbrowser/src/org/netbeans/modules/extbrowser/NetscapeBrowser.java
M extbrowser/src/org/netbeans/modules/extbrowser/SimpleExtBrowser.java
M form/src/org/netbeans/modules/form/FormUtils.java
M ide/launcher/upgrade/src/org/netbeans/license/AcceptLicense.java
M java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/J2SEInstallImpl.java
M
java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/Util.java
M java/platform/src/org/netbeans/modules/java/platform/PlatformSettings.java
M openide/awt/src/org/openide/awt/HtmlRenderer.java
M openide/awt/src/org/openide/awt/Mnemonics.java
M openide/awt/test/unit/src/org/openide/awt/MnemonicsTest.java
M openide/dialogs/src/org/openide/WizardDescriptor.java
M openide/explorer/src/org/openide/explorer/view/TreeView.java
M openide/explorer/src/org/openide/explorer/view/ViewTooltips.java
M openide/fs/src/org/openide/filesystems/FileUtil.java
M openide/fs/src/org/openide/filesystems/LocalFileSystem.java
M openide/loaders/src/org/openide/awt/MenuBar.java
M openide/util/src/org/openide/util/IconManager.java
Comment 3 _ rkubacki 2007-01-04 07:45:30 UTC
Comments?
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 

db/derby/src/org/netbeans/modules/derby/RegisterDerby.java
openide/dialogs/src/org/openide/WizardDescriptor.java

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. http://db.apache.org/derby/faq.html. 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 10.1.2.1.
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.