Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Java 1.6.0_51 seems to be broken when running certain applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java 1.6.0_51 seems to be broken when running certain applications



On Thu, Jun 20, 2013 at 3:56 AM, Robert Schmunk <email@hidden> wrote:
>> Anyone else having similar issues?

> I have another Java app which does not exhibit this problem. I have
> not been able to explore the problem much further, but the first thing
> I was going to check Thursday was preferences initialization. The
> broken app uses java.util.prefs.Preferences, while the working app
> does not.

I managed to get my problem app working again by re-ordering a few
lines of code at the very start. Why the ordering makes such a
difference, however, is beyond my ken.

In the app broken by the Java update, I had code that looked like...

public static void main (String args[]) { new BrokenApp ( ); }
public BrokenApp ( ) {
   UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ( ));
   MyAppPreferences prefs = MyAppPreferences.getPrefs ( )
  // more code...
}

But in the app that was not broken by the update, those two lines of
code at the start of the constructor were reversed.

public static void main (String args[]) { new WorkingApp ( ); }
public WorkingApp ( ) {
   FooPreferences prefs = MyAppPreferences.getPrefs ( )
   UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ( ));
  // more code...
}

Simply reversing those two lines at the start of broken app's
constructor, so that the prefs were initialized before the UIManager
was touched, got things working again. (Alternatively, reversing the
lines in the working app broke that app.)

rbs

--
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Re: Java 1.6.0_51 seems to be broken when running certain applications (From: Robert Schmunk <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.